@@ -153,6 +153,14 @@ def list_invalid_properties
153153 invalid_properties . push ( 'invalid value for "mass_g", mass_g cannot be nil.' )
154154 end
155155
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+
156164 if @production . nil?
157165 invalid_properties . push ( 'invalid value for "production", production cannot be nil.' )
158166 end
@@ -181,6 +189,8 @@ def list_invalid_properties
181189 def valid?
182190 return false if @id . nil?
183191 return false if @mass_g . nil?
192+ return false if @mass_g > 2000000000
193+ return false if @mass_g < 1
184194 return false if @production . nil?
185195 return false if @state . nil?
186196 state_validator = EnumAttributeValidator . new ( 'String' , [ "draft" , "placed" , "complete" , "cancelled" ] )
@@ -193,6 +203,24 @@ def valid?
193203 true
194204 end
195205
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+
196224 # Custom attribute writer method checking allowed values (enum).
197225 # @param [Object] state Object to be assigned
198226 def state = ( state )
0 commit comments