patch_ruby 2.5.0 → 2.6.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 +5 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +18 -25
- data/README.md +0 -52
- data/lib/patch_ruby/api_client.rb +1 -1
- data/lib/patch_ruby/version.rb +1 -1
- data/lib/patch_ruby.rb +0 -10
- data/spec/api/orders_api_spec.rb +0 -1
- data/spec/integration/orders_spec.rb +0 -25
- data/spec/integration/projects_spec.rb +1 -1
- metadata +15 -45
- data/lib/patch_ruby/api/estimates_api.rb +0 -612
- data/lib/patch_ruby/models/create_air_shipping_estimate_request.rb +0 -374
- data/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +0 -271
- data/lib/patch_ruby/models/create_mass_estimate_request.rb +0 -282
- data/lib/patch_ruby/models/create_rail_shipping_estimate_request.rb +0 -404
- data/lib/patch_ruby/models/create_road_shipping_estimate_request.rb +0 -517
- data/lib/patch_ruby/models/create_sea_shipping_estimate_request.rb +0 -461
- data/lib/patch_ruby/models/estimate.rb +0 -288
- data/lib/patch_ruby/models/estimate_list_response.rb +0 -273
- data/lib/patch_ruby/models/estimate_response.rb +0 -257
- data/spec/api/estimates_api_spec.rb +0 -70
- data/spec/factories/create_mass_estimate_requests.rb +0 -6
- data/spec/factories/estimate_list_responses.rb +0 -8
- data/spec/factories/estimate_responses.rb +0 -7
- data/spec/factories/estimates.rb +0 -8
- data/spec/integration/estimates_spec.rb +0 -218
- data/spec/models/create_mass_estimate_request_spec.rb +0 -46
- data/spec/models/estimate_list_response_spec.rb +0 -64
- data/spec/models/estimate_response_spec.rb +0 -58
- data/spec/models/estimate_spec.rb +0 -65
|
@@ -1,612 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#Patch API V2
|
|
3
|
-
|
|
4
|
-
#The core API used to integrate with Patch's service
|
|
5
|
-
|
|
6
|
-
The version of the OpenAPI document: 2
|
|
7
|
-
Contact: engineering@usepatch.com
|
|
8
|
-
Generated by: https://openapi-generator.tech
|
|
9
|
-
OpenAPI Generator version: 5.3.1
|
|
10
|
-
|
|
11
|
-
=end
|
|
12
|
-
|
|
13
|
-
require 'cgi'
|
|
14
|
-
|
|
15
|
-
module Patch
|
|
16
|
-
class EstimatesApi
|
|
17
|
-
OPERATIONS = [
|
|
18
|
-
:create_air_shipping_estimate,
|
|
19
|
-
:create_bitcoin_estimate,
|
|
20
|
-
:create_mass_estimate,
|
|
21
|
-
:create_rail_shipping_estimate,
|
|
22
|
-
:create_road_shipping_estimate,
|
|
23
|
-
:create_sea_shipping_estimate,
|
|
24
|
-
:retrieve_estimate,
|
|
25
|
-
:retrieve_estimates,
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
attr_accessor :api_client
|
|
29
|
-
|
|
30
|
-
def initialize(api_client = ApiClient.default)
|
|
31
|
-
@api_client = api_client
|
|
32
|
-
end
|
|
33
|
-
# Creates a GLEC air shipping estimate given freight mass and logistics
|
|
34
|
-
# 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.
|
|
35
|
-
# @param create_air_shipping_estimate_request [CreateAirShippingEstimateRequest]
|
|
36
|
-
# @param [Hash] opts the optional parameters
|
|
37
|
-
# @option opts [Integer] :patch_version
|
|
38
|
-
# @return [EstimateResponse]
|
|
39
|
-
def create_air_shipping_estimate(create_air_shipping_estimate_request = {}, opts = {})
|
|
40
|
-
_create_air_shipping_estimate_request = Patch::CreateAirShippingEstimateRequest.new(create_air_shipping_estimate_request)
|
|
41
|
-
data, _status_code, _headers = create_air_shipping_estimate_with_http_info(_create_air_shipping_estimate_request, opts)
|
|
42
|
-
data
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# Creates a GLEC air shipping estimate given freight mass and logistics
|
|
46
|
-
# 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.
|
|
47
|
-
# @param create_air_shipping_estimate_request [CreateAirShippingEstimateRequest]
|
|
48
|
-
# @param [Hash] opts the optional parameters
|
|
49
|
-
# @option opts [Integer] :patch_version
|
|
50
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
|
51
|
-
def create_air_shipping_estimate_with_http_info(create_air_shipping_estimate_request, opts = {})
|
|
52
|
-
if @api_client.config.debugging
|
|
53
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_air_shipping_estimate ...'
|
|
54
|
-
end
|
|
55
|
-
# verify the required parameter 'create_air_shipping_estimate_request' is set
|
|
56
|
-
if @api_client.config.client_side_validation && create_air_shipping_estimate_request.nil?
|
|
57
|
-
fail ArgumentError, "Missing the required parameter 'create_air_shipping_estimate_request' when calling EstimatesApi.create_air_shipping_estimate"
|
|
58
|
-
end
|
|
59
|
-
# resource path
|
|
60
|
-
local_var_path = '/v1/estimates/shipping/air'
|
|
61
|
-
|
|
62
|
-
# query parameters
|
|
63
|
-
query_params = opts[:query_params] || {}
|
|
64
|
-
|
|
65
|
-
# header parameters
|
|
66
|
-
header_params = opts[:header_params] || {}
|
|
67
|
-
|
|
68
|
-
# HTTP header 'Accept' (if needed)
|
|
69
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
70
|
-
# HTTP header 'Content-Type'
|
|
71
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
72
|
-
if !content_type.nil?
|
|
73
|
-
header_params['Content-Type'] = content_type
|
|
74
|
-
end
|
|
75
|
-
header_params['Patch-Version'] = 2
|
|
76
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
77
|
-
|
|
78
|
-
# form parameters
|
|
79
|
-
form_params = opts[:form_params] || {}
|
|
80
|
-
|
|
81
|
-
# http body (model)
|
|
82
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_air_shipping_estimate_request)
|
|
83
|
-
|
|
84
|
-
# return_type
|
|
85
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
|
86
|
-
|
|
87
|
-
# auth_names
|
|
88
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
89
|
-
|
|
90
|
-
new_options = opts.merge(
|
|
91
|
-
:operation => :"EstimatesApi.create_air_shipping_estimate",
|
|
92
|
-
:header_params => header_params,
|
|
93
|
-
:query_params => query_params,
|
|
94
|
-
:form_params => form_params,
|
|
95
|
-
:body => post_body,
|
|
96
|
-
:auth_names => auth_names,
|
|
97
|
-
:return_type => return_type
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
101
|
-
if @api_client.config.debugging
|
|
102
|
-
@api_client.config.logger.debug "API called: EstimatesApi#create_air_shipping_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
103
|
-
end
|
|
104
|
-
return data, status_code, headers
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Create a bitcoin estimate given a timestamp and transaction value
|
|
108
|
-
# 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
|
-
# @param create_bitcoin_estimate_request [CreateBitcoinEstimateRequest]
|
|
110
|
-
# @param [Hash] opts the optional parameters
|
|
111
|
-
# @option opts [Integer] :patch_version
|
|
112
|
-
# @return [EstimateResponse]
|
|
113
|
-
def create_bitcoin_estimate(create_bitcoin_estimate_request = {}, opts = {})
|
|
114
|
-
_create_bitcoin_estimate_request = Patch::CreateBitcoinEstimateRequest.new(create_bitcoin_estimate_request)
|
|
115
|
-
data, _status_code, _headers = create_bitcoin_estimate_with_http_info(_create_bitcoin_estimate_request, opts)
|
|
116
|
-
data
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
# Create a bitcoin estimate given a timestamp and transaction value
|
|
120
|
-
# 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.
|
|
121
|
-
# @param create_bitcoin_estimate_request [CreateBitcoinEstimateRequest]
|
|
122
|
-
# @param [Hash] opts the optional parameters
|
|
123
|
-
# @option opts [Integer] :patch_version
|
|
124
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
|
125
|
-
def create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts = {})
|
|
126
|
-
if @api_client.config.debugging
|
|
127
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_bitcoin_estimate ...'
|
|
128
|
-
end
|
|
129
|
-
# verify the required parameter 'create_bitcoin_estimate_request' is set
|
|
130
|
-
if @api_client.config.client_side_validation && create_bitcoin_estimate_request.nil?
|
|
131
|
-
fail ArgumentError, "Missing the required parameter 'create_bitcoin_estimate_request' when calling EstimatesApi.create_bitcoin_estimate"
|
|
132
|
-
end
|
|
133
|
-
# resource path
|
|
134
|
-
local_var_path = '/v1/estimates/crypto/btc'
|
|
135
|
-
|
|
136
|
-
# query parameters
|
|
137
|
-
query_params = opts[:query_params] || {}
|
|
138
|
-
|
|
139
|
-
# header parameters
|
|
140
|
-
header_params = opts[:header_params] || {}
|
|
141
|
-
|
|
142
|
-
# HTTP header 'Accept' (if needed)
|
|
143
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
144
|
-
# HTTP header 'Content-Type'
|
|
145
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
146
|
-
if !content_type.nil?
|
|
147
|
-
header_params['Content-Type'] = content_type
|
|
148
|
-
end
|
|
149
|
-
header_params['Patch-Version'] = 2
|
|
150
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
151
|
-
|
|
152
|
-
# form parameters
|
|
153
|
-
form_params = opts[:form_params] || {}
|
|
154
|
-
|
|
155
|
-
# http body (model)
|
|
156
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_bitcoin_estimate_request)
|
|
157
|
-
|
|
158
|
-
# return_type
|
|
159
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
|
160
|
-
|
|
161
|
-
# auth_names
|
|
162
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
163
|
-
|
|
164
|
-
new_options = opts.merge(
|
|
165
|
-
:operation => :"EstimatesApi.create_bitcoin_estimate",
|
|
166
|
-
:header_params => header_params,
|
|
167
|
-
:query_params => query_params,
|
|
168
|
-
:form_params => form_params,
|
|
169
|
-
:body => post_body,
|
|
170
|
-
:auth_names => auth_names,
|
|
171
|
-
:return_type => return_type
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
175
|
-
if @api_client.config.debugging
|
|
176
|
-
@api_client.config.logger.debug "API called: EstimatesApi#create_bitcoin_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
177
|
-
end
|
|
178
|
-
return data, status_code, headers
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
# Create an estimate based on mass of CO2
|
|
182
|
-
# 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.
|
|
183
|
-
# @param create_mass_estimate_request [CreateMassEstimateRequest]
|
|
184
|
-
# @param [Hash] opts the optional parameters
|
|
185
|
-
# @option opts [Integer] :patch_version
|
|
186
|
-
# @return [EstimateResponse]
|
|
187
|
-
def create_mass_estimate(create_mass_estimate_request = {}, opts = {})
|
|
188
|
-
_create_mass_estimate_request = Patch::CreateMassEstimateRequest.new(create_mass_estimate_request)
|
|
189
|
-
data, _status_code, _headers = create_mass_estimate_with_http_info(_create_mass_estimate_request, opts)
|
|
190
|
-
data
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
# Create an estimate based on mass of CO2
|
|
194
|
-
# 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.
|
|
195
|
-
# @param create_mass_estimate_request [CreateMassEstimateRequest]
|
|
196
|
-
# @param [Hash] opts the optional parameters
|
|
197
|
-
# @option opts [Integer] :patch_version
|
|
198
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
|
199
|
-
def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
|
|
200
|
-
if @api_client.config.debugging
|
|
201
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_mass_estimate ...'
|
|
202
|
-
end
|
|
203
|
-
# verify the required parameter 'create_mass_estimate_request' is set
|
|
204
|
-
if @api_client.config.client_side_validation && create_mass_estimate_request.nil?
|
|
205
|
-
fail ArgumentError, "Missing the required parameter 'create_mass_estimate_request' when calling EstimatesApi.create_mass_estimate"
|
|
206
|
-
end
|
|
207
|
-
# resource path
|
|
208
|
-
local_var_path = '/v1/estimates/mass'
|
|
209
|
-
|
|
210
|
-
# query parameters
|
|
211
|
-
query_params = opts[:query_params] || {}
|
|
212
|
-
|
|
213
|
-
# header parameters
|
|
214
|
-
header_params = opts[:header_params] || {}
|
|
215
|
-
|
|
216
|
-
# HTTP header 'Accept' (if needed)
|
|
217
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
218
|
-
# HTTP header 'Content-Type'
|
|
219
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
220
|
-
if !content_type.nil?
|
|
221
|
-
header_params['Content-Type'] = content_type
|
|
222
|
-
end
|
|
223
|
-
header_params['Patch-Version'] = 2
|
|
224
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
225
|
-
|
|
226
|
-
# form parameters
|
|
227
|
-
form_params = opts[:form_params] || {}
|
|
228
|
-
|
|
229
|
-
# http body (model)
|
|
230
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_mass_estimate_request)
|
|
231
|
-
|
|
232
|
-
# return_type
|
|
233
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
|
234
|
-
|
|
235
|
-
# auth_names
|
|
236
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
237
|
-
|
|
238
|
-
new_options = opts.merge(
|
|
239
|
-
:operation => :"EstimatesApi.create_mass_estimate",
|
|
240
|
-
:header_params => header_params,
|
|
241
|
-
:query_params => query_params,
|
|
242
|
-
:form_params => form_params,
|
|
243
|
-
:body => post_body,
|
|
244
|
-
:auth_names => auth_names,
|
|
245
|
-
:return_type => return_type
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
249
|
-
if @api_client.config.debugging
|
|
250
|
-
@api_client.config.logger.debug "API called: EstimatesApi#create_mass_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
251
|
-
end
|
|
252
|
-
return data, status_code, headers
|
|
253
|
-
end
|
|
254
|
-
|
|
255
|
-
# Creates a GLEC rail shipping estimate given freight mass and logistics
|
|
256
|
-
# 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.
|
|
257
|
-
# @param create_rail_shipping_estimate_request [CreateRailShippingEstimateRequest]
|
|
258
|
-
# @param [Hash] opts the optional parameters
|
|
259
|
-
# @option opts [Integer] :patch_version
|
|
260
|
-
# @return [EstimateResponse]
|
|
261
|
-
def create_rail_shipping_estimate(create_rail_shipping_estimate_request = {}, opts = {})
|
|
262
|
-
_create_rail_shipping_estimate_request = Patch::CreateRailShippingEstimateRequest.new(create_rail_shipping_estimate_request)
|
|
263
|
-
data, _status_code, _headers = create_rail_shipping_estimate_with_http_info(_create_rail_shipping_estimate_request, opts)
|
|
264
|
-
data
|
|
265
|
-
end
|
|
266
|
-
|
|
267
|
-
# Creates a GLEC rail shipping estimate given freight mass and logistics
|
|
268
|
-
# 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.
|
|
269
|
-
# @param create_rail_shipping_estimate_request [CreateRailShippingEstimateRequest]
|
|
270
|
-
# @param [Hash] opts the optional parameters
|
|
271
|
-
# @option opts [Integer] :patch_version
|
|
272
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
|
273
|
-
def create_rail_shipping_estimate_with_http_info(create_rail_shipping_estimate_request, opts = {})
|
|
274
|
-
if @api_client.config.debugging
|
|
275
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_rail_shipping_estimate ...'
|
|
276
|
-
end
|
|
277
|
-
# verify the required parameter 'create_rail_shipping_estimate_request' is set
|
|
278
|
-
if @api_client.config.client_side_validation && create_rail_shipping_estimate_request.nil?
|
|
279
|
-
fail ArgumentError, "Missing the required parameter 'create_rail_shipping_estimate_request' when calling EstimatesApi.create_rail_shipping_estimate"
|
|
280
|
-
end
|
|
281
|
-
# resource path
|
|
282
|
-
local_var_path = '/v1/estimates/shipping/rail'
|
|
283
|
-
|
|
284
|
-
# query parameters
|
|
285
|
-
query_params = opts[:query_params] || {}
|
|
286
|
-
|
|
287
|
-
# header parameters
|
|
288
|
-
header_params = opts[:header_params] || {}
|
|
289
|
-
|
|
290
|
-
# HTTP header 'Accept' (if needed)
|
|
291
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
292
|
-
# HTTP header 'Content-Type'
|
|
293
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
294
|
-
if !content_type.nil?
|
|
295
|
-
header_params['Content-Type'] = content_type
|
|
296
|
-
end
|
|
297
|
-
header_params['Patch-Version'] = 2
|
|
298
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
299
|
-
|
|
300
|
-
# form parameters
|
|
301
|
-
form_params = opts[:form_params] || {}
|
|
302
|
-
|
|
303
|
-
# http body (model)
|
|
304
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_rail_shipping_estimate_request)
|
|
305
|
-
|
|
306
|
-
# return_type
|
|
307
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
|
308
|
-
|
|
309
|
-
# auth_names
|
|
310
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
311
|
-
|
|
312
|
-
new_options = opts.merge(
|
|
313
|
-
:operation => :"EstimatesApi.create_rail_shipping_estimate",
|
|
314
|
-
:header_params => header_params,
|
|
315
|
-
:query_params => query_params,
|
|
316
|
-
:form_params => form_params,
|
|
317
|
-
:body => post_body,
|
|
318
|
-
:auth_names => auth_names,
|
|
319
|
-
:return_type => return_type
|
|
320
|
-
)
|
|
321
|
-
|
|
322
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
323
|
-
if @api_client.config.debugging
|
|
324
|
-
@api_client.config.logger.debug "API called: EstimatesApi#create_rail_shipping_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
325
|
-
end
|
|
326
|
-
return data, status_code, headers
|
|
327
|
-
end
|
|
328
|
-
|
|
329
|
-
# Creates a GLEC road shipping estimate given freight mass and logistics
|
|
330
|
-
# 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.
|
|
331
|
-
# @param create_road_shipping_estimate_request [CreateRoadShippingEstimateRequest]
|
|
332
|
-
# @param [Hash] opts the optional parameters
|
|
333
|
-
# @option opts [Integer] :patch_version
|
|
334
|
-
# @return [EstimateResponse]
|
|
335
|
-
def create_road_shipping_estimate(create_road_shipping_estimate_request = {}, opts = {})
|
|
336
|
-
_create_road_shipping_estimate_request = Patch::CreateRoadShippingEstimateRequest.new(create_road_shipping_estimate_request)
|
|
337
|
-
data, _status_code, _headers = create_road_shipping_estimate_with_http_info(_create_road_shipping_estimate_request, opts)
|
|
338
|
-
data
|
|
339
|
-
end
|
|
340
|
-
|
|
341
|
-
# Creates a GLEC road shipping estimate given freight mass and logistics
|
|
342
|
-
# 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.
|
|
343
|
-
# @param create_road_shipping_estimate_request [CreateRoadShippingEstimateRequest]
|
|
344
|
-
# @param [Hash] opts the optional parameters
|
|
345
|
-
# @option opts [Integer] :patch_version
|
|
346
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
|
347
|
-
def create_road_shipping_estimate_with_http_info(create_road_shipping_estimate_request, opts = {})
|
|
348
|
-
if @api_client.config.debugging
|
|
349
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_road_shipping_estimate ...'
|
|
350
|
-
end
|
|
351
|
-
# verify the required parameter 'create_road_shipping_estimate_request' is set
|
|
352
|
-
if @api_client.config.client_side_validation && create_road_shipping_estimate_request.nil?
|
|
353
|
-
fail ArgumentError, "Missing the required parameter 'create_road_shipping_estimate_request' when calling EstimatesApi.create_road_shipping_estimate"
|
|
354
|
-
end
|
|
355
|
-
# resource path
|
|
356
|
-
local_var_path = '/v1/estimates/shipping/road'
|
|
357
|
-
|
|
358
|
-
# query parameters
|
|
359
|
-
query_params = opts[:query_params] || {}
|
|
360
|
-
|
|
361
|
-
# header parameters
|
|
362
|
-
header_params = opts[:header_params] || {}
|
|
363
|
-
|
|
364
|
-
# HTTP header 'Accept' (if needed)
|
|
365
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
366
|
-
# HTTP header 'Content-Type'
|
|
367
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
368
|
-
if !content_type.nil?
|
|
369
|
-
header_params['Content-Type'] = content_type
|
|
370
|
-
end
|
|
371
|
-
header_params['Patch-Version'] = 2
|
|
372
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
373
|
-
|
|
374
|
-
# form parameters
|
|
375
|
-
form_params = opts[:form_params] || {}
|
|
376
|
-
|
|
377
|
-
# http body (model)
|
|
378
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_road_shipping_estimate_request)
|
|
379
|
-
|
|
380
|
-
# return_type
|
|
381
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
|
382
|
-
|
|
383
|
-
# auth_names
|
|
384
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
385
|
-
|
|
386
|
-
new_options = opts.merge(
|
|
387
|
-
:operation => :"EstimatesApi.create_road_shipping_estimate",
|
|
388
|
-
:header_params => header_params,
|
|
389
|
-
:query_params => query_params,
|
|
390
|
-
:form_params => form_params,
|
|
391
|
-
:body => post_body,
|
|
392
|
-
:auth_names => auth_names,
|
|
393
|
-
:return_type => return_type
|
|
394
|
-
)
|
|
395
|
-
|
|
396
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
397
|
-
if @api_client.config.debugging
|
|
398
|
-
@api_client.config.logger.debug "API called: EstimatesApi#create_road_shipping_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
399
|
-
end
|
|
400
|
-
return data, status_code, headers
|
|
401
|
-
end
|
|
402
|
-
|
|
403
|
-
# Creates a GLEC sea shipping estimate given freight mass and logistics
|
|
404
|
-
# 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.
|
|
405
|
-
# @param create_sea_shipping_estimate_request [CreateSeaShippingEstimateRequest]
|
|
406
|
-
# @param [Hash] opts the optional parameters
|
|
407
|
-
# @option opts [Integer] :patch_version
|
|
408
|
-
# @return [EstimateResponse]
|
|
409
|
-
def create_sea_shipping_estimate(create_sea_shipping_estimate_request = {}, opts = {})
|
|
410
|
-
_create_sea_shipping_estimate_request = Patch::CreateSeaShippingEstimateRequest.new(create_sea_shipping_estimate_request)
|
|
411
|
-
data, _status_code, _headers = create_sea_shipping_estimate_with_http_info(_create_sea_shipping_estimate_request, opts)
|
|
412
|
-
data
|
|
413
|
-
end
|
|
414
|
-
|
|
415
|
-
# Creates a GLEC sea shipping estimate given freight mass and logistics
|
|
416
|
-
# 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.
|
|
417
|
-
# @param create_sea_shipping_estimate_request [CreateSeaShippingEstimateRequest]
|
|
418
|
-
# @param [Hash] opts the optional parameters
|
|
419
|
-
# @option opts [Integer] :patch_version
|
|
420
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
|
421
|
-
def create_sea_shipping_estimate_with_http_info(create_sea_shipping_estimate_request, opts = {})
|
|
422
|
-
if @api_client.config.debugging
|
|
423
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_sea_shipping_estimate ...'
|
|
424
|
-
end
|
|
425
|
-
# verify the required parameter 'create_sea_shipping_estimate_request' is set
|
|
426
|
-
if @api_client.config.client_side_validation && create_sea_shipping_estimate_request.nil?
|
|
427
|
-
fail ArgumentError, "Missing the required parameter 'create_sea_shipping_estimate_request' when calling EstimatesApi.create_sea_shipping_estimate"
|
|
428
|
-
end
|
|
429
|
-
# resource path
|
|
430
|
-
local_var_path = '/v1/estimates/shipping/sea'
|
|
431
|
-
|
|
432
|
-
# query parameters
|
|
433
|
-
query_params = opts[:query_params] || {}
|
|
434
|
-
|
|
435
|
-
# header parameters
|
|
436
|
-
header_params = opts[:header_params] || {}
|
|
437
|
-
|
|
438
|
-
# HTTP header 'Accept' (if needed)
|
|
439
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
440
|
-
# HTTP header 'Content-Type'
|
|
441
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
442
|
-
if !content_type.nil?
|
|
443
|
-
header_params['Content-Type'] = content_type
|
|
444
|
-
end
|
|
445
|
-
header_params['Patch-Version'] = 2
|
|
446
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
447
|
-
|
|
448
|
-
# form parameters
|
|
449
|
-
form_params = opts[:form_params] || {}
|
|
450
|
-
|
|
451
|
-
# http body (model)
|
|
452
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sea_shipping_estimate_request)
|
|
453
|
-
|
|
454
|
-
# return_type
|
|
455
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
|
456
|
-
|
|
457
|
-
# auth_names
|
|
458
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
459
|
-
|
|
460
|
-
new_options = opts.merge(
|
|
461
|
-
:operation => :"EstimatesApi.create_sea_shipping_estimate",
|
|
462
|
-
:header_params => header_params,
|
|
463
|
-
:query_params => query_params,
|
|
464
|
-
:form_params => form_params,
|
|
465
|
-
:body => post_body,
|
|
466
|
-
:auth_names => auth_names,
|
|
467
|
-
:return_type => return_type
|
|
468
|
-
)
|
|
469
|
-
|
|
470
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
471
|
-
if @api_client.config.debugging
|
|
472
|
-
@api_client.config.logger.debug "API called: EstimatesApi#create_sea_shipping_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
473
|
-
end
|
|
474
|
-
return data, status_code, headers
|
|
475
|
-
end
|
|
476
|
-
|
|
477
|
-
# Retrieves an estimate
|
|
478
|
-
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
|
|
479
|
-
# @param id [String]
|
|
480
|
-
# @param [Hash] opts the optional parameters
|
|
481
|
-
# @option opts [Integer] :patch_version
|
|
482
|
-
# @return [EstimateResponse]
|
|
483
|
-
def retrieve_estimate(id, opts = {})
|
|
484
|
-
|
|
485
|
-
data, _status_code, _headers = retrieve_estimate_with_http_info(id, opts)
|
|
486
|
-
data
|
|
487
|
-
end
|
|
488
|
-
|
|
489
|
-
# Retrieves an estimate
|
|
490
|
-
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
|
|
491
|
-
# @param id [String]
|
|
492
|
-
# @param [Hash] opts the optional parameters
|
|
493
|
-
# @option opts [Integer] :patch_version
|
|
494
|
-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
|
|
495
|
-
def retrieve_estimate_with_http_info(id, opts = {})
|
|
496
|
-
if @api_client.config.debugging
|
|
497
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.retrieve_estimate ...'
|
|
498
|
-
end
|
|
499
|
-
# verify the required parameter 'id' is set
|
|
500
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
501
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling EstimatesApi.retrieve_estimate"
|
|
502
|
-
end
|
|
503
|
-
# resource path
|
|
504
|
-
local_var_path = '/v1/estimates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
505
|
-
|
|
506
|
-
# query parameters
|
|
507
|
-
query_params = opts[:query_params] || {}
|
|
508
|
-
|
|
509
|
-
# header parameters
|
|
510
|
-
header_params = opts[:header_params] || {}
|
|
511
|
-
|
|
512
|
-
# HTTP header 'Accept' (if needed)
|
|
513
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
514
|
-
header_params['Patch-Version'] = 2
|
|
515
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
516
|
-
|
|
517
|
-
# form parameters
|
|
518
|
-
form_params = opts[:form_params] || {}
|
|
519
|
-
|
|
520
|
-
# http body (model)
|
|
521
|
-
post_body = opts[:debug_body]
|
|
522
|
-
|
|
523
|
-
# return_type
|
|
524
|
-
return_type = opts[:debug_return_type] || 'EstimateResponse'
|
|
525
|
-
|
|
526
|
-
# auth_names
|
|
527
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
528
|
-
|
|
529
|
-
new_options = opts.merge(
|
|
530
|
-
:operation => :"EstimatesApi.retrieve_estimate",
|
|
531
|
-
:header_params => header_params,
|
|
532
|
-
:query_params => query_params,
|
|
533
|
-
:form_params => form_params,
|
|
534
|
-
:body => post_body,
|
|
535
|
-
:auth_names => auth_names,
|
|
536
|
-
:return_type => return_type
|
|
537
|
-
)
|
|
538
|
-
|
|
539
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
540
|
-
if @api_client.config.debugging
|
|
541
|
-
@api_client.config.logger.debug "API called: EstimatesApi#retrieve_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
542
|
-
end
|
|
543
|
-
return data, status_code, headers
|
|
544
|
-
end
|
|
545
|
-
|
|
546
|
-
# Retrieves a list of estimates
|
|
547
|
-
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
|
|
548
|
-
# @param [Hash] opts the optional parameters
|
|
549
|
-
# @option opts [Integer] :page
|
|
550
|
-
# @option opts [Integer] :patch_version
|
|
551
|
-
# @return [EstimateListResponse]
|
|
552
|
-
def retrieve_estimates(opts = {})
|
|
553
|
-
|
|
554
|
-
data, _status_code, _headers = retrieve_estimates_with_http_info(opts)
|
|
555
|
-
data
|
|
556
|
-
end
|
|
557
|
-
|
|
558
|
-
# Retrieves a list of estimates
|
|
559
|
-
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
|
|
560
|
-
# @param [Hash] opts the optional parameters
|
|
561
|
-
# @option opts [Integer] :page
|
|
562
|
-
# @option opts [Integer] :patch_version
|
|
563
|
-
# @return [Array<(EstimateListResponse, Integer, Hash)>] EstimateListResponse data, response status code and response headers
|
|
564
|
-
def retrieve_estimates_with_http_info(opts = {})
|
|
565
|
-
if @api_client.config.debugging
|
|
566
|
-
@api_client.config.logger.debug 'Calling API: EstimatesApi.retrieve_estimates ...'
|
|
567
|
-
end
|
|
568
|
-
# resource path
|
|
569
|
-
local_var_path = '/v1/estimates'
|
|
570
|
-
|
|
571
|
-
# query parameters
|
|
572
|
-
query_params = opts[:query_params] || {}
|
|
573
|
-
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
574
|
-
|
|
575
|
-
# header parameters
|
|
576
|
-
header_params = opts[:header_params] || {}
|
|
577
|
-
|
|
578
|
-
# HTTP header 'Accept' (if needed)
|
|
579
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
580
|
-
header_params['Patch-Version'] = 2
|
|
581
|
-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
|
582
|
-
|
|
583
|
-
# form parameters
|
|
584
|
-
form_params = opts[:form_params] || {}
|
|
585
|
-
|
|
586
|
-
# http body (model)
|
|
587
|
-
post_body = opts[:debug_body]
|
|
588
|
-
|
|
589
|
-
# return_type
|
|
590
|
-
return_type = opts[:debug_return_type] || 'EstimateListResponse'
|
|
591
|
-
|
|
592
|
-
# auth_names
|
|
593
|
-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
|
594
|
-
|
|
595
|
-
new_options = opts.merge(
|
|
596
|
-
:operation => :"EstimatesApi.retrieve_estimates",
|
|
597
|
-
:header_params => header_params,
|
|
598
|
-
:query_params => query_params,
|
|
599
|
-
:form_params => form_params,
|
|
600
|
-
:body => post_body,
|
|
601
|
-
:auth_names => auth_names,
|
|
602
|
-
:return_type => return_type
|
|
603
|
-
)
|
|
604
|
-
|
|
605
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
606
|
-
if @api_client.config.debugging
|
|
607
|
-
@api_client.config.logger.debug "API called: EstimatesApi#retrieve_estimates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
608
|
-
end
|
|
609
|
-
return data, status_code, headers
|
|
610
|
-
end
|
|
611
|
-
end
|
|
612
|
-
end
|