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

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