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

171 lines
5.8 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 CancelOrder(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', 'id': 'str', 'account': 'str'}
  25. attribute_map = {'currency_pair': 'currency_pair', 'id': 'id', 'account': 'account'}
  26. def __init__(self, currency_pair=None, id=None, account=None, local_vars_configuration=None): # noqa: E501
  27. # type: (str, str, str, Configuration) -> None
  28. """CancelOrder - 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._id = None
  34. self._account = None
  35. self.discriminator = None
  36. self.currency_pair = currency_pair
  37. self.id = id
  38. if account is not None:
  39. self.account = account
  40. @property
  41. def currency_pair(self):
  42. """Gets the currency_pair of this CancelOrder. # noqa: E501
  43. Order currency pair # noqa: E501
  44. :return: The currency_pair of this CancelOrder. # noqa: E501
  45. :rtype: str
  46. """
  47. return self._currency_pair
  48. @currency_pair.setter
  49. def currency_pair(self, currency_pair):
  50. """Sets the currency_pair of this CancelOrder.
  51. Order currency pair # noqa: E501
  52. :param currency_pair: The currency_pair of this CancelOrder. # noqa: E501
  53. :type: str
  54. """
  55. if self.local_vars_configuration.client_side_validation and currency_pair is None: # noqa: E501
  56. raise ValueError("Invalid value for `currency_pair`, must not be `None`") # noqa: E501
  57. self._currency_pair = currency_pair
  58. @property
  59. def id(self):
  60. """Gets the id of this CancelOrder. # noqa: E501
  61. Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation # noqa: E501
  62. :return: The id of this CancelOrder. # noqa: E501
  63. :rtype: str
  64. """
  65. return self._id
  66. @id.setter
  67. def id(self, id):
  68. """Sets the id of this CancelOrder.
  69. Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation # noqa: E501
  70. :param id: The id of this CancelOrder. # noqa: E501
  71. :type: str
  72. """
  73. if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
  74. raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
  75. self._id = id
  76. @property
  77. def account(self):
  78. """Gets the account of this CancelOrder. # noqa: E501
  79. If cancelled order is cross margin order or is portfolio margin account's API key, this field must be set and can only be `cross_margin`If cancelled order is cross margin order, this field must be set and can only be `cross_margin` # noqa: E501
  80. :return: The account of this CancelOrder. # noqa: E501
  81. :rtype: str
  82. """
  83. return self._account
  84. @account.setter
  85. def account(self, account):
  86. """Sets the account of this CancelOrder.
  87. If cancelled order is cross margin order or is portfolio margin account's API key, this field must be set and can only be `cross_margin`If cancelled order is cross margin order, this field must be set and can only be `cross_margin` # noqa: E501
  88. :param account: The account of this CancelOrder. # noqa: E501
  89. :type: str
  90. """
  91. self._account = account
  92. def to_dict(self):
  93. """Returns the model properties as a dict"""
  94. result = {}
  95. for attr, _ in six.iteritems(self.openapi_types):
  96. value = getattr(self, attr)
  97. if isinstance(value, list):
  98. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  99. elif hasattr(value, "to_dict"):
  100. result[attr] = value.to_dict()
  101. elif isinstance(value, dict):
  102. result[attr] = dict(
  103. map(
  104. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  105. value.items(),
  106. )
  107. )
  108. else:
  109. result[attr] = value
  110. return result
  111. def to_str(self):
  112. """Returns the string representation of the model"""
  113. return pprint.pformat(self.to_dict())
  114. def __repr__(self):
  115. """For `print` and `pprint`"""
  116. return self.to_str()
  117. def __eq__(self, other):
  118. """Returns true if both objects are equal"""
  119. if not isinstance(other, CancelOrder):
  120. return False
  121. return self.to_dict() == other.to_dict()
  122. def __ne__(self, other):
  123. """Returns true if both objects are not equal"""
  124. if not isinstance(other, CancelOrder):
  125. return True
  126. return self.to_dict() != other.to_dict()