Skip to content

Commit add7067

Browse files
committed
set currency_pair spot order book as required
1 parent 89ff3d4 commit add7067

48 files changed

Lines changed: 81 additions & 77 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API
33

44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

6-
- API version: 4.5.1
7-
- Package version: 4.5.1
6+
- API version: 4.5.2
7+
- Package version: 4.5.2
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://gate.io/page/contacts](https://gate.io/page/contacts)
1010

@@ -18,9 +18,9 @@ Python 2.7 and 3.4+
1818
If the python package is hosted on Github, you can install directly from Github
1919

2020
```sh
21-
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
21+
pip install git+https://github.com/gateio/gateapi-python.git
2222
```
23-
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
23+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/gateio/gateapi-python.git`)
2424

2525
Then import the package:
2626
```python

docs/MarginApi.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ configuration.secret = 'YOUR_API_SECRET'
4141

4242
# create an instance of the API class
4343
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
44-
loan_id = 'loan_id_example' # str | Loan ID
44+
loan_id = '12345' # str | Loan ID
4545
currency = 'BTC' # str | Retrieved specified currency related data
4646

4747
try:
@@ -141,7 +141,7 @@ configuration.secret = 'YOUR_API_SECRET'
141141

142142
# create an instance of the API class
143143
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
144-
loan_id = 'loan_id_example' # str | Loan ID
144+
loan_id = '12345' # str | Loan ID
145145
side = 'lend' # str | Lend or borrow
146146

147147
try:
@@ -192,8 +192,8 @@ configuration.secret = 'YOUR_API_SECRET'
192192

193193
# create an instance of the API class
194194
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
195-
loan_record_id = 'loan_record_id_example' # str | Loan record ID
196-
loan_id = 'loan_id_example' # str | Loan ID
195+
loan_record_id = '12345' # str | Loan record ID
196+
loan_id = '12345' # str | Loan ID
197197

198198
try:
199199
# Get one single loan record
@@ -337,8 +337,8 @@ configuration.secret = 'YOUR_API_SECRET'
337337

338338
# create an instance of the API class
339339
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
340-
loan_id = 'loan_id_example' # str | Loan ID
341-
status = 'status_example' # str | Loan record status (optional)
340+
loan_id = '12345' # str | Loan ID
341+
status = 'loaned' # str | Loan record status (optional)
342342
page = 1 # int | Page number (optional) (default to 1)
343343
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)
344344

@@ -392,7 +392,7 @@ configuration.secret = 'YOUR_API_SECRET'
392392

393393
# create an instance of the API class
394394
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
395-
loan_id = 'loan_id_example' # str | Loan ID
395+
loan_id = '12345' # str | Loan ID
396396

397397
try:
398398
# List loan repayment records
@@ -639,7 +639,7 @@ configuration.secret = 'YOUR_API_SECRET'
639639

640640
# create an instance of the API class
641641
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
642-
loan_id = 'loan_id_example' # str | Loan ID
642+
loan_id = '12345' # str | Loan ID
643643
repay_request = gate_api.RepayRequest() # RepayRequest |
644644

645645
try:
@@ -692,7 +692,7 @@ configuration.secret = 'YOUR_API_SECRET'
692692

693693
# create an instance of the API class
694694
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
695-
loan_id = 'loan_id_example' # str | Loan ID
695+
loan_id = '12345' # str | Loan ID
696696
loan_patch = gate_api.LoanPatch() # LoanPatch |
697697

698698
try:
@@ -745,7 +745,7 @@ configuration.secret = 'YOUR_API_SECRET'
745745

746746
# create an instance of the API class
747747
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
748-
loan_record_id = 'loan_record_id_example' # str | Loan record ID
748+
loan_record_id = '12345' # str | Loan record ID
749749
loan_patch = gate_api.LoanPatch() # LoanPatch |
750750

751751
try:

docs/SpotApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ Authentication with API key and secret is required
416416
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
417417

418418
# **list_order_book**
419-
> OrderBook list_order_book(currency_pair=currency_pair, interval=interval, limit=limit)
419+
> OrderBook list_order_book(currency_pair, interval=interval, limit=limit)
420420
421421
Retrieve order book
422422

@@ -431,13 +431,13 @@ from gate_api.rest import ApiException
431431

432432
# create an instance of the API class
433433
api_instance = gate_api.SpotApi()
434-
currency_pair = 'BTC_USDT' # str | Currency pair (optional)
434+
currency_pair = 'BTC_USDT' # str | Currency pair
435435
interval = '0' # str | Price precision of order book. 0 means no aggregation is applied (optional) (default to '0')
436436
limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10)
437437

438438
try:
439439
# Retrieve order book
440-
api_response = api_instance.list_order_book(currency_pair=currency_pair, interval=interval, limit=limit)
440+
api_response = api_instance.list_order_book(currency_pair, interval=interval, limit=limit)
441441
print(api_response)
442442
except ApiException as e:
443443
print("Exception when calling SpotApi->list_order_book: %s\n" % e)
@@ -447,7 +447,7 @@ except ApiException as e:
447447

448448
Name | Type | Description | Notes
449449
------------- | ------------- | ------------- | -------------
450-
**currency_pair** | **str**| Currency pair | [optional]
450+
**currency_pair** | **str**| Currency pair |
451451
**interval** | **str**| Price precision of order book. 0 means no aggregation is applied | [optional] [default to '0']
452452
**limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10]
453453

gate_api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
88
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
99
10-
OpenAPI spec version: 4.5.1
10+
OpenAPI spec version: 4.5.2
1111
Contact: support@mail.gate.io
1212
Generated by: https://openapi-generator.tech
1313
"""
1414

1515

1616
from __future__ import absolute_import
1717

18-
__version__ = "4.5.1"
18+
__version__ = "4.5.2"
1919

2020
# import apis into sdk package
2121
from gate_api.api.futures_api import FuturesApi

gate_api/api/futures_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
77
8-
OpenAPI spec version: 4.5.1
8+
OpenAPI spec version: 4.5.2
99
Contact: support@mail.gate.io
1010
Generated by: https://openapi-generator.tech
1111
"""

gate_api/api/margin_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
77
8-
OpenAPI spec version: 4.5.1
8+
OpenAPI spec version: 4.5.2
99
Contact: support@mail.gate.io
1010
Generated by: https://openapi-generator.tech
1111
"""

gate_api/api/spot_api.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
77
8-
OpenAPI spec version: 4.5.1
8+
OpenAPI spec version: 4.5.2
99
Contact: support@mail.gate.io
1010
Generated by: https://openapi-generator.tech
1111
"""
@@ -837,17 +837,17 @@ def list_my_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501
837837
_request_timeout=local_var_params.get('_request_timeout'),
838838
collection_formats=collection_formats)
839839

840-
def list_order_book(self, **kwargs): # noqa: E501
840+
def list_order_book(self, currency_pair, **kwargs): # noqa: E501
841841
"""Retrieve order book # noqa: E501
842842
843843
Order book will be sorted by price from high to low on bids; reversed on asks # noqa: E501
844844
This method makes a synchronous HTTP request by default. To make an
845845
asynchronous HTTP request, please pass async_req=True
846-
>>> thread = api.list_order_book(async_req=True)
846+
>>> thread = api.list_order_book(currency_pair, async_req=True)
847847
>>> result = thread.get()
848848
849849
:param async_req bool
850-
:param str currency_pair: Currency pair
850+
:param str currency_pair: Currency pair (required)
851851
:param str interval: Price precision of order book. 0 means no aggregation is applied
852852
:param int limit: Maximum number of order depth data in asks or bids
853853
:return: OrderBook
@@ -856,22 +856,22 @@ def list_order_book(self, **kwargs): # noqa: E501
856856
"""
857857
kwargs['_return_http_data_only'] = True
858858
if kwargs.get('async_req'):
859-
return self.list_order_book_with_http_info(**kwargs) # noqa: E501
859+
return self.list_order_book_with_http_info(currency_pair, **kwargs) # noqa: E501
860860
else:
861-
(data) = self.list_order_book_with_http_info(**kwargs) # noqa: E501
861+
(data) = self.list_order_book_with_http_info(currency_pair, **kwargs) # noqa: E501
862862
return data
863863

864-
def list_order_book_with_http_info(self, **kwargs): # noqa: E501
864+
def list_order_book_with_http_info(self, currency_pair, **kwargs): # noqa: E501
865865
"""Retrieve order book # noqa: E501
866866
867867
Order book will be sorted by price from high to low on bids; reversed on asks # noqa: E501
868868
This method makes a synchronous HTTP request by default. To make an
869869
asynchronous HTTP request, please pass async_req=True
870-
>>> thread = api.list_order_book_with_http_info(async_req=True)
870+
>>> thread = api.list_order_book_with_http_info(currency_pair, async_req=True)
871871
>>> result = thread.get()
872872
873873
:param async_req bool
874-
:param str currency_pair: Currency pair
874+
:param str currency_pair: Currency pair (required)
875875
:param str interval: Price precision of order book. 0 means no aggregation is applied
876876
:param int limit: Maximum number of order depth data in asks or bids
877877
:return: OrderBook
@@ -895,6 +895,10 @@ def list_order_book_with_http_info(self, **kwargs): # noqa: E501
895895
)
896896
local_var_params[key] = val
897897
del local_var_params['kwargs']
898+
# verify the required parameter 'currency_pair' is set
899+
if ('currency_pair' not in local_var_params or
900+
local_var_params['currency_pair'] is None):
901+
raise ValueError("Missing the required parameter `currency_pair` when calling `list_order_book`") # noqa: E501
898902

899903
if 'limit' in local_var_params and local_var_params['limit'] > 30: # noqa: E501
900904
raise ValueError("Invalid value for parameter `limit` when calling `list_order_book`, must be a value less than or equal to `30`") # noqa: E501

gate_api/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
66
7-
OpenAPI spec version: 4.5.1
7+
OpenAPI spec version: 4.5.2
88
Contact: support@mail.gate.io
99
Generated by: https://openapi-generator.tech
1010
"""
@@ -76,7 +76,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7676
self.default_headers[header_name] = header_value
7777
self.cookie = cookie
7878
# Set default User-Agent.
79-
self.user_agent = 'OpenAPI-Generator/4.5.1/python'
79+
self.user_agent = 'OpenAPI-Generator/4.5.2/python'
8080

8181
def __del__(self):
8282
if self._pool:

gate_api/configuration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
77
8-
OpenAPI spec version: 4.5.1
8+
OpenAPI spec version: 4.5.2
99
Contact: support@mail.gate.io
1010
Generated by: https://openapi-generator.tech
1111
"""
@@ -249,6 +249,6 @@ def to_debug_report(self):
249249
return "Python SDK Debug Report:\n"\
250250
"OS: {env}\n"\
251251
"Python Version: {pyversion}\n"\
252-
"Version of the API: 4.5.1\n"\
253-
"SDK Package Version: 4.5.1".\
252+
"Version of the API: 4.5.2\n"\
253+
"SDK Package Version: 4.5.2".\
254254
format(env=sys.platform, pyversion=sys.version)

gate_api/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
88
9-
OpenAPI spec version: 4.5.1
9+
OpenAPI spec version: 4.5.2
1010
Contact: support@mail.gate.io
1111
Generated by: https://openapi-generator.tech
1212
"""

0 commit comments

Comments
 (0)