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

357 lines
10 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 CrossMarginBalance(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. 'available': 'str',
  26. 'freeze': 'str',
  27. 'borrowed': 'str',
  28. 'interest': 'str',
  29. 'negative_liab': 'str',
  30. 'futures_pos_liab': 'str',
  31. 'equity': 'str',
  32. 'total_freeze': 'str',
  33. 'total_liab': 'str',
  34. }
  35. attribute_map = {
  36. 'available': 'available',
  37. 'freeze': 'freeze',
  38. 'borrowed': 'borrowed',
  39. 'interest': 'interest',
  40. 'negative_liab': 'negative_liab',
  41. 'futures_pos_liab': 'futures_pos_liab',
  42. 'equity': 'equity',
  43. 'total_freeze': 'total_freeze',
  44. 'total_liab': 'total_liab',
  45. }
  46. def __init__(
  47. self,
  48. available=None,
  49. freeze=None,
  50. borrowed=None,
  51. interest=None,
  52. negative_liab=None,
  53. futures_pos_liab=None,
  54. equity=None,
  55. total_freeze=None,
  56. total_liab=None,
  57. local_vars_configuration=None,
  58. ): # noqa: E501
  59. # type: (str, str, str, str, str, str, str, str, str, Configuration) -> None
  60. """CrossMarginBalance - a model defined in OpenAPI""" # noqa: E501
  61. if local_vars_configuration is None:
  62. local_vars_configuration = Configuration()
  63. self.local_vars_configuration = local_vars_configuration
  64. self._available = None
  65. self._freeze = None
  66. self._borrowed = None
  67. self._interest = None
  68. self._negative_liab = None
  69. self._futures_pos_liab = None
  70. self._equity = None
  71. self._total_freeze = None
  72. self._total_liab = None
  73. self.discriminator = None
  74. if available is not None:
  75. self.available = available
  76. if freeze is not None:
  77. self.freeze = freeze
  78. if borrowed is not None:
  79. self.borrowed = borrowed
  80. if interest is not None:
  81. self.interest = interest
  82. if negative_liab is not None:
  83. self.negative_liab = negative_liab
  84. if futures_pos_liab is not None:
  85. self.futures_pos_liab = futures_pos_liab
  86. if equity is not None:
  87. self.equity = equity
  88. if total_freeze is not None:
  89. self.total_freeze = total_freeze
  90. if total_liab is not None:
  91. self.total_liab = total_liab
  92. @property
  93. def available(self):
  94. """Gets the available of this CrossMarginBalance. # noqa: E501
  95. Available amount # noqa: E501
  96. :return: The available of this CrossMarginBalance. # noqa: E501
  97. :rtype: str
  98. """
  99. return self._available
  100. @available.setter
  101. def available(self, available):
  102. """Sets the available of this CrossMarginBalance.
  103. Available amount # noqa: E501
  104. :param available: The available of this CrossMarginBalance. # noqa: E501
  105. :type: str
  106. """
  107. self._available = available
  108. @property
  109. def freeze(self):
  110. """Gets the freeze of this CrossMarginBalance. # noqa: E501
  111. Locked amount # noqa: E501
  112. :return: The freeze of this CrossMarginBalance. # noqa: E501
  113. :rtype: str
  114. """
  115. return self._freeze
  116. @freeze.setter
  117. def freeze(self, freeze):
  118. """Sets the freeze of this CrossMarginBalance.
  119. Locked amount # noqa: E501
  120. :param freeze: The freeze of this CrossMarginBalance. # noqa: E501
  121. :type: str
  122. """
  123. self._freeze = freeze
  124. @property
  125. def borrowed(self):
  126. """Gets the borrowed of this CrossMarginBalance. # noqa: E501
  127. Borrowed amount # noqa: E501
  128. :return: The borrowed of this CrossMarginBalance. # noqa: E501
  129. :rtype: str
  130. """
  131. return self._borrowed
  132. @borrowed.setter
  133. def borrowed(self, borrowed):
  134. """Sets the borrowed of this CrossMarginBalance.
  135. Borrowed amount # noqa: E501
  136. :param borrowed: The borrowed of this CrossMarginBalance. # noqa: E501
  137. :type: str
  138. """
  139. self._borrowed = borrowed
  140. @property
  141. def interest(self):
  142. """Gets the interest of this CrossMarginBalance. # noqa: E501
  143. Unpaid interests # noqa: E501
  144. :return: The interest of this CrossMarginBalance. # noqa: E501
  145. :rtype: str
  146. """
  147. return self._interest
  148. @interest.setter
  149. def interest(self, interest):
  150. """Sets the interest of this CrossMarginBalance.
  151. Unpaid interests # noqa: E501
  152. :param interest: The interest of this CrossMarginBalance. # noqa: E501
  153. :type: str
  154. """
  155. self._interest = interest
  156. @property
  157. def negative_liab(self):
  158. """Gets the negative_liab of this CrossMarginBalance. # noqa: E501
  159. Negative Liabilities # noqa: E501
  160. :return: The negative_liab of this CrossMarginBalance. # noqa: E501
  161. :rtype: str
  162. """
  163. return self._negative_liab
  164. @negative_liab.setter
  165. def negative_liab(self, negative_liab):
  166. """Sets the negative_liab of this CrossMarginBalance.
  167. Negative Liabilities # noqa: E501
  168. :param negative_liab: The negative_liab of this CrossMarginBalance. # noqa: E501
  169. :type: str
  170. """
  171. self._negative_liab = negative_liab
  172. @property
  173. def futures_pos_liab(self):
  174. """Gets the futures_pos_liab of this CrossMarginBalance. # noqa: E501
  175. Borrowing to Open Positions in Futures # noqa: E501
  176. :return: The futures_pos_liab of this CrossMarginBalance. # noqa: E501
  177. :rtype: str
  178. """
  179. return self._futures_pos_liab
  180. @futures_pos_liab.setter
  181. def futures_pos_liab(self, futures_pos_liab):
  182. """Sets the futures_pos_liab of this CrossMarginBalance.
  183. Borrowing to Open Positions in Futures # noqa: E501
  184. :param futures_pos_liab: The futures_pos_liab of this CrossMarginBalance. # noqa: E501
  185. :type: str
  186. """
  187. self._futures_pos_liab = futures_pos_liab
  188. @property
  189. def equity(self):
  190. """Gets the equity of this CrossMarginBalance. # noqa: E501
  191. Equity # noqa: E501
  192. :return: The equity of this CrossMarginBalance. # noqa: E501
  193. :rtype: str
  194. """
  195. return self._equity
  196. @equity.setter
  197. def equity(self, equity):
  198. """Sets the equity of this CrossMarginBalance.
  199. Equity # noqa: E501
  200. :param equity: The equity of this CrossMarginBalance. # noqa: E501
  201. :type: str
  202. """
  203. self._equity = equity
  204. @property
  205. def total_freeze(self):
  206. """Gets the total_freeze of this CrossMarginBalance. # noqa: E501
  207. Total occupied # noqa: E501
  208. :return: The total_freeze of this CrossMarginBalance. # noqa: E501
  209. :rtype: str
  210. """
  211. return self._total_freeze
  212. @total_freeze.setter
  213. def total_freeze(self, total_freeze):
  214. """Sets the total_freeze of this CrossMarginBalance.
  215. Total occupied # noqa: E501
  216. :param total_freeze: The total_freeze of this CrossMarginBalance. # noqa: E501
  217. :type: str
  218. """
  219. self._total_freeze = total_freeze
  220. @property
  221. def total_liab(self):
  222. """Gets the total_liab of this CrossMarginBalance. # noqa: E501
  223. Total liabilities # noqa: E501
  224. :return: The total_liab of this CrossMarginBalance. # noqa: E501
  225. :rtype: str
  226. """
  227. return self._total_liab
  228. @total_liab.setter
  229. def total_liab(self, total_liab):
  230. """Sets the total_liab of this CrossMarginBalance.
  231. Total liabilities # noqa: E501
  232. :param total_liab: The total_liab of this CrossMarginBalance. # noqa: E501
  233. :type: str
  234. """
  235. self._total_liab = total_liab
  236. def to_dict(self):
  237. """Returns the model properties as a dict"""
  238. result = {}
  239. for attr, _ in six.iteritems(self.openapi_types):
  240. value = getattr(self, attr)
  241. if isinstance(value, list):
  242. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  243. elif hasattr(value, "to_dict"):
  244. result[attr] = value.to_dict()
  245. elif isinstance(value, dict):
  246. result[attr] = dict(
  247. map(
  248. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  249. value.items(),
  250. )
  251. )
  252. else:
  253. result[attr] = value
  254. return result
  255. def to_str(self):
  256. """Returns the string representation of the model"""
  257. return pprint.pformat(self.to_dict())
  258. def __repr__(self):
  259. """For `print` and `pprint`"""
  260. return self.to_str()
  261. def __eq__(self, other):
  262. """Returns true if both objects are equal"""
  263. if not isinstance(other, CrossMarginBalance):
  264. return False
  265. return self.to_dict() == other.to_dict()
  266. def __ne__(self, other):
  267. """Returns true if both objects are not equal"""
  268. if not isinstance(other, CrossMarginBalance):
  269. return True
  270. return self.to_dict() != other.to_dict()