天择加密量化开放框架下载
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.7 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 CreateUniLend(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': 'str', 'amount': 'str', 'type': 'str', 'min_rate': 'str'}
  25. attribute_map = {'currency': 'currency', 'amount': 'amount', 'type': 'type', 'min_rate': 'min_rate'}
  26. def __init__(
  27. self, currency=None, amount=None, type=None, min_rate=None, local_vars_configuration=None
  28. ): # noqa: E501
  29. # type: (str, str, str, str, Configuration) -> None
  30. """CreateUniLend - 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 = None
  35. self._amount = None
  36. self._type = None
  37. self._min_rate = None
  38. self.discriminator = None
  39. self.currency = currency
  40. self.amount = amount
  41. self.type = type
  42. if min_rate is not None:
  43. self.min_rate = min_rate
  44. @property
  45. def currency(self):
  46. """Gets the currency of this CreateUniLend. # noqa: E501
  47. Currency name # noqa: E501
  48. :return: The currency of this CreateUniLend. # noqa: E501
  49. :rtype: str
  50. """
  51. return self._currency
  52. @currency.setter
  53. def currency(self, currency):
  54. """Sets the currency of this CreateUniLend.
  55. Currency name # noqa: E501
  56. :param currency: The currency of this CreateUniLend. # noqa: E501
  57. :type: str
  58. """
  59. if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501
  60. raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501
  61. self._currency = currency
  62. @property
  63. def amount(self):
  64. """Gets the amount of this CreateUniLend. # noqa: E501
  65. The amount of currency could be lent # noqa: E501
  66. :return: The amount of this CreateUniLend. # noqa: E501
  67. :rtype: str
  68. """
  69. return self._amount
  70. @amount.setter
  71. def amount(self, amount):
  72. """Sets the amount of this CreateUniLend.
  73. The amount of currency could be lent # noqa: E501
  74. :param amount: The amount of this CreateUniLend. # noqa: E501
  75. :type: str
  76. """
  77. if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501
  78. raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501
  79. self._amount = amount
  80. @property
  81. def type(self):
  82. """Gets the type of this CreateUniLend. # noqa: E501
  83. type: lend - lend, redeem - redeem # noqa: E501
  84. :return: The type of this CreateUniLend. # noqa: E501
  85. :rtype: str
  86. """
  87. return self._type
  88. @type.setter
  89. def type(self, type):
  90. """Sets the type of this CreateUniLend.
  91. type: lend - lend, redeem - redeem # noqa: E501
  92. :param type: The type of this CreateUniLend. # noqa: E501
  93. :type: str
  94. """
  95. if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
  96. raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
  97. allowed_values = ["lend", "redeem"] # noqa: E501
  98. if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501
  99. raise ValueError(
  100. "Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values) # noqa: E501
  101. )
  102. self._type = type
  103. @property
  104. def min_rate(self):
  105. """Gets the min_rate of this CreateUniLend. # noqa: E501
  106. The minimum interest rate. If the value is too high, it might lead to the unsuccessful lending and no profit will be gained for that hour. # noqa: E501
  107. :return: The min_rate of this CreateUniLend. # noqa: E501
  108. :rtype: str
  109. """
  110. return self._min_rate
  111. @min_rate.setter
  112. def min_rate(self, min_rate):
  113. """Sets the min_rate of this CreateUniLend.
  114. The minimum interest rate. If the value is too high, it might lead to the unsuccessful lending and no profit will be gained for that hour. # noqa: E501
  115. :param min_rate: The min_rate of this CreateUniLend. # noqa: E501
  116. :type: str
  117. """
  118. self._min_rate = min_rate
  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, CreateUniLend):
  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, CreateUniLend):
  152. return True
  153. return self.to_dict() != other.to_dict()