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

386 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 TradeFee(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. 'user_id': 'int',
  26. 'taker_fee': 'str',
  27. 'maker_fee': 'str',
  28. 'gt_discount': 'bool',
  29. 'gt_taker_fee': 'str',
  30. 'gt_maker_fee': 'str',
  31. 'loan_fee': 'str',
  32. 'point_type': 'str',
  33. 'futures_taker_fee': 'str',
  34. 'futures_maker_fee': 'str',
  35. }
  36. attribute_map = {
  37. 'user_id': 'user_id',
  38. 'taker_fee': 'taker_fee',
  39. 'maker_fee': 'maker_fee',
  40. 'gt_discount': 'gt_discount',
  41. 'gt_taker_fee': 'gt_taker_fee',
  42. 'gt_maker_fee': 'gt_maker_fee',
  43. 'loan_fee': 'loan_fee',
  44. 'point_type': 'point_type',
  45. 'futures_taker_fee': 'futures_taker_fee',
  46. 'futures_maker_fee': 'futures_maker_fee',
  47. }
  48. def __init__(
  49. self,
  50. user_id=None,
  51. taker_fee=None,
  52. maker_fee=None,
  53. gt_discount=None,
  54. gt_taker_fee=None,
  55. gt_maker_fee=None,
  56. loan_fee=None,
  57. point_type=None,
  58. futures_taker_fee=None,
  59. futures_maker_fee=None,
  60. local_vars_configuration=None,
  61. ): # noqa: E501
  62. # type: (int, str, str, bool, str, str, str, str, str, str, Configuration) -> None
  63. """TradeFee - a model defined in OpenAPI""" # noqa: E501
  64. if local_vars_configuration is None:
  65. local_vars_configuration = Configuration()
  66. self.local_vars_configuration = local_vars_configuration
  67. self._user_id = None
  68. self._taker_fee = None
  69. self._maker_fee = None
  70. self._gt_discount = None
  71. self._gt_taker_fee = None
  72. self._gt_maker_fee = None
  73. self._loan_fee = None
  74. self._point_type = None
  75. self._futures_taker_fee = None
  76. self._futures_maker_fee = None
  77. self.discriminator = None
  78. if user_id is not None:
  79. self.user_id = user_id
  80. if taker_fee is not None:
  81. self.taker_fee = taker_fee
  82. if maker_fee is not None:
  83. self.maker_fee = maker_fee
  84. if gt_discount is not None:
  85. self.gt_discount = gt_discount
  86. if gt_taker_fee is not None:
  87. self.gt_taker_fee = gt_taker_fee
  88. if gt_maker_fee is not None:
  89. self.gt_maker_fee = gt_maker_fee
  90. if loan_fee is not None:
  91. self.loan_fee = loan_fee
  92. if point_type is not None:
  93. self.point_type = point_type
  94. if futures_taker_fee is not None:
  95. self.futures_taker_fee = futures_taker_fee
  96. if futures_maker_fee is not None:
  97. self.futures_maker_fee = futures_maker_fee
  98. @property
  99. def user_id(self):
  100. """Gets the user_id of this TradeFee. # noqa: E501
  101. User ID # noqa: E501
  102. :return: The user_id of this TradeFee. # noqa: E501
  103. :rtype: int
  104. """
  105. return self._user_id
  106. @user_id.setter
  107. def user_id(self, user_id):
  108. """Sets the user_id of this TradeFee.
  109. User ID # noqa: E501
  110. :param user_id: The user_id of this TradeFee. # noqa: E501
  111. :type: int
  112. """
  113. self._user_id = user_id
  114. @property
  115. def taker_fee(self):
  116. """Gets the taker_fee of this TradeFee. # noqa: E501
  117. taker fee rate # noqa: E501
  118. :return: The taker_fee of this TradeFee. # noqa: E501
  119. :rtype: str
  120. """
  121. return self._taker_fee
  122. @taker_fee.setter
  123. def taker_fee(self, taker_fee):
  124. """Sets the taker_fee of this TradeFee.
  125. taker fee rate # noqa: E501
  126. :param taker_fee: The taker_fee of this TradeFee. # noqa: E501
  127. :type: str
  128. """
  129. self._taker_fee = taker_fee
  130. @property
  131. def maker_fee(self):
  132. """Gets the maker_fee of this TradeFee. # noqa: E501
  133. maker fee rate # noqa: E501
  134. :return: The maker_fee of this TradeFee. # noqa: E501
  135. :rtype: str
  136. """
  137. return self._maker_fee
  138. @maker_fee.setter
  139. def maker_fee(self, maker_fee):
  140. """Sets the maker_fee of this TradeFee.
  141. maker fee rate # noqa: E501
  142. :param maker_fee: The maker_fee of this TradeFee. # noqa: E501
  143. :type: str
  144. """
  145. self._maker_fee = maker_fee
  146. @property
  147. def gt_discount(self):
  148. """Gets the gt_discount of this TradeFee. # noqa: E501
  149. If GT deduction is enabled # noqa: E501
  150. :return: The gt_discount of this TradeFee. # noqa: E501
  151. :rtype: bool
  152. """
  153. return self._gt_discount
  154. @gt_discount.setter
  155. def gt_discount(self, gt_discount):
  156. """Sets the gt_discount of this TradeFee.
  157. If GT deduction is enabled # noqa: E501
  158. :param gt_discount: The gt_discount of this TradeFee. # noqa: E501
  159. :type: bool
  160. """
  161. self._gt_discount = gt_discount
  162. @property
  163. def gt_taker_fee(self):
  164. """Gets the gt_taker_fee of this TradeFee. # noqa: E501
  165. Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501
  166. :return: The gt_taker_fee of this TradeFee. # noqa: E501
  167. :rtype: str
  168. """
  169. return self._gt_taker_fee
  170. @gt_taker_fee.setter
  171. def gt_taker_fee(self, gt_taker_fee):
  172. """Sets the gt_taker_fee of this TradeFee.
  173. Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501
  174. :param gt_taker_fee: The gt_taker_fee of this TradeFee. # noqa: E501
  175. :type: str
  176. """
  177. self._gt_taker_fee = gt_taker_fee
  178. @property
  179. def gt_maker_fee(self):
  180. """Gets the gt_maker_fee of this TradeFee. # noqa: E501
  181. Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501
  182. :return: The gt_maker_fee of this TradeFee. # noqa: E501
  183. :rtype: str
  184. """
  185. return self._gt_maker_fee
  186. @gt_maker_fee.setter
  187. def gt_maker_fee(self, gt_maker_fee):
  188. """Sets the gt_maker_fee of this TradeFee.
  189. Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501
  190. :param gt_maker_fee: The gt_maker_fee of this TradeFee. # noqa: E501
  191. :type: str
  192. """
  193. self._gt_maker_fee = gt_maker_fee
  194. @property
  195. def loan_fee(self):
  196. """Gets the loan_fee of this TradeFee. # noqa: E501
  197. Loan fee rate of margin lending # noqa: E501
  198. :return: The loan_fee of this TradeFee. # noqa: E501
  199. :rtype: str
  200. """
  201. return self._loan_fee
  202. @loan_fee.setter
  203. def loan_fee(self, loan_fee):
  204. """Sets the loan_fee of this TradeFee.
  205. Loan fee rate of margin lending # noqa: E501
  206. :param loan_fee: The loan_fee of this TradeFee. # noqa: E501
  207. :type: str
  208. """
  209. self._loan_fee = loan_fee
  210. @property
  211. def point_type(self):
  212. """Gets the point_type of this TradeFee. # noqa: E501
  213. Point type. 0 - Initial version. 1 - new version since 202009 # noqa: E501
  214. :return: The point_type of this TradeFee. # noqa: E501
  215. :rtype: str
  216. """
  217. return self._point_type
  218. @point_type.setter
  219. def point_type(self, point_type):
  220. """Sets the point_type of this TradeFee.
  221. Point type. 0 - Initial version. 1 - new version since 202009 # noqa: E501
  222. :param point_type: The point_type of this TradeFee. # noqa: E501
  223. :type: str
  224. """
  225. self._point_type = point_type
  226. @property
  227. def futures_taker_fee(self):
  228. """Gets the futures_taker_fee of this TradeFee. # noqa: E501
  229. Futures trading taker fee # noqa: E501
  230. :return: The futures_taker_fee of this TradeFee. # noqa: E501
  231. :rtype: str
  232. """
  233. return self._futures_taker_fee
  234. @futures_taker_fee.setter
  235. def futures_taker_fee(self, futures_taker_fee):
  236. """Sets the futures_taker_fee of this TradeFee.
  237. Futures trading taker fee # noqa: E501
  238. :param futures_taker_fee: The futures_taker_fee of this TradeFee. # noqa: E501
  239. :type: str
  240. """
  241. self._futures_taker_fee = futures_taker_fee
  242. @property
  243. def futures_maker_fee(self):
  244. """Gets the futures_maker_fee of this TradeFee. # noqa: E501
  245. Future trading maker fee # noqa: E501
  246. :return: The futures_maker_fee of this TradeFee. # noqa: E501
  247. :rtype: str
  248. """
  249. return self._futures_maker_fee
  250. @futures_maker_fee.setter
  251. def futures_maker_fee(self, futures_maker_fee):
  252. """Sets the futures_maker_fee of this TradeFee.
  253. Future trading maker fee # noqa: E501
  254. :param futures_maker_fee: The futures_maker_fee of this TradeFee. # noqa: E501
  255. :type: str
  256. """
  257. self._futures_maker_fee = futures_maker_fee
  258. def to_dict(self):
  259. """Returns the model properties as a dict"""
  260. result = {}
  261. for attr, _ in six.iteritems(self.openapi_types):
  262. value = getattr(self, attr)
  263. if isinstance(value, list):
  264. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  265. elif hasattr(value, "to_dict"):
  266. result[attr] = value.to_dict()
  267. elif isinstance(value, dict):
  268. result[attr] = dict(
  269. map(
  270. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  271. value.items(),
  272. )
  273. )
  274. else:
  275. result[attr] = value
  276. return result
  277. def to_str(self):
  278. """Returns the string representation of the model"""
  279. return pprint.pformat(self.to_dict())
  280. def __repr__(self):
  281. """For `print` and `pprint`"""
  282. return self.to_str()
  283. def __eq__(self, other):
  284. """Returns true if both objects are equal"""
  285. if not isinstance(other, TradeFee):
  286. return False
  287. return self.to_dict() == other.to_dict()
  288. def __ne__(self, other):
  289. """Returns true if both objects are not equal"""
  290. if not isinstance(other, TradeFee):
  291. return True
  292. return self.to_dict() != other.to_dict()