patch_ruby 2.1.1 → 2.3.1
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 +4 -4
- data/Gemfile.lock +5 -4
- data/lib/patch_ruby/api/estimates_api.rb +0 -300
- data/lib/patch_ruby/api_client.rb +1 -1
- data/lib/patch_ruby/models/create_order_line_item_request.rb +17 -17
- data/lib/patch_ruby/models/create_order_request.rb +17 -17
- data/lib/patch_ruby/models/estimate.rb +1 -1
- data/lib/patch_ruby/models/project.rb +1 -1
- data/lib/patch_ruby/models/update_order_line_item_request.rb +17 -17
- data/lib/patch_ruby/version.rb +1 -1
- data/lib/patch_ruby.rb +0 -4
- data/spec/integration/estimates_spec.rb +0 -79
- metadata +25 -29
- data/lib/patch_ruby/models/create_ecommerce_estimate_request.rb +0 -373
- data/lib/patch_ruby/models/create_ethereum_estimate_request.rb +0 -281
- data/lib/patch_ruby/models/create_shipping_estimate_request.rb +0 -373
- data/lib/patch_ruby/models/create_vehicle_estimate_request.rb +0 -328
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a6cf438be6ff5461e7154c3c8a552c30bb2889fe35822da0ac35a8a1b51e630
|
4
|
+
data.tar.gz: abdd0f7524382a3f257ab8c7076311da89bf3c7e450b1024cd120df41ae3a367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d7ed5df7cf393f5fb8dc111da72d98f868edf3958e6557e6cdcbf5bd03ff192174a2beaf3e453b875fabb2eeb16c1321a288c0d0ffb70e4f956f6e8586fcae6
|
7
|
+
data.tar.gz: 0ef3be8201d172e095158291c2483b403abdd5dfeec3c63041b0be6232d2defa3262c0d6d84b35c6c66c82cc20f6e3cb43173c35fd587f07f1de25b64e2419cc
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
patch_ruby (2.
|
4
|
+
patch_ruby (2.3.1)
|
5
5
|
typhoeus (~> 1.0, >= 1.0.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -21,10 +21,10 @@ GEM
|
|
21
21
|
ffi (>= 1.15.0)
|
22
22
|
factory_bot (6.2.0)
|
23
23
|
activesupport (>= 5.0.0)
|
24
|
-
ffi (1.
|
24
|
+
ffi (1.17.1)
|
25
25
|
i18n (1.12.0)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
jaro_winkler (1.5.
|
27
|
+
jaro_winkler (1.5.6)
|
28
28
|
method_source (1.0.0)
|
29
29
|
minitest (5.18.0)
|
30
30
|
parallel (1.20.1)
|
@@ -61,7 +61,7 @@ GEM
|
|
61
61
|
ruby-progressbar (~> 1.7)
|
62
62
|
unicode-display_width (>= 1.4.0, < 1.6)
|
63
63
|
ruby-progressbar (1.11.0)
|
64
|
-
typhoeus (1.4.
|
64
|
+
typhoeus (1.4.1)
|
65
65
|
ethon (>= 0.9.0)
|
66
66
|
tzinfo (2.0.6)
|
67
67
|
concurrent-ruby (~> 1.0)
|
@@ -71,6 +71,7 @@ PLATFORMS
|
|
71
71
|
arm64-darwin-20
|
72
72
|
arm64-darwin-21
|
73
73
|
arm64-darwin-22
|
74
|
+
arm64-darwin-24
|
74
75
|
x86_64-darwin-20
|
75
76
|
x86_64-darwin-21
|
76
77
|
x86_64-linux
|
@@ -17,16 +17,12 @@ module Patch
|
|
17
17
|
OPERATIONS = [
|
18
18
|
:create_air_shipping_estimate,
|
19
19
|
:create_bitcoin_estimate,
|
20
|
-
:create_ecommerce_estimate,
|
21
|
-
:create_ethereum_estimate,
|
22
20
|
:create_flight_estimate,
|
23
21
|
:create_hotel_estimate,
|
24
22
|
:create_mass_estimate,
|
25
23
|
:create_rail_shipping_estimate,
|
26
24
|
:create_road_shipping_estimate,
|
27
25
|
:create_sea_shipping_estimate,
|
28
|
-
:create_shipping_estimate,
|
29
|
-
:create_vehicle_estimate,
|
30
26
|
:retrieve_estimate,
|
31
27
|
:retrieve_estimates,
|
32
28
|
]
|
@@ -184,154 +180,6 @@ module Patch
|
|
184
180
|
return data, status_code, headers
|
185
181
|
end
|
186
182
|
|
187
|
-
# Create an e-commerce estimate given the distance traveled in meters, package weight, and transportation method.
|
188
|
-
# Creates a e-commerce estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
|
189
|
-
# @param create_ecommerce_estimate_request [CreateEcommerceEstimateRequest]
|
190
|
-
# @param [Hash] opts the optional parameters
|
191
|
-
# @option opts [Integer] :patch_version
|
192
|
-
# @return [EstimateResponse]
|
193
|
-
def create_ecommerce_estimate(create_ecommerce_estimate_request = {}, opts = {})
|
194
|
-
_create_ecommerce_estimate_request = Patch::CreateEcommerceEstimateRequest.new(create_ecommerce_estimate_request)
|
195
|
-
data, _status_code, _headers = create_ecommerce_estimate_with_http_info(_create_ecommerce_estimate_request, opts)
|
196
|
-
data
|
197
|
-
end
|
198
|
-
|
199
|
-
# Create an e-commerce estimate given the distance traveled in meters, package weight, and transportation method.
|
200
|
-
# Creates a e-commerce estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
|
201
|
-
# @param create_ecommerce_estimate_request [CreateEcommerceEstimateRequest]
|
202
|
-
# @param [Hash] opts the optional parameters
|
203
|
-
# @option opts [Integer] :patch_version
|
204
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
205
|
-
def create_ecommerce_estimate_with_http_info(create_ecommerce_estimate_request, opts = {})
|
206
|
-
if @api_client.config.debugging
|
207
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_ecommerce_estimate ...'
|
208
|
-
end
|
209
|
-
# verify the required parameter 'create_ecommerce_estimate_request' is set
|
210
|
-
if @api_client.config.client_side_validation && create_ecommerce_estimate_request.nil?
|
211
|
-
fail ArgumentError, "Missing the required parameter 'create_ecommerce_estimate_request' when calling EstimatesApi.create_ecommerce_estimate"
|
212
|
-
end
|
213
|
-
# resource path
|
214
|
-
local_var_path = '/v1/estimates/ecommerce'
|
215
|
-
|
216
|
-
# query parameters
|
217
|
-
query_params = opts[:query_params] || {}
|
218
|
-
|
219
|
-
# header parameters
|
220
|
-
header_params = opts[:header_params] || {}
|
221
|
-
|
222
|
-
# HTTP header 'Accept' (if needed)
|
223
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
224
|
-
# HTTP header 'Content-Type'
|
225
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
226
|
-
if !content_type.nil?
|
227
|
-
header_params['Content-Type'] = content_type
|
228
|
-
end
|
229
|
-
header_params['Patch-Version'] = 2
|
230
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
231
|
-
|
232
|
-
# form parameters
|
233
|
-
form_params = opts[:form_params] || {}
|
234
|
-
|
235
|
-
# http body (model)
|
236
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ecommerce_estimate_request)
|
237
|
-
|
238
|
-
# return_type
|
239
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
240
|
-
|
241
|
-
# auth_names
|
242
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
243
|
-
|
244
|
-
new_options = opts.merge(
|
245
|
-
:operation => :"EstimatesApi.create_ecommerce_estimate",
|
246
|
-
:header_params => header_params,
|
247
|
-
:query_params => query_params,
|
248
|
-
:form_params => form_params,
|
249
|
-
:body => post_body,
|
250
|
-
:auth_names => auth_names,
|
251
|
-
:return_type => return_type
|
252
|
-
)
|
253
|
-
|
254
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
255
|
-
if @api_client.config.debugging
|
256
|
-
@api_client.config.logger.debug "API called: EstimatesApi#create_ecommerce_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
257
|
-
end
|
258
|
-
return data, status_code, headers
|
259
|
-
end
|
260
|
-
|
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
183
|
# Create a flight estimate given the distance traveled in meters
|
336
184
|
# 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
185
|
# @param create_flight_estimate_request [CreateFlightEstimateRequest]
|
@@ -776,154 +624,6 @@ module Patch
|
|
776
624
|
return data, status_code, headers
|
777
625
|
end
|
778
626
|
|
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
627
|
# Retrieves an estimate
|
928
628
|
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
|
929
629
|
# @param id [String]
|
@@ -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.
|
34
|
+
@user_agent = "patch-ruby/2.3.1"
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => 'application/json',
|
37
37
|
'User-Agent' => @user_agent
|
@@ -163,24 +163,24 @@ module Patch
|
|
163
163
|
# @return Array for valid properties with the reasons
|
164
164
|
def list_invalid_properties
|
165
165
|
invalid_properties = Array.new
|
166
|
-
if !@vintage_year.nil? && @vintage_year >
|
167
|
-
invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to
|
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.')
|
168
168
|
end
|
169
169
|
|
170
170
|
if !@vintage_year.nil? && @vintage_year < 1900
|
171
171
|
invalid_properties.push('invalid value for "vintage_year", must be greater than or equal to 1900.')
|
172
172
|
end
|
173
173
|
|
174
|
-
if !@vintage_start_year.nil? && @vintage_start_year >
|
175
|
-
invalid_properties.push('invalid value for "vintage_start_year", must be smaller than or equal to
|
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
176
|
end
|
177
177
|
|
178
178
|
if !@vintage_start_year.nil? && @vintage_start_year < 1900
|
179
179
|
invalid_properties.push('invalid value for "vintage_start_year", must be greater than or equal to 1900.')
|
180
180
|
end
|
181
181
|
|
182
|
-
if !@vintage_end_year.nil? && @vintage_end_year >
|
183
|
-
invalid_properties.push('invalid value for "vintage_end_year", must be smaller than or equal to
|
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
184
|
end
|
185
185
|
|
186
186
|
if !@vintage_end_year.nil? && @vintage_end_year < 1900
|
@@ -205,16 +205,16 @@ module Patch
|
|
205
205
|
# Check to see if the all the properties in the model are valid
|
206
206
|
# @return true if the model is valid
|
207
207
|
def valid?
|
208
|
-
return false if !@vintage_year.nil? && @vintage_year >
|
208
|
+
return false if !@vintage_year.nil? && @vintage_year > 2225
|
209
209
|
return false if !@vintage_year.nil? && @vintage_year < 1900
|
210
|
-
return false if !@vintage_start_year.nil? && @vintage_start_year >
|
210
|
+
return false if !@vintage_start_year.nil? && @vintage_start_year > 2225
|
211
211
|
return false if !@vintage_start_year.nil? && @vintage_start_year < 1900
|
212
|
-
return false if !@vintage_end_year.nil? && @vintage_end_year >
|
212
|
+
return false if !@vintage_end_year.nil? && @vintage_end_year > 2225
|
213
213
|
return false if !@vintage_end_year.nil? && @vintage_end_year < 1900
|
214
214
|
return false if !@price.nil? && @price < 2
|
215
215
|
return false if !@amount.nil? && @amount > 100000000000000
|
216
216
|
return false if !@amount.nil? && @amount < 0
|
217
|
-
unit_validator = EnumAttributeValidator.new('String', ["g"
|
217
|
+
unit_validator = EnumAttributeValidator.new('String', ["g"])
|
218
218
|
return false unless unit_validator.valid?(@unit)
|
219
219
|
true
|
220
220
|
end
|
@@ -222,8 +222,8 @@ module Patch
|
|
222
222
|
# Custom attribute writer method with validation
|
223
223
|
# @param [Object] vintage_year Value to be assigned
|
224
224
|
def vintage_year=(vintage_year)
|
225
|
-
if !vintage_year.nil? && vintage_year >
|
226
|
-
fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to
|
225
|
+
if !vintage_year.nil? && vintage_year > 2225
|
226
|
+
fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to 2225.'
|
227
227
|
end
|
228
228
|
|
229
229
|
if !vintage_year.nil? && vintage_year < 1900
|
@@ -236,8 +236,8 @@ module Patch
|
|
236
236
|
# Custom attribute writer method with validation
|
237
237
|
# @param [Object] vintage_start_year Value to be assigned
|
238
238
|
def vintage_start_year=(vintage_start_year)
|
239
|
-
if !vintage_start_year.nil? && vintage_start_year >
|
240
|
-
fail ArgumentError, 'invalid value for "vintage_start_year", must be smaller than or equal to
|
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
241
|
end
|
242
242
|
|
243
243
|
if !vintage_start_year.nil? && vintage_start_year < 1900
|
@@ -250,8 +250,8 @@ module Patch
|
|
250
250
|
# Custom attribute writer method with validation
|
251
251
|
# @param [Object] vintage_end_year Value to be assigned
|
252
252
|
def vintage_end_year=(vintage_end_year)
|
253
|
-
if !vintage_end_year.nil? && vintage_end_year >
|
254
|
-
fail ArgumentError, 'invalid value for "vintage_end_year", must be smaller than or equal to
|
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
255
|
end
|
256
256
|
|
257
257
|
if !vintage_end_year.nil? && vintage_end_year < 1900
|
@@ -288,7 +288,7 @@ module Patch
|
|
288
288
|
# Custom attribute writer method checking allowed values (enum).
|
289
289
|
# @param [Object] unit Object to be assigned
|
290
290
|
def unit=(unit)
|
291
|
-
validator = EnumAttributeValidator.new('String', ["g"
|
291
|
+
validator = EnumAttributeValidator.new('String', ["g"])
|
292
292
|
unless validator.valid?(unit)
|
293
293
|
fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}."
|
294
294
|
end
|
@@ -190,24 +190,24 @@ module Patch
|
|
190
190
|
# @return Array for valid properties with the reasons
|
191
191
|
def list_invalid_properties
|
192
192
|
invalid_properties = Array.new
|
193
|
-
if !@vintage_year.nil? && @vintage_year >
|
194
|
-
invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to
|
193
|
+
if !@vintage_year.nil? && @vintage_year > 2225
|
194
|
+
invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to 2225.')
|
195
195
|
end
|
196
196
|
|
197
197
|
if !@vintage_year.nil? && @vintage_year < 1900
|
198
198
|
invalid_properties.push('invalid value for "vintage_year", must be greater than or equal to 1900.')
|
199
199
|
end
|
200
200
|
|
201
|
-
if !@vintage_start_year.nil? && @vintage_start_year >
|
202
|
-
invalid_properties.push('invalid value for "vintage_start_year", must be smaller than or equal to
|
201
|
+
if !@vintage_start_year.nil? && @vintage_start_year > 2225
|
202
|
+
invalid_properties.push('invalid value for "vintage_start_year", must be smaller than or equal to 2225.')
|
203
203
|
end
|
204
204
|
|
205
205
|
if !@vintage_start_year.nil? && @vintage_start_year < 1900
|
206
206
|
invalid_properties.push('invalid value for "vintage_start_year", must be greater than or equal to 1900.')
|
207
207
|
end
|
208
208
|
|
209
|
-
if !@vintage_end_year.nil? && @vintage_end_year >
|
210
|
-
invalid_properties.push('invalid value for "vintage_end_year", must be smaller than or equal to
|
209
|
+
if !@vintage_end_year.nil? && @vintage_end_year > 2225
|
210
|
+
invalid_properties.push('invalid value for "vintage_end_year", must be smaller than or equal to 2225.')
|
211
211
|
end
|
212
212
|
|
213
213
|
if !@vintage_end_year.nil? && @vintage_end_year < 1900
|
@@ -234,16 +234,16 @@ module Patch
|
|
234
234
|
def valid?
|
235
235
|
state_validator = EnumAttributeValidator.new('String', ["draft", "reserved", "placed"])
|
236
236
|
return false unless state_validator.valid?(@state)
|
237
|
-
return false if !@vintage_year.nil? && @vintage_year >
|
237
|
+
return false if !@vintage_year.nil? && @vintage_year > 2225
|
238
238
|
return false if !@vintage_year.nil? && @vintage_year < 1900
|
239
|
-
return false if !@vintage_start_year.nil? && @vintage_start_year >
|
239
|
+
return false if !@vintage_start_year.nil? && @vintage_start_year > 2225
|
240
240
|
return false if !@vintage_start_year.nil? && @vintage_start_year < 1900
|
241
|
-
return false if !@vintage_end_year.nil? && @vintage_end_year >
|
241
|
+
return false if !@vintage_end_year.nil? && @vintage_end_year > 2225
|
242
242
|
return false if !@vintage_end_year.nil? && @vintage_end_year < 1900
|
243
243
|
return false if !@total_price.nil? && @total_price < 2
|
244
244
|
return false if !@amount.nil? && @amount > 100000000000000
|
245
245
|
return false if !@amount.nil? && @amount < 0
|
246
|
-
unit_validator = EnumAttributeValidator.new('String', ["g"
|
246
|
+
unit_validator = EnumAttributeValidator.new('String', ["g"])
|
247
247
|
return false unless unit_validator.valid?(@unit)
|
248
248
|
true
|
249
249
|
end
|
@@ -261,8 +261,8 @@ module Patch
|
|
261
261
|
# Custom attribute writer method with validation
|
262
262
|
# @param [Object] vintage_year Value to be assigned
|
263
263
|
def vintage_year=(vintage_year)
|
264
|
-
if !vintage_year.nil? && vintage_year >
|
265
|
-
fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to
|
264
|
+
if !vintage_year.nil? && vintage_year > 2225
|
265
|
+
fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to 2225.'
|
266
266
|
end
|
267
267
|
|
268
268
|
if !vintage_year.nil? && vintage_year < 1900
|
@@ -275,8 +275,8 @@ module Patch
|
|
275
275
|
# Custom attribute writer method with validation
|
276
276
|
# @param [Object] vintage_start_year Value to be assigned
|
277
277
|
def vintage_start_year=(vintage_start_year)
|
278
|
-
if !vintage_start_year.nil? && vintage_start_year >
|
279
|
-
fail ArgumentError, 'invalid value for "vintage_start_year", must be smaller than or equal to
|
278
|
+
if !vintage_start_year.nil? && vintage_start_year > 2225
|
279
|
+
fail ArgumentError, 'invalid value for "vintage_start_year", must be smaller than or equal to 2225.'
|
280
280
|
end
|
281
281
|
|
282
282
|
if !vintage_start_year.nil? && vintage_start_year < 1900
|
@@ -289,8 +289,8 @@ module Patch
|
|
289
289
|
# Custom attribute writer method with validation
|
290
290
|
# @param [Object] vintage_end_year Value to be assigned
|
291
291
|
def vintage_end_year=(vintage_end_year)
|
292
|
-
if !vintage_end_year.nil? && vintage_end_year >
|
293
|
-
fail ArgumentError, 'invalid value for "vintage_end_year", must be smaller than or equal to
|
292
|
+
if !vintage_end_year.nil? && vintage_end_year > 2225
|
293
|
+
fail ArgumentError, 'invalid value for "vintage_end_year", must be smaller than or equal to 2225.'
|
294
294
|
end
|
295
295
|
|
296
296
|
if !vintage_end_year.nil? && vintage_end_year < 1900
|
@@ -327,7 +327,7 @@ module Patch
|
|
327
327
|
# Custom attribute writer method checking allowed values (enum).
|
328
328
|
# @param [Object] unit Object to be assigned
|
329
329
|
def unit=(unit)
|
330
|
-
validator = EnumAttributeValidator.new('String', ["g"
|
330
|
+
validator = EnumAttributeValidator.new('String', ["g"])
|
331
331
|
unless validator.valid?(unit)
|
332
332
|
fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}."
|
333
333
|
end
|
@@ -21,7 +21,7 @@ module Patch
|
|
21
21
|
# A boolean indicating if this estimate is a production or demo mode estimate.
|
22
22
|
attr_accessor :production
|
23
23
|
|
24
|
-
# The type of estimate. Available types are mass, flight, shipping,
|
24
|
+
# The type of estimate. Available types are mass, flight, shipping, and crypto.
|
25
25
|
attr_accessor :type
|
26
26
|
|
27
27
|
# The estimated mass in grams for this estimate.
|
@@ -65,7 +65,7 @@ module Patch
|
|
65
65
|
|
66
66
|
attr_accessor :technology_type
|
67
67
|
|
68
|
-
# An array of objects containing the highlight's slug, title, and a URL for the corresponding icon. A highlight's title is a short string that spotlights a characteristic about the project.
|
68
|
+
# DEPRECATED. An array of objects containing the highlight's slug, title, and a URL for the corresponding icon. A highlight's title is a short string that spotlights a characteristic about the project. Highlights are deprecated and not populated for recent projects.
|
69
69
|
attr_accessor :highlights
|
70
70
|
|
71
71
|
# An array of objects containing available inventory for a project. Available inventory is grouped by a project's vintage year and returns amount and pricing available for a given vintage year.
|