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

238 lines
7.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 CreateUniLoan(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', 'type': 'str', 'amount': 'str', 'repaid_all': 'bool', 'currency_pair': 'str'}
  25. attribute_map = {
  26. 'currency': 'currency',
  27. 'type': 'type',
  28. 'amount': 'amount',
  29. 'repaid_all': 'repaid_all',
  30. 'currency_pair': 'currency_pair',
  31. }
  32. def __init__(
  33. self, currency=None, type=None, amount=None, repaid_all=None, currency_pair=None, local_vars_configuration=None
  34. ): # noqa: E501
  35. # type: (str, str, str, bool, str, Configuration) -> None
  36. """CreateUniLoan - a model defined in OpenAPI""" # noqa: E501
  37. if local_vars_configuration is None:
  38. local_vars_configuration = Configuration()
  39. self.local_vars_configuration = local_vars_configuration
  40. self._currency = None
  41. self._type = None
  42. self._amount = None
  43. self._repaid_all = None
  44. self._currency_pair = None
  45. self.discriminator = None
  46. self.currency = currency
  47. self.type = type
  48. self.amount = amount
  49. if repaid_all is not None:
  50. self.repaid_all = repaid_all
  51. self.currency_pair = currency_pair
  52. @property
  53. def currency(self):
  54. """Gets the currency of this CreateUniLoan. # noqa: E501
  55. Currency # noqa: E501
  56. :return: The currency of this CreateUniLoan. # noqa: E501
  57. :rtype: str
  58. """
  59. return self._currency
  60. @currency.setter
  61. def currency(self, currency):
  62. """Sets the currency of this CreateUniLoan.
  63. Currency # noqa: E501
  64. :param currency: The currency of this CreateUniLoan. # noqa: E501
  65. :type: str
  66. """
  67. if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501
  68. raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501
  69. self._currency = currency
  70. @property
  71. def type(self):
  72. """Gets the type of this CreateUniLoan. # noqa: E501
  73. type: borrow - borrow, repay - repay # noqa: E501
  74. :return: The type of this CreateUniLoan. # noqa: E501
  75. :rtype: str
  76. """
  77. return self._type
  78. @type.setter
  79. def type(self, type):
  80. """Sets the type of this CreateUniLoan.
  81. type: borrow - borrow, repay - repay # noqa: E501
  82. :param type: The type of this CreateUniLoan. # noqa: E501
  83. :type: str
  84. """
  85. if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
  86. raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
  87. allowed_values = ["borrow", "repay"] # noqa: E501
  88. if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501
  89. raise ValueError(
  90. "Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values) # noqa: E501
  91. )
  92. self._type = type
  93. @property
  94. def amount(self):
  95. """Gets the amount of this CreateUniLoan. # noqa: E501
  96. The amount of lending or repaying # noqa: E501
  97. :return: The amount of this CreateUniLoan. # noqa: E501
  98. :rtype: str
  99. """
  100. return self._amount
  101. @amount.setter
  102. def amount(self, amount):
  103. """Sets the amount of this CreateUniLoan.
  104. The amount of lending or repaying # noqa: E501
  105. :param amount: The amount of this CreateUniLoan. # noqa: E501
  106. :type: str
  107. """
  108. if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501
  109. raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501
  110. self._amount = amount
  111. @property
  112. def repaid_all(self):
  113. """Gets the repaid_all of this CreateUniLoan. # noqa: E501
  114. Full repayment. Repay operation only. If the value is `true`, the amount will be ignored and the loan will be repaid in full. # noqa: E501
  115. :return: The repaid_all of this CreateUniLoan. # noqa: E501
  116. :rtype: bool
  117. """
  118. return self._repaid_all
  119. @repaid_all.setter
  120. def repaid_all(self, repaid_all):
  121. """Sets the repaid_all of this CreateUniLoan.
  122. Full repayment. Repay operation only. If the value is `true`, the amount will be ignored and the loan will be repaid in full. # noqa: E501
  123. :param repaid_all: The repaid_all of this CreateUniLoan. # noqa: E501
  124. :type: bool
  125. """
  126. self._repaid_all = repaid_all
  127. @property
  128. def currency_pair(self):
  129. """Gets the currency_pair of this CreateUniLoan. # noqa: E501
  130. Currency pair # noqa: E501
  131. :return: The currency_pair of this CreateUniLoan. # noqa: E501
  132. :rtype: str
  133. """
  134. return self._currency_pair
  135. @currency_pair.setter
  136. def currency_pair(self, currency_pair):
  137. """Sets the currency_pair of this CreateUniLoan.
  138. Currency pair # noqa: E501
  139. :param currency_pair: The currency_pair of this CreateUniLoan. # noqa: E501
  140. :type: str
  141. """
  142. if self.local_vars_configuration.client_side_validation and currency_pair is None: # noqa: E501
  143. raise ValueError("Invalid value for `currency_pair`, must not be `None`") # noqa: E501
  144. self._currency_pair = currency_pair
  145. def to_dict(self):
  146. """Returns the model properties as a dict"""
  147. result = {}
  148. for attr, _ in six.iteritems(self.openapi_types):
  149. value = getattr(self, attr)
  150. if isinstance(value, list):
  151. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  152. elif hasattr(value, "to_dict"):
  153. result[attr] = value.to_dict()
  154. elif isinstance(value, dict):
  155. result[attr] = dict(
  156. map(
  157. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  158. value.items(),
  159. )
  160. )
  161. else:
  162. result[attr] = value
  163. return result
  164. def to_str(self):
  165. """Returns the string representation of the model"""
  166. return pprint.pformat(self.to_dict())
  167. def __repr__(self):
  168. """For `print` and `pprint`"""
  169. return self.to_str()
  170. def __eq__(self, other):
  171. """Returns true if both objects are equal"""
  172. if not isinstance(other, CreateUniLoan):
  173. return False
  174. return self.to_dict() == other.to_dict()
  175. def __ne__(self, other):
  176. """Returns true if both objects are not equal"""
  177. if not isinstance(other, CreateUniLoan):
  178. return True
  179. return self.to_dict() != other.to_dict()