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

200 lines
6.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 LiquidateOrder(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 = {'text': 'str', 'currency_pair': 'str', 'amount': 'str', 'price': 'str'}
  25. attribute_map = {'text': 'text', 'currency_pair': 'currency_pair', 'amount': 'amount', 'price': 'price'}
  26. def __init__(
  27. self, text=None, currency_pair=None, amount=None, price=None, local_vars_configuration=None
  28. ): # noqa: E501
  29. # type: (str, str, str, str, Configuration) -> None
  30. """LiquidateOrder - 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._text = None
  35. self._currency_pair = None
  36. self._amount = None
  37. self._price = None
  38. self.discriminator = None
  39. if text is not None:
  40. self.text = text
  41. self.currency_pair = currency_pair
  42. self.amount = amount
  43. self.price = price
  44. @property
  45. def text(self):
  46. """Gets the text of this LiquidateOrder. # noqa: E501
  47. User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501
  48. :return: The text of this LiquidateOrder. # noqa: E501
  49. :rtype: str
  50. """
  51. return self._text
  52. @text.setter
  53. def text(self, text):
  54. """Sets the text of this LiquidateOrder.
  55. User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501
  56. :param text: The text of this LiquidateOrder. # noqa: E501
  57. :type: str
  58. """
  59. self._text = text
  60. @property
  61. def currency_pair(self):
  62. """Gets the currency_pair of this LiquidateOrder. # noqa: E501
  63. Currency pair # noqa: E501
  64. :return: The currency_pair of this LiquidateOrder. # noqa: E501
  65. :rtype: str
  66. """
  67. return self._currency_pair
  68. @currency_pair.setter
  69. def currency_pair(self, currency_pair):
  70. """Sets the currency_pair of this LiquidateOrder.
  71. Currency pair # noqa: E501
  72. :param currency_pair: The currency_pair of this LiquidateOrder. # noqa: E501
  73. :type: str
  74. """
  75. if self.local_vars_configuration.client_side_validation and currency_pair is None: # noqa: E501
  76. raise ValueError("Invalid value for `currency_pair`, must not be `None`") # noqa: E501
  77. self._currency_pair = currency_pair
  78. @property
  79. def amount(self):
  80. """Gets the amount of this LiquidateOrder. # noqa: E501
  81. Trade amount # noqa: E501
  82. :return: The amount of this LiquidateOrder. # noqa: E501
  83. :rtype: str
  84. """
  85. return self._amount
  86. @amount.setter
  87. def amount(self, amount):
  88. """Sets the amount of this LiquidateOrder.
  89. Trade amount # noqa: E501
  90. :param amount: The amount of this LiquidateOrder. # noqa: E501
  91. :type: str
  92. """
  93. if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501
  94. raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501
  95. self._amount = amount
  96. @property
  97. def price(self):
  98. """Gets the price of this LiquidateOrder. # noqa: E501
  99. Order price # noqa: E501
  100. :return: The price of this LiquidateOrder. # noqa: E501
  101. :rtype: str
  102. """
  103. return self._price
  104. @price.setter
  105. def price(self, price):
  106. """Sets the price of this LiquidateOrder.
  107. Order price # noqa: E501
  108. :param price: The price of this LiquidateOrder. # noqa: E501
  109. :type: str
  110. """
  111. if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501
  112. raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501
  113. self._price = price
  114. def to_dict(self):
  115. """Returns the model properties as a dict"""
  116. result = {}
  117. for attr, _ in six.iteritems(self.openapi_types):
  118. value = getattr(self, attr)
  119. if isinstance(value, list):
  120. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  121. elif hasattr(value, "to_dict"):
  122. result[attr] = value.to_dict()
  123. elif isinstance(value, dict):
  124. result[attr] = dict(
  125. map(
  126. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  127. value.items(),
  128. )
  129. )
  130. else:
  131. result[attr] = value
  132. return result
  133. def to_str(self):
  134. """Returns the string representation of the model"""
  135. return pprint.pformat(self.to_dict())
  136. def __repr__(self):
  137. """For `print` and `pprint`"""
  138. return self.to_str()
  139. def __eq__(self, other):
  140. """Returns true if both objects are equal"""
  141. if not isinstance(other, LiquidateOrder):
  142. return False
  143. return self.to_dict() == other.to_dict()
  144. def __ne__(self, other):
  145. """Returns true if both objects are not equal"""
  146. if not isinstance(other, LiquidateOrder):
  147. return True
  148. return self.to_dict() != other.to_dict()