@@ -27,6 +27,14 @@ class CreateOrderRequest
2727
2828 attr_accessor :vintage_year
2929
30+ attr_accessor :total_price
31+
32+ attr_accessor :currency
33+
34+ attr_accessor :amount
35+
36+ attr_accessor :unit
37+
3038 class EnumAttributeValidator
3139 attr_reader :datatype
3240 attr_reader :allowable_values
@@ -57,7 +65,11 @@ def self.attribute_map
5765 :'project_id' => :'project_id' ,
5866 :'metadata' => :'metadata' ,
5967 :'state' => :'state' ,
60- :'vintage_year' => :'vintage_year'
68+ :'vintage_year' => :'vintage_year' ,
69+ :'total_price' => :'total_price' ,
70+ :'currency' => :'currency' ,
71+ :'amount' => :'amount' ,
72+ :'unit' => :'unit'
6173 }
6274 end
6375
@@ -74,7 +86,11 @@ def self.openapi_types
7486 :'project_id' => :'String' ,
7587 :'metadata' => :'Object' ,
7688 :'state' => :'String' ,
77- :'vintage_year' => :'Integer'
89+ :'vintage_year' => :'Integer' ,
90+ :'total_price' => :'Integer' ,
91+ :'currency' => :'String' ,
92+ :'amount' => :'Integer' ,
93+ :'unit' => :'String'
7894 }
7995 end
8096
@@ -86,7 +102,11 @@ def self.openapi_nullable
86102 :'project_id' ,
87103 :'metadata' ,
88104 :'state' ,
89- :'vintage_year'
105+ :'vintage_year' ,
106+ :'total_price' ,
107+ :'currency' ,
108+ :'amount' ,
109+ :'unit'
90110 ] )
91111 end
92112
@@ -140,6 +160,22 @@ def initialize(attributes = {})
140160 if attributes . key? ( :'vintage_year' )
141161 self . vintage_year = attributes [ :'vintage_year' ]
142162 end
163+
164+ if attributes . key? ( :'total_price' )
165+ self . total_price = attributes [ :'total_price' ]
166+ end
167+
168+ if attributes . key? ( :'currency' )
169+ self . currency = attributes [ :'currency' ]
170+ end
171+
172+ if attributes . key? ( :'amount' )
173+ self . amount = attributes [ :'amount' ]
174+ end
175+
176+ if attributes . key? ( :'unit' )
177+ self . unit = attributes [ :'unit' ]
178+ end
143179 end
144180
145181 # Show invalid properties with the reasons. Usually used together with valid?
@@ -166,6 +202,18 @@ def list_invalid_properties
166202 invalid_properties . push ( 'invalid value for "vintage_year", must be greater than or equal to 1900.' )
167203 end
168204
205+ if !@total_price . nil? && @total_price < 1
206+ invalid_properties . push ( 'invalid value for "total_price", must be greater than or equal to 1.' )
207+ end
208+
209+ if !@amount . nil? && @amount > 100000000000
210+ invalid_properties . push ( 'invalid value for "amount", must be smaller than or equal to 100000000000.' )
211+ end
212+
213+ if !@amount . nil? && @amount < 0
214+ invalid_properties . push ( 'invalid value for "amount", must be greater than or equal to 0.' )
215+ end
216+
169217 invalid_properties
170218 end
171219
@@ -179,6 +227,11 @@ def valid?
179227 return false unless state_validator . valid? ( @state )
180228 return false if !@vintage_year . nil? && @vintage_year > 2100
181229 return false if !@vintage_year . nil? && @vintage_year < 1900
230+ return false if !@total_price . nil? && @total_price < 1
231+ return false if !@amount . nil? && @amount > 100000000000
232+ return false if !@amount . nil? && @amount < 0
233+ unit_validator = EnumAttributeValidator . new ( 'String' , [ "g" , "Wh" ] )
234+ return false unless unit_validator . valid? ( @unit )
182235 true
183236 end
184237
@@ -230,6 +283,40 @@ def vintage_year=(vintage_year)
230283 @vintage_year = vintage_year
231284 end
232285
286+ # Custom attribute writer method with validation
287+ # @param [Object] total_price Value to be assigned
288+ def total_price = ( total_price )
289+ if !total_price . nil? && total_price < 1
290+ fail ArgumentError , 'invalid value for "total_price", must be greater than or equal to 1.'
291+ end
292+
293+ @total_price = total_price
294+ end
295+
296+ # Custom attribute writer method with validation
297+ # @param [Object] amount Value to be assigned
298+ def amount = ( amount )
299+ if !amount . nil? && amount > 100000000000
300+ fail ArgumentError , 'invalid value for "amount", must be smaller than or equal to 100000000000.'
301+ end
302+
303+ if !amount . nil? && amount < 0
304+ fail ArgumentError , 'invalid value for "amount", must be greater than or equal to 0.'
305+ end
306+
307+ @amount = amount
308+ end
309+
310+ # Custom attribute writer method checking allowed values (enum).
311+ # @param [Object] unit Object to be assigned
312+ def unit = ( unit )
313+ validator = EnumAttributeValidator . new ( 'String' , [ "g" , "Wh" ] )
314+ unless validator . valid? ( unit )
315+ fail ArgumentError , "invalid value for \" unit\" , must be one of #{ validator . allowable_values } ."
316+ end
317+ @unit = unit
318+ end
319+
233320 # Checks equality by comparing each attribute.
234321 # @param [Object] Object to be compared
235322 def ==( o )
@@ -240,7 +327,11 @@ def ==(o)
240327 project_id == o . project_id &&
241328 metadata == o . metadata &&
242329 state == o . state &&
243- vintage_year == o . vintage_year
330+ vintage_year == o . vintage_year &&
331+ total_price == o . total_price &&
332+ currency == o . currency &&
333+ amount == o . amount &&
334+ unit == o . unit
244335 end
245336
246337 # @see the `==` method
@@ -252,7 +343,7 @@ def eql?(o)
252343 # Calculates hash code according to all attributes.
253344 # @return [Integer] Hash code
254345 def hash
255- [ mass_g , total_price_cents_usd , project_id , metadata , state , vintage_year ] . hash
346+ [ mass_g , total_price_cents_usd , project_id , metadata , state , vintage_year , total_price , currency , amount , unit ] . hash
256347 end
257348
258349 # Builds the object from hash
0 commit comments