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

386 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 OptionsAccount(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': 'int',
  26. 'total': 'str',
  27. 'short_enabled': 'bool',
  28. 'unrealised_pnl': 'str',
  29. 'init_margin': 'str',
  30. 'maint_margin': 'str',
  31. 'order_margin': 'str',
  32. 'available': 'str',
  33. 'point': 'str',
  34. 'currency': 'str',
  35. }
  36. attribute_map = {
  37. 'user': 'user',
  38. 'total': 'total',
  39. 'short_enabled': 'short_enabled',
  40. 'unrealised_pnl': 'unrealised_pnl',
  41. 'init_margin': 'init_margin',
  42. 'maint_margin': 'maint_margin',
  43. 'order_margin': 'order_margin',
  44. 'available': 'available',
  45. 'point': 'point',
  46. 'currency': 'currency',
  47. }
  48. def __init__(
  49. self,
  50. user=None,
  51. total=None,
  52. short_enabled=None,
  53. unrealised_pnl=None,
  54. init_margin=None,
  55. maint_margin=None,
  56. order_margin=None,
  57. available=None,
  58. point=None,
  59. currency=None,
  60. local_vars_configuration=None,
  61. ): # noqa: E501
  62. # type: (int, str, bool, str, str, str, str, str, str, str, Configuration) -> None
  63. """OptionsAccount - a model defined in OpenAPI""" # noqa: E501
  64. if local_vars_configuration is None:
  65. local_vars_configuration = Configuration()
  66. self.local_vars_configuration = local_vars_configuration
  67. self._user = None
  68. self._total = None
  69. self._short_enabled = None
  70. self._unrealised_pnl = None
  71. self._init_margin = None
  72. self._maint_margin = None
  73. self._order_margin = None
  74. self._available = None
  75. self._point = None
  76. self._currency = None
  77. self.discriminator = None
  78. if user is not None:
  79. self.user = user
  80. if total is not None:
  81. self.total = total
  82. if short_enabled is not None:
  83. self.short_enabled = short_enabled
  84. if unrealised_pnl is not None:
  85. self.unrealised_pnl = unrealised_pnl
  86. if init_margin is not None:
  87. self.init_margin = init_margin
  88. if maint_margin is not None:
  89. self.maint_margin = maint_margin
  90. if order_margin is not None:
  91. self.order_margin = order_margin
  92. if available is not None:
  93. self.available = available
  94. if point is not None:
  95. self.point = point
  96. if currency is not None:
  97. self.currency = currency
  98. @property
  99. def user(self):
  100. """Gets the user of this OptionsAccount. # noqa: E501
  101. User ID # noqa: E501
  102. :return: The user of this OptionsAccount. # noqa: E501
  103. :rtype: int
  104. """
  105. return self._user
  106. @user.setter
  107. def user(self, user):
  108. """Sets the user of this OptionsAccount.
  109. User ID # noqa: E501
  110. :param user: The user of this OptionsAccount. # noqa: E501
  111. :type: int
  112. """
  113. self._user = user
  114. @property
  115. def total(self):
  116. """Gets the total of this OptionsAccount. # noqa: E501
  117. Total account balance # noqa: E501
  118. :return: The total of this OptionsAccount. # noqa: E501
  119. :rtype: str
  120. """
  121. return self._total
  122. @total.setter
  123. def total(self, total):
  124. """Sets the total of this OptionsAccount.
  125. Total account balance # noqa: E501
  126. :param total: The total of this OptionsAccount. # noqa: E501
  127. :type: str
  128. """
  129. self._total = total
  130. @property
  131. def short_enabled(self):
  132. """Gets the short_enabled of this OptionsAccount. # noqa: E501
  133. If the account is allowed to short # noqa: E501
  134. :return: The short_enabled of this OptionsAccount. # noqa: E501
  135. :rtype: bool
  136. """
  137. return self._short_enabled
  138. @short_enabled.setter
  139. def short_enabled(self, short_enabled):
  140. """Sets the short_enabled of this OptionsAccount.
  141. If the account is allowed to short # noqa: E501
  142. :param short_enabled: The short_enabled of this OptionsAccount. # noqa: E501
  143. :type: bool
  144. """
  145. self._short_enabled = short_enabled
  146. @property
  147. def unrealised_pnl(self):
  148. """Gets the unrealised_pnl of this OptionsAccount. # noqa: E501
  149. Unrealized PNL # noqa: E501
  150. :return: The unrealised_pnl of this OptionsAccount. # noqa: E501
  151. :rtype: str
  152. """
  153. return self._unrealised_pnl
  154. @unrealised_pnl.setter
  155. def unrealised_pnl(self, unrealised_pnl):
  156. """Sets the unrealised_pnl of this OptionsAccount.
  157. Unrealized PNL # noqa: E501
  158. :param unrealised_pnl: The unrealised_pnl of this OptionsAccount. # noqa: E501
  159. :type: str
  160. """
  161. self._unrealised_pnl = unrealised_pnl
  162. @property
  163. def init_margin(self):
  164. """Gets the init_margin of this OptionsAccount. # noqa: E501
  165. Initial position margin # noqa: E501
  166. :return: The init_margin of this OptionsAccount. # noqa: E501
  167. :rtype: str
  168. """
  169. return self._init_margin
  170. @init_margin.setter
  171. def init_margin(self, init_margin):
  172. """Sets the init_margin of this OptionsAccount.
  173. Initial position margin # noqa: E501
  174. :param init_margin: The init_margin of this OptionsAccount. # noqa: E501
  175. :type: str
  176. """
  177. self._init_margin = init_margin
  178. @property
  179. def maint_margin(self):
  180. """Gets the maint_margin of this OptionsAccount. # noqa: E501
  181. Position maintenance margin # noqa: E501
  182. :return: The maint_margin of this OptionsAccount. # noqa: E501
  183. :rtype: str
  184. """
  185. return self._maint_margin
  186. @maint_margin.setter
  187. def maint_margin(self, maint_margin):
  188. """Sets the maint_margin of this OptionsAccount.
  189. Position maintenance margin # noqa: E501
  190. :param maint_margin: The maint_margin of this OptionsAccount. # noqa: E501
  191. :type: str
  192. """
  193. self._maint_margin = maint_margin
  194. @property
  195. def order_margin(self):
  196. """Gets the order_margin of this OptionsAccount. # noqa: E501
  197. Order margin of unfinished orders # noqa: E501
  198. :return: The order_margin of this OptionsAccount. # noqa: E501
  199. :rtype: str
  200. """
  201. return self._order_margin
  202. @order_margin.setter
  203. def order_margin(self, order_margin):
  204. """Sets the order_margin of this OptionsAccount.
  205. Order margin of unfinished orders # noqa: E501
  206. :param order_margin: The order_margin of this OptionsAccount. # noqa: E501
  207. :type: str
  208. """
  209. self._order_margin = order_margin
  210. @property
  211. def available(self):
  212. """Gets the available of this OptionsAccount. # noqa: E501
  213. Available balance to transfer out or trade # noqa: E501
  214. :return: The available of this OptionsAccount. # noqa: E501
  215. :rtype: str
  216. """
  217. return self._available
  218. @available.setter
  219. def available(self, available):
  220. """Sets the available of this OptionsAccount.
  221. Available balance to transfer out or trade # noqa: E501
  222. :param available: The available of this OptionsAccount. # noqa: E501
  223. :type: str
  224. """
  225. self._available = available
  226. @property
  227. def point(self):
  228. """Gets the point of this OptionsAccount. # noqa: E501
  229. POINT amount # noqa: E501
  230. :return: The point of this OptionsAccount. # noqa: E501
  231. :rtype: str
  232. """
  233. return self._point
  234. @point.setter
  235. def point(self, point):
  236. """Sets the point of this OptionsAccount.
  237. POINT amount # noqa: E501
  238. :param point: The point of this OptionsAccount. # noqa: E501
  239. :type: str
  240. """
  241. self._point = point
  242. @property
  243. def currency(self):
  244. """Gets the currency of this OptionsAccount. # noqa: E501
  245. Settle currency # noqa: E501
  246. :return: The currency of this OptionsAccount. # noqa: E501
  247. :rtype: str
  248. """
  249. return self._currency
  250. @currency.setter
  251. def currency(self, currency):
  252. """Sets the currency of this OptionsAccount.
  253. Settle currency # noqa: E501
  254. :param currency: The currency of this OptionsAccount. # noqa: E501
  255. :type: str
  256. """
  257. self._currency = currency
  258. def to_dict(self):
  259. """Returns the model properties as a dict"""
  260. result = {}
  261. for attr, _ in six.iteritems(self.openapi_types):
  262. value = getattr(self, attr)
  263. if isinstance(value, list):
  264. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  265. elif hasattr(value, "to_dict"):
  266. result[attr] = value.to_dict()
  267. elif isinstance(value, dict):
  268. result[attr] = dict(
  269. map(
  270. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  271. value.items(),
  272. )
  273. )
  274. else:
  275. result[attr] = value
  276. return result
  277. def to_str(self):
  278. """Returns the string representation of the model"""
  279. return pprint.pformat(self.to_dict())
  280. def __repr__(self):
  281. """For `print` and `pprint`"""
  282. return self.to_str()
  283. def __eq__(self, other):
  284. """Returns true if both objects are equal"""
  285. if not isinstance(other, OptionsAccount):
  286. return False
  287. return self.to_dict() == other.to_dict()
  288. def __ne__(self, other):
  289. """Returns true if both objects are not equal"""
  290. if not isinstance(other, OptionsAccount):
  291. return True
  292. return self.to_dict() != other.to_dict()