天择加密量化开放框架下载
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.

444 lines
13 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 FuturesLiquidate(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. 'contract': 'str',
  27. 'leverage': 'str',
  28. 'size': 'int',
  29. 'margin': 'str',
  30. 'entry_price': 'str',
  31. 'liq_price': 'str',
  32. 'mark_price': 'str',
  33. 'order_id': 'int',
  34. 'order_price': 'str',
  35. 'fill_price': 'str',
  36. 'left': 'int',
  37. }
  38. attribute_map = {
  39. 'time': 'time',
  40. 'contract': 'contract',
  41. 'leverage': 'leverage',
  42. 'size': 'size',
  43. 'margin': 'margin',
  44. 'entry_price': 'entry_price',
  45. 'liq_price': 'liq_price',
  46. 'mark_price': 'mark_price',
  47. 'order_id': 'order_id',
  48. 'order_price': 'order_price',
  49. 'fill_price': 'fill_price',
  50. 'left': 'left',
  51. }
  52. def __init__(
  53. self,
  54. time=None,
  55. contract=None,
  56. leverage=None,
  57. size=None,
  58. margin=None,
  59. entry_price=None,
  60. liq_price=None,
  61. mark_price=None,
  62. order_id=None,
  63. order_price=None,
  64. fill_price=None,
  65. left=None,
  66. local_vars_configuration=None,
  67. ): # noqa: E501
  68. # type: (int, str, str, int, str, str, str, str, int, str, str, int, Configuration) -> None
  69. """FuturesLiquidate - a model defined in OpenAPI""" # noqa: E501
  70. if local_vars_configuration is None:
  71. local_vars_configuration = Configuration()
  72. self.local_vars_configuration = local_vars_configuration
  73. self._time = None
  74. self._contract = None
  75. self._leverage = None
  76. self._size = None
  77. self._margin = None
  78. self._entry_price = None
  79. self._liq_price = None
  80. self._mark_price = None
  81. self._order_id = None
  82. self._order_price = None
  83. self._fill_price = None
  84. self._left = None
  85. self.discriminator = None
  86. if time is not None:
  87. self.time = time
  88. if contract is not None:
  89. self.contract = contract
  90. if leverage is not None:
  91. self.leverage = leverage
  92. if size is not None:
  93. self.size = size
  94. if margin is not None:
  95. self.margin = margin
  96. if entry_price is not None:
  97. self.entry_price = entry_price
  98. if liq_price is not None:
  99. self.liq_price = liq_price
  100. if mark_price is not None:
  101. self.mark_price = mark_price
  102. if order_id is not None:
  103. self.order_id = order_id
  104. if order_price is not None:
  105. self.order_price = order_price
  106. if fill_price is not None:
  107. self.fill_price = fill_price
  108. if left is not None:
  109. self.left = left
  110. @property
  111. def time(self):
  112. """Gets the time of this FuturesLiquidate. # noqa: E501
  113. Liquidation time # noqa: E501
  114. :return: The time of this FuturesLiquidate. # noqa: E501
  115. :rtype: int
  116. """
  117. return self._time
  118. @time.setter
  119. def time(self, time):
  120. """Sets the time of this FuturesLiquidate.
  121. Liquidation time # noqa: E501
  122. :param time: The time of this FuturesLiquidate. # noqa: E501
  123. :type: int
  124. """
  125. self._time = time
  126. @property
  127. def contract(self):
  128. """Gets the contract of this FuturesLiquidate. # noqa: E501
  129. Futures contract # noqa: E501
  130. :return: The contract of this FuturesLiquidate. # noqa: E501
  131. :rtype: str
  132. """
  133. return self._contract
  134. @contract.setter
  135. def contract(self, contract):
  136. """Sets the contract of this FuturesLiquidate.
  137. Futures contract # noqa: E501
  138. :param contract: The contract of this FuturesLiquidate. # noqa: E501
  139. :type: str
  140. """
  141. self._contract = contract
  142. @property
  143. def leverage(self):
  144. """Gets the leverage of this FuturesLiquidate. # noqa: E501
  145. Position leverage. Not returned in public endpoints. # noqa: E501
  146. :return: The leverage of this FuturesLiquidate. # noqa: E501
  147. :rtype: str
  148. """
  149. return self._leverage
  150. @leverage.setter
  151. def leverage(self, leverage):
  152. """Sets the leverage of this FuturesLiquidate.
  153. Position leverage. Not returned in public endpoints. # noqa: E501
  154. :param leverage: The leverage of this FuturesLiquidate. # noqa: E501
  155. :type: str
  156. """
  157. self._leverage = leverage
  158. @property
  159. def size(self):
  160. """Gets the size of this FuturesLiquidate. # noqa: E501
  161. Position size # noqa: E501
  162. :return: The size of this FuturesLiquidate. # noqa: E501
  163. :rtype: int
  164. """
  165. return self._size
  166. @size.setter
  167. def size(self, size):
  168. """Sets the size of this FuturesLiquidate.
  169. Position size # noqa: E501
  170. :param size: The size of this FuturesLiquidate. # noqa: E501
  171. :type: int
  172. """
  173. self._size = size
  174. @property
  175. def margin(self):
  176. """Gets the margin of this FuturesLiquidate. # noqa: E501
  177. Position margin. Not returned in public endpoints. # noqa: E501
  178. :return: The margin of this FuturesLiquidate. # noqa: E501
  179. :rtype: str
  180. """
  181. return self._margin
  182. @margin.setter
  183. def margin(self, margin):
  184. """Sets the margin of this FuturesLiquidate.
  185. Position margin. Not returned in public endpoints. # noqa: E501
  186. :param margin: The margin of this FuturesLiquidate. # noqa: E501
  187. :type: str
  188. """
  189. self._margin = margin
  190. @property
  191. def entry_price(self):
  192. """Gets the entry_price of this FuturesLiquidate. # noqa: E501
  193. Average entry price. Not returned in public endpoints. # noqa: E501
  194. :return: The entry_price of this FuturesLiquidate. # noqa: E501
  195. :rtype: str
  196. """
  197. return self._entry_price
  198. @entry_price.setter
  199. def entry_price(self, entry_price):
  200. """Sets the entry_price of this FuturesLiquidate.
  201. Average entry price. Not returned in public endpoints. # noqa: E501
  202. :param entry_price: The entry_price of this FuturesLiquidate. # noqa: E501
  203. :type: str
  204. """
  205. self._entry_price = entry_price
  206. @property
  207. def liq_price(self):
  208. """Gets the liq_price of this FuturesLiquidate. # noqa: E501
  209. Liquidation price. Not returned in public endpoints. # noqa: E501
  210. :return: The liq_price of this FuturesLiquidate. # noqa: E501
  211. :rtype: str
  212. """
  213. return self._liq_price
  214. @liq_price.setter
  215. def liq_price(self, liq_price):
  216. """Sets the liq_price of this FuturesLiquidate.
  217. Liquidation price. Not returned in public endpoints. # noqa: E501
  218. :param liq_price: The liq_price of this FuturesLiquidate. # noqa: E501
  219. :type: str
  220. """
  221. self._liq_price = liq_price
  222. @property
  223. def mark_price(self):
  224. """Gets the mark_price of this FuturesLiquidate. # noqa: E501
  225. Mark price. Not returned in public endpoints. # noqa: E501
  226. :return: The mark_price of this FuturesLiquidate. # noqa: E501
  227. :rtype: str
  228. """
  229. return self._mark_price
  230. @mark_price.setter
  231. def mark_price(self, mark_price):
  232. """Sets the mark_price of this FuturesLiquidate.
  233. Mark price. Not returned in public endpoints. # noqa: E501
  234. :param mark_price: The mark_price of this FuturesLiquidate. # noqa: E501
  235. :type: str
  236. """
  237. self._mark_price = mark_price
  238. @property
  239. def order_id(self):
  240. """Gets the order_id of this FuturesLiquidate. # noqa: E501
  241. Liquidation order ID. Not returned in public endpoints. # noqa: E501
  242. :return: The order_id of this FuturesLiquidate. # noqa: E501
  243. :rtype: int
  244. """
  245. return self._order_id
  246. @order_id.setter
  247. def order_id(self, order_id):
  248. """Sets the order_id of this FuturesLiquidate.
  249. Liquidation order ID. Not returned in public endpoints. # noqa: E501
  250. :param order_id: The order_id of this FuturesLiquidate. # noqa: E501
  251. :type: int
  252. """
  253. self._order_id = order_id
  254. @property
  255. def order_price(self):
  256. """Gets the order_price of this FuturesLiquidate. # noqa: E501
  257. Liquidation order price # noqa: E501
  258. :return: The order_price of this FuturesLiquidate. # noqa: E501
  259. :rtype: str
  260. """
  261. return self._order_price
  262. @order_price.setter
  263. def order_price(self, order_price):
  264. """Sets the order_price of this FuturesLiquidate.
  265. Liquidation order price # noqa: E501
  266. :param order_price: The order_price of this FuturesLiquidate. # noqa: E501
  267. :type: str
  268. """
  269. self._order_price = order_price
  270. @property
  271. def fill_price(self):
  272. """Gets the fill_price of this FuturesLiquidate. # noqa: E501
  273. Liquidation order average taker price # noqa: E501
  274. :return: The fill_price of this FuturesLiquidate. # noqa: E501
  275. :rtype: str
  276. """
  277. return self._fill_price
  278. @fill_price.setter
  279. def fill_price(self, fill_price):
  280. """Sets the fill_price of this FuturesLiquidate.
  281. Liquidation order average taker price # noqa: E501
  282. :param fill_price: The fill_price of this FuturesLiquidate. # noqa: E501
  283. :type: str
  284. """
  285. self._fill_price = fill_price
  286. @property
  287. def left(self):
  288. """Gets the left of this FuturesLiquidate. # noqa: E501
  289. Liquidation order maker size # noqa: E501
  290. :return: The left of this FuturesLiquidate. # noqa: E501
  291. :rtype: int
  292. """
  293. return self._left
  294. @left.setter
  295. def left(self, left):
  296. """Sets the left of this FuturesLiquidate.
  297. Liquidation order maker size # noqa: E501
  298. :param left: The left of this FuturesLiquidate. # noqa: E501
  299. :type: int
  300. """
  301. self._left = left
  302. def to_dict(self):
  303. """Returns the model properties as a dict"""
  304. result = {}
  305. for attr, _ in six.iteritems(self.openapi_types):
  306. value = getattr(self, attr)
  307. if isinstance(value, list):
  308. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  309. elif hasattr(value, "to_dict"):
  310. result[attr] = value.to_dict()
  311. elif isinstance(value, dict):
  312. result[attr] = dict(
  313. map(
  314. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  315. value.items(),
  316. )
  317. )
  318. else:
  319. result[attr] = value
  320. return result
  321. def to_str(self):
  322. """Returns the string representation of the model"""
  323. return pprint.pformat(self.to_dict())
  324. def __repr__(self):
  325. """For `print` and `pprint`"""
  326. return self.to_str()
  327. def __eq__(self, other):
  328. """Returns true if both objects are equal"""
  329. if not isinstance(other, FuturesLiquidate):
  330. return False
  331. return self.to_dict() == other.to_dict()
  332. def __ne__(self, other):
  333. """Returns true if both objects are not equal"""
  334. if not isinstance(other, FuturesLiquidate):
  335. return True
  336. return self.to_dict() != other.to_dict()