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

284 lines
8.9 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 Transfer(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 = {
  25. 'currency': 'str',
  26. '_from': 'str',
  27. 'to': 'str',
  28. 'amount': 'str',
  29. 'currency_pair': 'str',
  30. 'settle': 'str',
  31. }
  32. attribute_map = {
  33. 'currency': 'currency',
  34. '_from': 'from',
  35. 'to': 'to',
  36. 'amount': 'amount',
  37. 'currency_pair': 'currency_pair',
  38. 'settle': 'settle',
  39. }
  40. def __init__(
  41. self,
  42. currency=None,
  43. _from=None,
  44. to=None,
  45. amount=None,
  46. currency_pair=None,
  47. settle=None,
  48. local_vars_configuration=None,
  49. ): # noqa: E501
  50. # type: (str, str, str, str, str, str, Configuration) -> None
  51. """Transfer - a model defined in OpenAPI""" # noqa: E501
  52. if local_vars_configuration is None:
  53. local_vars_configuration = Configuration()
  54. self.local_vars_configuration = local_vars_configuration
  55. self._currency = None
  56. self.__from = None
  57. self._to = None
  58. self._amount = None
  59. self._currency_pair = None
  60. self._settle = None
  61. self.discriminator = None
  62. self.currency = currency
  63. self._from = _from
  64. self.to = to
  65. self.amount = amount
  66. if currency_pair is not None:
  67. self.currency_pair = currency_pair
  68. if settle is not None:
  69. self.settle = settle
  70. @property
  71. def currency(self):
  72. """Gets the currency of this Transfer. # noqa: E501
  73. Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency # noqa: E501
  74. :return: The currency of this Transfer. # noqa: E501
  75. :rtype: str
  76. """
  77. return self._currency
  78. @currency.setter
  79. def currency(self, currency):
  80. """Sets the currency of this Transfer.
  81. Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency # noqa: E501
  82. :param currency: The currency of this Transfer. # noqa: E501
  83. :type: str
  84. """
  85. if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501
  86. raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501
  87. self._currency = currency
  88. @property
  89. def _from(self):
  90. """Gets the _from of this Transfer. # noqa: E501
  91. Account to transfer from # noqa: E501
  92. :return: The _from of this Transfer. # noqa: E501
  93. :rtype: str
  94. """
  95. return self.__from
  96. @_from.setter
  97. def _from(self, _from):
  98. """Sets the _from of this Transfer.
  99. Account to transfer from # noqa: E501
  100. :param _from: The _from of this Transfer. # noqa: E501
  101. :type: str
  102. """
  103. if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501
  104. raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501
  105. allowed_values = ["spot", "margin", "futures", "delivery", "cross_margin", "options"] # noqa: E501
  106. if self.local_vars_configuration.client_side_validation and _from not in allowed_values: # noqa: E501
  107. raise ValueError(
  108. "Invalid value for `_from` ({0}), must be one of {1}".format(_from, allowed_values) # noqa: E501
  109. )
  110. self.__from = _from
  111. @property
  112. def to(self):
  113. """Gets the to of this Transfer. # noqa: E501
  114. Account to transfer to # noqa: E501
  115. :return: The to of this Transfer. # noqa: E501
  116. :rtype: str
  117. """
  118. return self._to
  119. @to.setter
  120. def to(self, to):
  121. """Sets the to of this Transfer.
  122. Account to transfer to # noqa: E501
  123. :param to: The to of this Transfer. # noqa: E501
  124. :type: str
  125. """
  126. if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501
  127. raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501
  128. allowed_values = ["spot", "margin", "futures", "delivery", "cross_margin", "options"] # noqa: E501
  129. if self.local_vars_configuration.client_side_validation and to not in allowed_values: # noqa: E501
  130. raise ValueError(
  131. "Invalid value for `to` ({0}), must be one of {1}".format(to, allowed_values) # noqa: E501
  132. )
  133. self._to = to
  134. @property
  135. def amount(self):
  136. """Gets the amount of this Transfer. # noqa: E501
  137. Transfer amount # noqa: E501
  138. :return: The amount of this Transfer. # noqa: E501
  139. :rtype: str
  140. """
  141. return self._amount
  142. @amount.setter
  143. def amount(self, amount):
  144. """Sets the amount of this Transfer.
  145. Transfer amount # noqa: E501
  146. :param amount: The amount of this Transfer. # noqa: E501
  147. :type: str
  148. """
  149. if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501
  150. raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501
  151. self._amount = amount
  152. @property
  153. def currency_pair(self):
  154. """Gets the currency_pair of this Transfer. # noqa: E501
  155. Margin currency pair. Required if transfer from or to margin account # noqa: E501
  156. :return: The currency_pair of this Transfer. # noqa: E501
  157. :rtype: str
  158. """
  159. return self._currency_pair
  160. @currency_pair.setter
  161. def currency_pair(self, currency_pair):
  162. """Sets the currency_pair of this Transfer.
  163. Margin currency pair. Required if transfer from or to margin account # noqa: E501
  164. :param currency_pair: The currency_pair of this Transfer. # noqa: E501
  165. :type: str
  166. """
  167. self._currency_pair = currency_pair
  168. @property
  169. def settle(self):
  170. """Gets the settle of this Transfer. # noqa: E501
  171. Futures settle currency. Required if transferring from or to futures account # noqa: E501
  172. :return: The settle of this Transfer. # noqa: E501
  173. :rtype: str
  174. """
  175. return self._settle
  176. @settle.setter
  177. def settle(self, settle):
  178. """Sets the settle of this Transfer.
  179. Futures settle currency. Required if transferring from or to futures account # noqa: E501
  180. :param settle: The settle of this Transfer. # noqa: E501
  181. :type: str
  182. """
  183. self._settle = settle
  184. def to_dict(self):
  185. """Returns the model properties as a dict"""
  186. result = {}
  187. for attr, _ in six.iteritems(self.openapi_types):
  188. value = getattr(self, attr)
  189. if isinstance(value, list):
  190. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  191. elif hasattr(value, "to_dict"):
  192. result[attr] = value.to_dict()
  193. elif isinstance(value, dict):
  194. result[attr] = dict(
  195. map(
  196. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  197. value.items(),
  198. )
  199. )
  200. else:
  201. result[attr] = value
  202. return result
  203. def to_str(self):
  204. """Returns the string representation of the model"""
  205. return pprint.pformat(self.to_dict())
  206. def __repr__(self):
  207. """For `print` and `pprint`"""
  208. return self.to_str()
  209. def __eq__(self, other):
  210. """Returns true if both objects are equal"""
  211. if not isinstance(other, Transfer):
  212. return False
  213. return self.to_dict() == other.to_dict()
  214. def __ne__(self, other):
  215. """Returns true if both objects are not equal"""
  216. if not isinstance(other, Transfer):
  217. return True
  218. return self.to_dict() != other.to_dict()