@@ -19,6 +19,10 @@ class CreateOrderLineItemRequest
1919
2020 attr_accessor :vintage_year
2121
22+ attr_accessor :vintage_start_year
23+
24+ attr_accessor :vintage_end_year
25+
2226 attr_accessor :price
2327
2428 attr_accessor :currency
@@ -54,6 +58,8 @@ def self.attribute_map
5458 {
5559 :'project_id' => :'project_id' ,
5660 :'vintage_year' => :'vintage_year' ,
61+ :'vintage_start_year' => :'vintage_start_year' ,
62+ :'vintage_end_year' => :'vintage_end_year' ,
5763 :'price' => :'price' ,
5864 :'currency' => :'currency' ,
5965 :'amount' => :'amount' ,
@@ -71,6 +77,8 @@ def self.openapi_types
7177 {
7278 :'project_id' => :'String' ,
7379 :'vintage_year' => :'Integer' ,
80+ :'vintage_start_year' => :'Integer' ,
81+ :'vintage_end_year' => :'Integer' ,
7482 :'price' => :'Integer' ,
7583 :'currency' => :'String' ,
7684 :'amount' => :'Integer' ,
@@ -82,6 +90,8 @@ def self.openapi_types
8290 def self . openapi_nullable
8391 Set . new ( [
8492 :'vintage_year' ,
93+ :'vintage_start_year' ,
94+ :'vintage_end_year' ,
8595 :'price' ,
8696 :'currency' ,
8797 :'amount' ,
@@ -124,6 +134,14 @@ def initialize(attributes = {})
124134 self . vintage_year = attributes [ :'vintage_year' ]
125135 end
126136
137+ if attributes . key? ( :'vintage_start_year' )
138+ self . vintage_start_year = attributes [ :'vintage_start_year' ]
139+ end
140+
141+ if attributes . key? ( :'vintage_end_year' )
142+ self . vintage_end_year = attributes [ :'vintage_end_year' ]
143+ end
144+
127145 if attributes . key? ( :'price' )
128146 self . price = attributes [ :'price' ]
129147 end
@@ -153,12 +171,28 @@ def list_invalid_properties
153171 invalid_properties . push ( 'invalid value for "vintage_year", must be greater than or equal to 1900.' )
154172 end
155173
174+ if !@vintage_start_year . nil? && @vintage_start_year > 2100
175+ invalid_properties . push ( 'invalid value for "vintage_start_year", must be smaller than or equal to 2100.' )
176+ end
177+
178+ if !@vintage_start_year . nil? && @vintage_start_year < 1900
179+ invalid_properties . push ( 'invalid value for "vintage_start_year", must be greater than or equal to 1900.' )
180+ end
181+
182+ if !@vintage_end_year . nil? && @vintage_end_year > 2100
183+ invalid_properties . push ( 'invalid value for "vintage_end_year", must be smaller than or equal to 2100.' )
184+ end
185+
186+ if !@vintage_end_year . nil? && @vintage_end_year < 1900
187+ invalid_properties . push ( 'invalid value for "vintage_end_year", must be greater than or equal to 1900.' )
188+ end
189+
156190 if !@price . nil? && @price < 2
157191 invalid_properties . push ( 'invalid value for "price", must be greater than or equal to 2.' )
158192 end
159193
160- if !@amount . nil? && @amount > 100000000000
161- invalid_properties . push ( 'invalid value for "amount", must be smaller than or equal to 100000000000 .' )
194+ if !@amount . nil? && @amount > 100000000000000
195+ invalid_properties . push ( 'invalid value for "amount", must be smaller than or equal to 100000000000000 .' )
162196 end
163197
164198 if !@amount . nil? && @amount < 0
@@ -173,8 +207,12 @@ def list_invalid_properties
173207 def valid?
174208 return false if !@vintage_year . nil? && @vintage_year > 2100
175209 return false if !@vintage_year . nil? && @vintage_year < 1900
210+ return false if !@vintage_start_year . nil? && @vintage_start_year > 2100
211+ return false if !@vintage_start_year . nil? && @vintage_start_year < 1900
212+ return false if !@vintage_end_year . nil? && @vintage_end_year > 2100
213+ return false if !@vintage_end_year . nil? && @vintage_end_year < 1900
176214 return false if !@price . nil? && @price < 2
177- return false if !@amount . nil? && @amount > 100000000000
215+ return false if !@amount . nil? && @amount > 100000000000000
178216 return false if !@amount . nil? && @amount < 0
179217 unit_validator = EnumAttributeValidator . new ( 'String' , [ "g" , "Wh" ] )
180218 return false unless unit_validator . valid? ( @unit )
@@ -195,6 +233,34 @@ def vintage_year=(vintage_year)
195233 @vintage_year = vintage_year
196234 end
197235
236+ # Custom attribute writer method with validation
237+ # @param [Object] vintage_start_year Value to be assigned
238+ def vintage_start_year = ( vintage_start_year )
239+ if !vintage_start_year . nil? && vintage_start_year > 2100
240+ fail ArgumentError , 'invalid value for "vintage_start_year", must be smaller than or equal to 2100.'
241+ end
242+
243+ if !vintage_start_year . nil? && vintage_start_year < 1900
244+ fail ArgumentError , 'invalid value for "vintage_start_year", must be greater than or equal to 1900.'
245+ end
246+
247+ @vintage_start_year = vintage_start_year
248+ end
249+
250+ # Custom attribute writer method with validation
251+ # @param [Object] vintage_end_year Value to be assigned
252+ def vintage_end_year = ( vintage_end_year )
253+ if !vintage_end_year . nil? && vintage_end_year > 2100
254+ fail ArgumentError , 'invalid value for "vintage_end_year", must be smaller than or equal to 2100.'
255+ end
256+
257+ if !vintage_end_year . nil? && vintage_end_year < 1900
258+ fail ArgumentError , 'invalid value for "vintage_end_year", must be greater than or equal to 1900.'
259+ end
260+
261+ @vintage_end_year = vintage_end_year
262+ end
263+
198264 # Custom attribute writer method with validation
199265 # @param [Object] price Value to be assigned
200266 def price = ( price )
@@ -208,8 +274,8 @@ def price=(price)
208274 # Custom attribute writer method with validation
209275 # @param [Object] amount Value to be assigned
210276 def amount = ( amount )
211- if !amount . nil? && amount > 100000000000
212- fail ArgumentError , 'invalid value for "amount", must be smaller than or equal to 100000000000 .'
277+ if !amount . nil? && amount > 100000000000000
278+ fail ArgumentError , 'invalid value for "amount", must be smaller than or equal to 100000000000000 .'
213279 end
214280
215281 if !amount . nil? && amount < 0
@@ -236,6 +302,8 @@ def ==(o)
236302 self . class == o . class &&
237303 project_id == o . project_id &&
238304 vintage_year == o . vintage_year &&
305+ vintage_start_year == o . vintage_start_year &&
306+ vintage_end_year == o . vintage_end_year &&
239307 price == o . price &&
240308 currency == o . currency &&
241309 amount == o . amount &&
@@ -251,7 +319,7 @@ def eql?(o)
251319 # Calculates hash code according to all attributes.
252320 # @return [Integer] Hash code
253321 def hash
254- [ project_id , vintage_year , price , currency , amount , unit ] . hash
322+ [ project_id , vintage_year , vintage_start_year , vintage_end_year , price , currency , amount , unit ] . hash
255323 end
256324
257325 # Builds the object from hash
0 commit comments