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

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