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

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