@@ -153,6 +153,14 @@ def list_invalid_properties
153
153
invalid_properties . push ( 'invalid value for "mass_g", mass_g cannot be nil.' )
154
154
end
155
155
156
+ if @mass_g > 2000000000
157
+ invalid_properties . push ( 'invalid value for "mass_g", must be smaller than or equal to 2000000000.' )
158
+ end
159
+
160
+ if @mass_g < 1
161
+ invalid_properties . push ( 'invalid value for "mass_g", must be greater than or equal to 1.' )
162
+ end
163
+
156
164
if @production . nil?
157
165
invalid_properties . push ( 'invalid value for "production", production cannot be nil.' )
158
166
end
@@ -181,6 +189,8 @@ def list_invalid_properties
181
189
def valid?
182
190
return false if @id . nil?
183
191
return false if @mass_g . nil?
192
+ return false if @mass_g > 2000000000
193
+ return false if @mass_g < 1
184
194
return false if @production . nil?
185
195
return false if @state . nil?
186
196
state_validator = EnumAttributeValidator . new ( 'String' , [ "draft" , "placed" , "complete" , "cancelled" ] )
@@ -193,6 +203,24 @@ def valid?
193
203
true
194
204
end
195
205
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] mass_g Value to be assigned
208
+ def mass_g = ( mass_g )
209
+ if mass_g . nil?
210
+ fail ArgumentError , 'mass_g cannot be nil'
211
+ end
212
+
213
+ if mass_g > 2000000000
214
+ fail ArgumentError , 'invalid value for "mass_g", must be smaller than or equal to 2000000000.'
215
+ end
216
+
217
+ if mass_g < 1
218
+ fail ArgumentError , 'invalid value for "mass_g", must be greater than or equal to 1.'
219
+ end
220
+
221
+ @mass_g = mass_g
222
+ end
223
+
196
224
# Custom attribute writer method checking allowed values (enum).
197
225
# @param [Object] state Object to be assigned
198
226
def state = ( state )
0 commit comments