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

647 lines
20 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 FuturesTicker(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. 'contract': 'str',
  26. 'last': 'str',
  27. 'change_percentage': 'str',
  28. 'total_size': 'str',
  29. 'low_24h': 'str',
  30. 'high_24h': 'str',
  31. 'volume_24h': 'str',
  32. 'volume_24h_btc': 'str',
  33. 'volume_24h_usd': 'str',
  34. 'volume_24h_base': 'str',
  35. 'volume_24h_quote': 'str',
  36. 'volume_24h_settle': 'str',
  37. 'mark_price': 'str',
  38. 'funding_rate': 'str',
  39. 'funding_rate_indicative': 'str',
  40. 'index_price': 'str',
  41. 'quanto_base_rate': 'str',
  42. 'basis_rate': 'str',
  43. 'basis_value': 'str',
  44. }
  45. attribute_map = {
  46. 'contract': 'contract',
  47. 'last': 'last',
  48. 'change_percentage': 'change_percentage',
  49. 'total_size': 'total_size',
  50. 'low_24h': 'low_24h',
  51. 'high_24h': 'high_24h',
  52. 'volume_24h': 'volume_24h',
  53. 'volume_24h_btc': 'volume_24h_btc',
  54. 'volume_24h_usd': 'volume_24h_usd',
  55. 'volume_24h_base': 'volume_24h_base',
  56. 'volume_24h_quote': 'volume_24h_quote',
  57. 'volume_24h_settle': 'volume_24h_settle',
  58. 'mark_price': 'mark_price',
  59. 'funding_rate': 'funding_rate',
  60. 'funding_rate_indicative': 'funding_rate_indicative',
  61. 'index_price': 'index_price',
  62. 'quanto_base_rate': 'quanto_base_rate',
  63. 'basis_rate': 'basis_rate',
  64. 'basis_value': 'basis_value',
  65. }
  66. def __init__(
  67. self,
  68. contract=None,
  69. last=None,
  70. change_percentage=None,
  71. total_size=None,
  72. low_24h=None,
  73. high_24h=None,
  74. volume_24h=None,
  75. volume_24h_btc=None,
  76. volume_24h_usd=None,
  77. volume_24h_base=None,
  78. volume_24h_quote=None,
  79. volume_24h_settle=None,
  80. mark_price=None,
  81. funding_rate=None,
  82. funding_rate_indicative=None,
  83. index_price=None,
  84. quanto_base_rate=None,
  85. basis_rate=None,
  86. basis_value=None,
  87. local_vars_configuration=None,
  88. ): # noqa: E501
  89. # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None
  90. """FuturesTicker - a model defined in OpenAPI""" # noqa: E501
  91. if local_vars_configuration is None:
  92. local_vars_configuration = Configuration()
  93. self.local_vars_configuration = local_vars_configuration
  94. self._contract = None
  95. self._last = None
  96. self._change_percentage = None
  97. self._total_size = None
  98. self._low_24h = None
  99. self._high_24h = None
  100. self._volume_24h = None
  101. self._volume_24h_btc = None
  102. self._volume_24h_usd = None
  103. self._volume_24h_base = None
  104. self._volume_24h_quote = None
  105. self._volume_24h_settle = None
  106. self._mark_price = None
  107. self._funding_rate = None
  108. self._funding_rate_indicative = None
  109. self._index_price = None
  110. self._quanto_base_rate = None
  111. self._basis_rate = None
  112. self._basis_value = None
  113. self.discriminator = None
  114. if contract is not None:
  115. self.contract = contract
  116. if last is not None:
  117. self.last = last
  118. if change_percentage is not None:
  119. self.change_percentage = change_percentage
  120. if total_size is not None:
  121. self.total_size = total_size
  122. if low_24h is not None:
  123. self.low_24h = low_24h
  124. if high_24h is not None:
  125. self.high_24h = high_24h
  126. if volume_24h is not None:
  127. self.volume_24h = volume_24h
  128. if volume_24h_btc is not None:
  129. self.volume_24h_btc = volume_24h_btc
  130. if volume_24h_usd is not None:
  131. self.volume_24h_usd = volume_24h_usd
  132. if volume_24h_base is not None:
  133. self.volume_24h_base = volume_24h_base
  134. if volume_24h_quote is not None:
  135. self.volume_24h_quote = volume_24h_quote
  136. if volume_24h_settle is not None:
  137. self.volume_24h_settle = volume_24h_settle
  138. if mark_price is not None:
  139. self.mark_price = mark_price
  140. if funding_rate is not None:
  141. self.funding_rate = funding_rate
  142. if funding_rate_indicative is not None:
  143. self.funding_rate_indicative = funding_rate_indicative
  144. if index_price is not None:
  145. self.index_price = index_price
  146. if quanto_base_rate is not None:
  147. self.quanto_base_rate = quanto_base_rate
  148. if basis_rate is not None:
  149. self.basis_rate = basis_rate
  150. if basis_value is not None:
  151. self.basis_value = basis_value
  152. @property
  153. def contract(self):
  154. """Gets the contract of this FuturesTicker. # noqa: E501
  155. Futures contract # noqa: E501
  156. :return: The contract of this FuturesTicker. # noqa: E501
  157. :rtype: str
  158. """
  159. return self._contract
  160. @contract.setter
  161. def contract(self, contract):
  162. """Sets the contract of this FuturesTicker.
  163. Futures contract # noqa: E501
  164. :param contract: The contract of this FuturesTicker. # noqa: E501
  165. :type: str
  166. """
  167. self._contract = contract
  168. @property
  169. def last(self):
  170. """Gets the last of this FuturesTicker. # noqa: E501
  171. Last trading price # noqa: E501
  172. :return: The last of this FuturesTicker. # noqa: E501
  173. :rtype: str
  174. """
  175. return self._last
  176. @last.setter
  177. def last(self, last):
  178. """Sets the last of this FuturesTicker.
  179. Last trading price # noqa: E501
  180. :param last: The last of this FuturesTicker. # noqa: E501
  181. :type: str
  182. """
  183. self._last = last
  184. @property
  185. def change_percentage(self):
  186. """Gets the change_percentage of this FuturesTicker. # noqa: E501
  187. Change percentage. # noqa: E501
  188. :return: The change_percentage of this FuturesTicker. # noqa: E501
  189. :rtype: str
  190. """
  191. return self._change_percentage
  192. @change_percentage.setter
  193. def change_percentage(self, change_percentage):
  194. """Sets the change_percentage of this FuturesTicker.
  195. Change percentage. # noqa: E501
  196. :param change_percentage: The change_percentage of this FuturesTicker. # noqa: E501
  197. :type: str
  198. """
  199. self._change_percentage = change_percentage
  200. @property
  201. def total_size(self):
  202. """Gets the total_size of this FuturesTicker. # noqa: E501
  203. Contract total size # noqa: E501
  204. :return: The total_size of this FuturesTicker. # noqa: E501
  205. :rtype: str
  206. """
  207. return self._total_size
  208. @total_size.setter
  209. def total_size(self, total_size):
  210. """Sets the total_size of this FuturesTicker.
  211. Contract total size # noqa: E501
  212. :param total_size: The total_size of this FuturesTicker. # noqa: E501
  213. :type: str
  214. """
  215. self._total_size = total_size
  216. @property
  217. def low_24h(self):
  218. """Gets the low_24h of this FuturesTicker. # noqa: E501
  219. Lowest trading price in recent 24h # noqa: E501
  220. :return: The low_24h of this FuturesTicker. # noqa: E501
  221. :rtype: str
  222. """
  223. return self._low_24h
  224. @low_24h.setter
  225. def low_24h(self, low_24h):
  226. """Sets the low_24h of this FuturesTicker.
  227. Lowest trading price in recent 24h # noqa: E501
  228. :param low_24h: The low_24h of this FuturesTicker. # noqa: E501
  229. :type: str
  230. """
  231. self._low_24h = low_24h
  232. @property
  233. def high_24h(self):
  234. """Gets the high_24h of this FuturesTicker. # noqa: E501
  235. Highest trading price in recent 24h # noqa: E501
  236. :return: The high_24h of this FuturesTicker. # noqa: E501
  237. :rtype: str
  238. """
  239. return self._high_24h
  240. @high_24h.setter
  241. def high_24h(self, high_24h):
  242. """Sets the high_24h of this FuturesTicker.
  243. Highest trading price in recent 24h # noqa: E501
  244. :param high_24h: The high_24h of this FuturesTicker. # noqa: E501
  245. :type: str
  246. """
  247. self._high_24h = high_24h
  248. @property
  249. def volume_24h(self):
  250. """Gets the volume_24h of this FuturesTicker. # noqa: E501
  251. Trade size in recent 24h # noqa: E501
  252. :return: The volume_24h of this FuturesTicker. # noqa: E501
  253. :rtype: str
  254. """
  255. return self._volume_24h
  256. @volume_24h.setter
  257. def volume_24h(self, volume_24h):
  258. """Sets the volume_24h of this FuturesTicker.
  259. Trade size in recent 24h # noqa: E501
  260. :param volume_24h: The volume_24h of this FuturesTicker. # noqa: E501
  261. :type: str
  262. """
  263. self._volume_24h = volume_24h
  264. @property
  265. def volume_24h_btc(self):
  266. """Gets the volume_24h_btc of this FuturesTicker. # noqa: E501
  267. Trade volumes in recent 24h in BTC(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501
  268. :return: The volume_24h_btc of this FuturesTicker. # noqa: E501
  269. :rtype: str
  270. """
  271. return self._volume_24h_btc
  272. @volume_24h_btc.setter
  273. def volume_24h_btc(self, volume_24h_btc):
  274. """Sets the volume_24h_btc of this FuturesTicker.
  275. Trade volumes in recent 24h in BTC(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501
  276. :param volume_24h_btc: The volume_24h_btc of this FuturesTicker. # noqa: E501
  277. :type: str
  278. """
  279. self._volume_24h_btc = volume_24h_btc
  280. @property
  281. def volume_24h_usd(self):
  282. """Gets the volume_24h_usd of this FuturesTicker. # noqa: E501
  283. Trade volumes in recent 24h in USD(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501
  284. :return: The volume_24h_usd of this FuturesTicker. # noqa: E501
  285. :rtype: str
  286. """
  287. return self._volume_24h_usd
  288. @volume_24h_usd.setter
  289. def volume_24h_usd(self, volume_24h_usd):
  290. """Sets the volume_24h_usd of this FuturesTicker.
  291. Trade volumes in recent 24h in USD(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501
  292. :param volume_24h_usd: The volume_24h_usd of this FuturesTicker. # noqa: E501
  293. :type: str
  294. """
  295. self._volume_24h_usd = volume_24h_usd
  296. @property
  297. def volume_24h_base(self):
  298. """Gets the volume_24h_base of this FuturesTicker. # noqa: E501
  299. Trade volume in recent 24h, in base currency # noqa: E501
  300. :return: The volume_24h_base of this FuturesTicker. # noqa: E501
  301. :rtype: str
  302. """
  303. return self._volume_24h_base
  304. @volume_24h_base.setter
  305. def volume_24h_base(self, volume_24h_base):
  306. """Sets the volume_24h_base of this FuturesTicker.
  307. Trade volume in recent 24h, in base currency # noqa: E501
  308. :param volume_24h_base: The volume_24h_base of this FuturesTicker. # noqa: E501
  309. :type: str
  310. """
  311. self._volume_24h_base = volume_24h_base
  312. @property
  313. def volume_24h_quote(self):
  314. """Gets the volume_24h_quote of this FuturesTicker. # noqa: E501
  315. Trade volume in recent 24h, in quote currency # noqa: E501
  316. :return: The volume_24h_quote of this FuturesTicker. # noqa: E501
  317. :rtype: str
  318. """
  319. return self._volume_24h_quote
  320. @volume_24h_quote.setter
  321. def volume_24h_quote(self, volume_24h_quote):
  322. """Sets the volume_24h_quote of this FuturesTicker.
  323. Trade volume in recent 24h, in quote currency # noqa: E501
  324. :param volume_24h_quote: The volume_24h_quote of this FuturesTicker. # noqa: E501
  325. :type: str
  326. """
  327. self._volume_24h_quote = volume_24h_quote
  328. @property
  329. def volume_24h_settle(self):
  330. """Gets the volume_24h_settle of this FuturesTicker. # noqa: E501
  331. Trade volume in recent 24h, in settle currency # noqa: E501
  332. :return: The volume_24h_settle of this FuturesTicker. # noqa: E501
  333. :rtype: str
  334. """
  335. return self._volume_24h_settle
  336. @volume_24h_settle.setter
  337. def volume_24h_settle(self, volume_24h_settle):
  338. """Sets the volume_24h_settle of this FuturesTicker.
  339. Trade volume in recent 24h, in settle currency # noqa: E501
  340. :param volume_24h_settle: The volume_24h_settle of this FuturesTicker. # noqa: E501
  341. :type: str
  342. """
  343. self._volume_24h_settle = volume_24h_settle
  344. @property
  345. def mark_price(self):
  346. """Gets the mark_price of this FuturesTicker. # noqa: E501
  347. Recent mark price # noqa: E501
  348. :return: The mark_price of this FuturesTicker. # noqa: E501
  349. :rtype: str
  350. """
  351. return self._mark_price
  352. @mark_price.setter
  353. def mark_price(self, mark_price):
  354. """Sets the mark_price of this FuturesTicker.
  355. Recent mark price # noqa: E501
  356. :param mark_price: The mark_price of this FuturesTicker. # noqa: E501
  357. :type: str
  358. """
  359. self._mark_price = mark_price
  360. @property
  361. def funding_rate(self):
  362. """Gets the funding_rate of this FuturesTicker. # noqa: E501
  363. Funding rate # noqa: E501
  364. :return: The funding_rate of this FuturesTicker. # noqa: E501
  365. :rtype: str
  366. """
  367. return self._funding_rate
  368. @funding_rate.setter
  369. def funding_rate(self, funding_rate):
  370. """Sets the funding_rate of this FuturesTicker.
  371. Funding rate # noqa: E501
  372. :param funding_rate: The funding_rate of this FuturesTicker. # noqa: E501
  373. :type: str
  374. """
  375. self._funding_rate = funding_rate
  376. @property
  377. def funding_rate_indicative(self):
  378. """Gets the funding_rate_indicative of this FuturesTicker. # noqa: E501
  379. Indicative Funding rate in next period # noqa: E501
  380. :return: The funding_rate_indicative of this FuturesTicker. # noqa: E501
  381. :rtype: str
  382. """
  383. return self._funding_rate_indicative
  384. @funding_rate_indicative.setter
  385. def funding_rate_indicative(self, funding_rate_indicative):
  386. """Sets the funding_rate_indicative of this FuturesTicker.
  387. Indicative Funding rate in next period # noqa: E501
  388. :param funding_rate_indicative: The funding_rate_indicative of this FuturesTicker. # noqa: E501
  389. :type: str
  390. """
  391. self._funding_rate_indicative = funding_rate_indicative
  392. @property
  393. def index_price(self):
  394. """Gets the index_price of this FuturesTicker. # noqa: E501
  395. Index price # noqa: E501
  396. :return: The index_price of this FuturesTicker. # noqa: E501
  397. :rtype: str
  398. """
  399. return self._index_price
  400. @index_price.setter
  401. def index_price(self, index_price):
  402. """Sets the index_price of this FuturesTicker.
  403. Index price # noqa: E501
  404. :param index_price: The index_price of this FuturesTicker. # noqa: E501
  405. :type: str
  406. """
  407. self._index_price = index_price
  408. @property
  409. def quanto_base_rate(self):
  410. """Gets the quanto_base_rate of this FuturesTicker. # noqa: E501
  411. Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types # noqa: E501
  412. :return: The quanto_base_rate of this FuturesTicker. # noqa: E501
  413. :rtype: str
  414. """
  415. return self._quanto_base_rate
  416. @quanto_base_rate.setter
  417. def quanto_base_rate(self, quanto_base_rate):
  418. """Sets the quanto_base_rate of this FuturesTicker.
  419. Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types # noqa: E501
  420. :param quanto_base_rate: The quanto_base_rate of this FuturesTicker. # noqa: E501
  421. :type: str
  422. """
  423. self._quanto_base_rate = quanto_base_rate
  424. @property
  425. def basis_rate(self):
  426. """Gets the basis_rate of this FuturesTicker. # noqa: E501
  427. Basis rate # noqa: E501
  428. :return: The basis_rate of this FuturesTicker. # noqa: E501
  429. :rtype: str
  430. """
  431. return self._basis_rate
  432. @basis_rate.setter
  433. def basis_rate(self, basis_rate):
  434. """Sets the basis_rate of this FuturesTicker.
  435. Basis rate # noqa: E501
  436. :param basis_rate: The basis_rate of this FuturesTicker. # noqa: E501
  437. :type: str
  438. """
  439. self._basis_rate = basis_rate
  440. @property
  441. def basis_value(self):
  442. """Gets the basis_value of this FuturesTicker. # noqa: E501
  443. Basis value # noqa: E501
  444. :return: The basis_value of this FuturesTicker. # noqa: E501
  445. :rtype: str
  446. """
  447. return self._basis_value
  448. @basis_value.setter
  449. def basis_value(self, basis_value):
  450. """Sets the basis_value of this FuturesTicker.
  451. Basis value # noqa: E501
  452. :param basis_value: The basis_value of this FuturesTicker. # noqa: E501
  453. :type: str
  454. """
  455. self._basis_value = basis_value
  456. def to_dict(self):
  457. """Returns the model properties as a dict"""
  458. result = {}
  459. for attr, _ in six.iteritems(self.openapi_types):
  460. value = getattr(self, attr)
  461. if isinstance(value, list):
  462. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  463. elif hasattr(value, "to_dict"):
  464. result[attr] = value.to_dict()
  465. elif isinstance(value, dict):
  466. result[attr] = dict(
  467. map(
  468. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  469. value.items(),
  470. )
  471. )
  472. else:
  473. result[attr] = value
  474. return result
  475. def to_str(self):
  476. """Returns the string representation of the model"""
  477. return pprint.pformat(self.to_dict())
  478. def __repr__(self):
  479. """For `print` and `pprint`"""
  480. return self.to_str()
  481. def __eq__(self, other):
  482. """Returns true if both objects are equal"""
  483. if not isinstance(other, FuturesTicker):
  484. return False
  485. return self.to_dict() == other.to_dict()
  486. def __ne__(self, other):
  487. """Returns true if both objects are not equal"""
  488. if not isinstance(other, FuturesTicker):
  489. return True
  490. return self.to_dict() != other.to_dict()