patch_ruby 1.24.1 → 2.0.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +11 -11
- data/lib/patch_ruby/api/estimates_api.rb +142 -2
- data/lib/patch_ruby/api/order_line_items_api.rb +269 -0
- data/lib/patch_ruby/api/orders_api.rb +99 -4
- data/lib/patch_ruby/api/projects_api.rb +12 -2
- data/lib/patch_ruby/api/technology_types_api.rb +7 -2
- data/lib/patch_ruby/api_client.rb +3 -3
- data/lib/patch_ruby/api_error.rb +2 -2
- data/lib/patch_ruby/configuration.rb +2 -2
- data/lib/patch_ruby/models/create_air_shipping_estimate_request.rb +3 -3
- data/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_ecommerce_estimate_request.rb +373 -0
- data/lib/patch_ruby/models/create_ethereum_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_flight_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_hotel_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_mass_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_order_line_item_request.rb +375 -0
- data/lib/patch_ruby/models/create_order_request.rb +8 -67
- data/lib/patch_ruby/models/create_rail_shipping_estimate_request.rb +3 -3
- data/lib/patch_ruby/models/create_road_shipping_estimate_request.rb +3 -3
- data/lib/patch_ruby/models/create_sea_shipping_estimate_request.rb +3 -3
- data/lib/patch_ruby/models/create_shipping_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_success_response.rb +2 -2
- data/lib/patch_ruby/models/create_vehicle_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/delete_order_line_item_response.rb +257 -0
- data/lib/patch_ruby/models/delete_order_response.rb +257 -0
- data/lib/patch_ruby/models/error_response.rb +2 -2
- data/lib/patch_ruby/models/estimate.rb +2 -2
- data/lib/patch_ruby/models/estimate_list_response.rb +2 -2
- data/lib/patch_ruby/models/estimate_response.rb +2 -2
- data/lib/patch_ruby/models/highlight.rb +2 -2
- data/lib/patch_ruby/models/inventory.rb +2 -2
- data/lib/patch_ruby/models/meta_index_object.rb +2 -2
- data/lib/patch_ruby/models/order.rb +11 -115
- data/lib/patch_ruby/models/order_issued_to.rb +2 -2
- data/lib/patch_ruby/models/{order_inventory.rb → order_line_item.rb} +19 -9
- data/lib/patch_ruby/models/{order_inventory_project.rb → order_line_item_project.rb} +7 -7
- data/lib/patch_ruby/models/{allocation.rb → order_line_item_response.rb} +33 -40
- data/lib/patch_ruby/models/order_list_response.rb +2 -2
- data/lib/patch_ruby/models/order_response.rb +2 -2
- data/lib/patch_ruby/models/parent_technology_type.rb +2 -2
- data/lib/patch_ruby/models/photo.rb +2 -2
- data/lib/patch_ruby/models/place_order_request.rb +2 -2
- data/lib/patch_ruby/models/project.rb +13 -53
- data/lib/patch_ruby/models/project_list_response.rb +2 -2
- data/lib/patch_ruby/models/project_response.rb +2 -2
- data/lib/patch_ruby/models/sdg.rb +2 -2
- data/lib/patch_ruby/models/standard.rb +2 -2
- data/lib/patch_ruby/models/technology_type.rb +2 -2
- data/lib/patch_ruby/models/technology_type_list_response.rb +2 -2
- data/lib/patch_ruby/models/update_order_line_item_request.rb +366 -0
- data/lib/patch_ruby/version.rb +3 -3
- data/lib/patch_ruby.rb +11 -5
- data/patch_ruby.gemspec +2 -2
- data/spec/api/order_line_items_api_spec.rb +78 -0
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/factories/create_order_requests.rb +4 -2
- data/spec/factories/orders.rb +5 -4
- data/spec/factories/projects.rb +1 -4
- data/spec/integration/estimates_spec.rb +29 -16
- data/spec/integration/orders_spec.rb +85 -44
- data/spec/integration/projects_spec.rb +2 -4
- data/spec/models/create_order_request_spec.rb +10 -3
- data/spec/models/order_spec.rb +8 -23
- data/spec/models/project_spec.rb +1 -4
- data/spec/spec_helper.rb +2 -2
- metadata +35 -31
- data/spec/factories/allocations.rb +0 -7
- data/spec/models/allocation_spec.rb +0 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffab52fb27f71cbe7b98bf78cd0c73271c058bcf0d6f3c38b9df718f6816a802
|
4
|
+
data.tar.gz: 519f529a4d608fde6517907961fe4b38398594aaa2ebd8a6b54d4b39d8e2da99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da969c2cfe5217621910a4629945cf47cc29473394010fecdc53ad9bcf94c747ae677f12de8fd9e24c44bb1b2969e23167163dc4e8085dcb9572931794aa421c
|
7
|
+
data.tar.gz: 899e11a3911ed3102353c7d4753ac5cfe522f0dd9448a66e48f7e04f66f442c70f2bcaf8514b5faa86425c5db1cb8905350536290017656e2d9a5786dd2c1ba3
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,12 @@ 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
|
+
## [1.24.2] - 2022-08-10
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Adds `Patch::Estimate.create_ecommerce_estimate` method
|
13
|
+
|
8
14
|
## [1.24.0] - 2022-07-22
|
9
15
|
|
10
16
|
### Added
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -127,16 +127,6 @@ Patch::Estimate.create_mass_estimate(mass_g: mass)
|
|
127
127
|
distance_m = 1_000_000 # Pass in the distance traveled in meters
|
128
128
|
Patch::Estimate.create_flight_estimate(distance_m: distance_m)
|
129
129
|
|
130
|
-
# Create a shipping estimate
|
131
|
-
distance_m = 1_000_000 # Pass in the shipping distance in meters
|
132
|
-
package_mass_g = 10_000 # Pass in the weight of the package shipped in grams
|
133
|
-
transportation_method = "air" # Pass in the transportation method (air, rail, road, sea)
|
134
|
-
Patch::Estimate.create_shipping_estimate(
|
135
|
-
distance_m: distance_m,
|
136
|
-
package_mass_g: package_mass_g,
|
137
|
-
transportation_method: transportation_method
|
138
|
-
)
|
139
|
-
|
140
130
|
# Create a vehicle estimate
|
141
131
|
distance_m = 1_000_000 # Pass in the shipping distance in meters
|
142
132
|
make = "Toyota" # Pass in the car make
|
@@ -149,10 +139,20 @@ Patch::Estimate.create_vehicle_estimate(
|
|
149
139
|
year: year
|
150
140
|
)
|
151
141
|
|
152
|
-
# Create a
|
142
|
+
# Create a Bitcoin estimate
|
153
143
|
transaction_value_btc_sats = 1000; # [Optional] Pass in the transaction value in satoshis
|
154
144
|
Patch::Estimate.create_bitcoin_estimate(transaction_value_btc_sats: transaction_value_btc_sats)
|
155
145
|
|
146
|
+
# Create an ecommerce estimate
|
147
|
+
distance_m = 1_000_000 # Pass in the shipping distance in meters
|
148
|
+
package_mass_g = 10_000 # Pass in the weight of the package shipped in grams
|
149
|
+
transportation_method = "air" # Pass in the transportation method (air, rail, road, sea)
|
150
|
+
Patch::Estimate.create_ecommerce_estimate(
|
151
|
+
distance_m: distance_m,
|
152
|
+
package_mass_g: package_mass_g,
|
153
|
+
transportation_method: transportation_method
|
154
|
+
)
|
155
|
+
|
156
156
|
## You can also specify a project-id field (optional) to be used instead of the preferred one
|
157
157
|
project_id = 'pro_test_1234' # Pass in the project's ID
|
158
158
|
Patch::Estimate.create_mass_estimate(mass_g: mass, project_id: project_id)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
=begin
|
2
|
-
#Patch API
|
2
|
+
#Patch API V2
|
3
3
|
|
4
4
|
#The core API used to integrate with Patch's service
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
6
|
+
The version of the OpenAPI document: 2
|
7
7
|
Contact: engineering@usepatch.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
OpenAPI Generator version: 5.3.1
|
@@ -17,6 +17,7 @@ module Patch
|
|
17
17
|
OPERATIONS = [
|
18
18
|
:create_air_shipping_estimate,
|
19
19
|
:create_bitcoin_estimate,
|
20
|
+
:create_ecommerce_estimate,
|
20
21
|
:create_ethereum_estimate,
|
21
22
|
:create_flight_estimate,
|
22
23
|
:create_hotel_estimate,
|
@@ -39,6 +40,7 @@ module Patch
|
|
39
40
|
# Creates a GLEC air shipping 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.
|
40
41
|
# @param create_air_shipping_estimate_request [CreateAirShippingEstimateRequest]
|
41
42
|
# @param [Hash] opts the optional parameters
|
43
|
+
# @option opts [Integer] :patch_version
|
42
44
|
# @return [EstimateResponse]
|
43
45
|
def create_air_shipping_estimate(create_air_shipping_estimate_request = {}, opts = {})
|
44
46
|
_create_air_shipping_estimate_request = Patch::CreateAirShippingEstimateRequest.new(create_air_shipping_estimate_request)
|
@@ -50,6 +52,7 @@ module Patch
|
|
50
52
|
# Creates a GLEC air shipping 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.
|
51
53
|
# @param create_air_shipping_estimate_request [CreateAirShippingEstimateRequest]
|
52
54
|
# @param [Hash] opts the optional parameters
|
55
|
+
# @option opts [Integer] :patch_version
|
53
56
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
54
57
|
def create_air_shipping_estimate_with_http_info(create_air_shipping_estimate_request, opts = {})
|
55
58
|
if @api_client.config.debugging
|
@@ -67,6 +70,7 @@ module Patch
|
|
67
70
|
|
68
71
|
# header parameters
|
69
72
|
header_params = opts[:header_params] || {}
|
73
|
+
|
70
74
|
# HTTP header 'Accept' (if needed)
|
71
75
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
72
76
|
# HTTP header 'Content-Type'
|
@@ -74,6 +78,8 @@ module Patch
|
|
74
78
|
if !content_type.nil?
|
75
79
|
header_params['Content-Type'] = content_type
|
76
80
|
end
|
81
|
+
header_params['Patch-Version'] = 2
|
82
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
77
83
|
|
78
84
|
# form parameters
|
79
85
|
form_params = opts[:form_params] || {}
|
@@ -108,6 +114,7 @@ module Patch
|
|
108
114
|
# Creates a bitcoin 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.
|
109
115
|
# @param create_bitcoin_estimate_request [CreateBitcoinEstimateRequest]
|
110
116
|
# @param [Hash] opts the optional parameters
|
117
|
+
# @option opts [Integer] :patch_version
|
111
118
|
# @return [EstimateResponse]
|
112
119
|
def create_bitcoin_estimate(create_bitcoin_estimate_request = {}, opts = {})
|
113
120
|
_create_bitcoin_estimate_request = Patch::CreateBitcoinEstimateRequest.new(create_bitcoin_estimate_request)
|
@@ -119,6 +126,7 @@ module Patch
|
|
119
126
|
# Creates a bitcoin 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.
|
120
127
|
# @param create_bitcoin_estimate_request [CreateBitcoinEstimateRequest]
|
121
128
|
# @param [Hash] opts the optional parameters
|
129
|
+
# @option opts [Integer] :patch_version
|
122
130
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
123
131
|
def create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts = {})
|
124
132
|
if @api_client.config.debugging
|
@@ -136,6 +144,7 @@ module Patch
|
|
136
144
|
|
137
145
|
# header parameters
|
138
146
|
header_params = opts[:header_params] || {}
|
147
|
+
|
139
148
|
# HTTP header 'Accept' (if needed)
|
140
149
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
141
150
|
# HTTP header 'Content-Type'
|
@@ -143,6 +152,8 @@ module Patch
|
|
143
152
|
if !content_type.nil?
|
144
153
|
header_params['Content-Type'] = content_type
|
145
154
|
end
|
155
|
+
header_params['Patch-Version'] = 2
|
156
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
146
157
|
|
147
158
|
# form parameters
|
148
159
|
form_params = opts[:form_params] || {}
|
@@ -173,10 +184,85 @@ module Patch
|
|
173
184
|
return data, status_code, headers
|
174
185
|
end
|
175
186
|
|
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
|
+
|
176
261
|
# Create an ethereum estimate
|
177
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.
|
178
263
|
# @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
|
179
264
|
# @param [Hash] opts the optional parameters
|
265
|
+
# @option opts [Integer] :patch_version
|
180
266
|
# @return [EstimateResponse]
|
181
267
|
def create_ethereum_estimate(create_ethereum_estimate_request = {}, opts = {})
|
182
268
|
_create_ethereum_estimate_request = Patch::CreateEthereumEstimateRequest.new(create_ethereum_estimate_request)
|
@@ -188,6 +274,7 @@ module Patch
|
|
188
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.
|
189
275
|
# @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
|
190
276
|
# @param [Hash] opts the optional parameters
|
277
|
+
# @option opts [Integer] :patch_version
|
191
278
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
192
279
|
def create_ethereum_estimate_with_http_info(create_ethereum_estimate_request, opts = {})
|
193
280
|
if @api_client.config.debugging
|
@@ -205,6 +292,7 @@ module Patch
|
|
205
292
|
|
206
293
|
# header parameters
|
207
294
|
header_params = opts[:header_params] || {}
|
295
|
+
|
208
296
|
# HTTP header 'Accept' (if needed)
|
209
297
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
210
298
|
# HTTP header 'Content-Type'
|
@@ -212,6 +300,8 @@ module Patch
|
|
212
300
|
if !content_type.nil?
|
213
301
|
header_params['Content-Type'] = content_type
|
214
302
|
end
|
303
|
+
header_params['Patch-Version'] = 2
|
304
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
215
305
|
|
216
306
|
# form parameters
|
217
307
|
form_params = opts[:form_params] || {}
|
@@ -246,6 +336,7 @@ module Patch
|
|
246
336
|
# 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.
|
247
337
|
# @param create_flight_estimate_request [CreateFlightEstimateRequest]
|
248
338
|
# @param [Hash] opts the optional parameters
|
339
|
+
# @option opts [Integer] :patch_version
|
249
340
|
# @return [EstimateResponse]
|
250
341
|
def create_flight_estimate(create_flight_estimate_request = {}, opts = {})
|
251
342
|
_create_flight_estimate_request = Patch::CreateFlightEstimateRequest.new(create_flight_estimate_request)
|
@@ -257,6 +348,7 @@ module Patch
|
|
257
348
|
# 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.
|
258
349
|
# @param create_flight_estimate_request [CreateFlightEstimateRequest]
|
259
350
|
# @param [Hash] opts the optional parameters
|
351
|
+
# @option opts [Integer] :patch_version
|
260
352
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
261
353
|
def create_flight_estimate_with_http_info(create_flight_estimate_request, opts = {})
|
262
354
|
if @api_client.config.debugging
|
@@ -274,6 +366,7 @@ module Patch
|
|
274
366
|
|
275
367
|
# header parameters
|
276
368
|
header_params = opts[:header_params] || {}
|
369
|
+
|
277
370
|
# HTTP header 'Accept' (if needed)
|
278
371
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
279
372
|
# HTTP header 'Content-Type'
|
@@ -281,6 +374,8 @@ module Patch
|
|
281
374
|
if !content_type.nil?
|
282
375
|
header_params['Content-Type'] = content_type
|
283
376
|
end
|
377
|
+
header_params['Patch-Version'] = 2
|
378
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
284
379
|
|
285
380
|
# form parameters
|
286
381
|
form_params = opts[:form_params] || {}
|
@@ -315,6 +410,7 @@ module Patch
|
|
315
410
|
# Creates a hotel estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
|
316
411
|
# @param create_hotel_estimate_request [CreateHotelEstimateRequest]
|
317
412
|
# @param [Hash] opts the optional parameters
|
413
|
+
# @option opts [Integer] :patch_version
|
318
414
|
# @return [EstimateResponse]
|
319
415
|
def create_hotel_estimate(create_hotel_estimate_request = {}, opts = {})
|
320
416
|
_create_hotel_estimate_request = Patch::CreateHotelEstimateRequest.new(create_hotel_estimate_request)
|
@@ -326,6 +422,7 @@ module Patch
|
|
326
422
|
# Creates a hotel estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
|
327
423
|
# @param create_hotel_estimate_request [CreateHotelEstimateRequest]
|
328
424
|
# @param [Hash] opts the optional parameters
|
425
|
+
# @option opts [Integer] :patch_version
|
329
426
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
330
427
|
def create_hotel_estimate_with_http_info(create_hotel_estimate_request, opts = {})
|
331
428
|
if @api_client.config.debugging
|
@@ -343,6 +440,7 @@ module Patch
|
|
343
440
|
|
344
441
|
# header parameters
|
345
442
|
header_params = opts[:header_params] || {}
|
443
|
+
|
346
444
|
# HTTP header 'Accept' (if needed)
|
347
445
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
348
446
|
# HTTP header 'Content-Type'
|
@@ -350,6 +448,8 @@ module Patch
|
|
350
448
|
if !content_type.nil?
|
351
449
|
header_params['Content-Type'] = content_type
|
352
450
|
end
|
451
|
+
header_params['Patch-Version'] = 2
|
452
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
353
453
|
|
354
454
|
# form parameters
|
355
455
|
form_params = opts[:form_params] || {}
|
@@ -384,6 +484,7 @@ module Patch
|
|
384
484
|
# Creates an estimate for the mass of CO2 to be compensated. An order in the `draft` state will also be created, linked to the estimate.
|
385
485
|
# @param create_mass_estimate_request [CreateMassEstimateRequest]
|
386
486
|
# @param [Hash] opts the optional parameters
|
487
|
+
# @option opts [Integer] :patch_version
|
387
488
|
# @return [EstimateResponse]
|
388
489
|
def create_mass_estimate(create_mass_estimate_request = {}, opts = {})
|
389
490
|
_create_mass_estimate_request = Patch::CreateMassEstimateRequest.new(create_mass_estimate_request)
|
@@ -395,6 +496,7 @@ module Patch
|
|
395
496
|
# Creates an estimate for the mass of CO2 to be compensated. An order in the `draft` state will also be created, linked to the estimate.
|
396
497
|
# @param create_mass_estimate_request [CreateMassEstimateRequest]
|
397
498
|
# @param [Hash] opts the optional parameters
|
499
|
+
# @option opts [Integer] :patch_version
|
398
500
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
399
501
|
def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
|
400
502
|
if @api_client.config.debugging
|
@@ -412,6 +514,7 @@ module Patch
|
|
412
514
|
|
413
515
|
# header parameters
|
414
516
|
header_params = opts[:header_params] || {}
|
517
|
+
|
415
518
|
# HTTP header 'Accept' (if needed)
|
416
519
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
417
520
|
# HTTP header 'Content-Type'
|
@@ -419,6 +522,8 @@ module Patch
|
|
419
522
|
if !content_type.nil?
|
420
523
|
header_params['Content-Type'] = content_type
|
421
524
|
end
|
525
|
+
header_params['Patch-Version'] = 2
|
526
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
422
527
|
|
423
528
|
# form parameters
|
424
529
|
form_params = opts[:form_params] || {}
|
@@ -453,6 +558,7 @@ module Patch
|
|
453
558
|
# Creates a GLEC rail shipping 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.
|
454
559
|
# @param create_rail_shipping_estimate_request [CreateRailShippingEstimateRequest]
|
455
560
|
# @param [Hash] opts the optional parameters
|
561
|
+
# @option opts [Integer] :patch_version
|
456
562
|
# @return [EstimateResponse]
|
457
563
|
def create_rail_shipping_estimate(create_rail_shipping_estimate_request = {}, opts = {})
|
458
564
|
_create_rail_shipping_estimate_request = Patch::CreateRailShippingEstimateRequest.new(create_rail_shipping_estimate_request)
|
@@ -464,6 +570,7 @@ module Patch
|
|
464
570
|
# Creates a GLEC rail shipping 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.
|
465
571
|
# @param create_rail_shipping_estimate_request [CreateRailShippingEstimateRequest]
|
466
572
|
# @param [Hash] opts the optional parameters
|
573
|
+
# @option opts [Integer] :patch_version
|
467
574
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
468
575
|
def create_rail_shipping_estimate_with_http_info(create_rail_shipping_estimate_request, opts = {})
|
469
576
|
if @api_client.config.debugging
|
@@ -481,6 +588,7 @@ module Patch
|
|
481
588
|
|
482
589
|
# header parameters
|
483
590
|
header_params = opts[:header_params] || {}
|
591
|
+
|
484
592
|
# HTTP header 'Accept' (if needed)
|
485
593
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
486
594
|
# HTTP header 'Content-Type'
|
@@ -488,6 +596,8 @@ module Patch
|
|
488
596
|
if !content_type.nil?
|
489
597
|
header_params['Content-Type'] = content_type
|
490
598
|
end
|
599
|
+
header_params['Patch-Version'] = 2
|
600
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
491
601
|
|
492
602
|
# form parameters
|
493
603
|
form_params = opts[:form_params] || {}
|
@@ -522,6 +632,7 @@ module Patch
|
|
522
632
|
# Creates a GLEC road shipping 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.
|
523
633
|
# @param create_road_shipping_estimate_request [CreateRoadShippingEstimateRequest]
|
524
634
|
# @param [Hash] opts the optional parameters
|
635
|
+
# @option opts [Integer] :patch_version
|
525
636
|
# @return [EstimateResponse]
|
526
637
|
def create_road_shipping_estimate(create_road_shipping_estimate_request = {}, opts = {})
|
527
638
|
_create_road_shipping_estimate_request = Patch::CreateRoadShippingEstimateRequest.new(create_road_shipping_estimate_request)
|
@@ -533,6 +644,7 @@ module Patch
|
|
533
644
|
# Creates a GLEC road shipping 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.
|
534
645
|
# @param create_road_shipping_estimate_request [CreateRoadShippingEstimateRequest]
|
535
646
|
# @param [Hash] opts the optional parameters
|
647
|
+
# @option opts [Integer] :patch_version
|
536
648
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
537
649
|
def create_road_shipping_estimate_with_http_info(create_road_shipping_estimate_request, opts = {})
|
538
650
|
if @api_client.config.debugging
|
@@ -550,6 +662,7 @@ module Patch
|
|
550
662
|
|
551
663
|
# header parameters
|
552
664
|
header_params = opts[:header_params] || {}
|
665
|
+
|
553
666
|
# HTTP header 'Accept' (if needed)
|
554
667
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
555
668
|
# HTTP header 'Content-Type'
|
@@ -557,6 +670,8 @@ module Patch
|
|
557
670
|
if !content_type.nil?
|
558
671
|
header_params['Content-Type'] = content_type
|
559
672
|
end
|
673
|
+
header_params['Patch-Version'] = 2
|
674
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
560
675
|
|
561
676
|
# form parameters
|
562
677
|
form_params = opts[:form_params] || {}
|
@@ -591,6 +706,7 @@ module Patch
|
|
591
706
|
# Creates a GLEC sea shipping 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.
|
592
707
|
# @param create_sea_shipping_estimate_request [CreateSeaShippingEstimateRequest]
|
593
708
|
# @param [Hash] opts the optional parameters
|
709
|
+
# @option opts [Integer] :patch_version
|
594
710
|
# @return [EstimateResponse]
|
595
711
|
def create_sea_shipping_estimate(create_sea_shipping_estimate_request = {}, opts = {})
|
596
712
|
_create_sea_shipping_estimate_request = Patch::CreateSeaShippingEstimateRequest.new(create_sea_shipping_estimate_request)
|
@@ -602,6 +718,7 @@ module Patch
|
|
602
718
|
# Creates a GLEC sea shipping 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.
|
603
719
|
# @param create_sea_shipping_estimate_request [CreateSeaShippingEstimateRequest]
|
604
720
|
# @param [Hash] opts the optional parameters
|
721
|
+
# @option opts [Integer] :patch_version
|
605
722
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
606
723
|
def create_sea_shipping_estimate_with_http_info(create_sea_shipping_estimate_request, opts = {})
|
607
724
|
if @api_client.config.debugging
|
@@ -619,6 +736,7 @@ module Patch
|
|
619
736
|
|
620
737
|
# header parameters
|
621
738
|
header_params = opts[:header_params] || {}
|
739
|
+
|
622
740
|
# HTTP header 'Accept' (if needed)
|
623
741
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
624
742
|
# HTTP header 'Content-Type'
|
@@ -626,6 +744,8 @@ module Patch
|
|
626
744
|
if !content_type.nil?
|
627
745
|
header_params['Content-Type'] = content_type
|
628
746
|
end
|
747
|
+
header_params['Patch-Version'] = 2
|
748
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
629
749
|
|
630
750
|
# form parameters
|
631
751
|
form_params = opts[:form_params] || {}
|
@@ -660,6 +780,7 @@ module Patch
|
|
660
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.
|
661
781
|
# @param create_shipping_estimate_request [CreateShippingEstimateRequest]
|
662
782
|
# @param [Hash] opts the optional parameters
|
783
|
+
# @option opts [Integer] :patch_version
|
663
784
|
# @return [EstimateResponse]
|
664
785
|
def create_shipping_estimate(create_shipping_estimate_request = {}, opts = {})
|
665
786
|
_create_shipping_estimate_request = Patch::CreateShippingEstimateRequest.new(create_shipping_estimate_request)
|
@@ -671,6 +792,7 @@ module Patch
|
|
671
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.
|
672
793
|
# @param create_shipping_estimate_request [CreateShippingEstimateRequest]
|
673
794
|
# @param [Hash] opts the optional parameters
|
795
|
+
# @option opts [Integer] :patch_version
|
674
796
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
675
797
|
def create_shipping_estimate_with_http_info(create_shipping_estimate_request, opts = {})
|
676
798
|
if @api_client.config.debugging
|
@@ -688,6 +810,7 @@ module Patch
|
|
688
810
|
|
689
811
|
# header parameters
|
690
812
|
header_params = opts[:header_params] || {}
|
813
|
+
|
691
814
|
# HTTP header 'Accept' (if needed)
|
692
815
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
693
816
|
# HTTP header 'Content-Type'
|
@@ -695,6 +818,8 @@ module Patch
|
|
695
818
|
if !content_type.nil?
|
696
819
|
header_params['Content-Type'] = content_type
|
697
820
|
end
|
821
|
+
header_params['Patch-Version'] = 2
|
822
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
698
823
|
|
699
824
|
# form parameters
|
700
825
|
form_params = opts[:form_params] || {}
|
@@ -729,6 +854,7 @@ module Patch
|
|
729
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.
|
730
855
|
# @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
|
731
856
|
# @param [Hash] opts the optional parameters
|
857
|
+
# @option opts [Integer] :patch_version
|
732
858
|
# @return [EstimateResponse]
|
733
859
|
def create_vehicle_estimate(create_vehicle_estimate_request = {}, opts = {})
|
734
860
|
_create_vehicle_estimate_request = Patch::CreateVehicleEstimateRequest.new(create_vehicle_estimate_request)
|
@@ -740,6 +866,7 @@ module Patch
|
|
740
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.
|
741
867
|
# @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
|
742
868
|
# @param [Hash] opts the optional parameters
|
869
|
+
# @option opts [Integer] :patch_version
|
743
870
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
744
871
|
def create_vehicle_estimate_with_http_info(create_vehicle_estimate_request, opts = {})
|
745
872
|
if @api_client.config.debugging
|
@@ -757,6 +884,7 @@ module Patch
|
|
757
884
|
|
758
885
|
# header parameters
|
759
886
|
header_params = opts[:header_params] || {}
|
887
|
+
|
760
888
|
# HTTP header 'Accept' (if needed)
|
761
889
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
762
890
|
# HTTP header 'Content-Type'
|
@@ -764,6 +892,8 @@ module Patch
|
|
764
892
|
if !content_type.nil?
|
765
893
|
header_params['Content-Type'] = content_type
|
766
894
|
end
|
895
|
+
header_params['Patch-Version'] = 2
|
896
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
767
897
|
|
768
898
|
# form parameters
|
769
899
|
form_params = opts[:form_params] || {}
|
@@ -798,6 +928,7 @@ module Patch
|
|
798
928
|
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
|
799
929
|
# @param id [String]
|
800
930
|
# @param [Hash] opts the optional parameters
|
931
|
+
# @option opts [Integer] :patch_version
|
801
932
|
# @return [EstimateResponse]
|
802
933
|
def retrieve_estimate(id, opts = {})
|
803
934
|
|
@@ -809,6 +940,7 @@ module Patch
|
|
809
940
|
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
|
810
941
|
# @param id [String]
|
811
942
|
# @param [Hash] opts the optional parameters
|
943
|
+
# @option opts [Integer] :patch_version
|
812
944
|
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
813
945
|
def retrieve_estimate_with_http_info(id, opts = {})
|
814
946
|
if @api_client.config.debugging
|
@@ -826,8 +958,11 @@ module Patch
|
|
826
958
|
|
827
959
|
# header parameters
|
828
960
|
header_params = opts[:header_params] || {}
|
961
|
+
|
829
962
|
# HTTP header 'Accept' (if needed)
|
830
963
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
964
|
+
header_params['Patch-Version'] = 2
|
965
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
831
966
|
|
832
967
|
# form parameters
|
833
968
|
form_params = opts[:form_params] || {}
|
@@ -862,6 +997,7 @@ module Patch
|
|
862
997
|
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
|
863
998
|
# @param [Hash] opts the optional parameters
|
864
999
|
# @option opts [Integer] :page
|
1000
|
+
# @option opts [Integer] :patch_version
|
865
1001
|
# @return [EstimateListResponse]
|
866
1002
|
def retrieve_estimates(opts = {})
|
867
1003
|
|
@@ -873,6 +1009,7 @@ module Patch
|
|
873
1009
|
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
|
874
1010
|
# @param [Hash] opts the optional parameters
|
875
1011
|
# @option opts [Integer] :page
|
1012
|
+
# @option opts [Integer] :patch_version
|
876
1013
|
# @return [Array<(EstimateListResponse, Integer, Hash)>] EstimateListResponse data, response status code and response headers
|
877
1014
|
def retrieve_estimates_with_http_info(opts = {})
|
878
1015
|
if @api_client.config.debugging
|
@@ -887,8 +1024,11 @@ module Patch
|
|
887
1024
|
|
888
1025
|
# header parameters
|
889
1026
|
header_params = opts[:header_params] || {}
|
1027
|
+
|
890
1028
|
# HTTP header 'Accept' (if needed)
|
891
1029
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1030
|
+
header_params['Patch-Version'] = 2
|
1031
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
892
1032
|
|
893
1033
|
# form parameters
|
894
1034
|
form_params = opts[:form_params] || {}
|