patch_ruby 2.0.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffab52fb27f71cbe7b98bf78cd0c73271c058bcf0d6f3c38b9df718f6816a802
4
- data.tar.gz: 519f529a4d608fde6517907961fe4b38398594aaa2ebd8a6b54d4b39d8e2da99
3
+ metadata.gz: 04f58db82f8abcbae1a77f0a0e9d942e7b4e9f489cc9510393d78d1a504ef643
4
+ data.tar.gz: 449a7f27b2828110e9692cbccdf4fc1a3b34acbb55228c7940ba931b92a9c896
5
5
  SHA512:
6
- metadata.gz: da969c2cfe5217621910a4629945cf47cc29473394010fecdc53ad9bcf94c747ae677f12de8fd9e24c44bb1b2969e23167163dc4e8085dcb9572931794aa421c
7
- data.tar.gz: 899e11a3911ed3102353c7d4753ac5cfe522f0dd9448a66e48f7e04f66f442c70f2bcaf8514b5faa86425c5db1cb8905350536290017656e2d9a5786dd2c1ba3
6
+ metadata.gz: 6c4b4cd548a77b1a0c6bba32698e95b2fac394d04304190c0699b4ab8bf295c9d46e71960e2bccd87da9354ea1a8748298db6a90f35297829e3508c541ce9556
7
+ data.tar.gz: 7c76591eddd59c6a33a6b60c92e739406b0c5845e421b881c7d53631e827e7b073961b713ae7bea6fb190437146de54e4971631aee6d2d1bb5423ca5a4f52379
data/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.1.1] - 2023-04-18
9
+
10
+ ### Added
11
+
12
+ - Adds `issuance_type` to `project` responses
13
+ - Adds `disclaimers` to `project` responses
14
+
15
+ ## [2.1.0] - 2023-04-04
16
+
17
+ ### Added
18
+
19
+ - Adds optional `vintage_start_year` and `vintage_end_year` fields to `order` creation
20
+ - Adds optional `vintage_start_year` and `vintage_end_year` fields to `order_line_item` create and update
21
+ - Adds optional `vintage_start_year` and `vintage_end_year` fields to `inventory` creation
22
+ - Adds `vintage_start_year` and `vintage_end_year` fields to `order` response
23
+ - Adds `vintage_start_year` and `vintage_end_year` fields to `order_line_item` response
24
+ - Adds optional `carrier_scac` field to `Patch::Estimate.create_road_shipping_estimate` method
25
+ - Deprecates `Patch::Estimate.create_shipping_estimate` in favor of `Patch::Estimate.create_ecommerce_estimate`
26
+
8
27
  ## [1.24.2] - 2022-08-10
9
28
 
10
29
  ### Added
data/Gemfile.lock CHANGED
@@ -1,33 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- patch_ruby (2.0.0)
4
+ patch_ruby (2.3.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.1.4.1)
10
+ activesupport (7.0.4.3)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
14
14
  tzinfo (~> 2.0)
15
- zeitwerk (~> 2.3)
16
15
  ast (2.4.2)
17
16
  byebug (11.1.3)
18
17
  coderay (1.1.3)
19
- concurrent-ruby (1.1.9)
18
+ concurrent-ruby (1.2.2)
20
19
  diff-lcs (1.4.4)
21
- ethon (0.15.0)
20
+ ethon (0.16.0)
22
21
  ffi (>= 1.15.0)
23
22
  factory_bot (6.2.0)
24
23
  activesupport (>= 5.0.0)
25
- ffi (1.15.5)
26
- i18n (1.8.10)
24
+ ffi (1.17.1)
25
+ i18n (1.12.0)
27
26
  concurrent-ruby (~> 1.0)
28
- jaro_winkler (1.5.4)
27
+ jaro_winkler (1.5.6)
29
28
  method_source (1.0.0)
30
- minitest (5.14.4)
29
+ minitest (5.18.0)
31
30
  parallel (1.20.1)
32
31
  parser (3.0.2.0)
33
32
  ast (~> 2.4.1)
@@ -62,16 +61,17 @@ GEM
62
61
  ruby-progressbar (~> 1.7)
63
62
  unicode-display_width (>= 1.4.0, < 1.6)
64
63
  ruby-progressbar (1.11.0)
65
- typhoeus (1.4.0)
64
+ typhoeus (1.4.1)
66
65
  ethon (>= 0.9.0)
67
- tzinfo (2.0.4)
66
+ tzinfo (2.0.6)
68
67
  concurrent-ruby (~> 1.0)
69
68
  unicode-display_width (1.5.0)
70
- zeitwerk (2.4.2)
71
69
 
72
70
  PLATFORMS
73
71
  arm64-darwin-20
74
72
  arm64-darwin-21
73
+ arm64-darwin-22
74
+ arm64-darwin-24
75
75
  x86_64-darwin-20
76
76
  x86_64-darwin-21
77
77
  x86_64-linux
@@ -86,4 +86,4 @@ DEPENDENCIES
86
86
  rubocop (~> 0.66.0)
87
87
 
88
88
  BUNDLED WITH
89
- 2.2.22
89
+ 2.3.9
@@ -18,15 +18,12 @@ module Patch
18
18
  :create_air_shipping_estimate,
19
19
  :create_bitcoin_estimate,
20
20
  :create_ecommerce_estimate,
21
- :create_ethereum_estimate,
22
21
  :create_flight_estimate,
23
22
  :create_hotel_estimate,
24
23
  :create_mass_estimate,
25
24
  :create_rail_shipping_estimate,
26
25
  :create_road_shipping_estimate,
27
26
  :create_sea_shipping_estimate,
28
- :create_shipping_estimate,
29
- :create_vehicle_estimate,
30
27
  :retrieve_estimate,
31
28
  :retrieve_estimates,
32
29
  ]
@@ -258,80 +255,6 @@ module Patch
258
255
  return data, status_code, headers
259
256
  end
260
257
 
261
- # Create an ethereum estimate
262
- # Creates an ethereum estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
263
- # @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
264
- # @param [Hash] opts the optional parameters
265
- # @option opts [Integer] :patch_version
266
- # @return [EstimateResponse]
267
- def create_ethereum_estimate(create_ethereum_estimate_request = {}, opts = {})
268
- _create_ethereum_estimate_request = Patch::CreateEthereumEstimateRequest.new(create_ethereum_estimate_request)
269
- data, _status_code, _headers = create_ethereum_estimate_with_http_info(_create_ethereum_estimate_request, opts)
270
- data
271
- end
272
-
273
- # Create an ethereum estimate
274
- # Creates an ethereum estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
275
- # @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
276
- # @param [Hash] opts the optional parameters
277
- # @option opts [Integer] :patch_version
278
- # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
279
- def create_ethereum_estimate_with_http_info(create_ethereum_estimate_request, opts = {})
280
- if @api_client.config.debugging
281
- @api_client.config.logger.debug 'Calling API: EstimatesApi.create_ethereum_estimate ...'
282
- end
283
- # verify the required parameter 'create_ethereum_estimate_request' is set
284
- if @api_client.config.client_side_validation && create_ethereum_estimate_request.nil?
285
- fail ArgumentError, "Missing the required parameter 'create_ethereum_estimate_request' when calling EstimatesApi.create_ethereum_estimate"
286
- end
287
- # resource path
288
- local_var_path = '/v1/estimates/crypto/eth'
289
-
290
- # query parameters
291
- query_params = opts[:query_params] || {}
292
-
293
- # header parameters
294
- header_params = opts[:header_params] || {}
295
-
296
- # HTTP header 'Accept' (if needed)
297
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
298
- # HTTP header 'Content-Type'
299
- content_type = @api_client.select_header_content_type(['application/json'])
300
- if !content_type.nil?
301
- header_params['Content-Type'] = content_type
302
- end
303
- header_params['Patch-Version'] = 2
304
- header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
305
-
306
- # form parameters
307
- form_params = opts[:form_params] || {}
308
-
309
- # http body (model)
310
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ethereum_estimate_request)
311
-
312
- # return_type
313
- return_type = opts[:debug_return_type] || 'EstimateResponse'
314
-
315
- # auth_names
316
- auth_names = opts[:debug_auth_names] || ['bearer_auth']
317
-
318
- new_options = opts.merge(
319
- :operation => :"EstimatesApi.create_ethereum_estimate",
320
- :header_params => header_params,
321
- :query_params => query_params,
322
- :form_params => form_params,
323
- :body => post_body,
324
- :auth_names => auth_names,
325
- :return_type => return_type
326
- )
327
-
328
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
329
- if @api_client.config.debugging
330
- @api_client.config.logger.debug "API called: EstimatesApi#create_ethereum_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
331
- end
332
- return data, status_code, headers
333
- end
334
-
335
258
  # Create a flight estimate given the distance traveled in meters
336
259
  # Creates a flight estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
337
260
  # @param create_flight_estimate_request [CreateFlightEstimateRequest]
@@ -776,154 +699,6 @@ module Patch
776
699
  return data, status_code, headers
777
700
  end
778
701
 
779
- # Create a shipping estimate given the distance traveled in meters, package weight, and transportation method.
780
- # Creates a shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
781
- # @param create_shipping_estimate_request [CreateShippingEstimateRequest]
782
- # @param [Hash] opts the optional parameters
783
- # @option opts [Integer] :patch_version
784
- # @return [EstimateResponse]
785
- def create_shipping_estimate(create_shipping_estimate_request = {}, opts = {})
786
- _create_shipping_estimate_request = Patch::CreateShippingEstimateRequest.new(create_shipping_estimate_request)
787
- data, _status_code, _headers = create_shipping_estimate_with_http_info(_create_shipping_estimate_request, opts)
788
- data
789
- end
790
-
791
- # Create a shipping estimate given the distance traveled in meters, package weight, and transportation method.
792
- # Creates a shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
793
- # @param create_shipping_estimate_request [CreateShippingEstimateRequest]
794
- # @param [Hash] opts the optional parameters
795
- # @option opts [Integer] :patch_version
796
- # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
797
- def create_shipping_estimate_with_http_info(create_shipping_estimate_request, opts = {})
798
- if @api_client.config.debugging
799
- @api_client.config.logger.debug 'Calling API: EstimatesApi.create_shipping_estimate ...'
800
- end
801
- # verify the required parameter 'create_shipping_estimate_request' is set
802
- if @api_client.config.client_side_validation && create_shipping_estimate_request.nil?
803
- fail ArgumentError, "Missing the required parameter 'create_shipping_estimate_request' when calling EstimatesApi.create_shipping_estimate"
804
- end
805
- # resource path
806
- local_var_path = '/v1/estimates/shipping'
807
-
808
- # query parameters
809
- query_params = opts[:query_params] || {}
810
-
811
- # header parameters
812
- header_params = opts[:header_params] || {}
813
-
814
- # HTTP header 'Accept' (if needed)
815
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
816
- # HTTP header 'Content-Type'
817
- content_type = @api_client.select_header_content_type(['application/json'])
818
- if !content_type.nil?
819
- header_params['Content-Type'] = content_type
820
- end
821
- header_params['Patch-Version'] = 2
822
- header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
823
-
824
- # form parameters
825
- form_params = opts[:form_params] || {}
826
-
827
- # http body (model)
828
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_shipping_estimate_request)
829
-
830
- # return_type
831
- return_type = opts[:debug_return_type] || 'EstimateResponse'
832
-
833
- # auth_names
834
- auth_names = opts[:debug_auth_names] || ['bearer_auth']
835
-
836
- new_options = opts.merge(
837
- :operation => :"EstimatesApi.create_shipping_estimate",
838
- :header_params => header_params,
839
- :query_params => query_params,
840
- :form_params => form_params,
841
- :body => post_body,
842
- :auth_names => auth_names,
843
- :return_type => return_type
844
- )
845
-
846
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
847
- if @api_client.config.debugging
848
- @api_client.config.logger.debug "API called: EstimatesApi#create_shipping_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
849
- end
850
- return data, status_code, headers
851
- end
852
-
853
- # Create a vehicle estimate given the distance traveled in meters and the type of vehicle
854
- # Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the `draft` state may be created based on the parameters, linked to the estimate.
855
- # @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
856
- # @param [Hash] opts the optional parameters
857
- # @option opts [Integer] :patch_version
858
- # @return [EstimateResponse]
859
- def create_vehicle_estimate(create_vehicle_estimate_request = {}, opts = {})
860
- _create_vehicle_estimate_request = Patch::CreateVehicleEstimateRequest.new(create_vehicle_estimate_request)
861
- data, _status_code, _headers = create_vehicle_estimate_with_http_info(_create_vehicle_estimate_request, opts)
862
- data
863
- end
864
-
865
- # Create a vehicle estimate given the distance traveled in meters and the type of vehicle
866
- # Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the `draft` state may be created based on the parameters, linked to the estimate.
867
- # @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
868
- # @param [Hash] opts the optional parameters
869
- # @option opts [Integer] :patch_version
870
- # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
871
- def create_vehicle_estimate_with_http_info(create_vehicle_estimate_request, opts = {})
872
- if @api_client.config.debugging
873
- @api_client.config.logger.debug 'Calling API: EstimatesApi.create_vehicle_estimate ...'
874
- end
875
- # verify the required parameter 'create_vehicle_estimate_request' is set
876
- if @api_client.config.client_side_validation && create_vehicle_estimate_request.nil?
877
- fail ArgumentError, "Missing the required parameter 'create_vehicle_estimate_request' when calling EstimatesApi.create_vehicle_estimate"
878
- end
879
- # resource path
880
- local_var_path = '/v1/estimates/vehicle'
881
-
882
- # query parameters
883
- query_params = opts[:query_params] || {}
884
-
885
- # header parameters
886
- header_params = opts[:header_params] || {}
887
-
888
- # HTTP header 'Accept' (if needed)
889
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
890
- # HTTP header 'Content-Type'
891
- content_type = @api_client.select_header_content_type(['application/json'])
892
- if !content_type.nil?
893
- header_params['Content-Type'] = content_type
894
- end
895
- header_params['Patch-Version'] = 2
896
- header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
897
-
898
- # form parameters
899
- form_params = opts[:form_params] || {}
900
-
901
- # http body (model)
902
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_vehicle_estimate_request)
903
-
904
- # return_type
905
- return_type = opts[:debug_return_type] || 'EstimateResponse'
906
-
907
- # auth_names
908
- auth_names = opts[:debug_auth_names] || ['bearer_auth']
909
-
910
- new_options = opts.merge(
911
- :operation => :"EstimatesApi.create_vehicle_estimate",
912
- :header_params => header_params,
913
- :query_params => query_params,
914
- :form_params => form_params,
915
- :body => post_body,
916
- :auth_names => auth_names,
917
- :return_type => return_type
918
- )
919
-
920
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
921
- if @api_client.config.debugging
922
- @api_client.config.logger.debug "API called: EstimatesApi#create_vehicle_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
923
- end
924
- return data, status_code, headers
925
- end
926
-
927
702
  # Retrieves an estimate
928
703
  # Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
929
704
  # @param id [String]
@@ -1059,4 +834,4 @@ module Patch
1059
834
  return data, status_code, headers
1060
835
  end
1061
836
  end
1062
- end
837
+ end
@@ -266,4 +266,4 @@ module Patch
266
266
  return data, status_code, headers
267
267
  end
268
268
  end
269
- end
269
+ end
@@ -460,4 +460,4 @@ module Patch
460
460
  return data, status_code, headers
461
461
  end
462
462
  end
463
- end
463
+ end
@@ -174,4 +174,4 @@ module Patch
174
174
  return data, status_code, headers
175
175
  end
176
176
  end
177
- end
177
+ end
@@ -86,4 +86,4 @@ module Patch
86
86
  return data, status_code, headers
87
87
  end
88
88
  end
89
- end
89
+ end
@@ -31,7 +31,7 @@ module Patch
31
31
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
32
  def initialize(config = Configuration.default)
33
33
  @config = config
34
- @user_agent = "patch-ruby/2.0.0"
34
+ @user_agent = "patch-ruby/2.3.0"
35
35
  @default_headers = {
36
36
  'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
@@ -101,8 +101,8 @@ module Patch
101
101
  invalid_properties.push('invalid value for "mass_g", mass_g cannot be nil.')
102
102
  end
103
103
 
104
- if @mass_g > 100000000000
105
- invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 100000000000.')
104
+ if @mass_g > 100000000000000
105
+ invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 100000000000000.')
106
106
  end
107
107
 
108
108
  if @mass_g < 0
@@ -116,7 +116,7 @@ module Patch
116
116
  # @return true if the model is valid
117
117
  def valid?
118
118
  return false if @mass_g.nil?
119
- return false if @mass_g > 100000000000
119
+ return false if @mass_g > 100000000000000
120
120
  return false if @mass_g < 0
121
121
  true
122
122
  end
@@ -128,8 +128,8 @@ module Patch
128
128
  fail ArgumentError, 'mass_g cannot be nil'
129
129
  end
130
130
 
131
- if mass_g > 100000000000
132
- fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 100000000000.'
131
+ if mass_g > 100000000000000
132
+ fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 100000000000000.'
133
133
  end
134
134
 
135
135
  if mass_g < 0
@@ -19,6 +19,10 @@ module Patch
19
19
 
20
20
  attr_accessor :vintage_year
21
21
 
22
+ attr_accessor :vintage_start_year
23
+
24
+ attr_accessor :vintage_end_year
25
+
22
26
  attr_accessor :price
23
27
 
24
28
  attr_accessor :currency
@@ -54,6 +58,8 @@ module Patch
54
58
  {
55
59
  :'project_id' => :'project_id',
56
60
  :'vintage_year' => :'vintage_year',
61
+ :'vintage_start_year' => :'vintage_start_year',
62
+ :'vintage_end_year' => :'vintage_end_year',
57
63
  :'price' => :'price',
58
64
  :'currency' => :'currency',
59
65
  :'amount' => :'amount',
@@ -71,6 +77,8 @@ module Patch
71
77
  {
72
78
  :'project_id' => :'String',
73
79
  :'vintage_year' => :'Integer',
80
+ :'vintage_start_year' => :'Integer',
81
+ :'vintage_end_year' => :'Integer',
74
82
  :'price' => :'Integer',
75
83
  :'currency' => :'String',
76
84
  :'amount' => :'Integer',
@@ -82,6 +90,8 @@ module Patch
82
90
  def self.openapi_nullable
83
91
  Set.new([
84
92
  :'vintage_year',
93
+ :'vintage_start_year',
94
+ :'vintage_end_year',
85
95
  :'price',
86
96
  :'currency',
87
97
  :'amount',
@@ -124,6 +134,14 @@ module Patch
124
134
  self.vintage_year = attributes[:'vintage_year']
125
135
  end
126
136
 
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
+
127
145
  if attributes.key?(:'price')
128
146
  self.price = attributes[:'price']
129
147
  end
@@ -145,20 +163,36 @@ module Patch
145
163
  # @return Array for valid properties with the reasons
146
164
  def list_invalid_properties
147
165
  invalid_properties = Array.new
148
- if !@vintage_year.nil? && @vintage_year > 2100
149
- invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to 2100.')
166
+ if !@vintage_year.nil? && @vintage_year > 2225
167
+ invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to 2225.')
150
168
  end
151
169
 
152
170
  if !@vintage_year.nil? && @vintage_year < 1900
153
171
  invalid_properties.push('invalid value for "vintage_year", must be greater than or equal to 1900.')
154
172
  end
155
173
 
174
+ if !@vintage_start_year.nil? && @vintage_start_year > 2225
175
+ invalid_properties.push('invalid value for "vintage_start_year", must be smaller than or equal to 2225.')
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 > 2225
183
+ invalid_properties.push('invalid value for "vintage_end_year", must be smaller than or equal to 2225.')
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
+
156
190
  if !@price.nil? && @price < 2
157
191
  invalid_properties.push('invalid value for "price", must be greater than or equal to 2.')
158
192
  end
159
193
 
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.')
162
196
  end
163
197
 
164
198
  if !@amount.nil? && @amount < 0
@@ -171,12 +205,16 @@ module Patch
171
205
  # Check to see if the all the properties in the model are valid
172
206
  # @return true if the model is valid
173
207
  def valid?
174
- return false if !@vintage_year.nil? && @vintage_year > 2100
208
+ return false if !@vintage_year.nil? && @vintage_year > 2225
175
209
  return false if !@vintage_year.nil? && @vintage_year < 1900
210
+ return false if !@vintage_start_year.nil? && @vintage_start_year > 2225
211
+ return false if !@vintage_start_year.nil? && @vintage_start_year < 1900
212
+ return false if !@vintage_end_year.nil? && @vintage_end_year > 2225
213
+ return false if !@vintage_end_year.nil? && @vintage_end_year < 1900
176
214
  return false if !@price.nil? && @price < 2
177
- return false if !@amount.nil? && @amount > 100000000000
215
+ return false if !@amount.nil? && @amount > 100000000000000
178
216
  return false if !@amount.nil? && @amount < 0
179
- unit_validator = EnumAttributeValidator.new('String', ["g", "Wh"])
217
+ unit_validator = EnumAttributeValidator.new('String', ["g"])
180
218
  return false unless unit_validator.valid?(@unit)
181
219
  true
182
220
  end
@@ -184,8 +222,8 @@ module Patch
184
222
  # Custom attribute writer method with validation
185
223
  # @param [Object] vintage_year Value to be assigned
186
224
  def vintage_year=(vintage_year)
187
- if !vintage_year.nil? && vintage_year > 2100
188
- fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to 2100.'
225
+ if !vintage_year.nil? && vintage_year > 2225
226
+ fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to 2225.'
189
227
  end
190
228
 
191
229
  if !vintage_year.nil? && vintage_year < 1900
@@ -195,6 +233,34 @@ module Patch
195
233
  @vintage_year = vintage_year
196
234
  end
197
235
 
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 > 2225
240
+ fail ArgumentError, 'invalid value for "vintage_start_year", must be smaller than or equal to 2225.'
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 > 2225
254
+ fail ArgumentError, 'invalid value for "vintage_end_year", must be smaller than or equal to 2225.'
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
+
198
264
  # Custom attribute writer method with validation
199
265
  # @param [Object] price Value to be assigned
200
266
  def price=(price)
@@ -208,8 +274,8 @@ module Patch
208
274
  # Custom attribute writer method with validation
209
275
  # @param [Object] amount Value to be assigned
210
276
  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.'
213
279
  end
214
280
 
215
281
  if !amount.nil? && amount < 0
@@ -222,7 +288,7 @@ module Patch
222
288
  # Custom attribute writer method checking allowed values (enum).
223
289
  # @param [Object] unit Object to be assigned
224
290
  def unit=(unit)
225
- validator = EnumAttributeValidator.new('String', ["g", "Wh"])
291
+ validator = EnumAttributeValidator.new('String', ["g"])
226
292
  unless validator.valid?(unit)
227
293
  fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}."
228
294
  end
@@ -236,6 +302,8 @@ module Patch
236
302
  self.class == o.class &&
237
303
  project_id == o.project_id &&
238
304
  vintage_year == o.vintage_year &&
305
+ vintage_start_year == o.vintage_start_year &&
306
+ vintage_end_year == o.vintage_end_year &&
239
307
  price == o.price &&
240
308
  currency == o.currency &&
241
309
  amount == o.amount &&
@@ -251,7 +319,7 @@ module Patch
251
319
  # Calculates hash code according to all attributes.
252
320
  # @return [Integer] Hash code
253
321
  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
255
323
  end
256
324
 
257
325
  # Builds the object from hash