Skip to content

Commit 968663f

Browse files
authored
Metadata query params for Orders endpoint (#29)
1 parent 98757ec commit 968663f

15 files changed

+330
-37
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.9.0] - 2021-08-17
9+
10+
### Added
11+
12+
- Fixed ability to create Orders with `metadata`
13+
- Add support for querying Orders by `metadata`
14+
- Added `transaction_value_eth_gwei` as an alternative way to compute transaction level emissions for ethereum
15+
816
## [1.8.0] - 2021-07-20
917

1018
### Added

patch_api/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from __future__ import absolute_import
1717

18-
__version__ = "1.8.0"
18+
__version__ = "1.9.0"
1919

2020
# import ApiClient
2121
from patch_api.api_client import ApiClient

patch_api/api/estimates_api.py

+65-9
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,15 @@ def create_bitcoin_estimate_with_http_info(
148148
path_params = {}
149149

150150
query_params = []
151+
152+
# do not add duplicate keys to query_params list
153+
existing_keys = []
154+
for param in query_params:
155+
existing_keys.append(param[0])
156+
151157
for key in kwargs:
152-
query_params.append([key, kwargs.get(key)])
158+
if key not in existing_keys:
159+
query_params.append([key, kwargs.get(key)])
153160

154161
header_params = {}
155162

@@ -294,8 +301,15 @@ def create_ethereum_estimate_with_http_info(
294301
path_params = {}
295302

296303
query_params = []
304+
305+
# do not add duplicate keys to query_params list
306+
existing_keys = []
307+
for param in query_params:
308+
existing_keys.append(param[0])
309+
297310
for key in kwargs:
298-
query_params.append([key, kwargs.get(key)])
311+
if key not in existing_keys:
312+
query_params.append([key, kwargs.get(key)])
299313

300314
header_params = {}
301315

@@ -440,8 +454,15 @@ def create_flight_estimate_with_http_info(
440454
path_params = {}
441455

442456
query_params = []
457+
458+
# do not add duplicate keys to query_params list
459+
existing_keys = []
460+
for param in query_params:
461+
existing_keys.append(param[0])
462+
443463
for key in kwargs:
444-
query_params.append([key, kwargs.get(key)])
464+
if key not in existing_keys:
465+
query_params.append([key, kwargs.get(key)])
445466

446467
header_params = {}
447468

@@ -586,8 +607,15 @@ def create_mass_estimate_with_http_info(
586607
path_params = {}
587608

588609
query_params = []
610+
611+
# do not add duplicate keys to query_params list
612+
existing_keys = []
613+
for param in query_params:
614+
existing_keys.append(param[0])
615+
589616
for key in kwargs:
590-
query_params.append([key, kwargs.get(key)])
617+
if key not in existing_keys:
618+
query_params.append([key, kwargs.get(key)])
591619

592620
header_params = {}
593621

@@ -732,8 +760,15 @@ def create_shipping_estimate_with_http_info(
732760
path_params = {}
733761

734762
query_params = []
763+
764+
# do not add duplicate keys to query_params list
765+
existing_keys = []
766+
for param in query_params:
767+
existing_keys.append(param[0])
768+
735769
for key in kwargs:
736-
query_params.append([key, kwargs.get(key)])
770+
if key not in existing_keys:
771+
query_params.append([key, kwargs.get(key)])
737772

738773
header_params = {}
739774

@@ -878,8 +913,15 @@ def create_vehicle_estimate_with_http_info(
878913
path_params = {}
879914

880915
query_params = []
916+
917+
# do not add duplicate keys to query_params list
918+
existing_keys = []
919+
for param in query_params:
920+
existing_keys.append(param[0])
921+
881922
for key in kwargs:
882-
query_params.append([key, kwargs.get(key)])
923+
if key not in existing_keys:
924+
query_params.append([key, kwargs.get(key)])
883925

884926
header_params = {}
885927

@@ -1017,8 +1059,15 @@ def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501
10171059
path_params["id"] = local_var_params["id"] # noqa: E501
10181060

10191061
query_params = []
1062+
1063+
# do not add duplicate keys to query_params list
1064+
existing_keys = []
1065+
for param in query_params:
1066+
existing_keys.append(param[0])
1067+
10201068
for key in kwargs:
1021-
query_params.append([key, kwargs.get(key)])
1069+
if key not in existing_keys:
1070+
query_params.append([key, kwargs.get(key)])
10221071

10231072
header_params = {}
10241073

@@ -1140,11 +1189,18 @@ def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501
11401189
path_params = {}
11411190

11421191
query_params = []
1143-
for key in kwargs:
1144-
query_params.append([key, kwargs.get(key)])
11451192
if "page" in local_var_params:
11461193
query_params.append(("page", local_var_params["page"])) # noqa: E501
11471194

1195+
# do not add duplicate keys to query_params list
1196+
existing_keys = []
1197+
for param in query_params:
1198+
existing_keys.append(param[0])
1199+
1200+
for key in kwargs:
1201+
if key not in existing_keys:
1202+
query_params.append([key, kwargs.get(key)])
1203+
11481204
header_params = {}
11491205

11501206
form_params = []

patch_api/api/orders_api.py

+65-7
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,15 @@ def cancel_order_with_http_info(self, id, **kwargs): # noqa: E501
141141
path_params["id"] = local_var_params["id"] # noqa: E501
142142

143143
query_params = []
144+
145+
# do not add duplicate keys to query_params list
146+
existing_keys = []
147+
for param in query_params:
148+
existing_keys.append(param[0])
149+
144150
for key in kwargs:
145-
query_params.append([key, kwargs.get(key)])
151+
if key not in existing_keys:
152+
query_params.append([key, kwargs.get(key)])
146153

147154
header_params = {}
148155

@@ -274,8 +281,15 @@ def create_order_with_http_info(self, create_order_request, **kwargs): # noqa:
274281
path_params = {}
275282

276283
query_params = []
284+
285+
# do not add duplicate keys to query_params list
286+
existing_keys = []
287+
for param in query_params:
288+
existing_keys.append(param[0])
289+
277290
for key in kwargs:
278-
query_params.append([key, kwargs.get(key)])
291+
if key not in existing_keys:
292+
query_params.append([key, kwargs.get(key)])
279293

280294
header_params = {}
281295

@@ -413,8 +427,15 @@ def place_order_with_http_info(self, id, **kwargs): # noqa: E501
413427
path_params["id"] = local_var_params["id"] # noqa: E501
414428

415429
query_params = []
430+
431+
# do not add duplicate keys to query_params list
432+
existing_keys = []
433+
for param in query_params:
434+
existing_keys.append(param[0])
435+
416436
for key in kwargs:
417-
query_params.append([key, kwargs.get(key)])
437+
if key not in existing_keys:
438+
query_params.append([key, kwargs.get(key)])
418439

419440
header_params = {}
420441

@@ -543,8 +564,15 @@ def retrieve_order_with_http_info(self, id, **kwargs): # noqa: E501
543564
path_params["id"] = local_var_params["id"] # noqa: E501
544565

545566
query_params = []
567+
568+
# do not add duplicate keys to query_params list
569+
existing_keys = []
570+
for param in query_params:
571+
existing_keys.append(param[0])
572+
546573
for key in kwargs:
547-
query_params.append([key, kwargs.get(key)])
574+
if key not in existing_keys:
575+
query_params.append([key, kwargs.get(key)])
548576

549577
header_params = {}
550578

@@ -591,6 +619,9 @@ def retrieve_orders(self, **kwargs): # noqa: E501
591619
592620
:param async_req bool: execute request asynchronously
593621
:param int page:
622+
:param str metadata:
623+
:param str metadata_example1:
624+
:param str metadata_example2:
594625
:param _preload_content: if False, the urllib3.HTTPResponse object will
595626
be returned without reading/decoding response
596627
data. Default is True.
@@ -616,6 +647,9 @@ def retrieve_orders_with_http_info(self, **kwargs): # noqa: E501
616647
617648
:param async_req bool: execute request asynchronously
618649
:param int page:
650+
:param str metadata:
651+
:param str metadata_example1:
652+
:param str metadata_example2:
619653
:param _return_http_data_only: response data without head status code
620654
and headers
621655
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -632,7 +666,12 @@ def retrieve_orders_with_http_info(self, **kwargs): # noqa: E501
632666

633667
local_var_params = locals()
634668

635-
all_params = ["page"] # noqa: E501
669+
all_params = [
670+
"page",
671+
"metadata",
672+
"metadata_example1",
673+
"metadata_example2",
674+
] # noqa: E501
636675
all_params.append("async_req")
637676
all_params.append("_return_http_data_only")
638677
all_params.append("_preload_content")
@@ -666,10 +705,29 @@ def retrieve_orders_with_http_info(self, **kwargs): # noqa: E501
666705
path_params = {}
667706

668707
query_params = []
669-
for key in kwargs:
670-
query_params.append([key, kwargs.get(key)])
671708
if "page" in local_var_params:
672709
query_params.append(("page", local_var_params["page"])) # noqa: E501
710+
if "metadata" in local_var_params:
711+
query_params.append(
712+
("metadata", local_var_params["metadata"])
713+
) # noqa: E501
714+
if "metadata_example1" in local_var_params:
715+
query_params.append(
716+
("metadata[example1]", local_var_params["metadata_example1"])
717+
) # noqa: E501
718+
if "metadata_example2" in local_var_params:
719+
query_params.append(
720+
("metadata[example2]", local_var_params["metadata_example2"])
721+
) # noqa: E501
722+
723+
# do not add duplicate keys to query_params list
724+
existing_keys = []
725+
for param in query_params:
726+
existing_keys.append(param[0])
727+
728+
for key in kwargs:
729+
if key not in existing_keys:
730+
query_params.append([key, kwargs.get(key)])
673731

674732
header_params = {}
675733

patch_api/api/preferences_api.py

+33-5
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,15 @@ def create_preference_with_http_info(
146146
path_params = {}
147147

148148
query_params = []
149+
150+
# do not add duplicate keys to query_params list
151+
existing_keys = []
152+
for param in query_params:
153+
existing_keys.append(param[0])
154+
149155
for key in kwargs:
150-
query_params.append([key, kwargs.get(key)])
156+
if key not in existing_keys:
157+
query_params.append([key, kwargs.get(key)])
151158

152159
header_params = {}
153160

@@ -285,8 +292,15 @@ def delete_preference_with_http_info(self, id, **kwargs): # noqa: E501
285292
path_params["id"] = local_var_params["id"] # noqa: E501
286293

287294
query_params = []
295+
296+
# do not add duplicate keys to query_params list
297+
existing_keys = []
298+
for param in query_params:
299+
existing_keys.append(param[0])
300+
288301
for key in kwargs:
289-
query_params.append([key, kwargs.get(key)])
302+
if key not in existing_keys:
303+
query_params.append([key, kwargs.get(key)])
290304

291305
header_params = {}
292306

@@ -415,8 +429,15 @@ def retrieve_preference_with_http_info(self, id, **kwargs): # noqa: E501
415429
path_params["id"] = local_var_params["id"] # noqa: E501
416430

417431
query_params = []
432+
433+
# do not add duplicate keys to query_params list
434+
existing_keys = []
435+
for param in query_params:
436+
existing_keys.append(param[0])
437+
418438
for key in kwargs:
419-
query_params.append([key, kwargs.get(key)])
439+
if key not in existing_keys:
440+
query_params.append([key, kwargs.get(key)])
420441

421442
header_params = {}
422443

@@ -538,11 +559,18 @@ def retrieve_preferences_with_http_info(self, **kwargs): # noqa: E501
538559
path_params = {}
539560

540561
query_params = []
541-
for key in kwargs:
542-
query_params.append([key, kwargs.get(key)])
543562
if "page" in local_var_params:
544563
query_params.append(("page", local_var_params["page"])) # noqa: E501
545564

565+
# do not add duplicate keys to query_params list
566+
existing_keys = []
567+
for param in query_params:
568+
existing_keys.append(param[0])
569+
570+
for key in kwargs:
571+
if key not in existing_keys:
572+
query_params.append([key, kwargs.get(key)])
573+
546574
header_params = {}
547575

548576
form_params = []

0 commit comments

Comments
 (0)