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

348 lines
11 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 SubAccountTransfer(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. 'sub_account': 'str',
  27. 'direction': 'str',
  28. 'amount': 'str',
  29. 'uid': 'str',
  30. 'timest': 'str',
  31. 'source': 'str',
  32. 'sub_account_type': 'str',
  33. }
  34. attribute_map = {
  35. 'currency': 'currency',
  36. 'sub_account': 'sub_account',
  37. 'direction': 'direction',
  38. 'amount': 'amount',
  39. 'uid': 'uid',
  40. 'timest': 'timest',
  41. 'source': 'source',
  42. 'sub_account_type': 'sub_account_type',
  43. }
  44. def __init__(
  45. self,
  46. currency=None,
  47. sub_account=None,
  48. direction=None,
  49. amount=None,
  50. uid=None,
  51. timest=None,
  52. source=None,
  53. sub_account_type='spot',
  54. local_vars_configuration=None,
  55. ): # noqa: E501
  56. # type: (str, str, str, str, str, str, str, str, Configuration) -> None
  57. """SubAccountTransfer - a model defined in OpenAPI""" # noqa: E501
  58. if local_vars_configuration is None:
  59. local_vars_configuration = Configuration()
  60. self.local_vars_configuration = local_vars_configuration
  61. self._currency = None
  62. self._sub_account = None
  63. self._direction = None
  64. self._amount = None
  65. self._uid = None
  66. self._timest = None
  67. self._source = None
  68. self._sub_account_type = None
  69. self.discriminator = None
  70. self.currency = currency
  71. self.sub_account = sub_account
  72. self.direction = direction
  73. self.amount = amount
  74. if uid is not None:
  75. self.uid = uid
  76. if timest is not None:
  77. self.timest = timest
  78. if source is not None:
  79. self.source = source
  80. if sub_account_type is not None:
  81. self.sub_account_type = sub_account_type
  82. @property
  83. def currency(self):
  84. """Gets the currency of this SubAccountTransfer. # noqa: E501
  85. Transfer currency name # noqa: E501
  86. :return: The currency of this SubAccountTransfer. # noqa: E501
  87. :rtype: str
  88. """
  89. return self._currency
  90. @currency.setter
  91. def currency(self, currency):
  92. """Sets the currency of this SubAccountTransfer.
  93. Transfer currency name # noqa: E501
  94. :param currency: The currency of this SubAccountTransfer. # noqa: E501
  95. :type: str
  96. """
  97. if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501
  98. raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501
  99. self._currency = currency
  100. @property
  101. def sub_account(self):
  102. """Gets the sub_account of this SubAccountTransfer. # noqa: E501
  103. Sub account user ID # noqa: E501
  104. :return: The sub_account of this SubAccountTransfer. # noqa: E501
  105. :rtype: str
  106. """
  107. return self._sub_account
  108. @sub_account.setter
  109. def sub_account(self, sub_account):
  110. """Sets the sub_account of this SubAccountTransfer.
  111. Sub account user ID # noqa: E501
  112. :param sub_account: The sub_account of this SubAccountTransfer. # noqa: E501
  113. :type: str
  114. """
  115. if self.local_vars_configuration.client_side_validation and sub_account is None: # noqa: E501
  116. raise ValueError("Invalid value for `sub_account`, must not be `None`") # noqa: E501
  117. self._sub_account = sub_account
  118. @property
  119. def direction(self):
  120. """Gets the direction of this SubAccountTransfer. # noqa: E501
  121. Transfer direction. to - transfer into sub account; from - transfer out from sub account # noqa: E501
  122. :return: The direction of this SubAccountTransfer. # noqa: E501
  123. :rtype: str
  124. """
  125. return self._direction
  126. @direction.setter
  127. def direction(self, direction):
  128. """Sets the direction of this SubAccountTransfer.
  129. Transfer direction. to - transfer into sub account; from - transfer out from sub account # noqa: E501
  130. :param direction: The direction of this SubAccountTransfer. # noqa: E501
  131. :type: str
  132. """
  133. if self.local_vars_configuration.client_side_validation and direction is None: # noqa: E501
  134. raise ValueError("Invalid value for `direction`, must not be `None`") # noqa: E501
  135. allowed_values = ["to", "from"] # noqa: E501
  136. if self.local_vars_configuration.client_side_validation and direction not in allowed_values: # noqa: E501
  137. raise ValueError(
  138. "Invalid value for `direction` ({0}), must be one of {1}".format( # noqa: E501
  139. direction, allowed_values
  140. )
  141. )
  142. self._direction = direction
  143. @property
  144. def amount(self):
  145. """Gets the amount of this SubAccountTransfer. # noqa: E501
  146. Transfer amount # noqa: E501
  147. :return: The amount of this SubAccountTransfer. # noqa: E501
  148. :rtype: str
  149. """
  150. return self._amount
  151. @amount.setter
  152. def amount(self, amount):
  153. """Sets the amount of this SubAccountTransfer.
  154. Transfer amount # noqa: E501
  155. :param amount: The amount of this SubAccountTransfer. # noqa: E501
  156. :type: str
  157. """
  158. if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501
  159. raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501
  160. self._amount = amount
  161. @property
  162. def uid(self):
  163. """Gets the uid of this SubAccountTransfer. # noqa: E501
  164. Main account user ID # noqa: E501
  165. :return: The uid of this SubAccountTransfer. # noqa: E501
  166. :rtype: str
  167. """
  168. return self._uid
  169. @uid.setter
  170. def uid(self, uid):
  171. """Sets the uid of this SubAccountTransfer.
  172. Main account user ID # noqa: E501
  173. :param uid: The uid of this SubAccountTransfer. # noqa: E501
  174. :type: str
  175. """
  176. self._uid = uid
  177. @property
  178. def timest(self):
  179. """Gets the timest of this SubAccountTransfer. # noqa: E501
  180. Transfer timestamp # noqa: E501
  181. :return: The timest of this SubAccountTransfer. # noqa: E501
  182. :rtype: str
  183. """
  184. return self._timest
  185. @timest.setter
  186. def timest(self, timest):
  187. """Sets the timest of this SubAccountTransfer.
  188. Transfer timestamp # noqa: E501
  189. :param timest: The timest of this SubAccountTransfer. # noqa: E501
  190. :type: str
  191. """
  192. self._timest = timest
  193. @property
  194. def source(self):
  195. """Gets the source of this SubAccountTransfer. # noqa: E501
  196. Where the operation is initiated from # noqa: E501
  197. :return: The source of this SubAccountTransfer. # noqa: E501
  198. :rtype: str
  199. """
  200. return self._source
  201. @source.setter
  202. def source(self, source):
  203. """Sets the source of this SubAccountTransfer.
  204. Where the operation is initiated from # noqa: E501
  205. :param source: The source of this SubAccountTransfer. # noqa: E501
  206. :type: str
  207. """
  208. self._source = source
  209. @property
  210. def sub_account_type(self):
  211. """Gets the sub_account_type of this SubAccountTransfer. # noqa: E501
  212. Target sub user's account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account, `delivery` - delivery account # noqa: E501
  213. :return: The sub_account_type of this SubAccountTransfer. # noqa: E501
  214. :rtype: str
  215. """
  216. return self._sub_account_type
  217. @sub_account_type.setter
  218. def sub_account_type(self, sub_account_type):
  219. """Sets the sub_account_type of this SubAccountTransfer.
  220. Target sub user's account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account, `delivery` - delivery account # noqa: E501
  221. :param sub_account_type: The sub_account_type of this SubAccountTransfer. # noqa: E501
  222. :type: str
  223. """
  224. allowed_values = ["spot", "futures", "cross_margin", "delivery"] # noqa: E501
  225. if (
  226. self.local_vars_configuration.client_side_validation and sub_account_type not in allowed_values
  227. ): # noqa: E501
  228. raise ValueError(
  229. "Invalid value for `sub_account_type` ({0}), must be one of {1}".format( # noqa: E501
  230. sub_account_type, allowed_values
  231. )
  232. )
  233. self._sub_account_type = sub_account_type
  234. def to_dict(self):
  235. """Returns the model properties as a dict"""
  236. result = {}
  237. for attr, _ in six.iteritems(self.openapi_types):
  238. value = getattr(self, attr)
  239. if isinstance(value, list):
  240. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  241. elif hasattr(value, "to_dict"):
  242. result[attr] = value.to_dict()
  243. elif isinstance(value, dict):
  244. result[attr] = dict(
  245. map(
  246. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  247. value.items(),
  248. )
  249. )
  250. else:
  251. result[attr] = value
  252. return result
  253. def to_str(self):
  254. """Returns the string representation of the model"""
  255. return pprint.pformat(self.to_dict())
  256. def __repr__(self):
  257. """For `print` and `pprint`"""
  258. return self.to_str()
  259. def __eq__(self, other):
  260. """Returns true if both objects are equal"""
  261. if not isinstance(other, SubAccountTransfer):
  262. return False
  263. return self.to_dict() == other.to_dict()
  264. def __ne__(self, other):
  265. """Returns true if both objects are not equal"""
  266. if not isinstance(other, SubAccountTransfer):
  267. return True
  268. return self.to_dict() != other.to_dict()