lib/patch_ruby/models/project.rb in patch_ruby-1.13.0 vs lib/patch_ruby/models/project.rb in patch_ruby-1.14.0

- old
+ new

@@ -28,13 +28,25 @@ attr_accessor :description # The type of carbon removal project, currently available project types are Biomass, Dac, Forestry, Mineralization, Ocean, Renewables, Soil. attr_accessor :type + # The mechanism of the project. removal or avoidance. + attr_accessor :mechanism + # The country of origin of the project. attr_accessor :country + # The state where this project is located. + attr_accessor :state + + # The latitude at which this project is located. + attr_accessor :latitude + + # The longitude at which this project is located. + attr_accessor :longitude + # The name of the project developer. attr_accessor :developer # An array of URLs for photos of the project. attr_accessor :photos @@ -49,10 +61,15 @@ attr_accessor :standard # An array returning the UN Sustainable Development Goals associated with this project. attr_accessor :sdgs + attr_accessor :technology_type + + # A short description of the project + attr_accessor :tagline + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values def initialize(datatype, allowable_values) @@ -79,17 +96,23 @@ :'id' => :'id', :'production' => :'production', :'name' => :'name', :'description' => :'description', :'type' => :'type', + :'mechanism' => :'mechanism', :'country' => :'country', + :'state' => :'state', + :'latitude' => :'latitude', + :'longitude' => :'longitude', :'developer' => :'developer', :'photos' => :'photos', :'average_price_per_tonne_cents_usd' => :'average_price_per_tonne_cents_usd', :'remaining_mass_g' => :'remaining_mass_g', :'standard' => :'standard', - :'sdgs' => :'sdgs' + :'sdgs' => :'sdgs', + :'technology_type' => :'technology_type', + :'tagline' => :'tagline' } end # Returns all the JSON keys this model knows about def self.acceptable_attributes @@ -102,26 +125,36 @@ :'id' => :'String', :'production' => :'Boolean', :'name' => :'String', :'description' => :'String', :'type' => :'String', + :'mechanism' => :'String', :'country' => :'String', + :'state' => :'String', + :'latitude' => :'Float', + :'longitude' => :'Float', :'developer' => :'String', :'photos' => :'Array<Photo>', :'average_price_per_tonne_cents_usd' => :'Integer', :'remaining_mass_g' => :'Integer', :'standard' => :'Standard', - :'sdgs' => :'Array<Sdg>' + :'sdgs' => :'Array<Sdg>', + :'technology_type' => :'TechnologyType', + :'tagline' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'state', + :'latitude', + :'longitude', :'photos', :'standard', - :'sdgs' + :'sdgs', + :'tagline' ]) end # Allows models with corresponding API classes to delegate API operations to those API classes @@ -168,14 +201,30 @@ if attributes.key?(:'type') self.type = attributes[:'type'] end + if attributes.key?(:'mechanism') + self.mechanism = attributes[:'mechanism'] + end + if attributes.key?(:'country') self.country = attributes[:'country'] end + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'latitude') + self.latitude = attributes[:'latitude'] + end + + if attributes.key?(:'longitude') + self.longitude = attributes[:'longitude'] + end + if attributes.key?(:'developer') self.developer = attributes[:'developer'] end if attributes.key?(:'photos') @@ -199,10 +248,18 @@ if attributes.key?(:'sdgs') if (value = attributes[:'sdgs']).is_a?(Array) self.sdgs = value end end + + if attributes.key?(:'technology_type') + self.technology_type = attributes[:'technology_type'] + end + + if attributes.key?(:'tagline') + self.tagline = attributes[:'tagline'] + 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 @@ -249,10 +306,12 @@ return false if @production.nil? return false if @name.nil? return false if @description.nil? type_validator = EnumAttributeValidator.new('String', ["biomass", "dac", "forestry", "mineralization", "ocean", "renewables", "soil"]) return false unless type_validator.valid?(@type) + mechanism_validator = EnumAttributeValidator.new('String', ["removal", "avoidance"]) + return false unless mechanism_validator.valid?(@mechanism) return false if @country.nil? return false if @developer.nil? return false if @average_price_per_tonne_cents_usd.nil? return false if @remaining_mass_g.nil? true @@ -266,27 +325,43 @@ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mechanism Object to be assigned + def mechanism=(mechanism) + validator = EnumAttributeValidator.new('String', ["removal", "avoidance"]) + unless validator.valid?(mechanism) + fail ArgumentError, "invalid value for \"mechanism\", must be one of #{validator.allowable_values}." + end + @mechanism = mechanism + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && production == o.production && name == o.name && description == o.description && type == o.type && + mechanism == o.mechanism && country == o.country && + state == o.state && + latitude == o.latitude && + longitude == o.longitude && developer == o.developer && photos == o.photos && average_price_per_tonne_cents_usd == o.average_price_per_tonne_cents_usd && remaining_mass_g == o.remaining_mass_g && standard == o.standard && - sdgs == o.sdgs + sdgs == o.sdgs && + technology_type == o.technology_type && + tagline == o.tagline end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -294,10 +369,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, production, name, description, type, country, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs].hash + [id, production, name, description, type, mechanism, country, state, latitude, longitude, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs, technology_type, tagline].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself