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

326 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 SubAccountKey(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. 'user_id': 'str',
  26. 'name': 'str',
  27. 'perms': 'list[ApiV4KeyPerm]',
  28. 'ip_whitelist': 'list[str]',
  29. 'key': 'str',
  30. 'state': 'int',
  31. 'created_at': 'str',
  32. 'updated_at': 'str',
  33. }
  34. attribute_map = {
  35. 'user_id': 'user_id',
  36. 'name': 'name',
  37. 'perms': 'perms',
  38. 'ip_whitelist': 'ip_whitelist',
  39. 'key': 'key',
  40. 'state': 'state',
  41. 'created_at': 'created_at',
  42. 'updated_at': 'updated_at',
  43. }
  44. def __init__(
  45. self,
  46. user_id=None,
  47. name=None,
  48. perms=None,
  49. ip_whitelist=None,
  50. key=None,
  51. state=None,
  52. created_at=None,
  53. updated_at=None,
  54. local_vars_configuration=None,
  55. ): # noqa: E501
  56. # type: (str, str, list[ApiV4KeyPerm], list[str], str, int, str, str, Configuration) -> None
  57. """SubAccountKey - 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._user_id = None
  62. self._name = None
  63. self._perms = None
  64. self._ip_whitelist = None
  65. self._key = None
  66. self._state = None
  67. self._created_at = None
  68. self._updated_at = None
  69. self.discriminator = None
  70. if user_id is not None:
  71. self.user_id = user_id
  72. if name is not None:
  73. self.name = name
  74. if perms is not None:
  75. self.perms = perms
  76. if ip_whitelist is not None:
  77. self.ip_whitelist = ip_whitelist
  78. if key is not None:
  79. self.key = key
  80. if state is not None:
  81. self.state = state
  82. if created_at is not None:
  83. self.created_at = created_at
  84. if updated_at is not None:
  85. self.updated_at = updated_at
  86. @property
  87. def user_id(self):
  88. """Gets the user_id of this SubAccountKey. # noqa: E501
  89. User ID # noqa: E501
  90. :return: The user_id of this SubAccountKey. # noqa: E501
  91. :rtype: str
  92. """
  93. return self._user_id
  94. @user_id.setter
  95. def user_id(self, user_id):
  96. """Sets the user_id of this SubAccountKey.
  97. User ID # noqa: E501
  98. :param user_id: The user_id of this SubAccountKey. # noqa: E501
  99. :type: str
  100. """
  101. self._user_id = user_id
  102. @property
  103. def name(self):
  104. """Gets the name of this SubAccountKey. # noqa: E501
  105. API key name # noqa: E501
  106. :return: The name of this SubAccountKey. # noqa: E501
  107. :rtype: str
  108. """
  109. return self._name
  110. @name.setter
  111. def name(self, name):
  112. """Sets the name of this SubAccountKey.
  113. API key name # noqa: E501
  114. :param name: The name of this SubAccountKey. # noqa: E501
  115. :type: str
  116. """
  117. self._name = name
  118. @property
  119. def perms(self):
  120. """Gets the perms of this SubAccountKey. # noqa: E501
  121. :return: The perms of this SubAccountKey. # noqa: E501
  122. :rtype: list[ApiV4KeyPerm]
  123. """
  124. return self._perms
  125. @perms.setter
  126. def perms(self, perms):
  127. """Sets the perms of this SubAccountKey.
  128. :param perms: The perms of this SubAccountKey. # noqa: E501
  129. :type: list[ApiV4KeyPerm]
  130. """
  131. self._perms = perms
  132. @property
  133. def ip_whitelist(self):
  134. """Gets the ip_whitelist of this SubAccountKey. # noqa: E501
  135. ip white list (list will be removed if no value is passed) # noqa: E501
  136. :return: The ip_whitelist of this SubAccountKey. # noqa: E501
  137. :rtype: list[str]
  138. """
  139. return self._ip_whitelist
  140. @ip_whitelist.setter
  141. def ip_whitelist(self, ip_whitelist):
  142. """Sets the ip_whitelist of this SubAccountKey.
  143. ip white list (list will be removed if no value is passed) # noqa: E501
  144. :param ip_whitelist: The ip_whitelist of this SubAccountKey. # noqa: E501
  145. :type: list[str]
  146. """
  147. self._ip_whitelist = ip_whitelist
  148. @property
  149. def key(self):
  150. """Gets the key of this SubAccountKey. # noqa: E501
  151. API Key # noqa: E501
  152. :return: The key of this SubAccountKey. # noqa: E501
  153. :rtype: str
  154. """
  155. return self._key
  156. @key.setter
  157. def key(self, key):
  158. """Sets the key of this SubAccountKey.
  159. API Key # noqa: E501
  160. :param key: The key of this SubAccountKey. # noqa: E501
  161. :type: str
  162. """
  163. self._key = key
  164. @property
  165. def state(self):
  166. """Gets the state of this SubAccountKey. # noqa: E501
  167. State 1 - normal 2 - locked 3 - frozen # noqa: E501
  168. :return: The state of this SubAccountKey. # noqa: E501
  169. :rtype: int
  170. """
  171. return self._state
  172. @state.setter
  173. def state(self, state):
  174. """Sets the state of this SubAccountKey.
  175. State 1 - normal 2 - locked 3 - frozen # noqa: E501
  176. :param state: The state of this SubAccountKey. # noqa: E501
  177. :type: int
  178. """
  179. self._state = state
  180. @property
  181. def created_at(self):
  182. """Gets the created_at of this SubAccountKey. # noqa: E501
  183. Creation time # noqa: E501
  184. :return: The created_at of this SubAccountKey. # noqa: E501
  185. :rtype: str
  186. """
  187. return self._created_at
  188. @created_at.setter
  189. def created_at(self, created_at):
  190. """Sets the created_at of this SubAccountKey.
  191. Creation time # noqa: E501
  192. :param created_at: The created_at of this SubAccountKey. # noqa: E501
  193. :type: str
  194. """
  195. self._created_at = created_at
  196. @property
  197. def updated_at(self):
  198. """Gets the updated_at of this SubAccountKey. # noqa: E501
  199. Last update time # noqa: E501
  200. :return: The updated_at of this SubAccountKey. # noqa: E501
  201. :rtype: str
  202. """
  203. return self._updated_at
  204. @updated_at.setter
  205. def updated_at(self, updated_at):
  206. """Sets the updated_at of this SubAccountKey.
  207. Last update time # noqa: E501
  208. :param updated_at: The updated_at of this SubAccountKey. # noqa: E501
  209. :type: str
  210. """
  211. self._updated_at = updated_at
  212. def to_dict(self):
  213. """Returns the model properties as a dict"""
  214. result = {}
  215. for attr, _ in six.iteritems(self.openapi_types):
  216. value = getattr(self, attr)
  217. if isinstance(value, list):
  218. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  219. elif hasattr(value, "to_dict"):
  220. result[attr] = value.to_dict()
  221. elif isinstance(value, dict):
  222. result[attr] = dict(
  223. map(
  224. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  225. value.items(),
  226. )
  227. )
  228. else:
  229. result[attr] = value
  230. return result
  231. def to_str(self):
  232. """Returns the string representation of the model"""
  233. return pprint.pformat(self.to_dict())
  234. def __repr__(self):
  235. """For `print` and `pprint`"""
  236. return self.to_str()
  237. def __eq__(self, other):
  238. """Returns true if both objects are equal"""
  239. if not isinstance(other, SubAccountKey):
  240. return False
  241. return self.to_dict() == other.to_dict()
  242. def __ne__(self, other):
  243. """Returns true if both objects are not equal"""
  244. if not isinstance(other, SubAccountKey):
  245. return True
  246. return self.to_dict() != other.to_dict()