天择加密量化开放框架下载
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
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 CrossMarginCurrency(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. 'name': 'str',
  26. 'rate': 'str',
  27. 'prec': 'str',
  28. 'discount': 'str',
  29. 'min_borrow_amount': 'str',
  30. 'user_max_borrow_amount': 'str',
  31. 'total_max_borrow_amount': 'str',
  32. 'price': 'str',
  33. 'status': 'int',
  34. }
  35. attribute_map = {
  36. 'name': 'name',
  37. 'rate': 'rate',
  38. 'prec': 'prec',
  39. 'discount': 'discount',
  40. 'min_borrow_amount': 'min_borrow_amount',
  41. 'user_max_borrow_amount': 'user_max_borrow_amount',
  42. 'total_max_borrow_amount': 'total_max_borrow_amount',
  43. 'price': 'price',
  44. 'status': 'status',
  45. }
  46. def __init__(
  47. self,
  48. name=None,
  49. rate=None,
  50. prec=None,
  51. discount=None,
  52. min_borrow_amount=None,
  53. user_max_borrow_amount=None,
  54. total_max_borrow_amount=None,
  55. price=None,
  56. status=None,
  57. local_vars_configuration=None,
  58. ): # noqa: E501
  59. # type: (str, str, str, str, str, str, str, str, int, Configuration) -> None
  60. """CrossMarginCurrency - 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._name = None
  65. self._rate = None
  66. self._prec = None
  67. self._discount = None
  68. self._min_borrow_amount = None
  69. self._user_max_borrow_amount = None
  70. self._total_max_borrow_amount = None
  71. self._price = None
  72. self._status = None
  73. self.discriminator = None
  74. if name is not None:
  75. self.name = name
  76. if rate is not None:
  77. self.rate = rate
  78. if prec is not None:
  79. self.prec = prec
  80. if discount is not None:
  81. self.discount = discount
  82. if min_borrow_amount is not None:
  83. self.min_borrow_amount = min_borrow_amount
  84. if user_max_borrow_amount is not None:
  85. self.user_max_borrow_amount = user_max_borrow_amount
  86. if total_max_borrow_amount is not None:
  87. self.total_max_borrow_amount = total_max_borrow_amount
  88. if price is not None:
  89. self.price = price
  90. if status is not None:
  91. self.status = status
  92. @property
  93. def name(self):
  94. """Gets the name of this CrossMarginCurrency. # noqa: E501
  95. Currency name # noqa: E501
  96. :return: The name of this CrossMarginCurrency. # noqa: E501
  97. :rtype: str
  98. """
  99. return self._name
  100. @name.setter
  101. def name(self, name):
  102. """Sets the name of this CrossMarginCurrency.
  103. Currency name # noqa: E501
  104. :param name: The name of this CrossMarginCurrency. # noqa: E501
  105. :type: str
  106. """
  107. self._name = name
  108. @property
  109. def rate(self):
  110. """Gets the rate of this CrossMarginCurrency. # noqa: E501
  111. Minimum lending rate (hourly rate) # noqa: E501
  112. :return: The rate of this CrossMarginCurrency. # noqa: E501
  113. :rtype: str
  114. """
  115. return self._rate
  116. @rate.setter
  117. def rate(self, rate):
  118. """Sets the rate of this CrossMarginCurrency.
  119. Minimum lending rate (hourly rate) # noqa: E501
  120. :param rate: The rate of this CrossMarginCurrency. # noqa: E501
  121. :type: str
  122. """
  123. self._rate = rate
  124. @property
  125. def prec(self):
  126. """Gets the prec of this CrossMarginCurrency. # noqa: E501
  127. Currency precision # noqa: E501
  128. :return: The prec of this CrossMarginCurrency. # noqa: E501
  129. :rtype: str
  130. """
  131. return self._prec
  132. @prec.setter
  133. def prec(self, prec):
  134. """Sets the prec of this CrossMarginCurrency.
  135. Currency precision # noqa: E501
  136. :param prec: The prec of this CrossMarginCurrency. # noqa: E501
  137. :type: str
  138. """
  139. self._prec = prec
  140. @property
  141. def discount(self):
  142. """Gets the discount of this CrossMarginCurrency. # noqa: E501
  143. Currency value discount, which is used in total value calculation # noqa: E501
  144. :return: The discount of this CrossMarginCurrency. # noqa: E501
  145. :rtype: str
  146. """
  147. return self._discount
  148. @discount.setter
  149. def discount(self, discount):
  150. """Sets the discount of this CrossMarginCurrency.
  151. Currency value discount, which is used in total value calculation # noqa: E501
  152. :param discount: The discount of this CrossMarginCurrency. # noqa: E501
  153. :type: str
  154. """
  155. self._discount = discount
  156. @property
  157. def min_borrow_amount(self):
  158. """Gets the min_borrow_amount of this CrossMarginCurrency. # noqa: E501
  159. Minimum currency borrow amount. Unit is currency itself # noqa: E501
  160. :return: The min_borrow_amount of this CrossMarginCurrency. # noqa: E501
  161. :rtype: str
  162. """
  163. return self._min_borrow_amount
  164. @min_borrow_amount.setter
  165. def min_borrow_amount(self, min_borrow_amount):
  166. """Sets the min_borrow_amount of this CrossMarginCurrency.
  167. Minimum currency borrow amount. Unit is currency itself # noqa: E501
  168. :param min_borrow_amount: The min_borrow_amount of this CrossMarginCurrency. # noqa: E501
  169. :type: str
  170. """
  171. self._min_borrow_amount = min_borrow_amount
  172. @property
  173. def user_max_borrow_amount(self):
  174. """Gets the user_max_borrow_amount of this CrossMarginCurrency. # noqa: E501
  175. Maximum borrow value allowed per user, in USDT # noqa: E501
  176. :return: The user_max_borrow_amount of this CrossMarginCurrency. # noqa: E501
  177. :rtype: str
  178. """
  179. return self._user_max_borrow_amount
  180. @user_max_borrow_amount.setter
  181. def user_max_borrow_amount(self, user_max_borrow_amount):
  182. """Sets the user_max_borrow_amount of this CrossMarginCurrency.
  183. Maximum borrow value allowed per user, in USDT # noqa: E501
  184. :param user_max_borrow_amount: The user_max_borrow_amount of this CrossMarginCurrency. # noqa: E501
  185. :type: str
  186. """
  187. self._user_max_borrow_amount = user_max_borrow_amount
  188. @property
  189. def total_max_borrow_amount(self):
  190. """Gets the total_max_borrow_amount of this CrossMarginCurrency. # noqa: E501
  191. Maximum borrow value allowed for this currency, in USDT # noqa: E501
  192. :return: The total_max_borrow_amount of this CrossMarginCurrency. # noqa: E501
  193. :rtype: str
  194. """
  195. return self._total_max_borrow_amount
  196. @total_max_borrow_amount.setter
  197. def total_max_borrow_amount(self, total_max_borrow_amount):
  198. """Sets the total_max_borrow_amount of this CrossMarginCurrency.
  199. Maximum borrow value allowed for this currency, in USDT # noqa: E501
  200. :param total_max_borrow_amount: The total_max_borrow_amount of this CrossMarginCurrency. # noqa: E501
  201. :type: str
  202. """
  203. self._total_max_borrow_amount = total_max_borrow_amount
  204. @property
  205. def price(self):
  206. """Gets the price of this CrossMarginCurrency. # noqa: E501
  207. Price change between this currency and USDT # noqa: E501
  208. :return: The price of this CrossMarginCurrency. # noqa: E501
  209. :rtype: str
  210. """
  211. return self._price
  212. @price.setter
  213. def price(self, price):
  214. """Sets the price of this CrossMarginCurrency.
  215. Price change between this currency and USDT # noqa: E501
  216. :param price: The price of this CrossMarginCurrency. # noqa: E501
  217. :type: str
  218. """
  219. self._price = price
  220. @property
  221. def status(self):
  222. """Gets the status of this CrossMarginCurrency. # noqa: E501
  223. status - `0` : disable - `1` : enable # noqa: E501
  224. :return: The status of this CrossMarginCurrency. # noqa: E501
  225. :rtype: int
  226. """
  227. return self._status
  228. @status.setter
  229. def status(self, status):
  230. """Sets the status of this CrossMarginCurrency.
  231. status - `0` : disable - `1` : enable # noqa: E501
  232. :param status: The status of this CrossMarginCurrency. # noqa: E501
  233. :type: int
  234. """
  235. self._status = status
  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, CrossMarginCurrency):
  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, CrossMarginCurrency):
  269. return True
  270. return self.to_dict() != other.to_dict()