Skip to content

Commit 62cb049

Browse files
committed
ruby client code auto-generated
1 parent 91fb163 commit 62cb049

24 files changed

+363
-290
lines changed

lib/patch_ruby/api/estimates_api.rb

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ class EstimatesApi
2525
def initialize(api_client = ApiClient.default)
2626
@api_client = api_client
2727
end
28-
2928
# Create an estimate based on mass of CO2
30-
# 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.
31-
# @param create_mass_estimate_request [CreateMassEstimateRequest]
29+
# 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.
30+
# @param create_mass_estimate_request [CreateMassEstimateRequest]
3231
# @param [Hash] opts the optional parameters
3332
# @return [EstimateResponse]
3433
def create_mass_estimate(create_mass_estimate_request, opts = {})
@@ -37,8 +36,8 @@ def create_mass_estimate(create_mass_estimate_request, opts = {})
3736
end
3837

3938
# Create an estimate based on mass of CO2
40-
# 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.
41-
# @param create_mass_estimate_request [CreateMassEstimateRequest]
39+
# 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.
40+
# @param create_mass_estimate_request [CreateMassEstimateRequest]
4241
# @param [Hash] opts the optional parameters
4342
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
4443
def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
@@ -49,7 +48,6 @@ def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
4948
if @api_client.config.client_side_validation && create_mass_estimate_request.nil?
5049
fail ArgumentError, "Missing the required parameter 'create_mass_estimate_request' when calling EstimatesApi.create_mass_estimate"
5150
end
52-
5351
# resource path
5452
local_var_path = '/v1/estimates/mass'
5553

@@ -67,10 +65,10 @@ def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
6765
form_params = opts[:form_params] || {}
6866

6967
# http body (model)
70-
post_body = opts[:body] || @api_client.object_to_http_body(create_mass_estimate_request)
68+
post_body = opts[:body] || @api_client.object_to_http_body(create_mass_estimate_request)
7169

7270
# return_type
73-
return_type = opts[:return_type] || 'EstimateResponse'
71+
return_type = opts[:return_type] || 'EstimateResponse'
7472

7573
# auth_names
7674
auth_names = opts[:auth_names] || ['bearer_auth']
@@ -92,8 +90,8 @@ def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
9290
end
9391

9492
# Retrieves an estimate
95-
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
96-
# @param id [String]
93+
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
94+
# @param id [String]
9795
# @param [Hash] opts the optional parameters
9896
# @return [EstimateResponse]
9997
def retrieve_estimate(id, opts = {})
@@ -102,8 +100,8 @@ def retrieve_estimate(id, opts = {})
102100
end
103101

104102
# Retrieves an estimate
105-
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
106-
# @param id [String]
103+
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
104+
# @param id [String]
107105
# @param [Hash] opts the optional parameters
108106
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
109107
def retrieve_estimate_with_http_info(id, opts = {})
@@ -114,7 +112,6 @@ def retrieve_estimate_with_http_info(id, opts = {})
114112
if @api_client.config.client_side_validation && id.nil?
115113
fail ArgumentError, "Missing the required parameter 'id' when calling EstimatesApi.retrieve_estimate"
116114
end
117-
118115
# resource path
119116
local_var_path = '/v1/estimates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
120117

@@ -130,10 +127,10 @@ def retrieve_estimate_with_http_info(id, opts = {})
130127
form_params = opts[:form_params] || {}
131128

132129
# http body (model)
133-
post_body = opts[:body]
130+
post_body = opts[:body]
134131

135132
# return_type
136-
return_type = opts[:return_type] || 'EstimateResponse'
133+
return_type = opts[:return_type] || 'EstimateResponse'
137134

138135
# auth_names
139136
auth_names = opts[:auth_names] || ['bearer_auth']
@@ -155,19 +152,19 @@ def retrieve_estimate_with_http_info(id, opts = {})
155152
end
156153

157154
# Retrieves a list of estimates
158-
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
155+
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
159156
# @param [Hash] opts the optional parameters
160-
# @option opts [Integer] :page
157+
# @option opts [Integer] :page
161158
# @return [EstimateListResponse]
162159
def retrieve_estimates(opts = {})
163160
data, _status_code, _headers = retrieve_estimates_with_http_info(opts)
164161
data
165162
end
166163

167164
# Retrieves a list of estimates
168-
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
165+
# Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
169166
# @param [Hash] opts the optional parameters
170-
# @option opts [Integer] :page
167+
# @option opts [Integer] :page
171168
# @return [Array<(EstimateListResponse, Integer, Hash)>] EstimateListResponse data, response status code and response headers
172169
def retrieve_estimates_with_http_info(opts = {})
173170
if @api_client.config.debugging
@@ -189,10 +186,10 @@ def retrieve_estimates_with_http_info(opts = {})
189186
form_params = opts[:form_params] || {}
190187

191188
# http body (model)
192-
post_body = opts[:body]
189+
post_body = opts[:body]
193190

194191
# return_type
195-
return_type = opts[:return_type] || 'EstimateListResponse'
192+
return_type = opts[:return_type] || 'EstimateListResponse'
196193

197194
# auth_names
198195
auth_names = opts[:auth_names] || ['bearer_auth']

lib/patch_ruby/api/orders_api.rb

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ class OrdersApi
2727
def initialize(api_client = ApiClient.default)
2828
@api_client = api_client
2929
end
30-
3130
# Cancel an order
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` state can be cancelled.
33-
# @param id [String]
31+
# Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the `draft` state can be cancelled.
32+
# @param id [String]
3433
# @param [Hash] opts the optional parameters
3534
# @return [OrderResponse]
3635
def cancel_order(id, opts = {})
@@ -39,8 +38,8 @@ def cancel_order(id, opts = {})
3938
end
4039

4140
# Cancel an order
42-
# Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the &#x60;draft&#x60; state can be cancelled.
43-
# @param id [String]
41+
# Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the &#x60;draft&#x60; state can be cancelled.
42+
# @param id [String]
4443
# @param [Hash] opts the optional parameters
4544
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
4645
def cancel_order_with_http_info(id, opts = {})
@@ -51,7 +50,6 @@ def cancel_order_with_http_info(id, opts = {})
5150
if @api_client.config.client_side_validation && id.nil?
5251
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.cancel_order"
5352
end
54-
5553
# resource path
5654
local_var_path = '/v1/orders/{id}/cancel'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
5755

@@ -67,10 +65,10 @@ def cancel_order_with_http_info(id, opts = {})
6765
form_params = opts[:form_params] || {}
6866

6967
# http body (model)
70-
post_body = opts[:body]
68+
post_body = opts[:body]
7169

7270
# return_type
73-
return_type = opts[:return_type] || 'OrderResponse'
71+
return_type = opts[:return_type] || 'OrderResponse'
7472

7573
# auth_names
7674
auth_names = opts[:auth_names] || ['bearer_auth']
@@ -92,8 +90,8 @@ def cancel_order_with_http_info(id, opts = {})
9290
end
9391

9492
# Creates an order
95-
# Creates an order in the `placed` state. To create a `draft` order, create an estimate first.
96-
# @param create_order_request [CreateOrderRequest]
93+
# Creates an order in the `placed` state. To create a `draft` order, create an estimate first.
94+
# @param create_order_request [CreateOrderRequest]
9795
# @param [Hash] opts the optional parameters
9896
# @return [OrderResponse]
9997
def create_order(create_order_request, opts = {})
@@ -102,8 +100,8 @@ def create_order(create_order_request, opts = {})
102100
end
103101

104102
# Creates an order
105-
# Creates an order in the &#x60;placed&#x60; state. To create a &#x60;draft&#x60; order, create an estimate first.
106-
# @param create_order_request [CreateOrderRequest]
103+
# Creates an order in the &#x60;placed&#x60; state. To create a &#x60;draft&#x60; order, create an estimate first.
104+
# @param create_order_request [CreateOrderRequest]
107105
# @param [Hash] opts the optional parameters
108106
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
109107
def create_order_with_http_info(create_order_request, opts = {})
@@ -114,7 +112,6 @@ def create_order_with_http_info(create_order_request, opts = {})
114112
if @api_client.config.client_side_validation && create_order_request.nil?
115113
fail ArgumentError, "Missing the required parameter 'create_order_request' when calling OrdersApi.create_order"
116114
end
117-
118115
# resource path
119116
local_var_path = '/v1/orders'
120117

@@ -132,10 +129,10 @@ def create_order_with_http_info(create_order_request, opts = {})
132129
form_params = opts[:form_params] || {}
133130

134131
# http body (model)
135-
post_body = opts[:body] || @api_client.object_to_http_body(create_order_request)
132+
post_body = opts[:body] || @api_client.object_to_http_body(create_order_request)
136133

137134
# return_type
138-
return_type = opts[:return_type] || 'OrderResponse'
135+
return_type = opts[:return_type] || 'OrderResponse'
139136

140137
# auth_names
141138
auth_names = opts[:auth_names] || ['bearer_auth']
@@ -157,8 +154,8 @@ def create_order_with_http_info(create_order_request, opts = {})
157154
end
158155

159156
# Place an order
160-
# Placing an order confirms an order's allocation of offsets. Only orders that are in the `draft` state can be placed
161-
# @param id [String]
157+
# Placing an order confirms an order's allocation of offsets. Only orders that are in the `draft` state can be placed
158+
# @param id [String]
162159
# @param [Hash] opts the optional parameters
163160
# @return [OrderResponse]
164161
def place_order(id, opts = {})
@@ -167,8 +164,8 @@ def place_order(id, opts = {})
167164
end
168165

169166
# Place an order
170-
# Placing an order confirms an order&#39;s allocation of offsets. Only orders that are in the &#x60;draft&#x60; state can be placed
171-
# @param id [String]
167+
# Placing an order confirms an order&#39;s allocation of offsets. Only orders that are in the &#x60;draft&#x60; state can be placed
168+
# @param id [String]
172169
# @param [Hash] opts the optional parameters
173170
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
174171
def place_order_with_http_info(id, opts = {})
@@ -179,7 +176,6 @@ def place_order_with_http_info(id, opts = {})
179176
if @api_client.config.client_side_validation && id.nil?
180177
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.place_order"
181178
end
182-
183179
# resource path
184180
local_var_path = '/v1/orders/{id}/place'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
185181

@@ -195,10 +191,10 @@ def place_order_with_http_info(id, opts = {})
195191
form_params = opts[:form_params] || {}
196192

197193
# http body (model)
198-
post_body = opts[:body]
194+
post_body = opts[:body]
199195

200196
# return_type
201-
return_type = opts[:return_type] || 'OrderResponse'
197+
return_type = opts[:return_type] || 'OrderResponse'
202198

203199
# auth_names
204200
auth_names = opts[:auth_names] || ['bearer_auth']
@@ -220,8 +216,8 @@ def place_order_with_http_info(id, opts = {})
220216
end
221217

222218
# Retrieves an order
223-
# Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
224-
# @param id [String]
219+
# Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
220+
# @param id [String]
225221
# @param [Hash] opts the optional parameters
226222
# @return [OrderResponse]
227223
def retrieve_order(id, opts = {})
@@ -230,8 +226,8 @@ def retrieve_order(id, opts = {})
230226
end
231227

232228
# Retrieves an order
233-
# Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
234-
# @param id [String]
229+
# Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
230+
# @param id [String]
235231
# @param [Hash] opts the optional parameters
236232
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
237233
def retrieve_order_with_http_info(id, opts = {})
@@ -242,7 +238,6 @@ def retrieve_order_with_http_info(id, opts = {})
242238
if @api_client.config.client_side_validation && id.nil?
243239
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.retrieve_order"
244240
end
245-
246241
# resource path
247242
local_var_path = '/v1/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
248243

@@ -258,10 +253,10 @@ def retrieve_order_with_http_info(id, opts = {})
258253
form_params = opts[:form_params] || {}
259254

260255
# http body (model)
261-
post_body = opts[:body]
256+
post_body = opts[:body]
262257

263258
# return_type
264-
return_type = opts[:return_type] || 'OrderResponse'
259+
return_type = opts[:return_type] || 'OrderResponse'
265260

266261
# auth_names
267262
auth_names = opts[:auth_names] || ['bearer_auth']
@@ -283,19 +278,19 @@ def retrieve_order_with_http_info(id, opts = {})
283278
end
284279

285280
# Retrieves a list of orders
286-
# Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
281+
# Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
287282
# @param [Hash] opts the optional parameters
288-
# @option opts [Integer] :page
283+
# @option opts [Integer] :page
289284
# @return [OrderListResponse]
290285
def retrieve_orders(opts = {})
291286
data, _status_code, _headers = retrieve_orders_with_http_info(opts)
292287
data
293288
end
294289

295290
# Retrieves a list of orders
296-
# Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
291+
# Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
297292
# @param [Hash] opts the optional parameters
298-
# @option opts [Integer] :page
293+
# @option opts [Integer] :page
299294
# @return [Array<(OrderListResponse, Integer, Hash)>] OrderListResponse data, response status code and response headers
300295
def retrieve_orders_with_http_info(opts = {})
301296
if @api_client.config.debugging
@@ -317,10 +312,10 @@ def retrieve_orders_with_http_info(opts = {})
317312
form_params = opts[:form_params] || {}
318313

319314
# http body (model)
320-
post_body = opts[:body]
315+
post_body = opts[:body]
321316

322317
# return_type
323-
return_type = opts[:return_type] || 'OrderListResponse'
318+
return_type = opts[:return_type] || 'OrderListResponse'
324319

325320
# auth_names
326321
auth_names = opts[:auth_names] || ['bearer_auth']

0 commit comments

Comments
 (0)