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

205 lines
6.6 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 RepayRequest(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', 'currency': 'str', 'mode': 'str', 'amount': 'str'}
  25. attribute_map = {'currency_pair': 'currency_pair', 'currency': 'currency', 'mode': 'mode', 'amount': 'amount'}
  26. def __init__(
  27. self, currency_pair=None, currency=None, mode=None, amount=None, local_vars_configuration=None
  28. ): # noqa: E501
  29. # type: (str, str, str, str, Configuration) -> None
  30. """RepayRequest - 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._currency_pair = None
  35. self._currency = None
  36. self._mode = None
  37. self._amount = None
  38. self.discriminator = None
  39. self.currency_pair = currency_pair
  40. self.currency = currency
  41. self.mode = mode
  42. if amount is not None:
  43. self.amount = amount
  44. @property
  45. def currency_pair(self):
  46. """Gets the currency_pair of this RepayRequest. # noqa: E501
  47. Currency pair # noqa: E501
  48. :return: The currency_pair of this RepayRequest. # noqa: E501
  49. :rtype: str
  50. """
  51. return self._currency_pair
  52. @currency_pair.setter
  53. def currency_pair(self, currency_pair):
  54. """Sets the currency_pair of this RepayRequest.
  55. Currency pair # noqa: E501
  56. :param currency_pair: The currency_pair of this RepayRequest. # noqa: E501
  57. :type: str
  58. """
  59. if self.local_vars_configuration.client_side_validation and currency_pair is None: # noqa: E501
  60. raise ValueError("Invalid value for `currency_pair`, must not be `None`") # noqa: E501
  61. self._currency_pair = currency_pair
  62. @property
  63. def currency(self):
  64. """Gets the currency of this RepayRequest. # noqa: E501
  65. Loan currency # noqa: E501
  66. :return: The currency of this RepayRequest. # noqa: E501
  67. :rtype: str
  68. """
  69. return self._currency
  70. @currency.setter
  71. def currency(self, currency):
  72. """Sets the currency of this RepayRequest.
  73. Loan currency # noqa: E501
  74. :param currency: The currency of this RepayRequest. # noqa: E501
  75. :type: str
  76. """
  77. if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501
  78. raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501
  79. self._currency = currency
  80. @property
  81. def mode(self):
  82. """Gets the mode of this RepayRequest. # noqa: E501
  83. Repay mode. all - repay all; partial - repay only some portion # noqa: E501
  84. :return: The mode of this RepayRequest. # noqa: E501
  85. :rtype: str
  86. """
  87. return self._mode
  88. @mode.setter
  89. def mode(self, mode):
  90. """Sets the mode of this RepayRequest.
  91. Repay mode. all - repay all; partial - repay only some portion # noqa: E501
  92. :param mode: The mode of this RepayRequest. # noqa: E501
  93. :type: str
  94. """
  95. if self.local_vars_configuration.client_side_validation and mode is None: # noqa: E501
  96. raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501
  97. allowed_values = ["all", "partial"] # noqa: E501
  98. if self.local_vars_configuration.client_side_validation and mode not in allowed_values: # noqa: E501
  99. raise ValueError(
  100. "Invalid value for `mode` ({0}), must be one of {1}".format(mode, allowed_values) # noqa: E501
  101. )
  102. self._mode = mode
  103. @property
  104. def amount(self):
  105. """Gets the amount of this RepayRequest. # noqa: E501
  106. Repay amount. Required in `partial` mode # noqa: E501
  107. :return: The amount of this RepayRequest. # noqa: E501
  108. :rtype: str
  109. """
  110. return self._amount
  111. @amount.setter
  112. def amount(self, amount):
  113. """Sets the amount of this RepayRequest.
  114. Repay amount. Required in `partial` mode # noqa: E501
  115. :param amount: The amount of this RepayRequest. # noqa: E501
  116. :type: str
  117. """
  118. self._amount = amount
  119. def to_dict(self):
  120. """Returns the model properties as a dict"""
  121. result = {}
  122. for attr, _ in six.iteritems(self.openapi_types):
  123. value = getattr(self, attr)
  124. if isinstance(value, list):
  125. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  126. elif hasattr(value, "to_dict"):
  127. result[attr] = value.to_dict()
  128. elif isinstance(value, dict):
  129. result[attr] = dict(
  130. map(
  131. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  132. value.items(),
  133. )
  134. )
  135. else:
  136. result[attr] = value
  137. return result
  138. def to_str(self):
  139. """Returns the string representation of the model"""
  140. return pprint.pformat(self.to_dict())
  141. def __repr__(self):
  142. """For `print` and `pprint`"""
  143. return self.to_str()
  144. def __eq__(self, other):
  145. """Returns true if both objects are equal"""
  146. if not isinstance(other, RepayRequest):
  147. return False
  148. return self.to_dict() == other.to_dict()
  149. def __ne__(self, other):
  150. """Returns true if both objects are not equal"""
  151. if not isinstance(other, RepayRequest):
  152. return True
  153. return self.to_dict() != other.to_dict()