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

270 lines
7.4 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 FuturesTrade(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. 'id': 'int',
  26. 'create_time': 'float',
  27. 'create_time_ms': 'float',
  28. 'contract': 'str',
  29. 'size': 'int',
  30. 'price': 'str',
  31. }
  32. attribute_map = {
  33. 'id': 'id',
  34. 'create_time': 'create_time',
  35. 'create_time_ms': 'create_time_ms',
  36. 'contract': 'contract',
  37. 'size': 'size',
  38. 'price': 'price',
  39. }
  40. def __init__(
  41. self,
  42. id=None,
  43. create_time=None,
  44. create_time_ms=None,
  45. contract=None,
  46. size=None,
  47. price=None,
  48. local_vars_configuration=None,
  49. ): # noqa: E501
  50. # type: (int, float, float, str, int, str, Configuration) -> None
  51. """FuturesTrade - a model defined in OpenAPI""" # noqa: E501
  52. if local_vars_configuration is None:
  53. local_vars_configuration = Configuration()
  54. self.local_vars_configuration = local_vars_configuration
  55. self._id = None
  56. self._create_time = None
  57. self._create_time_ms = None
  58. self._contract = None
  59. self._size = None
  60. self._price = None
  61. self.discriminator = None
  62. if id is not None:
  63. self.id = id
  64. if create_time is not None:
  65. self.create_time = create_time
  66. if create_time_ms is not None:
  67. self.create_time_ms = create_time_ms
  68. if contract is not None:
  69. self.contract = contract
  70. if size is not None:
  71. self.size = size
  72. if price is not None:
  73. self.price = price
  74. @property
  75. def id(self):
  76. """Gets the id of this FuturesTrade. # noqa: E501
  77. Trade ID # noqa: E501
  78. :return: The id of this FuturesTrade. # noqa: E501
  79. :rtype: int
  80. """
  81. return self._id
  82. @id.setter
  83. def id(self, id):
  84. """Sets the id of this FuturesTrade.
  85. Trade ID # noqa: E501
  86. :param id: The id of this FuturesTrade. # noqa: E501
  87. :type: int
  88. """
  89. self._id = id
  90. @property
  91. def create_time(self):
  92. """Gets the create_time of this FuturesTrade. # noqa: E501
  93. Trading time # noqa: E501
  94. :return: The create_time of this FuturesTrade. # noqa: E501
  95. :rtype: float
  96. """
  97. return self._create_time
  98. @create_time.setter
  99. def create_time(self, create_time):
  100. """Sets the create_time of this FuturesTrade.
  101. Trading time # noqa: E501
  102. :param create_time: The create_time of this FuturesTrade. # noqa: E501
  103. :type: float
  104. """
  105. self._create_time = create_time
  106. @property
  107. def create_time_ms(self):
  108. """Gets the create_time_ms of this FuturesTrade. # noqa: E501
  109. Trading time, with milliseconds set to 3 decimal places. # noqa: E501
  110. :return: The create_time_ms of this FuturesTrade. # noqa: E501
  111. :rtype: float
  112. """
  113. return self._create_time_ms
  114. @create_time_ms.setter
  115. def create_time_ms(self, create_time_ms):
  116. """Sets the create_time_ms of this FuturesTrade.
  117. Trading time, with milliseconds set to 3 decimal places. # noqa: E501
  118. :param create_time_ms: The create_time_ms of this FuturesTrade. # noqa: E501
  119. :type: float
  120. """
  121. self._create_time_ms = create_time_ms
  122. @property
  123. def contract(self):
  124. """Gets the contract of this FuturesTrade. # noqa: E501
  125. Futures contract # noqa: E501
  126. :return: The contract of this FuturesTrade. # noqa: E501
  127. :rtype: str
  128. """
  129. return self._contract
  130. @contract.setter
  131. def contract(self, contract):
  132. """Sets the contract of this FuturesTrade.
  133. Futures contract # noqa: E501
  134. :param contract: The contract of this FuturesTrade. # noqa: E501
  135. :type: str
  136. """
  137. self._contract = contract
  138. @property
  139. def size(self):
  140. """Gets the size of this FuturesTrade. # noqa: E501
  141. Trading size # noqa: E501
  142. :return: The size of this FuturesTrade. # noqa: E501
  143. :rtype: int
  144. """
  145. return self._size
  146. @size.setter
  147. def size(self, size):
  148. """Sets the size of this FuturesTrade.
  149. Trading size # noqa: E501
  150. :param size: The size of this FuturesTrade. # noqa: E501
  151. :type: int
  152. """
  153. self._size = size
  154. @property
  155. def price(self):
  156. """Gets the price of this FuturesTrade. # noqa: E501
  157. Trading price (quote currency) # noqa: E501
  158. :return: The price of this FuturesTrade. # noqa: E501
  159. :rtype: str
  160. """
  161. return self._price
  162. @price.setter
  163. def price(self, price):
  164. """Sets the price of this FuturesTrade.
  165. Trading price (quote currency) # noqa: E501
  166. :param price: The price of this FuturesTrade. # noqa: E501
  167. :type: str
  168. """
  169. self._price = price
  170. def to_dict(self):
  171. """Returns the model properties as a dict"""
  172. result = {}
  173. for attr, _ in six.iteritems(self.openapi_types):
  174. value = getattr(self, attr)
  175. if isinstance(value, list):
  176. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  177. elif hasattr(value, "to_dict"):
  178. result[attr] = value.to_dict()
  179. elif isinstance(value, dict):
  180. result[attr] = dict(
  181. map(
  182. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  183. value.items(),
  184. )
  185. )
  186. else:
  187. result[attr] = value
  188. return result
  189. def to_str(self):
  190. """Returns the string representation of the model"""
  191. return pprint.pformat(self.to_dict())
  192. def __repr__(self):
  193. """For `print` and `pprint`"""
  194. return self.to_str()
  195. def __eq__(self, other):
  196. """Returns true if both objects are equal"""
  197. if not isinstance(other, FuturesTrade):
  198. return False
  199. return self.to_dict() == other.to_dict()
  200. def __ne__(self, other):
  201. """Returns true if both objects are not equal"""
  202. if not isinstance(other, FuturesTrade):
  203. return True
  204. return self.to_dict() != other.to_dict()