lib/patch_ruby/models/project.rb in patch_ruby-1.20.0 vs lib/patch_ruby/models/project.rb in patch_ruby-1.21.0
- old
+ new
@@ -49,14 +49,14 @@
attr_accessor :developer
# An array of URLs for photos of the project.
attr_accessor :photos
- # The average price per tonne in USD cents for carbon offsets supplied by this project.
+ # DEPRECATED. The average price per tonne in USD cents for carbon offsets supplied by this project.
attr_accessor :average_price_per_tonne_cents_usd
- # The remaining mass in grams available for purchase for this project.
+ # DEPRECATED. The remaining mass in grams available for purchase for this project.
attr_accessor :remaining_mass_g
# The name of the project verifier, when applicable. A verifier is the organization that verifies the calculations of the actual amount of greenhouse gas emissions that have been avoided or sequestered through implementation of the project.
attr_accessor :verifier
@@ -69,13 +69,16 @@
# A short description of the project.
attr_accessor :tagline
attr_accessor :technology_type
- # An array of objects containing the highlight's slug, title, and a URL for the corresponding icon. A highlight's title is a short string that spotlights a characteristic about the project.
+ # An array of objects containing the highlight's slug, title, and a URL for the corresponding icon. A highlight's title is a short string that spotlights a characteristic about the project.
attr_accessor :highlights
+ # An array of objects containing available inventory for a project. Available inventory is grouped by a project's vintage year and returns amount and pricing available for a given vintage year.
+ attr_accessor :inventory
+
class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
def initialize(datatype, allowable_values)
@@ -116,11 +119,12 @@
:'verifier' => :'verifier',
:'standard' => :'standard',
:'sdgs' => :'sdgs',
:'tagline' => :'tagline',
:'technology_type' => :'technology_type',
- :'highlights' => :'highlights'
+ :'highlights' => :'highlights',
+ :'inventory' => :'inventory'
}
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
@@ -147,11 +151,12 @@
:'verifier' => :'String',
:'standard' => :'Standard',
:'sdgs' => :'Array<Sdg>',
:'tagline' => :'String',
:'technology_type' => :'TechnologyType',
- :'highlights' => :'Array<Highlight>'
+ :'highlights' => :'Array<Highlight>',
+ :'inventory' => :'Array<Inventory>'
}
end
# List of attributes with nullable: true
def self.openapi_nullable
@@ -278,10 +283,16 @@
if attributes.key?(:'highlights')
if (value = attributes[:'highlights']).is_a?(Array)
self.highlights = value
end
end
+
+ if attributes.key?(:'inventory')
+ if (value = attributes[:'inventory']).is_a?(Array)
+ self.inventory = value
+ end
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
@@ -324,10 +335,14 @@
if @highlights.nil?
invalid_properties.push('invalid value for "highlights", highlights cannot be nil.')
end
+ if @inventory.nil?
+ invalid_properties.push('invalid value for "inventory", inventory cannot be nil.')
+ end
+
invalid_properties
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
@@ -342,10 +357,11 @@
return false if @developer.nil?
return false if @average_price_per_tonne_cents_usd.nil?
return false if @remaining_mass_g.nil?
return false if @technology_type.nil?
return false if @highlights.nil?
+ return false if @inventory.nil?
true
end
# Custom attribute writer method checking allowed values (enum).
# @param [Object] mechanism Object to be assigned
@@ -379,11 +395,12 @@
verifier == o.verifier &&
standard == o.standard &&
sdgs == o.sdgs &&
tagline == o.tagline &&
technology_type == o.technology_type &&
- highlights == o.highlights
+ highlights == o.highlights &&
+ inventory == o.inventory
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
@@ -391,10 +408,10 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, production, name, description, type, mechanism, country, state, latitude, longitude, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, verifier, standard, sdgs, tagline, technology_type, highlights].hash
+ [id, production, name, description, type, mechanism, country, state, latitude, longitude, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, verifier, standard, sdgs, tagline, technology_type, highlights, inventory].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself