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

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