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

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