19
19
import six
20
20
21
21
from patch_api .api_client import ApiClient
22
- from patch_api .exceptions import ( # noqa: F401
23
- ApiTypeError ,
24
- ApiValueError
25
- )
22
+ from patch_api .exceptions import ApiTypeError , ApiValueError # noqa: F401
26
23
27
24
28
25
class EstimatesApi (object ):
@@ -37,7 +34,9 @@ def __init__(self, api_client=None):
37
34
api_client = ApiClient ()
38
35
self .api_client = api_client
39
36
40
- def create_mass_estimate (self , create_mass_estimate_request , ** kwargs ): # noqa: E501
37
+ def create_mass_estimate (
38
+ self , create_mass_estimate_request , ** kwargs
39
+ ): # noqa: E501
41
40
"""Create an estimate based on mass of CO2 # noqa: E501
42
41
43
42
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. # noqa: E501
@@ -59,10 +58,14 @@ def create_mass_estimate(self, create_mass_estimate_request, **kwargs): # noqa:
59
58
If the method is called asynchronously,
60
59
returns the request thread.
61
60
"""
62
- kwargs ['_return_http_data_only' ] = True
63
- return self .create_mass_estimate_with_http_info (create_mass_estimate_request , ** kwargs ) # noqa: E501
64
-
65
- def create_mass_estimate_with_http_info (self , create_mass_estimate_request , ** kwargs ): # noqa: E501
61
+ kwargs ["_return_http_data_only" ] = True
62
+ return self .create_mass_estimate_with_http_info (
63
+ create_mass_estimate_request , ** kwargs
64
+ ) # noqa: E501
65
+
66
+ def create_mass_estimate_with_http_info (
67
+ self , create_mass_estimate_request , ** kwargs
68
+ ): # noqa: E501
66
69
"""Create an estimate based on mass of CO2 # noqa: E501
67
70
68
71
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. # noqa: E501
@@ -89,30 +92,32 @@ def create_mass_estimate_with_http_info(self, create_mass_estimate_request, **kw
89
92
90
93
local_var_params = locals ()
91
94
92
- all_params = [
93
- 'create_mass_estimate_request'
94
- ]
95
+ all_params = ["create_mass_estimate_request" ]
95
96
all_params .extend (
96
97
[
97
- ' async_req' ,
98
- ' _return_http_data_only' ,
99
- ' _preload_content' ,
100
- ' _request_timeout'
98
+ " async_req" ,
99
+ " _return_http_data_only" ,
100
+ " _preload_content" ,
101
+ " _request_timeout" ,
101
102
]
102
103
)
103
104
104
- for key , val in six .iteritems (local_var_params [' kwargs' ]):
105
+ for key , val in six .iteritems (local_var_params [" kwargs" ]):
105
106
if key not in all_params :
106
107
raise ApiTypeError (
107
108
"Got an unexpected keyword argument '%s'"
108
109
" to method create_mass_estimate" % key
109
110
)
110
111
local_var_params [key ] = val
111
- del local_var_params [' kwargs' ]
112
+ del local_var_params [" kwargs" ]
112
113
# verify the required parameter 'create_mass_estimate_request' is set
113
- if self .api_client .client_side_validation and ('create_mass_estimate_request' not in local_var_params or # noqa: E501
114
- local_var_params ['create_mass_estimate_request' ] is None ): # noqa: E501
115
- raise ApiValueError ("Missing the required parameter `create_mass_estimate_request` when calling `create_mass_estimate`" ) # noqa: E501
114
+ if self .api_client .client_side_validation and (
115
+ "create_mass_estimate_request" not in local_var_params
116
+ or local_var_params ["create_mass_estimate_request" ] is None # noqa: E501
117
+ ): # noqa: E501
118
+ raise ApiValueError (
119
+ "Missing the required parameter `create_mass_estimate_request` when calling `create_mass_estimate`"
120
+ ) # noqa: E501
116
121
117
122
collection_formats = {}
118
123
@@ -126,34 +131,42 @@ def create_mass_estimate_with_http_info(self, create_mass_estimate_request, **kw
126
131
local_var_files = {}
127
132
128
133
body_params = None
129
- if ' create_mass_estimate_request' in local_var_params :
130
- body_params = local_var_params [' create_mass_estimate_request' ]
134
+ if " create_mass_estimate_request" in local_var_params :
135
+ body_params = local_var_params [" create_mass_estimate_request" ]
131
136
# HTTP header `Accept`
132
- header_params ['Accept' ] = self .api_client .select_header_accept (
133
- ['application/json' ]) # noqa: E501
137
+ header_params ["Accept" ] = self .api_client .select_header_accept (
138
+ ["application/json" ]
139
+ ) # noqa: E501
134
140
135
141
# HTTP header `Content-Type`
136
- header_params ['Content-Type' ] = self .api_client .select_header_content_type ( # noqa: E501
137
- ['application/json' ]) # noqa: E501
142
+ header_params [
143
+ "Content-Type"
144
+ ] = self .api_client .select_header_content_type ( # noqa: E501
145
+ ["application/json" ]
146
+ ) # noqa: E501
138
147
139
148
# Authentication setting
140
- auth_settings = [' bearer_auth' ] # noqa: E501
149
+ auth_settings = [" bearer_auth" ] # noqa: E501
141
150
142
151
return self .api_client .call_api (
143
- '/v1/estimates/mass' , 'POST' ,
152
+ "/v1/estimates/mass" ,
153
+ "POST" ,
144
154
path_params ,
145
155
query_params ,
146
156
header_params ,
147
157
body = body_params ,
148
158
post_params = form_params ,
149
159
files = local_var_files ,
150
- response_type = ' EstimateResponse' , # noqa: E501
160
+ response_type = " EstimateResponse" , # noqa: E501
151
161
auth_settings = auth_settings ,
152
- async_req = local_var_params .get ('async_req' ),
153
- _return_http_data_only = local_var_params .get ('_return_http_data_only' ), # noqa: E501
154
- _preload_content = local_var_params .get ('_preload_content' , True ),
155
- _request_timeout = local_var_params .get ('_request_timeout' ),
156
- collection_formats = collection_formats )
162
+ async_req = local_var_params .get ("async_req" ),
163
+ _return_http_data_only = local_var_params .get (
164
+ "_return_http_data_only"
165
+ ), # noqa: E501
166
+ _preload_content = local_var_params .get ("_preload_content" , True ),
167
+ _request_timeout = local_var_params .get ("_request_timeout" ),
168
+ collection_formats = collection_formats ,
169
+ )
157
170
158
171
def retrieve_estimate (self , id , ** kwargs ): # noqa: E501
159
172
"""Retrieves an estimate # noqa: E501
@@ -177,7 +190,7 @@ def retrieve_estimate(self, id, **kwargs): # noqa: E501
177
190
If the method is called asynchronously,
178
191
returns the request thread.
179
192
"""
180
- kwargs [' _return_http_data_only' ] = True
193
+ kwargs [" _return_http_data_only" ] = True
181
194
return self .retrieve_estimate_with_http_info (id , ** kwargs ) # noqa: E501
182
195
183
196
def retrieve_estimate_with_http_info (self , id , ** kwargs ): # noqa: E501
@@ -207,36 +220,37 @@ def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501
207
220
208
221
local_var_params = locals ()
209
222
210
- all_params = [
211
- 'id'
212
- ]
223
+ all_params = ["id" ]
213
224
all_params .extend (
214
225
[
215
- ' async_req' ,
216
- ' _return_http_data_only' ,
217
- ' _preload_content' ,
218
- ' _request_timeout'
226
+ " async_req" ,
227
+ " _return_http_data_only" ,
228
+ " _preload_content" ,
229
+ " _request_timeout" ,
219
230
]
220
231
)
221
232
222
- for key , val in six .iteritems (local_var_params [' kwargs' ]):
233
+ for key , val in six .iteritems (local_var_params [" kwargs" ]):
223
234
if key not in all_params :
224
235
raise ApiTypeError (
225
236
"Got an unexpected keyword argument '%s'"
226
237
" to method retrieve_estimate" % key
227
238
)
228
239
local_var_params [key ] = val
229
- del local_var_params [' kwargs' ]
240
+ del local_var_params [" kwargs" ]
230
241
# verify the required parameter 'id' is set
231
- if self .api_client .client_side_validation and ('id' not in local_var_params or # noqa: E501
232
- local_var_params ['id' ] is None ): # noqa: E501
233
- raise ApiValueError ("Missing the required parameter `id` when calling `retrieve_estimate`" ) # noqa: E501
242
+ if self .api_client .client_side_validation and (
243
+ "id" not in local_var_params or local_var_params ["id" ] is None # noqa: E501
244
+ ): # noqa: E501
245
+ raise ApiValueError (
246
+ "Missing the required parameter `id` when calling `retrieve_estimate`"
247
+ ) # noqa: E501
234
248
235
249
collection_formats = {}
236
250
237
251
path_params = {}
238
- if 'id' in local_var_params :
239
- path_params ['id' ] = local_var_params ['id' ] # noqa: E501
252
+ if "id" in local_var_params :
253
+ path_params ["id" ] = local_var_params ["id" ] # noqa: E501
240
254
241
255
query_params = []
242
256
@@ -247,27 +261,32 @@ def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501
247
261
248
262
body_params = None
249
263
# HTTP header `Accept`
250
- header_params ['Accept' ] = self .api_client .select_header_accept (
251
- ['application/json' ]) # noqa: E501
264
+ header_params ["Accept" ] = self .api_client .select_header_accept (
265
+ ["application/json" ]
266
+ ) # noqa: E501
252
267
253
268
# Authentication setting
254
- auth_settings = [' bearer_auth' ] # noqa: E501
269
+ auth_settings = [" bearer_auth" ] # noqa: E501
255
270
256
271
return self .api_client .call_api (
257
- '/v1/estimates/{id}' , 'GET' ,
272
+ "/v1/estimates/{id}" ,
273
+ "GET" ,
258
274
path_params ,
259
275
query_params ,
260
276
header_params ,
261
277
body = body_params ,
262
278
post_params = form_params ,
263
279
files = local_var_files ,
264
- response_type = ' EstimateResponse' , # noqa: E501
280
+ response_type = " EstimateResponse" , # noqa: E501
265
281
auth_settings = auth_settings ,
266
- async_req = local_var_params .get ('async_req' ),
267
- _return_http_data_only = local_var_params .get ('_return_http_data_only' ), # noqa: E501
268
- _preload_content = local_var_params .get ('_preload_content' , True ),
269
- _request_timeout = local_var_params .get ('_request_timeout' ),
270
- collection_formats = collection_formats )
282
+ async_req = local_var_params .get ("async_req" ),
283
+ _return_http_data_only = local_var_params .get (
284
+ "_return_http_data_only"
285
+ ), # noqa: E501
286
+ _preload_content = local_var_params .get ("_preload_content" , True ),
287
+ _request_timeout = local_var_params .get ("_request_timeout" ),
288
+ collection_formats = collection_formats ,
289
+ )
271
290
272
291
def retrieve_estimates (self , ** kwargs ): # noqa: E501
273
292
"""Retrieves a list of estimates # noqa: E501
@@ -291,7 +310,7 @@ def retrieve_estimates(self, **kwargs): # noqa: E501
291
310
If the method is called asynchronously,
292
311
returns the request thread.
293
312
"""
294
- kwargs [' _return_http_data_only' ] = True
313
+ kwargs [" _return_http_data_only" ] = True
295
314
return self .retrieve_estimates_with_http_info (** kwargs ) # noqa: E501
296
315
297
316
def retrieve_estimates_with_http_info (self , ** kwargs ): # noqa: E501
@@ -321,34 +340,34 @@ def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501
321
340
322
341
local_var_params = locals ()
323
342
324
- all_params = [
325
- 'page'
326
- ]
343
+ all_params = ["page" ]
327
344
all_params .extend (
328
345
[
329
- ' async_req' ,
330
- ' _return_http_data_only' ,
331
- ' _preload_content' ,
332
- ' _request_timeout'
346
+ " async_req" ,
347
+ " _return_http_data_only" ,
348
+ " _preload_content" ,
349
+ " _request_timeout" ,
333
350
]
334
351
)
335
352
336
- for key , val in six .iteritems (local_var_params [' kwargs' ]):
353
+ for key , val in six .iteritems (local_var_params [" kwargs" ]):
337
354
if key not in all_params :
338
355
raise ApiTypeError (
339
356
"Got an unexpected keyword argument '%s'"
340
357
" to method retrieve_estimates" % key
341
358
)
342
359
local_var_params [key ] = val
343
- del local_var_params [' kwargs' ]
360
+ del local_var_params [" kwargs" ]
344
361
345
362
collection_formats = {}
346
363
347
364
path_params = {}
348
365
349
366
query_params = []
350
- if 'page' in local_var_params and local_var_params ['page' ] is not None : # noqa: E501
351
- query_params .append (('page' , local_var_params ['page' ])) # noqa: E501
367
+ if (
368
+ "page" in local_var_params and local_var_params ["page" ] is not None
369
+ ): # noqa: E501
370
+ query_params .append (("page" , local_var_params ["page" ])) # noqa: E501
352
371
353
372
header_params = {}
354
373
@@ -357,24 +376,29 @@ def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501
357
376
358
377
body_params = None
359
378
# HTTP header `Accept`
360
- header_params ['Accept' ] = self .api_client .select_header_accept (
361
- ['application/json' ]) # noqa: E501
379
+ header_params ["Accept" ] = self .api_client .select_header_accept (
380
+ ["application/json" ]
381
+ ) # noqa: E501
362
382
363
383
# Authentication setting
364
- auth_settings = [' bearer_auth' ] # noqa: E501
384
+ auth_settings = [" bearer_auth" ] # noqa: E501
365
385
366
386
return self .api_client .call_api (
367
- '/v1/estimates' , 'GET' ,
387
+ "/v1/estimates" ,
388
+ "GET" ,
368
389
path_params ,
369
390
query_params ,
370
391
header_params ,
371
392
body = body_params ,
372
393
post_params = form_params ,
373
394
files = local_var_files ,
374
- response_type = ' EstimateListResponse' , # noqa: E501
395
+ response_type = " EstimateListResponse" , # noqa: E501
375
396
auth_settings = auth_settings ,
376
- async_req = local_var_params .get ('async_req' ),
377
- _return_http_data_only = local_var_params .get ('_return_http_data_only' ), # noqa: E501
378
- _preload_content = local_var_params .get ('_preload_content' , True ),
379
- _request_timeout = local_var_params .get ('_request_timeout' ),
380
- collection_formats = collection_formats )
397
+ async_req = local_var_params .get ("async_req" ),
398
+ _return_http_data_only = local_var_params .get (
399
+ "_return_http_data_only"
400
+ ), # noqa: E501
401
+ _preload_content = local_var_params .get ("_preload_content" , True ),
402
+ _request_timeout = local_var_params .get ("_request_timeout" ),
403
+ collection_formats = collection_formats ,
404
+ )
0 commit comments