Skip to content

Commit eb7057a

Browse files
committed
fix missing settle in list_positions
1 parent 3ba3404 commit eb7057a

7 files changed

Lines changed: 29 additions & 17 deletions

File tree

README.md

Lines changed: 2 additions & 2 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.8.0
7-
- Package version: 4.8.0
6+
- API version: 4.8.1
7+
- Package version: 4.8.1
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
1010

docs/FuturesApi.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ Authentication with API key and secret is required
12281228
[[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)
12291229

12301230
# **list_positions**
1231-
> list[Position] list_positions()
1231+
> list[Position] list_positions(settle)
12321232
12331233
List all positions of a user
12341234

@@ -1245,17 +1245,21 @@ configuration.secret = 'YOUR_API_SECRET'
12451245

12461246
# create an instance of the API class
12471247
api_instance = gate_api.FuturesApi(gate_api.ApiClient(configuration))
1248+
settle = 'btc' # str | Settle currency (default to 'btc')
12481249

12491250
try:
12501251
# List all positions of a user
1251-
api_response = api_instance.list_positions()
1252+
api_response = api_instance.list_positions(settle)
12521253
print(api_response)
12531254
except ApiException as e:
12541255
print("Exception when calling FuturesApi->list_positions: %s\n" % e)
12551256
```
12561257

12571258
### Parameters
1258-
This endpoint does not need any parameter.
1259+
1260+
Name | Type | Description | Notes
1261+
------------- | ------------- | ------------- | -------------
1262+
**settle** | **str**| Settle currency | [default to 'btc']
12591263

12601264
### Return type
12611265

gate_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import absolute_import
1616

17-
__version__ = "4.8.0"
17+
__version__ = "4.8.1"
1818

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

gate_api/api/futures_api.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,43 +2488,45 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501
24882488
_request_timeout=local_var_params.get('_request_timeout'),
24892489
collection_formats=collection_formats)
24902490

2491-
def list_positions(self, **kwargs): # noqa: E501
2491+
def list_positions(self, settle, **kwargs): # noqa: E501
24922492
"""List all positions of a user # noqa: E501
24932493
24942494
This method makes a synchronous HTTP request by default. To make an
24952495
asynchronous HTTP request, please pass async_req=True
2496-
>>> thread = api.list_positions(async_req=True)
2496+
>>> thread = api.list_positions(settle, async_req=True)
24972497
>>> result = thread.get()
24982498
24992499
:param async_req bool
2500+
:param str settle: Settle currency (required)
25002501
:return: list[Position]
25012502
If the method is called asynchronously,
25022503
returns the request thread.
25032504
"""
25042505
kwargs['_return_http_data_only'] = True
25052506
if kwargs.get('async_req'):
2506-
return self.list_positions_with_http_info(**kwargs) # noqa: E501
2507+
return self.list_positions_with_http_info(settle, **kwargs) # noqa: E501
25072508
else:
2508-
(data) = self.list_positions_with_http_info(**kwargs) # noqa: E501
2509+
(data) = self.list_positions_with_http_info(settle, **kwargs) # noqa: E501
25092510
return data
25102511

2511-
def list_positions_with_http_info(self, **kwargs): # noqa: E501
2512+
def list_positions_with_http_info(self, settle, **kwargs): # noqa: E501
25122513
"""List all positions of a user # noqa: E501
25132514
25142515
This method makes a synchronous HTTP request by default. To make an
25152516
asynchronous HTTP request, please pass async_req=True
2516-
>>> thread = api.list_positions_with_http_info(async_req=True)
2517+
>>> thread = api.list_positions_with_http_info(settle, async_req=True)
25172518
>>> result = thread.get()
25182519
25192520
:param async_req bool
2521+
:param str settle: Settle currency (required)
25202522
:return: list[Position]
25212523
If the method is called asynchronously,
25222524
returns the request thread.
25232525
"""
25242526

25252527
local_var_params = locals()
25262528

2527-
all_params = [] # noqa: E501
2529+
all_params = ['settle'] # noqa: E501
25282530
all_params.append('async_req')
25292531
all_params.append('_return_http_data_only')
25302532
all_params.append('_preload_content')
@@ -2538,10 +2540,16 @@ def list_positions_with_http_info(self, **kwargs): # noqa: E501
25382540
)
25392541
local_var_params[key] = val
25402542
del local_var_params['kwargs']
2543+
# verify the required parameter 'settle' is set
2544+
if ('settle' not in local_var_params or
2545+
local_var_params['settle'] is None):
2546+
raise ValueError("Missing the required parameter `settle` when calling `list_positions`") # noqa: E501
25412547

25422548
collection_formats = {}
25432549

25442550
path_params = {}
2551+
if 'settle' in local_var_params:
2552+
path_params['settle'] = local_var_params['settle'] # noqa: E501
25452553

25462554
query_params = []
25472555

gate_api/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7575
self.default_headers[header_name] = header_value
7676
self.cookie = cookie
7777
# Set default User-Agent.
78-
self.user_agent = 'OpenAPI-Generator/4.8.0/python'
78+
self.user_agent = 'OpenAPI-Generator/4.8.1/python'
7979

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

gate_api/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,6 @@ def to_debug_report(self):
248248
return "Python SDK Debug Report:\n"\
249249
"OS: {env}\n"\
250250
"Python Version: {pyversion}\n"\
251-
"Version of the API: 4.8.0\n"\
252-
"SDK Package Version: 4.8.0".\
251+
"Version of the API: 4.8.1\n"\
252+
"SDK Package Version: 4.8.1".\
253253
format(env=sys.platform, pyversion=sys.version)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from setuptools import setup, find_packages # noqa: H301
1414

1515
NAME = "gate-api"
16-
VERSION = "4.8.0"
16+
VERSION = "4.8.1"
1717
# To install the library, run the following
1818
#
1919
# python setup.py install

0 commit comments

Comments
 (0)