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

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