Skip to content

Commit 4f3539f

Browse files
committed
Remove opts arg
1 parent 70bf760 commit 4f3539f

File tree

7 files changed

+138
-94
lines changed

7 files changed

+138
-94
lines changed

patch_api/api/estimates_api.py

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ class EstimatesApi(object):
2828
Do not edit the class manually.
2929
"""
3030

31+
ALLOWED_QUERY_PARAMS = ["mass_g", "price_cents_usd", "project_id", "page"]
32+
3133
def __init__(self, api_client=None):
3234
self.api_client = api_client
3335

3436
def create_mass_estimate(
35-
self, opts={}, create_mass_estimate_request={}, **kwargs
37+
self, create_mass_estimate_request={}, **kwargs
3638
): # noqa: E501
3739
"""Create an estimate based on mass of CO2 # noqa: E501
3840
@@ -58,11 +60,11 @@ def create_mass_estimate(
5860
"""
5961
kwargs["_return_http_data_only"] = True
6062
return self.create_mass_estimate_with_http_info(
61-
opts, create_mass_estimate_request, **kwargs
63+
create_mass_estimate_request, **kwargs
6264
) # noqa: E501
6365

6466
def create_mass_estimate_with_http_info(
65-
self, opts, create_mass_estimate_request, **kwargs
67+
self, create_mass_estimate_request, **kwargs
6668
): # noqa: E501
6769
"""Create an estimate based on mass of CO2 # noqa: E501
6870
@@ -74,7 +76,6 @@ def create_mass_estimate_with_http_info(
7476
7577
:param async_req bool: execute request asynchronously
7678
:param CreateMassEstimateRequest create_mass_estimate_request: (required)
77-
:param dict opts: dictionary holding the optional arguments for the query (required)
7879
:param _return_http_data_only: response data without head status code
7980
and headers
8081
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -96,6 +97,10 @@ def create_mass_estimate_with_http_info(
9697
all_params.append("_return_http_data_only")
9798
all_params.append("_preload_content")
9899
all_params.append("_request_timeout")
100+
all_params.append("mass_g")
101+
all_params.append("price_cents_usd")
102+
all_params.append("project_id")
103+
all_params.append("metadata")
99104

100105
for key, val in six.iteritems(local_var_params["kwargs"]):
101106
if key not in all_params:
@@ -119,8 +124,8 @@ def create_mass_estimate_with_http_info(
119124
path_params = {}
120125

121126
query_params = []
122-
for key in opts:
123-
query_params.append([key, opts.get(key)])
127+
for key in kwargs:
128+
query_params.append([key, kwargs.get(key)])
124129

125130
header_params = {}
126131

@@ -165,7 +170,7 @@ def create_mass_estimate_with_http_info(
165170
collection_formats=collection_formats,
166171
)
167172

168-
def retrieve_estimate(self, opts={}, id={}, **kwargs): # noqa: E501
173+
def retrieve_estimate(self, id={}, **kwargs): # noqa: E501
169174
"""Retrieves an estimate # noqa: E501
170175
171176
Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501
@@ -189,9 +194,9 @@ def retrieve_estimate(self, opts={}, id={}, **kwargs): # noqa: E501
189194
returns the request thread.
190195
"""
191196
kwargs["_return_http_data_only"] = True
192-
return self.retrieve_estimate_with_http_info(opts, id, **kwargs) # noqa: E501
197+
return self.retrieve_estimate_with_http_info(id, **kwargs) # noqa: E501
193198

194-
def retrieve_estimate_with_http_info(self, opts, id, **kwargs): # noqa: E501
199+
def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501
195200
"""Retrieves an estimate # noqa: E501
196201
197202
Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501
@@ -202,7 +207,6 @@ def retrieve_estimate_with_http_info(self, opts, id, **kwargs): # noqa: E501
202207
203208
:param async_req bool: execute request asynchronously
204209
:param str id: (required)
205-
:param dict opts: dictionary holding the optional arguments for the query (required)
206210
:param _return_http_data_only: response data without head status code
207211
and headers
208212
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -224,6 +228,10 @@ def retrieve_estimate_with_http_info(self, opts, id, **kwargs): # noqa: E501
224228
all_params.append("_return_http_data_only")
225229
all_params.append("_preload_content")
226230
all_params.append("_request_timeout")
231+
all_params.append("mass_g")
232+
all_params.append("price_cents_usd")
233+
all_params.append("project_id")
234+
all_params.append("metadata")
227235

228236
for key, val in six.iteritems(local_var_params["kwargs"]):
229237
if key not in all_params:
@@ -246,8 +254,8 @@ def retrieve_estimate_with_http_info(self, opts, id, **kwargs): # noqa: E501
246254
path_params["id"] = local_var_params["id"] # noqa: E501
247255

248256
query_params = []
249-
for key in opts:
250-
query_params.append([key, opts.get(key)])
257+
for key in kwargs:
258+
query_params.append([key, kwargs.get(key)])
251259

252260
header_params = {}
253261

@@ -283,7 +291,7 @@ def retrieve_estimate_with_http_info(self, opts, id, **kwargs): # noqa: E501
283291
collection_formats=collection_formats,
284292
)
285293

286-
def retrieve_estimates(self, opts={}, **kwargs): # noqa: E501
294+
def retrieve_estimates(self, **kwargs): # noqa: E501
287295
"""Retrieves a list of estimates # noqa: E501
288296
289297
Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501
@@ -307,9 +315,9 @@ def retrieve_estimates(self, opts={}, **kwargs): # noqa: E501
307315
returns the request thread.
308316
"""
309317
kwargs["_return_http_data_only"] = True
310-
return self.retrieve_estimates_with_http_info(opts, **kwargs) # noqa: E501
318+
return self.retrieve_estimates_with_http_info(**kwargs) # noqa: E501
311319

312-
def retrieve_estimates_with_http_info(self, opts, **kwargs): # noqa: E501
320+
def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501
313321
"""Retrieves a list of estimates # noqa: E501
314322
315323
Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501
@@ -320,7 +328,6 @@ def retrieve_estimates_with_http_info(self, opts, **kwargs): # noqa: E501
320328
321329
:param async_req bool: execute request asynchronously
322330
:param int page:
323-
:param dict opts: dictionary holding the optional arguments for the query (required)
324331
:param _return_http_data_only: response data without head status code
325332
and headers
326333
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -342,6 +349,10 @@ def retrieve_estimates_with_http_info(self, opts, **kwargs): # noqa: E501
342349
all_params.append("_return_http_data_only")
343350
all_params.append("_preload_content")
344351
all_params.append("_request_timeout")
352+
all_params.append("mass_g")
353+
all_params.append("price_cents_usd")
354+
all_params.append("project_id")
355+
all_params.append("metadata")
345356

346357
for key, val in six.iteritems(local_var_params["kwargs"]):
347358
if key not in all_params:
@@ -357,8 +368,8 @@ def retrieve_estimates_with_http_info(self, opts, **kwargs): # noqa: E501
357368
path_params = {}
358369

359370
query_params = []
360-
for key in opts:
361-
query_params.append([key, opts.get(key)])
371+
for key in kwargs:
372+
query_params.append([key, kwargs.get(key)])
362373
if "page" in local_var_params:
363374
query_params.append(("page", local_var_params["page"])) # noqa: E501
364375

0 commit comments

Comments
 (0)