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

143 lines
4.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 FuturesIndexConstituents(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 = {'index': 'str', 'constituents': 'list[IndexConstituent]'}
  25. attribute_map = {'index': 'index', 'constituents': 'constituents'}
  26. def __init__(self, index=None, constituents=None, local_vars_configuration=None): # noqa: E501
  27. # type: (str, list[IndexConstituent], Configuration) -> None
  28. """FuturesIndexConstituents - 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._index = None
  33. self._constituents = None
  34. self.discriminator = None
  35. if index is not None:
  36. self.index = index
  37. if constituents is not None:
  38. self.constituents = constituents
  39. @property
  40. def index(self):
  41. """Gets the index of this FuturesIndexConstituents. # noqa: E501
  42. Index name # noqa: E501
  43. :return: The index of this FuturesIndexConstituents. # noqa: E501
  44. :rtype: str
  45. """
  46. return self._index
  47. @index.setter
  48. def index(self, index):
  49. """Sets the index of this FuturesIndexConstituents.
  50. Index name # noqa: E501
  51. :param index: The index of this FuturesIndexConstituents. # noqa: E501
  52. :type: str
  53. """
  54. self._index = index
  55. @property
  56. def constituents(self):
  57. """Gets the constituents of this FuturesIndexConstituents. # noqa: E501
  58. Constituents # noqa: E501
  59. :return: The constituents of this FuturesIndexConstituents. # noqa: E501
  60. :rtype: list[IndexConstituent]
  61. """
  62. return self._constituents
  63. @constituents.setter
  64. def constituents(self, constituents):
  65. """Sets the constituents of this FuturesIndexConstituents.
  66. Constituents # noqa: E501
  67. :param constituents: The constituents of this FuturesIndexConstituents. # noqa: E501
  68. :type: list[IndexConstituent]
  69. """
  70. self._constituents = constituents
  71. def to_dict(self):
  72. """Returns the model properties as a dict"""
  73. result = {}
  74. for attr, _ in six.iteritems(self.openapi_types):
  75. value = getattr(self, attr)
  76. if isinstance(value, list):
  77. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  78. elif hasattr(value, "to_dict"):
  79. result[attr] = value.to_dict()
  80. elif isinstance(value, dict):
  81. result[attr] = dict(
  82. map(
  83. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  84. value.items(),
  85. )
  86. )
  87. else:
  88. result[attr] = value
  89. return result
  90. def to_str(self):
  91. """Returns the string representation of the model"""
  92. return pprint.pformat(self.to_dict())
  93. def __repr__(self):
  94. """For `print` and `pprint`"""
  95. return self.to_str()
  96. def __eq__(self, other):
  97. """Returns true if both objects are equal"""
  98. if not isinstance(other, FuturesIndexConstituents):
  99. return False
  100. return self.to_dict() == other.to_dict()
  101. def __ne__(self, other):
  102. """Returns true if both objects are not equal"""
  103. if not isinstance(other, FuturesIndexConstituents):
  104. return True
  105. return self.to_dict() != other.to_dict()