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

422 lines
12 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 CurrencyPair(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. 'id': 'str',
  26. 'base': 'str',
  27. 'quote': 'str',
  28. 'fee': 'str',
  29. 'min_base_amount': 'str',
  30. 'min_quote_amount': 'str',
  31. 'amount_precision': 'int',
  32. 'precision': 'int',
  33. 'trade_status': 'str',
  34. 'sell_start': 'int',
  35. 'buy_start': 'int',
  36. }
  37. attribute_map = {
  38. 'id': 'id',
  39. 'base': 'base',
  40. 'quote': 'quote',
  41. 'fee': 'fee',
  42. 'min_base_amount': 'min_base_amount',
  43. 'min_quote_amount': 'min_quote_amount',
  44. 'amount_precision': 'amount_precision',
  45. 'precision': 'precision',
  46. 'trade_status': 'trade_status',
  47. 'sell_start': 'sell_start',
  48. 'buy_start': 'buy_start',
  49. }
  50. def __init__(
  51. self,
  52. id=None,
  53. base=None,
  54. quote=None,
  55. fee=None,
  56. min_base_amount=None,
  57. min_quote_amount=None,
  58. amount_precision=None,
  59. precision=None,
  60. trade_status=None,
  61. sell_start=None,
  62. buy_start=None,
  63. local_vars_configuration=None,
  64. ): # noqa: E501
  65. # type: (str, str, str, str, str, str, int, int, str, int, int, Configuration) -> None
  66. """CurrencyPair - a model defined in OpenAPI""" # noqa: E501
  67. if local_vars_configuration is None:
  68. local_vars_configuration = Configuration()
  69. self.local_vars_configuration = local_vars_configuration
  70. self._id = None
  71. self._base = None
  72. self._quote = None
  73. self._fee = None
  74. self._min_base_amount = None
  75. self._min_quote_amount = None
  76. self._amount_precision = None
  77. self._precision = None
  78. self._trade_status = None
  79. self._sell_start = None
  80. self._buy_start = None
  81. self.discriminator = None
  82. if id is not None:
  83. self.id = id
  84. if base is not None:
  85. self.base = base
  86. if quote is not None:
  87. self.quote = quote
  88. if fee is not None:
  89. self.fee = fee
  90. if min_base_amount is not None:
  91. self.min_base_amount = min_base_amount
  92. if min_quote_amount is not None:
  93. self.min_quote_amount = min_quote_amount
  94. if amount_precision is not None:
  95. self.amount_precision = amount_precision
  96. if precision is not None:
  97. self.precision = precision
  98. if trade_status is not None:
  99. self.trade_status = trade_status
  100. if sell_start is not None:
  101. self.sell_start = sell_start
  102. if buy_start is not None:
  103. self.buy_start = buy_start
  104. @property
  105. def id(self):
  106. """Gets the id of this CurrencyPair. # noqa: E501
  107. Currency pair # noqa: E501
  108. :return: The id of this CurrencyPair. # noqa: E501
  109. :rtype: str
  110. """
  111. return self._id
  112. @id.setter
  113. def id(self, id):
  114. """Sets the id of this CurrencyPair.
  115. Currency pair # noqa: E501
  116. :param id: The id of this CurrencyPair. # noqa: E501
  117. :type: str
  118. """
  119. self._id = id
  120. @property
  121. def base(self):
  122. """Gets the base of this CurrencyPair. # noqa: E501
  123. Base currency # noqa: E501
  124. :return: The base of this CurrencyPair. # noqa: E501
  125. :rtype: str
  126. """
  127. return self._base
  128. @base.setter
  129. def base(self, base):
  130. """Sets the base of this CurrencyPair.
  131. Base currency # noqa: E501
  132. :param base: The base of this CurrencyPair. # noqa: E501
  133. :type: str
  134. """
  135. self._base = base
  136. @property
  137. def quote(self):
  138. """Gets the quote of this CurrencyPair. # noqa: E501
  139. Quote currency # noqa: E501
  140. :return: The quote of this CurrencyPair. # noqa: E501
  141. :rtype: str
  142. """
  143. return self._quote
  144. @quote.setter
  145. def quote(self, quote):
  146. """Sets the quote of this CurrencyPair.
  147. Quote currency # noqa: E501
  148. :param quote: The quote of this CurrencyPair. # noqa: E501
  149. :type: str
  150. """
  151. self._quote = quote
  152. @property
  153. def fee(self):
  154. """Gets the fee of this CurrencyPair. # noqa: E501
  155. Trading fee # noqa: E501
  156. :return: The fee of this CurrencyPair. # noqa: E501
  157. :rtype: str
  158. """
  159. return self._fee
  160. @fee.setter
  161. def fee(self, fee):
  162. """Sets the fee of this CurrencyPair.
  163. Trading fee # noqa: E501
  164. :param fee: The fee of this CurrencyPair. # noqa: E501
  165. :type: str
  166. """
  167. self._fee = fee
  168. @property
  169. def min_base_amount(self):
  170. """Gets the min_base_amount of this CurrencyPair. # noqa: E501
  171. Minimum amount of base currency to trade, `null` means no limit # noqa: E501
  172. :return: The min_base_amount of this CurrencyPair. # noqa: E501
  173. :rtype: str
  174. """
  175. return self._min_base_amount
  176. @min_base_amount.setter
  177. def min_base_amount(self, min_base_amount):
  178. """Sets the min_base_amount of this CurrencyPair.
  179. Minimum amount of base currency to trade, `null` means no limit # noqa: E501
  180. :param min_base_amount: The min_base_amount of this CurrencyPair. # noqa: E501
  181. :type: str
  182. """
  183. self._min_base_amount = min_base_amount
  184. @property
  185. def min_quote_amount(self):
  186. """Gets the min_quote_amount of this CurrencyPair. # noqa: E501
  187. Minimum amount of quote currency to trade, `null` means no limit # noqa: E501
  188. :return: The min_quote_amount of this CurrencyPair. # noqa: E501
  189. :rtype: str
  190. """
  191. return self._min_quote_amount
  192. @min_quote_amount.setter
  193. def min_quote_amount(self, min_quote_amount):
  194. """Sets the min_quote_amount of this CurrencyPair.
  195. Minimum amount of quote currency to trade, `null` means no limit # noqa: E501
  196. :param min_quote_amount: The min_quote_amount of this CurrencyPair. # noqa: E501
  197. :type: str
  198. """
  199. self._min_quote_amount = min_quote_amount
  200. @property
  201. def amount_precision(self):
  202. """Gets the amount_precision of this CurrencyPair. # noqa: E501
  203. Amount scale # noqa: E501
  204. :return: The amount_precision of this CurrencyPair. # noqa: E501
  205. :rtype: int
  206. """
  207. return self._amount_precision
  208. @amount_precision.setter
  209. def amount_precision(self, amount_precision):
  210. """Sets the amount_precision of this CurrencyPair.
  211. Amount scale # noqa: E501
  212. :param amount_precision: The amount_precision of this CurrencyPair. # noqa: E501
  213. :type: int
  214. """
  215. self._amount_precision = amount_precision
  216. @property
  217. def precision(self):
  218. """Gets the precision of this CurrencyPair. # noqa: E501
  219. Price scale # noqa: E501
  220. :return: The precision of this CurrencyPair. # noqa: E501
  221. :rtype: int
  222. """
  223. return self._precision
  224. @precision.setter
  225. def precision(self, precision):
  226. """Sets the precision of this CurrencyPair.
  227. Price scale # noqa: E501
  228. :param precision: The precision of this CurrencyPair. # noqa: E501
  229. :type: int
  230. """
  231. self._precision = precision
  232. @property
  233. def trade_status(self):
  234. """Gets the trade_status of this CurrencyPair. # noqa: E501
  235. How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold # noqa: E501
  236. :return: The trade_status of this CurrencyPair. # noqa: E501
  237. :rtype: str
  238. """
  239. return self._trade_status
  240. @trade_status.setter
  241. def trade_status(self, trade_status):
  242. """Sets the trade_status of this CurrencyPair.
  243. How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold # noqa: E501
  244. :param trade_status: The trade_status of this CurrencyPair. # noqa: E501
  245. :type: str
  246. """
  247. allowed_values = ["untradable", "buyable", "sellable", "tradable"] # noqa: E501
  248. if self.local_vars_configuration.client_side_validation and trade_status not in allowed_values: # noqa: E501
  249. raise ValueError(
  250. "Invalid value for `trade_status` ({0}), must be one of {1}".format( # noqa: E501
  251. trade_status, allowed_values
  252. )
  253. )
  254. self._trade_status = trade_status
  255. @property
  256. def sell_start(self):
  257. """Gets the sell_start of this CurrencyPair. # noqa: E501
  258. Sell start unix timestamp in seconds # noqa: E501
  259. :return: The sell_start of this CurrencyPair. # noqa: E501
  260. :rtype: int
  261. """
  262. return self._sell_start
  263. @sell_start.setter
  264. def sell_start(self, sell_start):
  265. """Sets the sell_start of this CurrencyPair.
  266. Sell start unix timestamp in seconds # noqa: E501
  267. :param sell_start: The sell_start of this CurrencyPair. # noqa: E501
  268. :type: int
  269. """
  270. self._sell_start = sell_start
  271. @property
  272. def buy_start(self):
  273. """Gets the buy_start of this CurrencyPair. # noqa: E501
  274. Buy start unix timestamp in seconds # noqa: E501
  275. :return: The buy_start of this CurrencyPair. # noqa: E501
  276. :rtype: int
  277. """
  278. return self._buy_start
  279. @buy_start.setter
  280. def buy_start(self, buy_start):
  281. """Sets the buy_start of this CurrencyPair.
  282. Buy start unix timestamp in seconds # noqa: E501
  283. :param buy_start: The buy_start of this CurrencyPair. # noqa: E501
  284. :type: int
  285. """
  286. self._buy_start = buy_start
  287. def to_dict(self):
  288. """Returns the model properties as a dict"""
  289. result = {}
  290. for attr, _ in six.iteritems(self.openapi_types):
  291. value = getattr(self, attr)
  292. if isinstance(value, list):
  293. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  294. elif hasattr(value, "to_dict"):
  295. result[attr] = value.to_dict()
  296. elif isinstance(value, dict):
  297. result[attr] = dict(
  298. map(
  299. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  300. value.items(),
  301. )
  302. )
  303. else:
  304. result[attr] = value
  305. return result
  306. def to_str(self):
  307. """Returns the string representation of the model"""
  308. return pprint.pformat(self.to_dict())
  309. def __repr__(self):
  310. """For `print` and `pprint`"""
  311. return self.to_str()
  312. def __eq__(self, other):
  313. """Returns true if both objects are equal"""
  314. if not isinstance(other, CurrencyPair):
  315. return False
  316. return self.to_dict() == other.to_dict()
  317. def __ne__(self, other):
  318. """Returns true if both objects are not equal"""
  319. if not isinstance(other, CurrencyPair):
  320. return True
  321. return self.to_dict() != other.to_dict()