@@ -25,6 +25,8 @@ class CreateOrderRequest
25
25
26
26
attr_accessor :state
27
27
28
+ attr_accessor :vintage_year
29
+
28
30
class EnumAttributeValidator
29
31
attr_reader :datatype
30
32
attr_reader :allowable_values
@@ -54,7 +56,8 @@ def self.attribute_map
54
56
:'total_price_cents_usd' => :'total_price_cents_usd' ,
55
57
:'project_id' => :'project_id' ,
56
58
:'metadata' => :'metadata' ,
57
- :'state' => :'state'
59
+ :'state' => :'state' ,
60
+ :'vintage_year' => :'vintage_year'
58
61
}
59
62
end
60
63
@@ -70,13 +73,20 @@ def self.openapi_types
70
73
:'total_price_cents_usd' => :'Integer' ,
71
74
:'project_id' => :'String' ,
72
75
:'metadata' => :'Object' ,
73
- :'state' => :'String'
76
+ :'state' => :'String' ,
77
+ :'vintage_year' => :'Integer'
74
78
}
75
79
end
76
80
77
81
# List of attributes with nullable: true
78
82
def self . openapi_nullable
79
83
Set . new ( [
84
+ :'mass_g' ,
85
+ :'total_price_cents_usd' ,
86
+ :'project_id' ,
87
+ :'metadata' ,
88
+ :'state' ,
89
+ :'vintage_year'
80
90
] )
81
91
end
82
92
@@ -126,6 +136,10 @@ def initialize(attributes = {})
126
136
if attributes . key? ( :'state' )
127
137
self . state = attributes [ :'state' ]
128
138
end
139
+
140
+ if attributes . key? ( :'vintage_year' )
141
+ self . vintage_year = attributes [ :'vintage_year' ]
142
+ end
129
143
end
130
144
131
145
# Show invalid properties with the reasons. Usually used together with valid?
@@ -144,6 +158,14 @@ def list_invalid_properties
144
158
invalid_properties . push ( 'invalid value for "total_price_cents_usd", must be greater than or equal to 1.' )
145
159
end
146
160
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
+
147
169
invalid_properties
148
170
end
149
171
@@ -155,6 +177,8 @@ def valid?
155
177
return false if !@total_price_cents_usd . nil? && @total_price_cents_usd < 1
156
178
state_validator = EnumAttributeValidator . new ( 'String' , [ "draft" , "placed" ] )
157
179
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
158
182
true
159
183
end
160
184
@@ -192,6 +216,20 @@ def state=(state)
192
216
@state = state
193
217
end
194
218
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
+
195
233
# Checks equality by comparing each attribute.
196
234
# @param [Object] Object to be compared
197
235
def ==( o )
@@ -201,7 +239,8 @@ def ==(o)
201
239
total_price_cents_usd == o . total_price_cents_usd &&
202
240
project_id == o . project_id &&
203
241
metadata == o . metadata &&
204
- state == o . state
242
+ state == o . state &&
243
+ vintage_year == o . vintage_year
205
244
end
206
245
207
246
# @see the `==` method
@@ -213,7 +252,7 @@ def eql?(o)
213
252
# Calculates hash code according to all attributes.
214
253
# @return [Integer] Hash code
215
254
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
217
256
end
218
257
219
258
# Builds the object from hash
0 commit comments