天择加密量化开放框架下载
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
10 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 OptionsMySettlements(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. 'time': 'float',
  26. 'underlying': 'str',
  27. 'contract': 'str',
  28. 'strike_price': 'str',
  29. 'settle_price': 'str',
  30. 'size': 'int',
  31. 'settle_profit': 'str',
  32. 'fee': 'str',
  33. 'realised_pnl': 'str',
  34. }
  35. attribute_map = {
  36. 'time': 'time',
  37. 'underlying': 'underlying',
  38. 'contract': 'contract',
  39. 'strike_price': 'strike_price',
  40. 'settle_price': 'settle_price',
  41. 'size': 'size',
  42. 'settle_profit': 'settle_profit',
  43. 'fee': 'fee',
  44. 'realised_pnl': 'realised_pnl',
  45. }
  46. def __init__(
  47. self,
  48. time=None,
  49. underlying=None,
  50. contract=None,
  51. strike_price=None,
  52. settle_price=None,
  53. size=None,
  54. settle_profit=None,
  55. fee=None,
  56. realised_pnl=None,
  57. local_vars_configuration=None,
  58. ): # noqa: E501
  59. # type: (float, str, str, str, str, int, str, str, str, Configuration) -> None
  60. """OptionsMySettlements - 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._time = None
  65. self._underlying = None
  66. self._contract = None
  67. self._strike_price = None
  68. self._settle_price = None
  69. self._size = None
  70. self._settle_profit = None
  71. self._fee = None
  72. self._realised_pnl = None
  73. self.discriminator = None
  74. if time is not None:
  75. self.time = time
  76. if underlying is not None:
  77. self.underlying = underlying
  78. if contract is not None:
  79. self.contract = contract
  80. if strike_price is not None:
  81. self.strike_price = strike_price
  82. if settle_price is not None:
  83. self.settle_price = settle_price
  84. if size is not None:
  85. self.size = size
  86. if settle_profit is not None:
  87. self.settle_profit = settle_profit
  88. if fee is not None:
  89. self.fee = fee
  90. if realised_pnl is not None:
  91. self.realised_pnl = realised_pnl
  92. @property
  93. def time(self):
  94. """Gets the time of this OptionsMySettlements. # noqa: E501
  95. Settlement time # noqa: E501
  96. :return: The time of this OptionsMySettlements. # noqa: E501
  97. :rtype: float
  98. """
  99. return self._time
  100. @time.setter
  101. def time(self, time):
  102. """Sets the time of this OptionsMySettlements.
  103. Settlement time # noqa: E501
  104. :param time: The time of this OptionsMySettlements. # noqa: E501
  105. :type: float
  106. """
  107. self._time = time
  108. @property
  109. def underlying(self):
  110. """Gets the underlying of this OptionsMySettlements. # noqa: E501
  111. Underlying # noqa: E501
  112. :return: The underlying of this OptionsMySettlements. # noqa: E501
  113. :rtype: str
  114. """
  115. return self._underlying
  116. @underlying.setter
  117. def underlying(self, underlying):
  118. """Sets the underlying of this OptionsMySettlements.
  119. Underlying # noqa: E501
  120. :param underlying: The underlying of this OptionsMySettlements. # noqa: E501
  121. :type: str
  122. """
  123. self._underlying = underlying
  124. @property
  125. def contract(self):
  126. """Gets the contract of this OptionsMySettlements. # noqa: E501
  127. Options contract name # noqa: E501
  128. :return: The contract of this OptionsMySettlements. # noqa: E501
  129. :rtype: str
  130. """
  131. return self._contract
  132. @contract.setter
  133. def contract(self, contract):
  134. """Sets the contract of this OptionsMySettlements.
  135. Options contract name # noqa: E501
  136. :param contract: The contract of this OptionsMySettlements. # noqa: E501
  137. :type: str
  138. """
  139. self._contract = contract
  140. @property
  141. def strike_price(self):
  142. """Gets the strike_price of this OptionsMySettlements. # noqa: E501
  143. Strike price (quote currency) # noqa: E501
  144. :return: The strike_price of this OptionsMySettlements. # noqa: E501
  145. :rtype: str
  146. """
  147. return self._strike_price
  148. @strike_price.setter
  149. def strike_price(self, strike_price):
  150. """Sets the strike_price of this OptionsMySettlements.
  151. Strike price (quote currency) # noqa: E501
  152. :param strike_price: The strike_price of this OptionsMySettlements. # noqa: E501
  153. :type: str
  154. """
  155. self._strike_price = strike_price
  156. @property
  157. def settle_price(self):
  158. """Gets the settle_price of this OptionsMySettlements. # noqa: E501
  159. Settlement price (quote currency) # noqa: E501
  160. :return: The settle_price of this OptionsMySettlements. # noqa: E501
  161. :rtype: str
  162. """
  163. return self._settle_price
  164. @settle_price.setter
  165. def settle_price(self, settle_price):
  166. """Sets the settle_price of this OptionsMySettlements.
  167. Settlement price (quote currency) # noqa: E501
  168. :param settle_price: The settle_price of this OptionsMySettlements. # noqa: E501
  169. :type: str
  170. """
  171. self._settle_price = settle_price
  172. @property
  173. def size(self):
  174. """Gets the size of this OptionsMySettlements. # noqa: E501
  175. Size # noqa: E501
  176. :return: The size of this OptionsMySettlements. # noqa: E501
  177. :rtype: int
  178. """
  179. return self._size
  180. @size.setter
  181. def size(self, size):
  182. """Sets the size of this OptionsMySettlements.
  183. Size # noqa: E501
  184. :param size: The size of this OptionsMySettlements. # noqa: E501
  185. :type: int
  186. """
  187. self._size = size
  188. @property
  189. def settle_profit(self):
  190. """Gets the settle_profit of this OptionsMySettlements. # noqa: E501
  191. Settlement profit (quote currency) # noqa: E501
  192. :return: The settle_profit of this OptionsMySettlements. # noqa: E501
  193. :rtype: str
  194. """
  195. return self._settle_profit
  196. @settle_profit.setter
  197. def settle_profit(self, settle_profit):
  198. """Sets the settle_profit of this OptionsMySettlements.
  199. Settlement profit (quote currency) # noqa: E501
  200. :param settle_profit: The settle_profit of this OptionsMySettlements. # noqa: E501
  201. :type: str
  202. """
  203. self._settle_profit = settle_profit
  204. @property
  205. def fee(self):
  206. """Gets the fee of this OptionsMySettlements. # noqa: E501
  207. Fee (quote currency) # noqa: E501
  208. :return: The fee of this OptionsMySettlements. # noqa: E501
  209. :rtype: str
  210. """
  211. return self._fee
  212. @fee.setter
  213. def fee(self, fee):
  214. """Sets the fee of this OptionsMySettlements.
  215. Fee (quote currency) # noqa: E501
  216. :param fee: The fee of this OptionsMySettlements. # noqa: E501
  217. :type: str
  218. """
  219. self._fee = fee
  220. @property
  221. def realised_pnl(self):
  222. """Gets the realised_pnl of this OptionsMySettlements. # noqa: E501
  223. The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (quote currency) # noqa: E501
  224. :return: The realised_pnl of this OptionsMySettlements. # noqa: E501
  225. :rtype: str
  226. """
  227. return self._realised_pnl
  228. @realised_pnl.setter
  229. def realised_pnl(self, realised_pnl):
  230. """Sets the realised_pnl of this OptionsMySettlements.
  231. The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (quote currency) # noqa: E501
  232. :param realised_pnl: The realised_pnl of this OptionsMySettlements. # noqa: E501
  233. :type: str
  234. """
  235. self._realised_pnl = realised_pnl
  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, OptionsMySettlements):
  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, OptionsMySettlements):
  269. return True
  270. return self.to_dict() != other.to_dict()