patch_ruby 1.24.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/patch_ruby/api/estimates_api.rb +72 -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 +2 -2
- data/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_ecommerce_estimate_request.rb +2 -2
- 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 +2 -2
- data/lib/patch_ruby/models/create_road_shipping_estimate_request.rb +2 -2
- data/lib/patch_ruby/models/create_sea_shipping_estimate_request.rb +2 -2
- 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 +10 -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/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 +34 -31
- data/spec/factories/allocations.rb +0 -7
- data/spec/models/allocation_spec.rb +0 -59
@@ -0,0 +1,269 @@
|
|
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 OrderLineItemsApi
|
17
|
+
OPERATIONS = [
|
18
|
+
:create_order_line_item,
|
19
|
+
:delete_order_line_item,
|
20
|
+
:update_order_line_item,
|
21
|
+
]
|
22
|
+
|
23
|
+
attr_accessor :api_client
|
24
|
+
|
25
|
+
def initialize(api_client = ApiClient.default)
|
26
|
+
@api_client = api_client
|
27
|
+
end
|
28
|
+
# Creates an order line item
|
29
|
+
# Creates a line item on an order that is in the `draft` state.
|
30
|
+
# @param order_id [String]
|
31
|
+
# @param create_order_line_item_request [CreateOrderLineItemRequest]
|
32
|
+
# @param [Hash] opts the optional parameters
|
33
|
+
# @option opts [Integer] :patch_version
|
34
|
+
# @return [OrderLineItemResponse]
|
35
|
+
def create_order_line_item(order_id, create_order_line_item_request = {}, opts = {})
|
36
|
+
_create_order_line_item_request = Patch::CreateOrderLineItemRequest.new(create_order_line_item_request)
|
37
|
+
data, _status_code, _headers = create_order_line_item_with_http_info(order_id, _create_order_line_item_request, opts)
|
38
|
+
data
|
39
|
+
end
|
40
|
+
|
41
|
+
# Creates an order line item
|
42
|
+
# Creates a line item on an order that is in the `draft` state.
|
43
|
+
# @param order_id [String]
|
44
|
+
# @param create_order_line_item_request [CreateOrderLineItemRequest]
|
45
|
+
# @param [Hash] opts the optional parameters
|
46
|
+
# @option opts [Integer] :patch_version
|
47
|
+
# @return [Array<(OrderLineItemResponse, Integer, Hash)>] OrderLineItemResponse data, response status code and response headers
|
48
|
+
def create_order_line_item_with_http_info(order_id, create_order_line_item_request, opts = {})
|
49
|
+
if @api_client.config.debugging
|
50
|
+
@api_client.config.logger.debug 'Calling API: OrderLineItemsApi.create_order_line_item ...'
|
51
|
+
end
|
52
|
+
# verify the required parameter 'order_id' is set
|
53
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
54
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderLineItemsApi.create_order_line_item"
|
55
|
+
end
|
56
|
+
# verify the required parameter 'create_order_line_item_request' is set
|
57
|
+
if @api_client.config.client_side_validation && create_order_line_item_request.nil?
|
58
|
+
fail ArgumentError, "Missing the required parameter 'create_order_line_item_request' when calling OrderLineItemsApi.create_order_line_item"
|
59
|
+
end
|
60
|
+
# resource path
|
61
|
+
local_var_path = '/v1/orders/{order_id}/line_items'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
|
62
|
+
|
63
|
+
# query parameters
|
64
|
+
query_params = opts[:query_params] || {}
|
65
|
+
|
66
|
+
# header parameters
|
67
|
+
header_params = opts[:header_params] || {}
|
68
|
+
|
69
|
+
# HTTP header 'Accept' (if needed)
|
70
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
71
|
+
# HTTP header 'Content-Type'
|
72
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
73
|
+
if !content_type.nil?
|
74
|
+
header_params['Content-Type'] = content_type
|
75
|
+
end
|
76
|
+
header_params['Patch-Version'] = 2
|
77
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
78
|
+
|
79
|
+
# form parameters
|
80
|
+
form_params = opts[:form_params] || {}
|
81
|
+
|
82
|
+
# http body (model)
|
83
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_order_line_item_request)
|
84
|
+
|
85
|
+
# return_type
|
86
|
+
return_type = opts[:debug_return_type] || 'OrderLineItemResponse'
|
87
|
+
|
88
|
+
# auth_names
|
89
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
90
|
+
|
91
|
+
new_options = opts.merge(
|
92
|
+
:operation => :"OrderLineItemsApi.create_order_line_item",
|
93
|
+
:header_params => header_params,
|
94
|
+
:query_params => query_params,
|
95
|
+
:form_params => form_params,
|
96
|
+
:body => post_body,
|
97
|
+
:auth_names => auth_names,
|
98
|
+
:return_type => return_type
|
99
|
+
)
|
100
|
+
|
101
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug "API called: OrderLineItemsApi#create_order_line_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
104
|
+
end
|
105
|
+
return data, status_code, headers
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deletes an order line item
|
109
|
+
# Deletes a line item on an order that is in the `draft` state.
|
110
|
+
# @param order_id [String]
|
111
|
+
# @param serial_number [String]
|
112
|
+
# @param [Hash] opts the optional parameters
|
113
|
+
# @option opts [Integer] :patch_version
|
114
|
+
# @return [DeleteOrderLineItemResponse]
|
115
|
+
def delete_order_line_item(order_id, serial_number, opts = {})
|
116
|
+
|
117
|
+
data, _status_code, _headers = delete_order_line_item_with_http_info(order_id, serial_number, opts)
|
118
|
+
data
|
119
|
+
end
|
120
|
+
|
121
|
+
# Deletes an order line item
|
122
|
+
# Deletes a line item on an order that is in the `draft` state.
|
123
|
+
# @param order_id [String]
|
124
|
+
# @param serial_number [String]
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @option opts [Integer] :patch_version
|
127
|
+
# @return [Array<(DeleteOrderLineItemResponse, Integer, Hash)>] DeleteOrderLineItemResponse data, response status code and response headers
|
128
|
+
def delete_order_line_item_with_http_info(order_id, serial_number, opts = {})
|
129
|
+
if @api_client.config.debugging
|
130
|
+
@api_client.config.logger.debug 'Calling API: OrderLineItemsApi.delete_order_line_item ...'
|
131
|
+
end
|
132
|
+
# verify the required parameter 'order_id' is set
|
133
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
134
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderLineItemsApi.delete_order_line_item"
|
135
|
+
end
|
136
|
+
# verify the required parameter 'serial_number' is set
|
137
|
+
if @api_client.config.client_side_validation && serial_number.nil?
|
138
|
+
fail ArgumentError, "Missing the required parameter 'serial_number' when calling OrderLineItemsApi.delete_order_line_item"
|
139
|
+
end
|
140
|
+
# resource path
|
141
|
+
local_var_path = '/v1/orders/{order_id}/line_items/{serial_number}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)).sub('{' + 'serial_number' + '}', CGI.escape(serial_number.to_s))
|
142
|
+
|
143
|
+
# query parameters
|
144
|
+
query_params = opts[:query_params] || {}
|
145
|
+
|
146
|
+
# header parameters
|
147
|
+
header_params = opts[:header_params] || {}
|
148
|
+
|
149
|
+
# HTTP header 'Accept' (if needed)
|
150
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
151
|
+
header_params['Patch-Version'] = 2
|
152
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
153
|
+
|
154
|
+
# form parameters
|
155
|
+
form_params = opts[:form_params] || {}
|
156
|
+
|
157
|
+
# http body (model)
|
158
|
+
post_body = opts[:debug_body]
|
159
|
+
|
160
|
+
# return_type
|
161
|
+
return_type = opts[:debug_return_type] || 'DeleteOrderLineItemResponse'
|
162
|
+
|
163
|
+
# auth_names
|
164
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
165
|
+
|
166
|
+
new_options = opts.merge(
|
167
|
+
:operation => :"OrderLineItemsApi.delete_order_line_item",
|
168
|
+
:header_params => header_params,
|
169
|
+
:query_params => query_params,
|
170
|
+
:form_params => form_params,
|
171
|
+
:body => post_body,
|
172
|
+
:auth_names => auth_names,
|
173
|
+
:return_type => return_type
|
174
|
+
)
|
175
|
+
|
176
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
177
|
+
if @api_client.config.debugging
|
178
|
+
@api_client.config.logger.debug "API called: OrderLineItemsApi#delete_order_line_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
179
|
+
end
|
180
|
+
return data, status_code, headers
|
181
|
+
end
|
182
|
+
|
183
|
+
# Updates an order line item
|
184
|
+
# Updates a line item on an order that is in the `draft` state.
|
185
|
+
# @param order_id [String]
|
186
|
+
# @param serial_number [String]
|
187
|
+
# @param update_order_line_item_request [UpdateOrderLineItemRequest]
|
188
|
+
# @param [Hash] opts the optional parameters
|
189
|
+
# @option opts [Integer] :patch_version
|
190
|
+
# @return [OrderLineItemResponse]
|
191
|
+
def update_order_line_item(order_id, serial_number, update_order_line_item_request = {}, opts = {})
|
192
|
+
_update_order_line_item_request = Patch::UpdateOrderLineItemRequest.new(update_order_line_item_request)
|
193
|
+
data, _status_code, _headers = update_order_line_item_with_http_info(order_id, serial_number, _update_order_line_item_request, opts)
|
194
|
+
data
|
195
|
+
end
|
196
|
+
|
197
|
+
# Updates an order line item
|
198
|
+
# Updates a line item on an order that is in the `draft` state.
|
199
|
+
# @param order_id [String]
|
200
|
+
# @param serial_number [String]
|
201
|
+
# @param update_order_line_item_request [UpdateOrderLineItemRequest]
|
202
|
+
# @param [Hash] opts the optional parameters
|
203
|
+
# @option opts [Integer] :patch_version
|
204
|
+
# @return [Array<(OrderLineItemResponse, Integer, Hash)>] OrderLineItemResponse data, response status code and response headers
|
205
|
+
def update_order_line_item_with_http_info(order_id, serial_number, update_order_line_item_request, opts = {})
|
206
|
+
if @api_client.config.debugging
|
207
|
+
@api_client.config.logger.debug 'Calling API: OrderLineItemsApi.update_order_line_item ...'
|
208
|
+
end
|
209
|
+
# verify the required parameter 'order_id' is set
|
210
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
211
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderLineItemsApi.update_order_line_item"
|
212
|
+
end
|
213
|
+
# verify the required parameter 'serial_number' is set
|
214
|
+
if @api_client.config.client_side_validation && serial_number.nil?
|
215
|
+
fail ArgumentError, "Missing the required parameter 'serial_number' when calling OrderLineItemsApi.update_order_line_item"
|
216
|
+
end
|
217
|
+
# verify the required parameter 'update_order_line_item_request' is set
|
218
|
+
if @api_client.config.client_side_validation && update_order_line_item_request.nil?
|
219
|
+
fail ArgumentError, "Missing the required parameter 'update_order_line_item_request' when calling OrderLineItemsApi.update_order_line_item"
|
220
|
+
end
|
221
|
+
# resource path
|
222
|
+
local_var_path = '/v1/orders/{order_id}/line_items/{serial_number}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)).sub('{' + 'serial_number' + '}', CGI.escape(serial_number.to_s))
|
223
|
+
|
224
|
+
# query parameters
|
225
|
+
query_params = opts[:query_params] || {}
|
226
|
+
|
227
|
+
# header parameters
|
228
|
+
header_params = opts[:header_params] || {}
|
229
|
+
|
230
|
+
# HTTP header 'Accept' (if needed)
|
231
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
232
|
+
# HTTP header 'Content-Type'
|
233
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
234
|
+
if !content_type.nil?
|
235
|
+
header_params['Content-Type'] = content_type
|
236
|
+
end
|
237
|
+
header_params['Patch-Version'] = 2
|
238
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
239
|
+
|
240
|
+
# form parameters
|
241
|
+
form_params = opts[:form_params] || {}
|
242
|
+
|
243
|
+
# http body (model)
|
244
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_order_line_item_request)
|
245
|
+
|
246
|
+
# return_type
|
247
|
+
return_type = opts[:debug_return_type] || 'OrderLineItemResponse'
|
248
|
+
|
249
|
+
# auth_names
|
250
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
251
|
+
|
252
|
+
new_options = opts.merge(
|
253
|
+
:operation => :"OrderLineItemsApi.update_order_line_item",
|
254
|
+
:header_params => header_params,
|
255
|
+
:query_params => query_params,
|
256
|
+
:form_params => form_params,
|
257
|
+
:body => post_body,
|
258
|
+
:auth_names => auth_names,
|
259
|
+
:return_type => return_type
|
260
|
+
)
|
261
|
+
|
262
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
263
|
+
if @api_client.config.debugging
|
264
|
+
@api_client.config.logger.debug "API called: OrderLineItemsApi#update_order_line_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
265
|
+
end
|
266
|
+
return data, status_code, headers
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
@@ -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
|
:cancel_order,
|
19
19
|
:create_order,
|
20
|
+
:delete_order,
|
20
21
|
:place_order,
|
21
22
|
:retrieve_order,
|
22
23
|
:retrieve_orders,
|
@@ -31,6 +32,7 @@ module Patch
|
|
31
32
|
# Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the `draft` or `placed` state can be cancelled.
|
32
33
|
# @param id [String]
|
33
34
|
# @param [Hash] opts the optional parameters
|
35
|
+
# @option opts [Integer] :patch_version
|
34
36
|
# @return [OrderResponse]
|
35
37
|
def cancel_order(id, opts = {})
|
36
38
|
|
@@ -42,6 +44,7 @@ module Patch
|
|
42
44
|
# Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the `draft` or `placed` state can be cancelled.
|
43
45
|
# @param id [String]
|
44
46
|
# @param [Hash] opts the optional parameters
|
47
|
+
# @option opts [Integer] :patch_version
|
45
48
|
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
|
46
49
|
def cancel_order_with_http_info(id, opts = {})
|
47
50
|
if @api_client.config.debugging
|
@@ -59,8 +62,11 @@ module Patch
|
|
59
62
|
|
60
63
|
# header parameters
|
61
64
|
header_params = opts[:header_params] || {}
|
65
|
+
|
62
66
|
# HTTP header 'Accept' (if needed)
|
63
67
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
68
|
+
header_params['Patch-Version'] = 2
|
69
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
64
70
|
|
65
71
|
# form parameters
|
66
72
|
form_params = opts[:form_params] || {}
|
@@ -92,9 +98,10 @@ module Patch
|
|
92
98
|
end
|
93
99
|
|
94
100
|
# Creates an order
|
95
|
-
# Creates an order in the `placed` or `draft` state.
|
101
|
+
# Creates an order in the `placed` or `draft`, or `reserved` state.
|
96
102
|
# @param create_order_request [CreateOrderRequest]
|
97
103
|
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [Integer] :patch_version
|
98
105
|
# @return [OrderResponse]
|
99
106
|
def create_order(create_order_request = {}, opts = {})
|
100
107
|
_create_order_request = Patch::CreateOrderRequest.new(create_order_request)
|
@@ -103,9 +110,10 @@ module Patch
|
|
103
110
|
end
|
104
111
|
|
105
112
|
# Creates an order
|
106
|
-
# Creates an order in the `placed` or `draft` state.
|
113
|
+
# Creates an order in the `placed` or `draft`, or `reserved` state.
|
107
114
|
# @param create_order_request [CreateOrderRequest]
|
108
115
|
# @param [Hash] opts the optional parameters
|
116
|
+
# @option opts [Integer] :patch_version
|
109
117
|
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
|
110
118
|
def create_order_with_http_info(create_order_request, opts = {})
|
111
119
|
if @api_client.config.debugging
|
@@ -123,6 +131,7 @@ module Patch
|
|
123
131
|
|
124
132
|
# header parameters
|
125
133
|
header_params = opts[:header_params] || {}
|
134
|
+
|
126
135
|
# HTTP header 'Accept' (if needed)
|
127
136
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
128
137
|
# HTTP header 'Content-Type'
|
@@ -130,6 +139,8 @@ module Patch
|
|
130
139
|
if !content_type.nil?
|
131
140
|
header_params['Content-Type'] = content_type
|
132
141
|
end
|
142
|
+
header_params['Patch-Version'] = 2
|
143
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
133
144
|
|
134
145
|
# form parameters
|
135
146
|
form_params = opts[:form_params] || {}
|
@@ -160,10 +171,80 @@ module Patch
|
|
160
171
|
return data, status_code, headers
|
161
172
|
end
|
162
173
|
|
174
|
+
# Deletes a draft order
|
175
|
+
# Deletes an order that is in the `draft` state.
|
176
|
+
# @param uid [String]
|
177
|
+
# @param [Hash] opts the optional parameters
|
178
|
+
# @option opts [Integer] :patch_version
|
179
|
+
# @return [DeleteOrderResponse]
|
180
|
+
def delete_order(uid, opts = {})
|
181
|
+
|
182
|
+
data, _status_code, _headers = delete_order_with_http_info(uid, opts)
|
183
|
+
data
|
184
|
+
end
|
185
|
+
|
186
|
+
# Deletes a draft order
|
187
|
+
# Deletes an order that is in the `draft` state.
|
188
|
+
# @param uid [String]
|
189
|
+
# @param [Hash] opts the optional parameters
|
190
|
+
# @option opts [Integer] :patch_version
|
191
|
+
# @return [Array<(DeleteOrderResponse, Integer, Hash)>] DeleteOrderResponse data, response status code and response headers
|
192
|
+
def delete_order_with_http_info(uid, opts = {})
|
193
|
+
if @api_client.config.debugging
|
194
|
+
@api_client.config.logger.debug 'Calling API: OrdersApi.delete_order ...'
|
195
|
+
end
|
196
|
+
# verify the required parameter 'uid' is set
|
197
|
+
if @api_client.config.client_side_validation && uid.nil?
|
198
|
+
fail ArgumentError, "Missing the required parameter 'uid' when calling OrdersApi.delete_order"
|
199
|
+
end
|
200
|
+
# resource path
|
201
|
+
local_var_path = '/v1/orders/{uid}'.sub('{' + 'uid' + '}', CGI.escape(uid.to_s))
|
202
|
+
|
203
|
+
# query parameters
|
204
|
+
query_params = opts[:query_params] || {}
|
205
|
+
|
206
|
+
# header parameters
|
207
|
+
header_params = opts[:header_params] || {}
|
208
|
+
|
209
|
+
# HTTP header 'Accept' (if needed)
|
210
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
211
|
+
header_params['Patch-Version'] = 2
|
212
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
213
|
+
|
214
|
+
# form parameters
|
215
|
+
form_params = opts[:form_params] || {}
|
216
|
+
|
217
|
+
# http body (model)
|
218
|
+
post_body = opts[:debug_body]
|
219
|
+
|
220
|
+
# return_type
|
221
|
+
return_type = opts[:debug_return_type] || 'DeleteOrderResponse'
|
222
|
+
|
223
|
+
# auth_names
|
224
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
225
|
+
|
226
|
+
new_options = opts.merge(
|
227
|
+
:operation => :"OrdersApi.delete_order",
|
228
|
+
:header_params => header_params,
|
229
|
+
:query_params => query_params,
|
230
|
+
:form_params => form_params,
|
231
|
+
:body => post_body,
|
232
|
+
:auth_names => auth_names,
|
233
|
+
:return_type => return_type
|
234
|
+
)
|
235
|
+
|
236
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
237
|
+
if @api_client.config.debugging
|
238
|
+
@api_client.config.logger.debug "API called: OrdersApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
239
|
+
end
|
240
|
+
return data, status_code, headers
|
241
|
+
end
|
242
|
+
|
163
243
|
# Place an order
|
164
244
|
# Placing an order confirms an order's allocation of offsets. Only orders that are in the `draft` state can be placed
|
165
245
|
# @param id [String]
|
166
246
|
# @param [Hash] opts the optional parameters
|
247
|
+
# @option opts [Integer] :patch_version
|
167
248
|
# @option opts [PlaceOrderRequest] :place_order_request
|
168
249
|
# @return [OrderResponse]
|
169
250
|
def place_order(id, opts = {})
|
@@ -176,6 +257,7 @@ module Patch
|
|
176
257
|
# Placing an order confirms an order's allocation of offsets. Only orders that are in the `draft` state can be placed
|
177
258
|
# @param id [String]
|
178
259
|
# @param [Hash] opts the optional parameters
|
260
|
+
# @option opts [Integer] :patch_version
|
179
261
|
# @option opts [PlaceOrderRequest] :place_order_request
|
180
262
|
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
|
181
263
|
def place_order_with_http_info(id, opts = {})
|
@@ -194,6 +276,7 @@ module Patch
|
|
194
276
|
|
195
277
|
# header parameters
|
196
278
|
header_params = opts[:header_params] || {}
|
279
|
+
|
197
280
|
# HTTP header 'Accept' (if needed)
|
198
281
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
199
282
|
# HTTP header 'Content-Type'
|
@@ -201,6 +284,8 @@ module Patch
|
|
201
284
|
if !content_type.nil?
|
202
285
|
header_params['Content-Type'] = content_type
|
203
286
|
end
|
287
|
+
header_params['Patch-Version'] = 2
|
288
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
204
289
|
|
205
290
|
# form parameters
|
206
291
|
form_params = opts[:form_params] || {}
|
@@ -235,6 +320,7 @@ module Patch
|
|
235
320
|
# Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
|
236
321
|
# @param id [String]
|
237
322
|
# @param [Hash] opts the optional parameters
|
323
|
+
# @option opts [Integer] :patch_version
|
238
324
|
# @return [OrderResponse]
|
239
325
|
def retrieve_order(id, opts = {})
|
240
326
|
|
@@ -246,6 +332,7 @@ module Patch
|
|
246
332
|
# Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
|
247
333
|
# @param id [String]
|
248
334
|
# @param [Hash] opts the optional parameters
|
335
|
+
# @option opts [Integer] :patch_version
|
249
336
|
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
|
250
337
|
def retrieve_order_with_http_info(id, opts = {})
|
251
338
|
if @api_client.config.debugging
|
@@ -263,8 +350,11 @@ module Patch
|
|
263
350
|
|
264
351
|
# header parameters
|
265
352
|
header_params = opts[:header_params] || {}
|
353
|
+
|
266
354
|
# HTTP header 'Accept' (if needed)
|
267
355
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
356
|
+
header_params['Patch-Version'] = 2
|
357
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
268
358
|
|
269
359
|
# form parameters
|
270
360
|
form_params = opts[:form_params] || {}
|
@@ -302,6 +392,7 @@ module Patch
|
|
302
392
|
# @option opts [String] :metadata
|
303
393
|
# @option opts [String] :metadata_example1
|
304
394
|
# @option opts [String] :metadata_example2
|
395
|
+
# @option opts [Integer] :patch_version
|
305
396
|
# @return [OrderListResponse]
|
306
397
|
def retrieve_orders(opts = {})
|
307
398
|
|
@@ -316,6 +407,7 @@ module Patch
|
|
316
407
|
# @option opts [String] :metadata
|
317
408
|
# @option opts [String] :metadata_example1
|
318
409
|
# @option opts [String] :metadata_example2
|
410
|
+
# @option opts [Integer] :patch_version
|
319
411
|
# @return [Array<(OrderListResponse, Integer, Hash)>] OrderListResponse data, response status code and response headers
|
320
412
|
def retrieve_orders_with_http_info(opts = {})
|
321
413
|
if @api_client.config.debugging
|
@@ -333,8 +425,11 @@ module Patch
|
|
333
425
|
|
334
426
|
# header parameters
|
335
427
|
header_params = opts[:header_params] || {}
|
428
|
+
|
336
429
|
# HTTP header 'Accept' (if needed)
|
337
430
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
431
|
+
header_params['Patch-Version'] = 2
|
432
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
338
433
|
|
339
434
|
# form parameters
|
340
435
|
form_params = opts[:form_params] || {}
|
@@ -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
|
@@ -29,6 +29,7 @@ module Patch
|
|
29
29
|
# @param id [String]
|
30
30
|
# @param [Hash] opts the optional parameters
|
31
31
|
# @option opts [String] :accept_language
|
32
|
+
# @option opts [Integer] :patch_version
|
32
33
|
# @return [ProjectResponse]
|
33
34
|
def retrieve_project(id, opts = {})
|
34
35
|
|
@@ -41,6 +42,7 @@ module Patch
|
|
41
42
|
# @param id [String]
|
42
43
|
# @param [Hash] opts the optional parameters
|
43
44
|
# @option opts [String] :accept_language
|
45
|
+
# @option opts [Integer] :patch_version
|
44
46
|
# @return [Array<(ProjectResponse, Integer, Hash)>] ProjectResponse data, response status code and response headers
|
45
47
|
def retrieve_project_with_http_info(id, opts = {})
|
46
48
|
if @api_client.config.debugging
|
@@ -58,9 +60,12 @@ module Patch
|
|
58
60
|
|
59
61
|
# header parameters
|
60
62
|
header_params = opts[:header_params] || {}
|
63
|
+
|
61
64
|
# HTTP header 'Accept' (if needed)
|
62
65
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
66
|
+
header_params['Patch-Version'] = 2
|
63
67
|
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
68
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
64
69
|
|
65
70
|
# form parameters
|
66
71
|
form_params = opts[:form_params] || {}
|
@@ -99,6 +104,7 @@ module Patch
|
|
99
104
|
# @option opts [String] :type
|
100
105
|
# @option opts [Integer] :minimum_available_mass
|
101
106
|
# @option opts [String] :accept_language
|
107
|
+
# @option opts [Integer] :patch_version
|
102
108
|
# @return [ProjectListResponse]
|
103
109
|
def retrieve_projects(opts = {})
|
104
110
|
|
@@ -114,6 +120,7 @@ module Patch
|
|
114
120
|
# @option opts [String] :type
|
115
121
|
# @option opts [Integer] :minimum_available_mass
|
116
122
|
# @option opts [String] :accept_language
|
123
|
+
# @option opts [Integer] :patch_version
|
117
124
|
# @return [Array<(ProjectListResponse, Integer, Hash)>] ProjectListResponse data, response status code and response headers
|
118
125
|
def retrieve_projects_with_http_info(opts = {})
|
119
126
|
if @api_client.config.debugging
|
@@ -131,9 +138,12 @@ module Patch
|
|
131
138
|
|
132
139
|
# header parameters
|
133
140
|
header_params = opts[:header_params] || {}
|
141
|
+
|
134
142
|
# HTTP header 'Accept' (if needed)
|
135
143
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
144
|
+
header_params['Patch-Version'] = 2
|
136
145
|
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
146
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
137
147
|
|
138
148
|
# form parameters
|
139
149
|
form_params = opts[:form_params] || {}
|
@@ -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
|
@@ -26,6 +26,7 @@ module Patch
|
|
26
26
|
# Retrieves the list of technology_types
|
27
27
|
# Retrieves a list of all technology_types.
|
28
28
|
# @param [Hash] opts the optional parameters
|
29
|
+
# @option opts [Integer] :patch_version
|
29
30
|
# @return [TechnologyTypeListResponse]
|
30
31
|
def retrieve_technology_types(opts = {})
|
31
32
|
|
@@ -36,6 +37,7 @@ module Patch
|
|
36
37
|
# Retrieves the list of technology_types
|
37
38
|
# Retrieves a list of all technology_types.
|
38
39
|
# @param [Hash] opts the optional parameters
|
40
|
+
# @option opts [Integer] :patch_version
|
39
41
|
# @return [Array<(TechnologyTypeListResponse, Integer, Hash)>] TechnologyTypeListResponse data, response status code and response headers
|
40
42
|
def retrieve_technology_types_with_http_info(opts = {})
|
41
43
|
if @api_client.config.debugging
|
@@ -49,8 +51,11 @@ module Patch
|
|
49
51
|
|
50
52
|
# header parameters
|
51
53
|
header_params = opts[:header_params] || {}
|
54
|
+
|
52
55
|
# HTTP header 'Accept' (if needed)
|
53
56
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
57
|
+
header_params['Patch-Version'] = 2
|
58
|
+
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
|
54
59
|
|
55
60
|
# form parameters
|
56
61
|
form_params = opts[:form_params] || {}
|
@@ -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
|
@@ -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/
|
34
|
+
@user_agent = "patch-ruby/2.0.0"
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => 'application/json',
|
37
37
|
'User-Agent' => @user_agent
|
data/lib/patch_ruby/api_error.rb
CHANGED
@@ -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
|
@@ -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
|
@@ -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
|