@@ -25,6 +25,8 @@ class CreateOrderRequest
2525
2626 attr_accessor :state
2727
28+ attr_accessor :vintage_year
29+
2830 class EnumAttributeValidator
2931 attr_reader :datatype
3032 attr_reader :allowable_values
@@ -54,7 +56,8 @@ def self.attribute_map
5456 :'total_price_cents_usd' => :'total_price_cents_usd' ,
5557 :'project_id' => :'project_id' ,
5658 :'metadata' => :'metadata' ,
57- :'state' => :'state'
59+ :'state' => :'state' ,
60+ :'vintage_year' => :'vintage_year'
5861 }
5962 end
6063
@@ -70,13 +73,20 @@ def self.openapi_types
7073 :'total_price_cents_usd' => :'Integer' ,
7174 :'project_id' => :'String' ,
7275 :'metadata' => :'Object' ,
73- :'state' => :'String'
76+ :'state' => :'String' ,
77+ :'vintage_year' => :'Integer'
7478 }
7579 end
7680
7781 # List of attributes with nullable: true
7882 def self . openapi_nullable
7983 Set . new ( [
84+ :'mass_g' ,
85+ :'total_price_cents_usd' ,
86+ :'project_id' ,
87+ :'metadata' ,
88+ :'state' ,
89+ :'vintage_year'
8090 ] )
8191 end
8292
@@ -126,6 +136,10 @@ def initialize(attributes = {})
126136 if attributes . key? ( :'state' )
127137 self . state = attributes [ :'state' ]
128138 end
139+
140+ if attributes . key? ( :'vintage_year' )
141+ self . vintage_year = attributes [ :'vintage_year' ]
142+ end
129143 end
130144
131145 # Show invalid properties with the reasons. Usually used together with valid?
@@ -144,6 +158,14 @@ def list_invalid_properties
144158 invalid_properties . push ( 'invalid value for "total_price_cents_usd", must be greater than or equal to 1.' )
145159 end
146160
161+ if !@vintage_year . nil? && @vintage_year > 2100
162+ invalid_properties . push ( 'invalid value for "vintage_year", must be smaller than or equal to 2100.' )
163+ end
164+
165+ if !@vintage_year . nil? && @vintage_year < 1900
166+ invalid_properties . push ( 'invalid value for "vintage_year", must be greater than or equal to 1900.' )
167+ end
168+
147169 invalid_properties
148170 end
149171
@@ -155,6 +177,8 @@ def valid?
155177 return false if !@total_price_cents_usd . nil? && @total_price_cents_usd < 1
156178 state_validator = EnumAttributeValidator . new ( 'String' , [ "draft" , "placed" ] )
157179 return false unless state_validator . valid? ( @state )
180+ return false if !@vintage_year . nil? && @vintage_year > 2100
181+ return false if !@vintage_year . nil? && @vintage_year < 1900
158182 true
159183 end
160184
@@ -192,6 +216,20 @@ def state=(state)
192216 @state = state
193217 end
194218
219+ # Custom attribute writer method with validation
220+ # @param [Object] vintage_year Value to be assigned
221+ def vintage_year = ( vintage_year )
222+ if !vintage_year . nil? && vintage_year > 2100
223+ fail ArgumentError , 'invalid value for "vintage_year", must be smaller than or equal to 2100.'
224+ end
225+
226+ if !vintage_year . nil? && vintage_year < 1900
227+ fail ArgumentError , 'invalid value for "vintage_year", must be greater than or equal to 1900.'
228+ end
229+
230+ @vintage_year = vintage_year
231+ end
232+
195233 # Checks equality by comparing each attribute.
196234 # @param [Object] Object to be compared
197235 def ==( o )
@@ -201,7 +239,8 @@ def ==(o)
201239 total_price_cents_usd == o . total_price_cents_usd &&
202240 project_id == o . project_id &&
203241 metadata == o . metadata &&
204- state == o . state
242+ state == o . state &&
243+ vintage_year == o . vintage_year
205244 end
206245
207246 # @see the `==` method
@@ -213,7 +252,7 @@ def eql?(o)
213252 # Calculates hash code according to all attributes.
214253 # @return [Integer] Hash code
215254 def hash
216- [ mass_g , total_price_cents_usd , project_id , metadata , state ] . hash
255+ [ mass_g , total_price_cents_usd , project_id , metadata , state , vintage_year ] . hash
217256 end
218257
219258 # Builds the object from hash
0 commit comments