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

268 lines
7.6 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 OptionsPositionClose(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. 'contract': 'str',
  27. 'side': 'str',
  28. 'pnl': 'str',
  29. 'text': 'str',
  30. 'settle_size': 'str',
  31. }
  32. attribute_map = {
  33. 'time': 'time',
  34. 'contract': 'contract',
  35. 'side': 'side',
  36. 'pnl': 'pnl',
  37. 'text': 'text',
  38. 'settle_size': 'settle_size',
  39. }
  40. def __init__(
  41. self, time=None, contract=None, side=None, pnl=None, text=None, settle_size=None, local_vars_configuration=None
  42. ): # noqa: E501
  43. # type: (float, str, str, str, str, str, Configuration) -> None
  44. """OptionsPositionClose - a model defined in OpenAPI""" # noqa: E501
  45. if local_vars_configuration is None:
  46. local_vars_configuration = Configuration()
  47. self.local_vars_configuration = local_vars_configuration
  48. self._time = None
  49. self._contract = None
  50. self._side = None
  51. self._pnl = None
  52. self._text = None
  53. self._settle_size = None
  54. self.discriminator = None
  55. if time is not None:
  56. self.time = time
  57. if contract is not None:
  58. self.contract = contract
  59. if side is not None:
  60. self.side = side
  61. if pnl is not None:
  62. self.pnl = pnl
  63. if text is not None:
  64. self.text = text
  65. if settle_size is not None:
  66. self.settle_size = settle_size
  67. @property
  68. def time(self):
  69. """Gets the time of this OptionsPositionClose. # noqa: E501
  70. Position close time # noqa: E501
  71. :return: The time of this OptionsPositionClose. # noqa: E501
  72. :rtype: float
  73. """
  74. return self._time
  75. @time.setter
  76. def time(self, time):
  77. """Sets the time of this OptionsPositionClose.
  78. Position close time # noqa: E501
  79. :param time: The time of this OptionsPositionClose. # noqa: E501
  80. :type: float
  81. """
  82. self._time = time
  83. @property
  84. def contract(self):
  85. """Gets the contract of this OptionsPositionClose. # noqa: E501
  86. Options contract name # noqa: E501
  87. :return: The contract of this OptionsPositionClose. # noqa: E501
  88. :rtype: str
  89. """
  90. return self._contract
  91. @contract.setter
  92. def contract(self, contract):
  93. """Sets the contract of this OptionsPositionClose.
  94. Options contract name # noqa: E501
  95. :param contract: The contract of this OptionsPositionClose. # noqa: E501
  96. :type: str
  97. """
  98. self._contract = contract
  99. @property
  100. def side(self):
  101. """Gets the side of this OptionsPositionClose. # noqa: E501
  102. Position side, long or short # noqa: E501
  103. :return: The side of this OptionsPositionClose. # noqa: E501
  104. :rtype: str
  105. """
  106. return self._side
  107. @side.setter
  108. def side(self, side):
  109. """Sets the side of this OptionsPositionClose.
  110. Position side, long or short # noqa: E501
  111. :param side: The side of this OptionsPositionClose. # noqa: E501
  112. :type: str
  113. """
  114. allowed_values = ["long", "short"] # noqa: E501
  115. if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501
  116. raise ValueError(
  117. "Invalid value for `side` ({0}), must be one of {1}".format(side, allowed_values) # noqa: E501
  118. )
  119. self._side = side
  120. @property
  121. def pnl(self):
  122. """Gets the pnl of this OptionsPositionClose. # noqa: E501
  123. PNL # noqa: E501
  124. :return: The pnl of this OptionsPositionClose. # noqa: E501
  125. :rtype: str
  126. """
  127. return self._pnl
  128. @pnl.setter
  129. def pnl(self, pnl):
  130. """Sets the pnl of this OptionsPositionClose.
  131. PNL # noqa: E501
  132. :param pnl: The pnl of this OptionsPositionClose. # noqa: E501
  133. :type: str
  134. """
  135. self._pnl = pnl
  136. @property
  137. def text(self):
  138. """Gets the text of this OptionsPositionClose. # noqa: E501
  139. Text of close order # noqa: E501
  140. :return: The text of this OptionsPositionClose. # noqa: E501
  141. :rtype: str
  142. """
  143. return self._text
  144. @text.setter
  145. def text(self, text):
  146. """Sets the text of this OptionsPositionClose.
  147. Text of close order # noqa: E501
  148. :param text: The text of this OptionsPositionClose. # noqa: E501
  149. :type: str
  150. """
  151. self._text = text
  152. @property
  153. def settle_size(self):
  154. """Gets the settle_size of this OptionsPositionClose. # noqa: E501
  155. settlement size # noqa: E501
  156. :return: The settle_size of this OptionsPositionClose. # noqa: E501
  157. :rtype: str
  158. """
  159. return self._settle_size
  160. @settle_size.setter
  161. def settle_size(self, settle_size):
  162. """Sets the settle_size of this OptionsPositionClose.
  163. settlement size # noqa: E501
  164. :param settle_size: The settle_size of this OptionsPositionClose. # noqa: E501
  165. :type: str
  166. """
  167. self._settle_size = settle_size
  168. def to_dict(self):
  169. """Returns the model properties as a dict"""
  170. result = {}
  171. for attr, _ in six.iteritems(self.openapi_types):
  172. value = getattr(self, attr)
  173. if isinstance(value, list):
  174. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  175. elif hasattr(value, "to_dict"):
  176. result[attr] = value.to_dict()
  177. elif isinstance(value, dict):
  178. result[attr] = dict(
  179. map(
  180. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  181. value.items(),
  182. )
  183. )
  184. else:
  185. result[attr] = value
  186. return result
  187. def to_str(self):
  188. """Returns the string representation of the model"""
  189. return pprint.pformat(self.to_dict())
  190. def __repr__(self):
  191. """For `print` and `pprint`"""
  192. return self.to_str()
  193. def __eq__(self, other):
  194. """Returns true if both objects are equal"""
  195. if not isinstance(other, OptionsPositionClose):
  196. return False
  197. return self.to_dict() == other.to_dict()
  198. def __ne__(self, other):
  199. """Returns true if both objects are not equal"""
  200. if not isinstance(other, OptionsPositionClose):
  201. return True
  202. return self.to_dict() != other.to_dict()