@@ -27,6 +27,14 @@ class CreateOrderRequest
27
27
28
28
attr_accessor :vintage_year
29
29
30
+ attr_accessor :total_price
31
+
32
+ attr_accessor :currency
33
+
34
+ attr_accessor :amount
35
+
36
+ attr_accessor :unit
37
+
30
38
class EnumAttributeValidator
31
39
attr_reader :datatype
32
40
attr_reader :allowable_values
@@ -57,7 +65,11 @@ def self.attribute_map
57
65
:'project_id' => :'project_id' ,
58
66
:'metadata' => :'metadata' ,
59
67
:'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'
61
73
}
62
74
end
63
75
@@ -74,7 +86,11 @@ def self.openapi_types
74
86
:'project_id' => :'String' ,
75
87
:'metadata' => :'Object' ,
76
88
:'state' => :'String' ,
77
- :'vintage_year' => :'Integer'
89
+ :'vintage_year' => :'Integer' ,
90
+ :'total_price' => :'Integer' ,
91
+ :'currency' => :'String' ,
92
+ :'amount' => :'Integer' ,
93
+ :'unit' => :'String'
78
94
}
79
95
end
80
96
@@ -86,7 +102,11 @@ def self.openapi_nullable
86
102
:'project_id' ,
87
103
:'metadata' ,
88
104
:'state' ,
89
- :'vintage_year'
105
+ :'vintage_year' ,
106
+ :'total_price' ,
107
+ :'currency' ,
108
+ :'amount' ,
109
+ :'unit'
90
110
] )
91
111
end
92
112
@@ -140,6 +160,22 @@ def initialize(attributes = {})
140
160
if attributes . key? ( :'vintage_year' )
141
161
self . vintage_year = attributes [ :'vintage_year' ]
142
162
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
143
179
end
144
180
145
181
# Show invalid properties with the reasons. Usually used together with valid?
@@ -166,6 +202,18 @@ def list_invalid_properties
166
202
invalid_properties . push ( 'invalid value for "vintage_year", must be greater than or equal to 1900.' )
167
203
end
168
204
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
+
169
217
invalid_properties
170
218
end
171
219
@@ -179,6 +227,11 @@ def valid?
179
227
return false unless state_validator . valid? ( @state )
180
228
return false if !@vintage_year . nil? && @vintage_year > 2100
181
229
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 )
182
235
true
183
236
end
184
237
@@ -230,6 +283,40 @@ def vintage_year=(vintage_year)
230
283
@vintage_year = vintage_year
231
284
end
232
285
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
+
233
320
# Checks equality by comparing each attribute.
234
321
# @param [Object] Object to be compared
235
322
def ==( o )
@@ -240,7 +327,11 @@ def ==(o)
240
327
project_id == o . project_id &&
241
328
metadata == o . metadata &&
242
329
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
244
335
end
245
336
246
337
# @see the `==` method
@@ -252,7 +343,7 @@ def eql?(o)
252
343
# Calculates hash code according to all attributes.
253
344
# @return [Integer] Hash code
254
345
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
256
347
end
257
348
258
349
# Builds the object from hash
0 commit comments