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

528 lines
15 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 Ticker(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. 'last': 'str',
  27. 'lowest_ask': 'str',
  28. 'highest_bid': 'str',
  29. 'change_percentage': 'str',
  30. 'change_utc0': 'str',
  31. 'change_utc8': 'str',
  32. 'base_volume': 'str',
  33. 'quote_volume': 'str',
  34. 'high_24h': 'str',
  35. 'low_24h': 'str',
  36. 'etf_net_value': 'str',
  37. 'etf_pre_net_value': 'str',
  38. 'etf_pre_timestamp': 'int',
  39. 'etf_leverage': 'str',
  40. }
  41. attribute_map = {
  42. 'currency_pair': 'currency_pair',
  43. 'last': 'last',
  44. 'lowest_ask': 'lowest_ask',
  45. 'highest_bid': 'highest_bid',
  46. 'change_percentage': 'change_percentage',
  47. 'change_utc0': 'change_utc0',
  48. 'change_utc8': 'change_utc8',
  49. 'base_volume': 'base_volume',
  50. 'quote_volume': 'quote_volume',
  51. 'high_24h': 'high_24h',
  52. 'low_24h': 'low_24h',
  53. 'etf_net_value': 'etf_net_value',
  54. 'etf_pre_net_value': 'etf_pre_net_value',
  55. 'etf_pre_timestamp': 'etf_pre_timestamp',
  56. 'etf_leverage': 'etf_leverage',
  57. }
  58. def __init__(
  59. self,
  60. currency_pair=None,
  61. last=None,
  62. lowest_ask=None,
  63. highest_bid=None,
  64. change_percentage=None,
  65. change_utc0=None,
  66. change_utc8=None,
  67. base_volume=None,
  68. quote_volume=None,
  69. high_24h=None,
  70. low_24h=None,
  71. etf_net_value=None,
  72. etf_pre_net_value=None,
  73. etf_pre_timestamp=None,
  74. etf_leverage=None,
  75. local_vars_configuration=None,
  76. ): # noqa: E501
  77. # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, int, str, Configuration) -> None
  78. """Ticker - a model defined in OpenAPI""" # noqa: E501
  79. if local_vars_configuration is None:
  80. local_vars_configuration = Configuration()
  81. self.local_vars_configuration = local_vars_configuration
  82. self._currency_pair = None
  83. self._last = None
  84. self._lowest_ask = None
  85. self._highest_bid = None
  86. self._change_percentage = None
  87. self._change_utc0 = None
  88. self._change_utc8 = None
  89. self._base_volume = None
  90. self._quote_volume = None
  91. self._high_24h = None
  92. self._low_24h = None
  93. self._etf_net_value = None
  94. self._etf_pre_net_value = None
  95. self._etf_pre_timestamp = None
  96. self._etf_leverage = None
  97. self.discriminator = None
  98. if currency_pair is not None:
  99. self.currency_pair = currency_pair
  100. if last is not None:
  101. self.last = last
  102. if lowest_ask is not None:
  103. self.lowest_ask = lowest_ask
  104. if highest_bid is not None:
  105. self.highest_bid = highest_bid
  106. if change_percentage is not None:
  107. self.change_percentage = change_percentage
  108. if change_utc0 is not None:
  109. self.change_utc0 = change_utc0
  110. if change_utc8 is not None:
  111. self.change_utc8 = change_utc8
  112. if base_volume is not None:
  113. self.base_volume = base_volume
  114. if quote_volume is not None:
  115. self.quote_volume = quote_volume
  116. if high_24h is not None:
  117. self.high_24h = high_24h
  118. if low_24h is not None:
  119. self.low_24h = low_24h
  120. if etf_net_value is not None:
  121. self.etf_net_value = etf_net_value
  122. self.etf_pre_net_value = etf_pre_net_value
  123. self.etf_pre_timestamp = etf_pre_timestamp
  124. self.etf_leverage = etf_leverage
  125. @property
  126. def currency_pair(self):
  127. """Gets the currency_pair of this Ticker. # noqa: E501
  128. Currency pair # noqa: E501
  129. :return: The currency_pair of this Ticker. # noqa: E501
  130. :rtype: str
  131. """
  132. return self._currency_pair
  133. @currency_pair.setter
  134. def currency_pair(self, currency_pair):
  135. """Sets the currency_pair of this Ticker.
  136. Currency pair # noqa: E501
  137. :param currency_pair: The currency_pair of this Ticker. # noqa: E501
  138. :type: str
  139. """
  140. self._currency_pair = currency_pair
  141. @property
  142. def last(self):
  143. """Gets the last of this Ticker. # noqa: E501
  144. Last trading price # noqa: E501
  145. :return: The last of this Ticker. # noqa: E501
  146. :rtype: str
  147. """
  148. return self._last
  149. @last.setter
  150. def last(self, last):
  151. """Sets the last of this Ticker.
  152. Last trading price # noqa: E501
  153. :param last: The last of this Ticker. # noqa: E501
  154. :type: str
  155. """
  156. self._last = last
  157. @property
  158. def lowest_ask(self):
  159. """Gets the lowest_ask of this Ticker. # noqa: E501
  160. Recent lowest ask # noqa: E501
  161. :return: The lowest_ask of this Ticker. # noqa: E501
  162. :rtype: str
  163. """
  164. return self._lowest_ask
  165. @lowest_ask.setter
  166. def lowest_ask(self, lowest_ask):
  167. """Sets the lowest_ask of this Ticker.
  168. Recent lowest ask # noqa: E501
  169. :param lowest_ask: The lowest_ask of this Ticker. # noqa: E501
  170. :type: str
  171. """
  172. self._lowest_ask = lowest_ask
  173. @property
  174. def highest_bid(self):
  175. """Gets the highest_bid of this Ticker. # noqa: E501
  176. Recent highest bid # noqa: E501
  177. :return: The highest_bid of this Ticker. # noqa: E501
  178. :rtype: str
  179. """
  180. return self._highest_bid
  181. @highest_bid.setter
  182. def highest_bid(self, highest_bid):
  183. """Sets the highest_bid of this Ticker.
  184. Recent highest bid # noqa: E501
  185. :param highest_bid: The highest_bid of this Ticker. # noqa: E501
  186. :type: str
  187. """
  188. self._highest_bid = highest_bid
  189. @property
  190. def change_percentage(self):
  191. """Gets the change_percentage of this Ticker. # noqa: E501
  192. Change percentage in the last 24h # noqa: E501
  193. :return: The change_percentage of this Ticker. # noqa: E501
  194. :rtype: str
  195. """
  196. return self._change_percentage
  197. @change_percentage.setter
  198. def change_percentage(self, change_percentage):
  199. """Sets the change_percentage of this Ticker.
  200. Change percentage in the last 24h # noqa: E501
  201. :param change_percentage: The change_percentage of this Ticker. # noqa: E501
  202. :type: str
  203. """
  204. self._change_percentage = change_percentage
  205. @property
  206. def change_utc0(self):
  207. """Gets the change_utc0 of this Ticker. # noqa: E501
  208. utc0 timezone, the percentage change in the last 24 hours # noqa: E501
  209. :return: The change_utc0 of this Ticker. # noqa: E501
  210. :rtype: str
  211. """
  212. return self._change_utc0
  213. @change_utc0.setter
  214. def change_utc0(self, change_utc0):
  215. """Sets the change_utc0 of this Ticker.
  216. utc0 timezone, the percentage change in the last 24 hours # noqa: E501
  217. :param change_utc0: The change_utc0 of this Ticker. # noqa: E501
  218. :type: str
  219. """
  220. self._change_utc0 = change_utc0
  221. @property
  222. def change_utc8(self):
  223. """Gets the change_utc8 of this Ticker. # noqa: E501
  224. utc8 timezone, the percentage change in the last 24 hours # noqa: E501
  225. :return: The change_utc8 of this Ticker. # noqa: E501
  226. :rtype: str
  227. """
  228. return self._change_utc8
  229. @change_utc8.setter
  230. def change_utc8(self, change_utc8):
  231. """Sets the change_utc8 of this Ticker.
  232. utc8 timezone, the percentage change in the last 24 hours # noqa: E501
  233. :param change_utc8: The change_utc8 of this Ticker. # noqa: E501
  234. :type: str
  235. """
  236. self._change_utc8 = change_utc8
  237. @property
  238. def base_volume(self):
  239. """Gets the base_volume of this Ticker. # noqa: E501
  240. Base currency trade volume in the last 24h # noqa: E501
  241. :return: The base_volume of this Ticker. # noqa: E501
  242. :rtype: str
  243. """
  244. return self._base_volume
  245. @base_volume.setter
  246. def base_volume(self, base_volume):
  247. """Sets the base_volume of this Ticker.
  248. Base currency trade volume in the last 24h # noqa: E501
  249. :param base_volume: The base_volume of this Ticker. # noqa: E501
  250. :type: str
  251. """
  252. self._base_volume = base_volume
  253. @property
  254. def quote_volume(self):
  255. """Gets the quote_volume of this Ticker. # noqa: E501
  256. Quote currency trade volume in the last 24h # noqa: E501
  257. :return: The quote_volume of this Ticker. # noqa: E501
  258. :rtype: str
  259. """
  260. return self._quote_volume
  261. @quote_volume.setter
  262. def quote_volume(self, quote_volume):
  263. """Sets the quote_volume of this Ticker.
  264. Quote currency trade volume in the last 24h # noqa: E501
  265. :param quote_volume: The quote_volume of this Ticker. # noqa: E501
  266. :type: str
  267. """
  268. self._quote_volume = quote_volume
  269. @property
  270. def high_24h(self):
  271. """Gets the high_24h of this Ticker. # noqa: E501
  272. Highest price in 24h # noqa: E501
  273. :return: The high_24h of this Ticker. # noqa: E501
  274. :rtype: str
  275. """
  276. return self._high_24h
  277. @high_24h.setter
  278. def high_24h(self, high_24h):
  279. """Sets the high_24h of this Ticker.
  280. Highest price in 24h # noqa: E501
  281. :param high_24h: The high_24h of this Ticker. # noqa: E501
  282. :type: str
  283. """
  284. self._high_24h = high_24h
  285. @property
  286. def low_24h(self):
  287. """Gets the low_24h of this Ticker. # noqa: E501
  288. Lowest price in 24h # noqa: E501
  289. :return: The low_24h of this Ticker. # noqa: E501
  290. :rtype: str
  291. """
  292. return self._low_24h
  293. @low_24h.setter
  294. def low_24h(self, low_24h):
  295. """Sets the low_24h of this Ticker.
  296. Lowest price in 24h # noqa: E501
  297. :param low_24h: The low_24h of this Ticker. # noqa: E501
  298. :type: str
  299. """
  300. self._low_24h = low_24h
  301. @property
  302. def etf_net_value(self):
  303. """Gets the etf_net_value of this Ticker. # noqa: E501
  304. ETF net value # noqa: E501
  305. :return: The etf_net_value of this Ticker. # noqa: E501
  306. :rtype: str
  307. """
  308. return self._etf_net_value
  309. @etf_net_value.setter
  310. def etf_net_value(self, etf_net_value):
  311. """Sets the etf_net_value of this Ticker.
  312. ETF net value # noqa: E501
  313. :param etf_net_value: The etf_net_value of this Ticker. # noqa: E501
  314. :type: str
  315. """
  316. self._etf_net_value = etf_net_value
  317. @property
  318. def etf_pre_net_value(self):
  319. """Gets the etf_pre_net_value of this Ticker. # noqa: E501
  320. ETF previous net value at re-balancing time # noqa: E501
  321. :return: The etf_pre_net_value of this Ticker. # noqa: E501
  322. :rtype: str
  323. """
  324. return self._etf_pre_net_value
  325. @etf_pre_net_value.setter
  326. def etf_pre_net_value(self, etf_pre_net_value):
  327. """Sets the etf_pre_net_value of this Ticker.
  328. ETF previous net value at re-balancing time # noqa: E501
  329. :param etf_pre_net_value: The etf_pre_net_value of this Ticker. # noqa: E501
  330. :type: str
  331. """
  332. self._etf_pre_net_value = etf_pre_net_value
  333. @property
  334. def etf_pre_timestamp(self):
  335. """Gets the etf_pre_timestamp of this Ticker. # noqa: E501
  336. ETF previous re-balancing time # noqa: E501
  337. :return: The etf_pre_timestamp of this Ticker. # noqa: E501
  338. :rtype: int
  339. """
  340. return self._etf_pre_timestamp
  341. @etf_pre_timestamp.setter
  342. def etf_pre_timestamp(self, etf_pre_timestamp):
  343. """Sets the etf_pre_timestamp of this Ticker.
  344. ETF previous re-balancing time # noqa: E501
  345. :param etf_pre_timestamp: The etf_pre_timestamp of this Ticker. # noqa: E501
  346. :type: int
  347. """
  348. self._etf_pre_timestamp = etf_pre_timestamp
  349. @property
  350. def etf_leverage(self):
  351. """Gets the etf_leverage of this Ticker. # noqa: E501
  352. ETF current leverage # noqa: E501
  353. :return: The etf_leverage of this Ticker. # noqa: E501
  354. :rtype: str
  355. """
  356. return self._etf_leverage
  357. @etf_leverage.setter
  358. def etf_leverage(self, etf_leverage):
  359. """Sets the etf_leverage of this Ticker.
  360. ETF current leverage # noqa: E501
  361. :param etf_leverage: The etf_leverage of this Ticker. # noqa: E501
  362. :type: str
  363. """
  364. self._etf_leverage = etf_leverage
  365. def to_dict(self):
  366. """Returns the model properties as a dict"""
  367. result = {}
  368. for attr, _ in six.iteritems(self.openapi_types):
  369. value = getattr(self, attr)
  370. if isinstance(value, list):
  371. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  372. elif hasattr(value, "to_dict"):
  373. result[attr] = value.to_dict()
  374. elif isinstance(value, dict):
  375. result[attr] = dict(
  376. map(
  377. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  378. value.items(),
  379. )
  380. )
  381. else:
  382. result[attr] = value
  383. return result
  384. def to_str(self):
  385. """Returns the string representation of the model"""
  386. return pprint.pformat(self.to_dict())
  387. def __repr__(self):
  388. """For `print` and `pprint`"""
  389. return self.to_str()
  390. def __eq__(self, other):
  391. """Returns true if both objects are equal"""
  392. if not isinstance(other, Ticker):
  393. return False
  394. return self.to_dict() == other.to_dict()
  395. def __ne__(self, other):
  396. """Returns true if both objects are not equal"""
  397. if not isinstance(other, Ticker):
  398. return True
  399. return self.to_dict() != other.to_dict()