lib/patch_ruby/models/inventory.rb in patch_ruby-2.0.0 vs lib/patch_ruby/models/inventory.rb in patch_ruby-2.1.1

- old
+ new

@@ -16,10 +16,16 @@ module Patch class Inventory # The year in which the climate impacts of the project occurred, or will occur. attr_accessor :vintage_year + # The starting year in which the climate impacts of the project occurred, or will occur. + attr_accessor :vintage_start_year + + # The ending year in which the climate impacts of the project occurred, or will occur. + attr_accessor :vintage_end_year + # The amount available for this vintage year. attr_accessor :amount_available # The price per tonne (1,000,000 g) or MWh (1,000,000 Wh) of inventory. Prices are always represented in the smallest currency unit (ie cents for USD). attr_accessor :price @@ -32,10 +38,12 @@ # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'vintage_year' => :'vintage_year', + :'vintage_start_year' => :'vintage_start_year', + :'vintage_end_year' => :'vintage_end_year', :'amount_available' => :'amount_available', :'price' => :'price', :'currency' => :'currency', :'unit' => :'unit' } @@ -48,10 +56,12 @@ # Attribute type mapping. def self.openapi_types { :'vintage_year' => :'Integer', + :'vintage_start_year' => :'Integer', + :'vintage_end_year' => :'Integer', :'amount_available' => :'Integer', :'price' => :'Integer', :'currency' => :'String', :'unit' => :'String' } @@ -92,10 +102,18 @@ if attributes.key?(:'vintage_year') self.vintage_year = attributes[:'vintage_year'] end + if attributes.key?(:'vintage_start_year') + self.vintage_start_year = attributes[:'vintage_start_year'] + end + + if attributes.key?(:'vintage_end_year') + self.vintage_end_year = attributes[:'vintage_end_year'] + end + if attributes.key?(:'amount_available') self.amount_available = attributes[:'amount_available'] end if attributes.key?(:'price') @@ -117,10 +135,18 @@ invalid_properties = Array.new if @vintage_year.nil? invalid_properties.push('invalid value for "vintage_year", vintage_year cannot be nil.') end + if @vintage_start_year.nil? + invalid_properties.push('invalid value for "vintage_start_year", vintage_start_year cannot be nil.') + end + + if @vintage_end_year.nil? + invalid_properties.push('invalid value for "vintage_end_year", vintage_end_year cannot be nil.') + end + if @amount_available.nil? invalid_properties.push('invalid value for "amount_available", amount_available cannot be nil.') end if @price.nil? @@ -140,10 +166,12 @@ # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if @vintage_year.nil? + return false if @vintage_start_year.nil? + return false if @vintage_end_year.nil? return false if @amount_available.nil? return false if @price.nil? return false if @currency.nil? return false if @unit.nil? true @@ -153,10 +181,12 @@ # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && vintage_year == o.vintage_year && + vintage_start_year == o.vintage_start_year && + vintage_end_year == o.vintage_end_year && amount_available == o.amount_available && price == o.price && currency == o.currency && unit == o.unit end @@ -168,10 +198,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [vintage_year, amount_available, price, currency, unit].hash + [vintage_year, vintage_start_year, vintage_end_year, amount_available, price, currency, unit].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself