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

391 lines
10 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 MyFuturesTrade(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. 'contract': 'str',
  28. 'order_id': 'str',
  29. 'size': 'int',
  30. 'price': 'str',
  31. 'role': 'str',
  32. 'text': 'str',
  33. 'fee': 'str',
  34. 'point_fee': 'str',
  35. }
  36. attribute_map = {
  37. 'id': 'id',
  38. 'create_time': 'create_time',
  39. 'contract': 'contract',
  40. 'order_id': 'order_id',
  41. 'size': 'size',
  42. 'price': 'price',
  43. 'role': 'role',
  44. 'text': 'text',
  45. 'fee': 'fee',
  46. 'point_fee': 'point_fee',
  47. }
  48. def __init__(
  49. self,
  50. id=None,
  51. create_time=None,
  52. contract=None,
  53. order_id=None,
  54. size=None,
  55. price=None,
  56. role=None,
  57. text=None,
  58. fee=None,
  59. point_fee=None,
  60. local_vars_configuration=None,
  61. ): # noqa: E501
  62. # type: (int, float, str, str, int, str, str, str, str, str, Configuration) -> None
  63. """MyFuturesTrade - 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._id = None
  68. self._create_time = None
  69. self._contract = None
  70. self._order_id = None
  71. self._size = None
  72. self._price = None
  73. self._role = None
  74. self._text = None
  75. self._fee = None
  76. self._point_fee = None
  77. self.discriminator = None
  78. if id is not None:
  79. self.id = id
  80. if create_time is not None:
  81. self.create_time = create_time
  82. if contract is not None:
  83. self.contract = contract
  84. if order_id is not None:
  85. self.order_id = order_id
  86. if size is not None:
  87. self.size = size
  88. if price is not None:
  89. self.price = price
  90. if role is not None:
  91. self.role = role
  92. if text is not None:
  93. self.text = text
  94. if fee is not None:
  95. self.fee = fee
  96. if point_fee is not None:
  97. self.point_fee = point_fee
  98. @property
  99. def id(self):
  100. """Gets the id of this MyFuturesTrade. # noqa: E501
  101. Trade ID # noqa: E501
  102. :return: The id of this MyFuturesTrade. # noqa: E501
  103. :rtype: int
  104. """
  105. return self._id
  106. @id.setter
  107. def id(self, id):
  108. """Sets the id of this MyFuturesTrade.
  109. Trade ID # noqa: E501
  110. :param id: The id of this MyFuturesTrade. # noqa: E501
  111. :type: int
  112. """
  113. self._id = id
  114. @property
  115. def create_time(self):
  116. """Gets the create_time of this MyFuturesTrade. # noqa: E501
  117. Trading time # noqa: E501
  118. :return: The create_time of this MyFuturesTrade. # noqa: E501
  119. :rtype: float
  120. """
  121. return self._create_time
  122. @create_time.setter
  123. def create_time(self, create_time):
  124. """Sets the create_time of this MyFuturesTrade.
  125. Trading time # noqa: E501
  126. :param create_time: The create_time of this MyFuturesTrade. # noqa: E501
  127. :type: float
  128. """
  129. self._create_time = create_time
  130. @property
  131. def contract(self):
  132. """Gets the contract of this MyFuturesTrade. # noqa: E501
  133. Futures contract # noqa: E501
  134. :return: The contract of this MyFuturesTrade. # noqa: E501
  135. :rtype: str
  136. """
  137. return self._contract
  138. @contract.setter
  139. def contract(self, contract):
  140. """Sets the contract of this MyFuturesTrade.
  141. Futures contract # noqa: E501
  142. :param contract: The contract of this MyFuturesTrade. # noqa: E501
  143. :type: str
  144. """
  145. self._contract = contract
  146. @property
  147. def order_id(self):
  148. """Gets the order_id of this MyFuturesTrade. # noqa: E501
  149. Order ID related # noqa: E501
  150. :return: The order_id of this MyFuturesTrade. # noqa: E501
  151. :rtype: str
  152. """
  153. return self._order_id
  154. @order_id.setter
  155. def order_id(self, order_id):
  156. """Sets the order_id of this MyFuturesTrade.
  157. Order ID related # noqa: E501
  158. :param order_id: The order_id of this MyFuturesTrade. # noqa: E501
  159. :type: str
  160. """
  161. self._order_id = order_id
  162. @property
  163. def size(self):
  164. """Gets the size of this MyFuturesTrade. # noqa: E501
  165. Trading size # noqa: E501
  166. :return: The size of this MyFuturesTrade. # noqa: E501
  167. :rtype: int
  168. """
  169. return self._size
  170. @size.setter
  171. def size(self, size):
  172. """Sets the size of this MyFuturesTrade.
  173. Trading size # noqa: E501
  174. :param size: The size of this MyFuturesTrade. # noqa: E501
  175. :type: int
  176. """
  177. self._size = size
  178. @property
  179. def price(self):
  180. """Gets the price of this MyFuturesTrade. # noqa: E501
  181. Trading price # noqa: E501
  182. :return: The price of this MyFuturesTrade. # noqa: E501
  183. :rtype: str
  184. """
  185. return self._price
  186. @price.setter
  187. def price(self, price):
  188. """Sets the price of this MyFuturesTrade.
  189. Trading price # noqa: E501
  190. :param price: The price of this MyFuturesTrade. # noqa: E501
  191. :type: str
  192. """
  193. self._price = price
  194. @property
  195. def role(self):
  196. """Gets the role of this MyFuturesTrade. # noqa: E501
  197. Trade role. Available values are `taker` and `maker` # noqa: E501
  198. :return: The role of this MyFuturesTrade. # noqa: E501
  199. :rtype: str
  200. """
  201. return self._role
  202. @role.setter
  203. def role(self, role):
  204. """Sets the role of this MyFuturesTrade.
  205. Trade role. Available values are `taker` and `maker` # noqa: E501
  206. :param role: The role of this MyFuturesTrade. # noqa: E501
  207. :type: str
  208. """
  209. allowed_values = ["taker", "maker"] # noqa: E501
  210. if self.local_vars_configuration.client_side_validation and role not in allowed_values: # noqa: E501
  211. raise ValueError(
  212. "Invalid value for `role` ({0}), must be one of {1}".format(role, allowed_values) # noqa: E501
  213. )
  214. self._role = role
  215. @property
  216. def text(self):
  217. """Gets the text of this MyFuturesTrade. # noqa: E501
  218. User defined information # noqa: E501
  219. :return: The text of this MyFuturesTrade. # noqa: E501
  220. :rtype: str
  221. """
  222. return self._text
  223. @text.setter
  224. def text(self, text):
  225. """Sets the text of this MyFuturesTrade.
  226. User defined information # noqa: E501
  227. :param text: The text of this MyFuturesTrade. # noqa: E501
  228. :type: str
  229. """
  230. self._text = text
  231. @property
  232. def fee(self):
  233. """Gets the fee of this MyFuturesTrade. # noqa: E501
  234. Fee deducted # noqa: E501
  235. :return: The fee of this MyFuturesTrade. # noqa: E501
  236. :rtype: str
  237. """
  238. return self._fee
  239. @fee.setter
  240. def fee(self, fee):
  241. """Sets the fee of this MyFuturesTrade.
  242. Fee deducted # noqa: E501
  243. :param fee: The fee of this MyFuturesTrade. # noqa: E501
  244. :type: str
  245. """
  246. self._fee = fee
  247. @property
  248. def point_fee(self):
  249. """Gets the point_fee of this MyFuturesTrade. # noqa: E501
  250. Points used to deduct fee # noqa: E501
  251. :return: The point_fee of this MyFuturesTrade. # noqa: E501
  252. :rtype: str
  253. """
  254. return self._point_fee
  255. @point_fee.setter
  256. def point_fee(self, point_fee):
  257. """Sets the point_fee of this MyFuturesTrade.
  258. Points used to deduct fee # noqa: E501
  259. :param point_fee: The point_fee of this MyFuturesTrade. # noqa: E501
  260. :type: str
  261. """
  262. self._point_fee = point_fee
  263. def to_dict(self):
  264. """Returns the model properties as a dict"""
  265. result = {}
  266. for attr, _ in six.iteritems(self.openapi_types):
  267. value = getattr(self, attr)
  268. if isinstance(value, list):
  269. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  270. elif hasattr(value, "to_dict"):
  271. result[attr] = value.to_dict()
  272. elif isinstance(value, dict):
  273. result[attr] = dict(
  274. map(
  275. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  276. value.items(),
  277. )
  278. )
  279. else:
  280. result[attr] = value
  281. return result
  282. def to_str(self):
  283. """Returns the string representation of the model"""
  284. return pprint.pformat(self.to_dict())
  285. def __repr__(self):
  286. """For `print` and `pprint`"""
  287. return self.to_str()
  288. def __eq__(self, other):
  289. """Returns true if both objects are equal"""
  290. if not isinstance(other, MyFuturesTrade):
  291. return False
  292. return self.to_dict() == other.to_dict()
  293. def __ne__(self, other):
  294. """Returns true if both objects are not equal"""
  295. if not isinstance(other, MyFuturesTrade):
  296. return True
  297. return self.to_dict() != other.to_dict()