天择加密量化开放框架下载
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

386 lines
11 KiB

1 year ago
  1. # coding: utf-8
  2. """
  3. Gate API v4
  4. Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
  5. Contact: support@mail.gate.io
  6. Generated by: https://openapi-generator.tech
  7. """
  8. import pprint
  9. import re # noqa: F401
  10. import six
  11. from gate_api.configuration import Configuration
  12. class FuturesAutoDeleverage(object):
  13. """NOTE: This class is auto generated by OpenAPI Generator.
  14. Ref: https://openapi-generator.tech
  15. Do not edit the class manually.
  16. """
  17. """
  18. Attributes:
  19. openapi_types (dict): The key is attribute name
  20. and the value is attribute type.
  21. attribute_map (dict): The key is attribute name
  22. and the value is json key in definition.
  23. """
  24. openapi_types = {
  25. 'time': 'int',
  26. 'user': 'int',
  27. 'order_id': 'int',
  28. 'contract': 'str',
  29. 'leverage': 'str',
  30. 'cross_leverage_limit': 'str',
  31. 'entry_price': 'str',
  32. 'fill_price': 'str',
  33. 'trade_size': 'int',
  34. 'position_size': 'int',
  35. }
  36. attribute_map = {
  37. 'time': 'time',
  38. 'user': 'user',
  39. 'order_id': 'order_id',
  40. 'contract': 'contract',
  41. 'leverage': 'leverage',
  42. 'cross_leverage_limit': 'cross_leverage_limit',
  43. 'entry_price': 'entry_price',
  44. 'fill_price': 'fill_price',
  45. 'trade_size': 'trade_size',
  46. 'position_size': 'position_size',
  47. }
  48. def __init__(
  49. self,
  50. time=None,
  51. user=None,
  52. order_id=None,
  53. contract=None,
  54. leverage=None,
  55. cross_leverage_limit=None,
  56. entry_price=None,
  57. fill_price=None,
  58. trade_size=None,
  59. position_size=None,
  60. local_vars_configuration=None,
  61. ): # noqa: E501
  62. # type: (int, int, int, str, str, str, str, str, int, int, Configuration) -> None
  63. """FuturesAutoDeleverage - a model defined in OpenAPI""" # noqa: E501
  64. if local_vars_configuration is None:
  65. local_vars_configuration = Configuration()
  66. self.local_vars_configuration = local_vars_configuration
  67. self._time = None
  68. self._user = None
  69. self._order_id = None
  70. self._contract = None
  71. self._leverage = None
  72. self._cross_leverage_limit = None
  73. self._entry_price = None
  74. self._fill_price = None
  75. self._trade_size = None
  76. self._position_size = None
  77. self.discriminator = None
  78. if time is not None:
  79. self.time = time
  80. if user is not None:
  81. self.user = user
  82. if order_id is not None:
  83. self.order_id = order_id
  84. if contract is not None:
  85. self.contract = contract
  86. if leverage is not None:
  87. self.leverage = leverage
  88. if cross_leverage_limit is not None:
  89. self.cross_leverage_limit = cross_leverage_limit
  90. if entry_price is not None:
  91. self.entry_price = entry_price
  92. if fill_price is not None:
  93. self.fill_price = fill_price
  94. if trade_size is not None:
  95. self.trade_size = trade_size
  96. if position_size is not None:
  97. self.position_size = position_size
  98. @property
  99. def time(self):
  100. """Gets the time of this FuturesAutoDeleverage. # noqa: E501
  101. Automatic deleveraging time # noqa: E501
  102. :return: The time of this FuturesAutoDeleverage. # noqa: E501
  103. :rtype: int
  104. """
  105. return self._time
  106. @time.setter
  107. def time(self, time):
  108. """Sets the time of this FuturesAutoDeleverage.
  109. Automatic deleveraging time # noqa: E501
  110. :param time: The time of this FuturesAutoDeleverage. # noqa: E501
  111. :type: int
  112. """
  113. self._time = time
  114. @property
  115. def user(self):
  116. """Gets the user of this FuturesAutoDeleverage. # noqa: E501
  117. User ID # noqa: E501
  118. :return: The user of this FuturesAutoDeleverage. # noqa: E501
  119. :rtype: int
  120. """
  121. return self._user
  122. @user.setter
  123. def user(self, user):
  124. """Sets the user of this FuturesAutoDeleverage.
  125. User ID # noqa: E501
  126. :param user: The user of this FuturesAutoDeleverage. # noqa: E501
  127. :type: int
  128. """
  129. self._user = user
  130. @property
  131. def order_id(self):
  132. """Gets the order_id of this FuturesAutoDeleverage. # noqa: E501
  133. Order ID. Order IDs before 2023-02-20 are null # noqa: E501
  134. :return: The order_id of this FuturesAutoDeleverage. # noqa: E501
  135. :rtype: int
  136. """
  137. return self._order_id
  138. @order_id.setter
  139. def order_id(self, order_id):
  140. """Sets the order_id of this FuturesAutoDeleverage.
  141. Order ID. Order IDs before 2023-02-20 are null # noqa: E501
  142. :param order_id: The order_id of this FuturesAutoDeleverage. # noqa: E501
  143. :type: int
  144. """
  145. self._order_id = order_id
  146. @property
  147. def contract(self):
  148. """Gets the contract of this FuturesAutoDeleverage. # noqa: E501
  149. Futures contract # noqa: E501
  150. :return: The contract of this FuturesAutoDeleverage. # noqa: E501
  151. :rtype: str
  152. """
  153. return self._contract
  154. @contract.setter
  155. def contract(self, contract):
  156. """Sets the contract of this FuturesAutoDeleverage.
  157. Futures contract # noqa: E501
  158. :param contract: The contract of this FuturesAutoDeleverage. # noqa: E501
  159. :type: str
  160. """
  161. self._contract = contract
  162. @property
  163. def leverage(self):
  164. """Gets the leverage of this FuturesAutoDeleverage. # noqa: E501
  165. Position leverage # noqa: E501
  166. :return: The leverage of this FuturesAutoDeleverage. # noqa: E501
  167. :rtype: str
  168. """
  169. return self._leverage
  170. @leverage.setter
  171. def leverage(self, leverage):
  172. """Sets the leverage of this FuturesAutoDeleverage.
  173. Position leverage # noqa: E501
  174. :param leverage: The leverage of this FuturesAutoDeleverage. # noqa: E501
  175. :type: str
  176. """
  177. self._leverage = leverage
  178. @property
  179. def cross_leverage_limit(self):
  180. """Gets the cross_leverage_limit of this FuturesAutoDeleverage. # noqa: E501
  181. Cross margin leverage(valid only when `leverage` is 0) # noqa: E501
  182. :return: The cross_leverage_limit of this FuturesAutoDeleverage. # noqa: E501
  183. :rtype: str
  184. """
  185. return self._cross_leverage_limit
  186. @cross_leverage_limit.setter
  187. def cross_leverage_limit(self, cross_leverage_limit):
  188. """Sets the cross_leverage_limit of this FuturesAutoDeleverage.
  189. Cross margin leverage(valid only when `leverage` is 0) # noqa: E501
  190. :param cross_leverage_limit: The cross_leverage_limit of this FuturesAutoDeleverage. # noqa: E501
  191. :type: str
  192. """
  193. self._cross_leverage_limit = cross_leverage_limit
  194. @property
  195. def entry_price(self):
  196. """Gets the entry_price of this FuturesAutoDeleverage. # noqa: E501
  197. Average entry price # noqa: E501
  198. :return: The entry_price of this FuturesAutoDeleverage. # noqa: E501
  199. :rtype: str
  200. """
  201. return self._entry_price
  202. @entry_price.setter
  203. def entry_price(self, entry_price):
  204. """Sets the entry_price of this FuturesAutoDeleverage.
  205. Average entry price # noqa: E501
  206. :param entry_price: The entry_price of this FuturesAutoDeleverage. # noqa: E501
  207. :type: str
  208. """
  209. self._entry_price = entry_price
  210. @property
  211. def fill_price(self):
  212. """Gets the fill_price of this FuturesAutoDeleverage. # noqa: E501
  213. Average fill price # noqa: E501
  214. :return: The fill_price of this FuturesAutoDeleverage. # noqa: E501
  215. :rtype: str
  216. """
  217. return self._fill_price
  218. @fill_price.setter
  219. def fill_price(self, fill_price):
  220. """Sets the fill_price of this FuturesAutoDeleverage.
  221. Average fill price # noqa: E501
  222. :param fill_price: The fill_price of this FuturesAutoDeleverage. # noqa: E501
  223. :type: str
  224. """
  225. self._fill_price = fill_price
  226. @property
  227. def trade_size(self):
  228. """Gets the trade_size of this FuturesAutoDeleverage. # noqa: E501
  229. Trading size # noqa: E501
  230. :return: The trade_size of this FuturesAutoDeleverage. # noqa: E501
  231. :rtype: int
  232. """
  233. return self._trade_size
  234. @trade_size.setter
  235. def trade_size(self, trade_size):
  236. """Sets the trade_size of this FuturesAutoDeleverage.
  237. Trading size # noqa: E501
  238. :param trade_size: The trade_size of this FuturesAutoDeleverage. # noqa: E501
  239. :type: int
  240. """
  241. self._trade_size = trade_size
  242. @property
  243. def position_size(self):
  244. """Gets the position_size of this FuturesAutoDeleverage. # noqa: E501
  245. Positions after auto-deleveraging # noqa: E501
  246. :return: The position_size of this FuturesAutoDeleverage. # noqa: E501
  247. :rtype: int
  248. """
  249. return self._position_size
  250. @position_size.setter
  251. def position_size(self, position_size):
  252. """Sets the position_size of this FuturesAutoDeleverage.
  253. Positions after auto-deleveraging # noqa: E501
  254. :param position_size: The position_size of this FuturesAutoDeleverage. # noqa: E501
  255. :type: int
  256. """
  257. self._position_size = position_size
  258. def to_dict(self):
  259. """Returns the model properties as a dict"""
  260. result = {}
  261. for attr, _ in six.iteritems(self.openapi_types):
  262. value = getattr(self, attr)
  263. if isinstance(value, list):
  264. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  265. elif hasattr(value, "to_dict"):
  266. result[attr] = value.to_dict()
  267. elif isinstance(value, dict):
  268. result[attr] = dict(
  269. map(
  270. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  271. value.items(),
  272. )
  273. )
  274. else:
  275. result[attr] = value
  276. return result
  277. def to_str(self):
  278. """Returns the string representation of the model"""
  279. return pprint.pformat(self.to_dict())
  280. def __repr__(self):
  281. """For `print` and `pprint`"""
  282. return self.to_str()
  283. def __eq__(self, other):
  284. """Returns true if both objects are equal"""
  285. if not isinstance(other, FuturesAutoDeleverage):
  286. return False
  287. return self.to_dict() == other.to_dict()
  288. def __ne__(self, other):
  289. """Returns true if both objects are not equal"""
  290. if not isinstance(other, FuturesAutoDeleverage):
  291. return True
  292. return self.to_dict() != other.to_dict()