# coding: utf-8 """ Gate API Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from gate_api.api_client import ApiClient from gate_api.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) class OptionsApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def list_options_underlyings(self, **kwargs): # noqa: E501 """List all underlying assets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_underlyings(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsUnderlying] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_underlyings_with_http_info(**kwargs) # noqa: E501 def list_options_underlyings_with_http_info(self, **kwargs): # noqa: E501 """List all underlying assets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_underlyings_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsUnderlying], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_underlyings" % k ) local_var_params[k] = v del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/underlyings', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsUnderlying]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_expirations(self, underlying, **kwargs): # noqa: E501 """List all expiration dates # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_expirations(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[int] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_expirations_with_http_info(underlying, **kwargs) # noqa: E501 def list_options_expirations_with_http_info(self, underlying, **kwargs): # noqa: E501 """List all expiration dates # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_expirations_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[int], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_expirations" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_expirations`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/expirations', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[int]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_contracts(self, underlying, **kwargs): # noqa: E501 """List all contracts for specified underlying and expiration date # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_contracts(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int expiration: Unix timestamp of expiration date :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsContract] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_contracts_with_http_info(underlying, **kwargs) # noqa: E501 def list_options_contracts_with_http_info(self, underlying, **kwargs): # noqa: E501 """List all contracts for specified underlying and expiration date # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_contracts_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int expiration: Unix timestamp of expiration date :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsContract], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying', 'expiration' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_contracts" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_contracts`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'expiration' in local_var_params and local_var_params['expiration'] is not None: # noqa: E501 query_params.append(('expiration', local_var_params['expiration'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/contracts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsContract]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_options_contract(self, contract, **kwargs): # noqa: E501 """Query specified contract details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_contract(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsContract :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_options_contract_with_http_info(contract, **kwargs) # noqa: E501 def get_options_contract_with_http_info(self, contract, **kwargs): # noqa: E501 """Query specified contract details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_contract_with_http_info(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsContract, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'contract' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_options_contract" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `contract` when calling `get_options_contract`") # noqa: E501 collection_formats = {} path_params = {} if 'contract' in local_var_params: path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/contracts/{contract}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsContract', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_settlements(self, underlying, **kwargs): # noqa: E501 """List settlement history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_settlements(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsSettlement] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_settlements_with_http_info(underlying, **kwargs) # noqa: E501 def list_options_settlements_with_http_info(self, underlying, **kwargs): # noqa: E501 """List settlement history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_settlements_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsSettlement], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying', 'limit', 'offset', '_from', 'to' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_settlements" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_settlements`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_settlements`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_settlements`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 raise ApiValueError("Invalid value for parameter `offset` when calling `list_options_settlements`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/settlements', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsSettlement]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_options_settlement(self, contract, underlying, at, **kwargs): # noqa: E501 """Get specified contract settlement information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_settlement(contract, underlying, at, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: (required) :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int at: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsSettlement :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_options_settlement_with_http_info(contract, underlying, at, **kwargs) # noqa: E501 def get_options_settlement_with_http_info(self, contract, underlying, at, **kwargs): # noqa: E501 """Get specified contract settlement information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_settlement_with_http_info(contract, underlying, at, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: (required) :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int at: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsSettlement, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'contract', 'underlying', 'at' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_options_settlement" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `contract` when calling `get_options_settlement`") # noqa: E501 # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `get_options_settlement`") # noqa: E501 # verify the required parameter 'at' is set if self.api_client.client_side_validation and ('at' not in local_var_params or # noqa: E501 local_var_params['at'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `at` when calling `get_options_settlement`") # noqa: E501 collection_formats = {} path_params = {} if 'contract' in local_var_params: path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'at' in local_var_params and local_var_params['at'] is not None: # noqa: E501 query_params.append(('at', local_var_params['at'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/settlements/{contract}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsSettlement', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_my_options_settlements(self, underlying, **kwargs): # noqa: E501 """Query personal settlement records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_my_options_settlements(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param str contract: Options contract name :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsMySettlements] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_my_options_settlements_with_http_info(underlying, **kwargs) # noqa: E501 def list_my_options_settlements_with_http_info(self, underlying, **kwargs): # noqa: E501 """Query personal settlement records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_my_options_settlements_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param str contract: Options contract name :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsMySettlements], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying', 'contract', 'limit', 'offset', '_from', 'to' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_my_options_settlements" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_my_options_settlements`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_my_options_settlements`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_my_options_settlements`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 raise ApiValueError("Invalid value for parameter `offset` when calling `list_my_options_settlements`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/my_settlements', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsMySettlements]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_order_book(self, contract, **kwargs): # noqa: E501 """Query options contract order book # noqa: E501 Bids will be sorted by price from high to low, while asks sorted reversely # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_order_book(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name (required) :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.FuturesOrderBook :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_order_book_with_http_info(contract, **kwargs) # noqa: E501 def list_options_order_book_with_http_info(self, contract, **kwargs): # noqa: E501 """Query options contract order book # noqa: E501 Bids will be sorted by price from high to low, while asks sorted reversely # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_order_book_with_http_info(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name (required) :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.FuturesOrderBook, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'contract', 'interval', 'limit', 'with_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_order_book" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `contract` when calling `list_options_order_book`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 50: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_order_book`, must be a value less than or equal to `50`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_order_book`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 query_params.append(('interval', local_var_params['interval'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'with_id' in local_var_params and local_var_params['with_id'] is not None: # noqa: E501 query_params.append(('with_id', local_var_params['with_id'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/order_book', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='FuturesOrderBook', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_tickers(self, underlying, **kwargs): # noqa: E501 """Query options market ticker information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_tickers(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsTicker] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_tickers_with_http_info(underlying, **kwargs) # noqa: E501 def list_options_tickers_with_http_info(self, underlying, **kwargs): # noqa: E501 """Query options market ticker information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_tickers_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsTicker], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_tickers" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_tickers`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/tickers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsTicker]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_underlying_tickers(self, underlying, **kwargs): # noqa: E501 """Query underlying ticker information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_underlying_tickers(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsUnderlyingTicker :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_underlying_tickers_with_http_info(underlying, **kwargs) # noqa: E501 def list_options_underlying_tickers_with_http_info(self, underlying, **kwargs): # noqa: E501 """Query underlying ticker information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_underlying_tickers_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsUnderlyingTicker, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_underlying_tickers" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_underlying_tickers`") # noqa: E501 collection_formats = {} path_params = {} if 'underlying' in local_var_params: path_params['underlying'] = local_var_params['underlying'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/underlying/tickers/{underlying}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsUnderlyingTicker', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_candlesticks(self, contract, **kwargs): # noqa: E501 """Options contract market candlestick chart # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_candlesticks(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name (required) :param int limit: Maximum number of records returned in a single list :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param str interval: Time interval between data points :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsCandlestick] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_candlesticks_with_http_info(contract, **kwargs) # noqa: E501 def list_options_candlesticks_with_http_info(self, contract, **kwargs): # noqa: E501 """Options contract market candlestick chart # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_candlesticks_with_http_info(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name (required) :param int limit: Maximum number of records returned in a single list :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param str interval: Time interval between data points :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsCandlestick], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'contract', 'limit', '_from', 'to', 'interval' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_candlesticks" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `contract` when calling `list_options_candlesticks`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_candlesticks`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_candlesticks`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 if 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 query_params.append(('interval', local_var_params['interval'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/candlesticks', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsCandlestick]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_underlying_candlesticks(self, underlying, **kwargs): # noqa: E501 """Underlying index price candlestick chart # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_underlying_candlesticks(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int limit: Maximum number of records returned in a single list :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param str interval: Time interval between data points :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.FuturesCandlestick] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_underlying_candlesticks_with_http_info(underlying, **kwargs) # noqa: E501 def list_options_underlying_candlesticks_with_http_info(self, underlying, **kwargs): # noqa: E501 """Underlying index price candlestick chart # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_underlying_candlesticks_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param int limit: Maximum number of records returned in a single list :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param str interval: Time interval between data points :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.FuturesCandlestick], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying', 'limit', '_from', 'to', 'interval' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_underlying_candlesticks" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_underlying_candlesticks`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_underlying_candlesticks`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_underlying_candlesticks`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 if 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 query_params.append(('interval', local_var_params['interval'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/underlying/candlesticks', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[FuturesCandlestick]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_trades(self, **kwargs): # noqa: E501 """Market trade records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_trades(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name :param str type: `C` for call, `P` for put :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.FuturesTrade] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_trades_with_http_info(**kwargs) # noqa: E501 def list_options_trades_with_http_info(self, **kwargs): # noqa: E501 """Market trade records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_trades_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name :param str type: `C` for call, `P` for put :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.FuturesTrade], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'contract', 'type', 'limit', 'offset', '_from', 'to' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_trades" % k ) local_var_params[k] = v del local_var_params['kwargs'] if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_trades`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_trades`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 raise ApiValueError("Invalid value for parameter `offset` when calling `list_options_trades`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 query_params.append(('type', local_var_params['type'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/options/trades', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[FuturesTrade]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_account(self, **kwargs): # noqa: E501 """Query account information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_account(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsAccount :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_account_with_http_info(**kwargs) # noqa: E501 def list_options_account_with_http_info(self, **kwargs): # noqa: E501 """Query account information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_account_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsAccount, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_account" % k ) local_var_params[k] = v del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/accounts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsAccount', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_account_book(self, **kwargs): # noqa: E501 """Query account change history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_account_book(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param str type: Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsAccountBook] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_account_book_with_http_info(**kwargs) # noqa: E501 def list_options_account_book_with_http_info(self, **kwargs): # noqa: E501 """Query account change history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_account_book_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param str type: Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsAccountBook], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'limit', 'offset', '_from', 'to', 'type' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_account_book" % k ) local_var_params[k] = v del local_var_params['kwargs'] if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_account_book`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_account_book`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 raise ApiValueError("Invalid value for parameter `offset` when calling `list_options_account_book`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 query_params.append(('type', local_var_params['type'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/account_book', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsAccountBook]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_positions(self, **kwargs): # noqa: E501 """List user's positions of specified underlying # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_positions(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsPosition] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_positions_with_http_info(**kwargs) # noqa: E501 def list_options_positions_with_http_info(self, **kwargs): # noqa: E501 """List user's positions of specified underlying # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_positions_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsPosition], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_positions" % k ) local_var_params[k] = v del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/positions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsPosition]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_options_position(self, contract, **kwargs): # noqa: E501 """Get specified contract position # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_position(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsPosition :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_options_position_with_http_info(contract, **kwargs) # noqa: E501 def get_options_position_with_http_info(self, contract, **kwargs): # noqa: E501 """Get specified contract position # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_position_with_http_info(contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsPosition, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'contract' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_options_position" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `contract` when calling `get_options_position`") # noqa: E501 collection_formats = {} path_params = {} if 'contract' in local_var_params: path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/positions/{contract}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsPosition', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_position_close(self, underlying, **kwargs): # noqa: E501 """List user's liquidation history of specified underlying # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_position_close(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param str contract: Options contract name :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsPositionClose] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_position_close_with_http_info(underlying, **kwargs) # noqa: E501 def list_options_position_close_with_http_info(self, underlying, **kwargs): # noqa: E501 """List user's liquidation history of specified underlying # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_position_close_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param str contract: Options contract name :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsPositionClose], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying', 'contract' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_position_close" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_position_close`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/position_close', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsPositionClose]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_options_orders(self, status, **kwargs): # noqa: E501 """List options orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_orders(status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str status: Query order list based on status (required) :param str contract: Options contract name :param str underlying: Underlying :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsOrder] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_options_orders_with_http_info(status, **kwargs) # noqa: E501 def list_options_orders_with_http_info(self, status, **kwargs): # noqa: E501 """List options orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_options_orders_with_http_info(status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str status: Query order list based on status (required) :param str contract: Options contract name :param str underlying: Underlying :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsOrder], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'status', 'contract', 'underlying', 'limit', 'offset', '_from', 'to' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_options_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'status' is set if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 local_var_params['status'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `status` when calling `list_options_orders`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_orders`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_orders`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 raise ApiValueError("Invalid value for parameter `offset` when calling `list_options_orders`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 query_params.append(('status', local_var_params['status'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/orders', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsOrder]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def create_options_order(self, options_order, **kwargs): # noqa: E501 """Create an options order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_options_order(options_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param OptionsOrder options_order: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsOrder :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.create_options_order_with_http_info(options_order, **kwargs) # noqa: E501 def create_options_order_with_http_info(self, options_order, **kwargs): # noqa: E501 """Create an options order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_options_order_with_http_info(options_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param OptionsOrder options_order: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsOrder, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'options_order' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_options_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'options_order' is set if self.api_client.client_side_validation and ('options_order' not in local_var_params or # noqa: E501 local_var_params['options_order'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `options_order` when calling `create_options_order`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'options_order' in local_var_params: body_params = local_var_params['options_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/orders', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsOrder', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def cancel_options_orders(self, **kwargs): # noqa: E501 """Cancel all orders with 'open' status # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.cancel_options_orders(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name :param str underlying: Underlying :param str side: Specify all bids or all asks, both included if not specified :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsOrder] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.cancel_options_orders_with_http_info(**kwargs) # noqa: E501 def cancel_options_orders_with_http_info(self, **kwargs): # noqa: E501 """Cancel all orders with 'open' status # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.cancel_options_orders_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str contract: Options contract name :param str underlying: Underlying :param str side: Specify all bids or all asks, both included if not specified :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsOrder], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'contract', 'underlying', 'side' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method cancel_options_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 query_params.append(('side', local_var_params['side'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/orders', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsOrder]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_options_order(self, order_id, **kwargs): # noqa: E501 """Query single order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_order(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param int order_id: Order ID returned when order is successfully created (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsOrder :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_options_order_with_http_info(order_id, **kwargs) # noqa: E501 def get_options_order_with_http_info(self, order_id, **kwargs): # noqa: E501 """Query single order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_order_with_http_info(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param int order_id: Order ID returned when order is successfully created (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsOrder, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'order_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_options_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'order_id' is set if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 local_var_params['order_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `get_options_order`") # noqa: E501 collection_formats = {} path_params = {} if 'order_id' in local_var_params: path_params['order_id'] = local_var_params['order_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/orders/{order_id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsOrder', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def cancel_options_order(self, order_id, **kwargs): # noqa: E501 """Cancel single order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.cancel_options_order(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param int order_id: Order ID returned when order is successfully created (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsOrder :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.cancel_options_order_with_http_info(order_id, **kwargs) # noqa: E501 def cancel_options_order_with_http_info(self, order_id, **kwargs): # noqa: E501 """Cancel single order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.cancel_options_order_with_http_info(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param int order_id: Order ID returned when order is successfully created (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsOrder, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'order_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method cancel_options_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'order_id' is set if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 local_var_params['order_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_options_order`") # noqa: E501 collection_formats = {} path_params = {} if 'order_id' in local_var_params: path_params['order_id'] = local_var_params['order_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/orders/{order_id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsOrder', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def countdown_cancel_all_options(self, countdown_cancel_all_options_task, **kwargs): # noqa: E501 """Countdown cancel orders # noqa: E501 Option order heartbeat detection, when the `timeout` time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related `option pending order` will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown `timeout` set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the `underlying` `contract` you specified will be automatically cancelled. If `underlying` `contract` is not specified, user will be automatically cancelled If `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.countdown_cancel_all_options(countdown_cancel_all_options_task, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param CountdownCancelAllOptionsTask countdown_cancel_all_options_task: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.TriggerTime :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.countdown_cancel_all_options_with_http_info(countdown_cancel_all_options_task, **kwargs) # noqa: E501 def countdown_cancel_all_options_with_http_info(self, countdown_cancel_all_options_task, **kwargs): # noqa: E501 """Countdown cancel orders # noqa: E501 Option order heartbeat detection, when the `timeout` time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related `option pending order` will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown `timeout` set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the `underlying` `contract` you specified will be automatically cancelled. If `underlying` `contract` is not specified, user will be automatically cancelled If `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.countdown_cancel_all_options_with_http_info(countdown_cancel_all_options_task, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param CountdownCancelAllOptionsTask countdown_cancel_all_options_task: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.TriggerTime, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'countdown_cancel_all_options_task' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method countdown_cancel_all_options" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'countdown_cancel_all_options_task' is set if self.api_client.client_side_validation and ('countdown_cancel_all_options_task' not in local_var_params or # noqa: E501 local_var_params['countdown_cancel_all_options_task'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `countdown_cancel_all_options_task` when calling `countdown_cancel_all_options`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'countdown_cancel_all_options_task' in local_var_params: body_params = local_var_params['countdown_cancel_all_options_task'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/countdown_cancel_all', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TriggerTime', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_my_options_trades(self, underlying, **kwargs): # noqa: E501 """Query personal trading records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_my_options_trades(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param str contract: Options contract name :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsMyTrade] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_my_options_trades_with_http_info(underlying, **kwargs) # noqa: E501 def list_my_options_trades_with_http_info(self, underlying, **kwargs): # noqa: E501 """Query personal trading records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_my_options_trades_with_http_info(underlying, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) :param str contract: Options contract name :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsMyTrade], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying', 'contract', 'limit', 'offset', '_from', 'to' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_my_options_trades" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'underlying' is set if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 local_var_params['underlying'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `underlying` when calling `list_my_options_trades`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_my_options_trades`, must be a value less than or equal to `1000`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_my_options_trades`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 raise ApiValueError("Invalid value for parameter `offset` when calling `list_my_options_trades`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/my_trades', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsMyTrade]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_options_mmp(self, **kwargs): # noqa: E501 """MMP Query. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_mmp(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: list[gate_api.OptionsMMP] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_options_mmp_with_http_info(**kwargs) # noqa: E501 def get_options_mmp_with_http_info(self, **kwargs): # noqa: E501 """MMP Query. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_options_mmp_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str underlying: Underlying :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(list[gate_api.OptionsMMP], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'underlying' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_options_mmp" % k ) local_var_params[k] = v del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/mmp', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[OptionsMMP]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def set_options_mmp(self, options_mmp, **kwargs): # noqa: E501 """MMP Settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_options_mmp(options_mmp, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param OptionsMMP options_mmp: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsMMP :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.set_options_mmp_with_http_info(options_mmp, **kwargs) # noqa: E501 def set_options_mmp_with_http_info(self, options_mmp, **kwargs): # noqa: E501 """MMP Settings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_options_mmp_with_http_info(options_mmp, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param OptionsMMP options_mmp: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsMMP, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'options_mmp' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method set_options_mmp" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'options_mmp' is set if self.api_client.client_side_validation and ('options_mmp' not in local_var_params or # noqa: E501 local_var_params['options_mmp'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `options_mmp` when calling `set_options_mmp`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'options_mmp' in local_var_params: body_params = local_var_params['options_mmp'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/mmp', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsMMP', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def reset_options_mmp(self, options_mmp_reset, **kwargs): # noqa: E501 """MMP Reset # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.reset_options_mmp(options_mmp_reset, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param OptionsMMPReset options_mmp_reset: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: gate_api.OptionsMMP :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.reset_options_mmp_with_http_info(options_mmp_reset, **kwargs) # noqa: E501 def reset_options_mmp_with_http_info(self, options_mmp_reset, **kwargs): # noqa: E501 """MMP Reset # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.reset_options_mmp_with_http_info(options_mmp_reset, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param OptionsMMPReset options_mmp_reset: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :rtype: tuple(gate_api.OptionsMMP, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'options_mmp_reset' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for k, v in six.iteritems(local_var_params['kwargs']): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method reset_options_mmp" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'options_mmp_reset' is set if self.api_client.client_side_validation and ('options_mmp_reset' not in local_var_params or # noqa: E501 local_var_params['options_mmp_reset'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `options_mmp_reset` when calling `reset_options_mmp`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'options_mmp_reset' in local_var_params: body_params = local_var_params['options_mmp_reset'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( '/options/mmp/reset', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OptionsMMP', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)