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

231 lines
6.5 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 MarginAccount(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_pair': 'str',
  26. 'locked': 'bool',
  27. 'risk': 'str',
  28. 'base': 'MarginAccountCurrency',
  29. 'quote': 'MarginAccountCurrency',
  30. }
  31. attribute_map = {
  32. 'currency_pair': 'currency_pair',
  33. 'locked': 'locked',
  34. 'risk': 'risk',
  35. 'base': 'base',
  36. 'quote': 'quote',
  37. }
  38. def __init__(
  39. self, currency_pair=None, locked=None, risk=None, base=None, quote=None, local_vars_configuration=None
  40. ): # noqa: E501
  41. # type: (str, bool, str, MarginAccountCurrency, MarginAccountCurrency, Configuration) -> None
  42. """MarginAccount - a model defined in OpenAPI""" # noqa: E501
  43. if local_vars_configuration is None:
  44. local_vars_configuration = Configuration()
  45. self.local_vars_configuration = local_vars_configuration
  46. self._currency_pair = None
  47. self._locked = None
  48. self._risk = None
  49. self._base = None
  50. self._quote = None
  51. self.discriminator = None
  52. if currency_pair is not None:
  53. self.currency_pair = currency_pair
  54. if locked is not None:
  55. self.locked = locked
  56. if risk is not None:
  57. self.risk = risk
  58. if base is not None:
  59. self.base = base
  60. if quote is not None:
  61. self.quote = quote
  62. @property
  63. def currency_pair(self):
  64. """Gets the currency_pair of this MarginAccount. # noqa: E501
  65. Currency pair # noqa: E501
  66. :return: The currency_pair of this MarginAccount. # noqa: E501
  67. :rtype: str
  68. """
  69. return self._currency_pair
  70. @currency_pair.setter
  71. def currency_pair(self, currency_pair):
  72. """Sets the currency_pair of this MarginAccount.
  73. Currency pair # noqa: E501
  74. :param currency_pair: The currency_pair of this MarginAccount. # noqa: E501
  75. :type: str
  76. """
  77. self._currency_pair = currency_pair
  78. @property
  79. def locked(self):
  80. """Gets the locked of this MarginAccount. # noqa: E501
  81. Whether account is locked # noqa: E501
  82. :return: The locked of this MarginAccount. # noqa: E501
  83. :rtype: bool
  84. """
  85. return self._locked
  86. @locked.setter
  87. def locked(self, locked):
  88. """Sets the locked of this MarginAccount.
  89. Whether account is locked # noqa: E501
  90. :param locked: The locked of this MarginAccount. # noqa: E501
  91. :type: bool
  92. """
  93. self._locked = locked
  94. @property
  95. def risk(self):
  96. """Gets the risk of this MarginAccount. # noqa: E501
  97. Current risk rate of margin account # noqa: E501
  98. :return: The risk of this MarginAccount. # noqa: E501
  99. :rtype: str
  100. """
  101. return self._risk
  102. @risk.setter
  103. def risk(self, risk):
  104. """Sets the risk of this MarginAccount.
  105. Current risk rate of margin account # noqa: E501
  106. :param risk: The risk of this MarginAccount. # noqa: E501
  107. :type: str
  108. """
  109. self._risk = risk
  110. @property
  111. def base(self):
  112. """Gets the base of this MarginAccount. # noqa: E501
  113. :return: The base of this MarginAccount. # noqa: E501
  114. :rtype: MarginAccountCurrency
  115. """
  116. return self._base
  117. @base.setter
  118. def base(self, base):
  119. """Sets the base of this MarginAccount.
  120. :param base: The base of this MarginAccount. # noqa: E501
  121. :type: MarginAccountCurrency
  122. """
  123. self._base = base
  124. @property
  125. def quote(self):
  126. """Gets the quote of this MarginAccount. # noqa: E501
  127. :return: The quote of this MarginAccount. # noqa: E501
  128. :rtype: MarginAccountCurrency
  129. """
  130. return self._quote
  131. @quote.setter
  132. def quote(self, quote):
  133. """Sets the quote of this MarginAccount.
  134. :param quote: The quote of this MarginAccount. # noqa: E501
  135. :type: MarginAccountCurrency
  136. """
  137. self._quote = quote
  138. def to_dict(self):
  139. """Returns the model properties as a dict"""
  140. result = {}
  141. for attr, _ in six.iteritems(self.openapi_types):
  142. value = getattr(self, attr)
  143. if isinstance(value, list):
  144. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  145. elif hasattr(value, "to_dict"):
  146. result[attr] = value.to_dict()
  147. elif isinstance(value, dict):
  148. result[attr] = dict(
  149. map(
  150. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  151. value.items(),
  152. )
  153. )
  154. else:
  155. result[attr] = value
  156. return result
  157. def to_str(self):
  158. """Returns the string representation of the model"""
  159. return pprint.pformat(self.to_dict())
  160. def __repr__(self):
  161. """For `print` and `pprint`"""
  162. return self.to_str()
  163. def __eq__(self, other):
  164. """Returns true if both objects are equal"""
  165. if not isinstance(other, MarginAccount):
  166. return False
  167. return self.to_dict() == other.to_dict()
  168. def __ne__(self, other):
  169. """Returns true if both objects are not equal"""
  170. if not isinstance(other, MarginAccount):
  171. return True
  172. return self.to_dict() != other.to_dict()