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

393 lines
12 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 CrossMarginLoan(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. 'id': 'str',
  26. 'create_time': 'int',
  27. 'update_time': 'int',
  28. 'currency': 'str',
  29. 'amount': 'str',
  30. 'text': 'str',
  31. 'status': 'int',
  32. 'repaid': 'str',
  33. 'repaid_interest': 'str',
  34. 'unpaid_interest': 'str',
  35. }
  36. attribute_map = {
  37. 'id': 'id',
  38. 'create_time': 'create_time',
  39. 'update_time': 'update_time',
  40. 'currency': 'currency',
  41. 'amount': 'amount',
  42. 'text': 'text',
  43. 'status': 'status',
  44. 'repaid': 'repaid',
  45. 'repaid_interest': 'repaid_interest',
  46. 'unpaid_interest': 'unpaid_interest',
  47. }
  48. def __init__(
  49. self,
  50. id=None,
  51. create_time=None,
  52. update_time=None,
  53. currency=None,
  54. amount=None,
  55. text=None,
  56. status=None,
  57. repaid=None,
  58. repaid_interest=None,
  59. unpaid_interest=None,
  60. local_vars_configuration=None,
  61. ): # noqa: E501
  62. # type: (str, int, int, str, str, str, int, str, str, str, Configuration) -> None
  63. """CrossMarginLoan - 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._id = None
  68. self._create_time = None
  69. self._update_time = None
  70. self._currency = None
  71. self._amount = None
  72. self._text = None
  73. self._status = None
  74. self._repaid = None
  75. self._repaid_interest = None
  76. self._unpaid_interest = None
  77. self.discriminator = None
  78. if id is not None:
  79. self.id = id
  80. if create_time is not None:
  81. self.create_time = create_time
  82. if update_time is not None:
  83. self.update_time = update_time
  84. self.currency = currency
  85. self.amount = amount
  86. if text is not None:
  87. self.text = text
  88. if status is not None:
  89. self.status = status
  90. if repaid is not None:
  91. self.repaid = repaid
  92. if repaid_interest is not None:
  93. self.repaid_interest = repaid_interest
  94. if unpaid_interest is not None:
  95. self.unpaid_interest = unpaid_interest
  96. @property
  97. def id(self):
  98. """Gets the id of this CrossMarginLoan. # noqa: E501
  99. Borrow loan ID # noqa: E501
  100. :return: The id of this CrossMarginLoan. # noqa: E501
  101. :rtype: str
  102. """
  103. return self._id
  104. @id.setter
  105. def id(self, id):
  106. """Sets the id of this CrossMarginLoan.
  107. Borrow loan ID # noqa: E501
  108. :param id: The id of this CrossMarginLoan. # noqa: E501
  109. :type: str
  110. """
  111. self._id = id
  112. @property
  113. def create_time(self):
  114. """Gets the create_time of this CrossMarginLoan. # noqa: E501
  115. Creation timestamp, in milliseconds # noqa: E501
  116. :return: The create_time of this CrossMarginLoan. # noqa: E501
  117. :rtype: int
  118. """
  119. return self._create_time
  120. @create_time.setter
  121. def create_time(self, create_time):
  122. """Sets the create_time of this CrossMarginLoan.
  123. Creation timestamp, in milliseconds # noqa: E501
  124. :param create_time: The create_time of this CrossMarginLoan. # noqa: E501
  125. :type: int
  126. """
  127. self._create_time = create_time
  128. @property
  129. def update_time(self):
  130. """Gets the update_time of this CrossMarginLoan. # noqa: E501
  131. Update timestamp, in milliseconds # noqa: E501
  132. :return: The update_time of this CrossMarginLoan. # noqa: E501
  133. :rtype: int
  134. """
  135. return self._update_time
  136. @update_time.setter
  137. def update_time(self, update_time):
  138. """Sets the update_time of this CrossMarginLoan.
  139. Update timestamp, in milliseconds # noqa: E501
  140. :param update_time: The update_time of this CrossMarginLoan. # noqa: E501
  141. :type: int
  142. """
  143. self._update_time = update_time
  144. @property
  145. def currency(self):
  146. """Gets the currency of this CrossMarginLoan. # noqa: E501
  147. Currency name # noqa: E501
  148. :return: The currency of this CrossMarginLoan. # noqa: E501
  149. :rtype: str
  150. """
  151. return self._currency
  152. @currency.setter
  153. def currency(self, currency):
  154. """Sets the currency of this CrossMarginLoan.
  155. Currency name # noqa: E501
  156. :param currency: The currency of this CrossMarginLoan. # noqa: E501
  157. :type: str
  158. """
  159. if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501
  160. raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501
  161. self._currency = currency
  162. @property
  163. def amount(self):
  164. """Gets the amount of this CrossMarginLoan. # noqa: E501
  165. Borrowed amount # noqa: E501
  166. :return: The amount of this CrossMarginLoan. # noqa: E501
  167. :rtype: str
  168. """
  169. return self._amount
  170. @amount.setter
  171. def amount(self, amount):
  172. """Sets the amount of this CrossMarginLoan.
  173. Borrowed amount # noqa: E501
  174. :param amount: The amount of this CrossMarginLoan. # noqa: E501
  175. :type: str
  176. """
  177. if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501
  178. raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501
  179. self._amount = amount
  180. @property
  181. def text(self):
  182. """Gets the text of this CrossMarginLoan. # noqa: E501
  183. User defined custom ID # noqa: E501
  184. :return: The text of this CrossMarginLoan. # noqa: E501
  185. :rtype: str
  186. """
  187. return self._text
  188. @text.setter
  189. def text(self, text):
  190. """Sets the text of this CrossMarginLoan.
  191. User defined custom ID # noqa: E501
  192. :param text: The text of this CrossMarginLoan. # noqa: E501
  193. :type: str
  194. """
  195. self._text = text
  196. @property
  197. def status(self):
  198. """Gets the status of this CrossMarginLoan. # noqa: E501
  199. Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete # noqa: E501
  200. :return: The status of this CrossMarginLoan. # noqa: E501
  201. :rtype: int
  202. """
  203. return self._status
  204. @status.setter
  205. def status(self, status):
  206. """Sets the status of this CrossMarginLoan.
  207. Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete # noqa: E501
  208. :param status: The status of this CrossMarginLoan. # noqa: E501
  209. :type: int
  210. """
  211. allowed_values = [1, 2, 3] # noqa: E501
  212. if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501
  213. raise ValueError(
  214. "Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values) # noqa: E501
  215. )
  216. self._status = status
  217. @property
  218. def repaid(self):
  219. """Gets the repaid of this CrossMarginLoan. # noqa: E501
  220. Repaid amount # noqa: E501
  221. :return: The repaid of this CrossMarginLoan. # noqa: E501
  222. :rtype: str
  223. """
  224. return self._repaid
  225. @repaid.setter
  226. def repaid(self, repaid):
  227. """Sets the repaid of this CrossMarginLoan.
  228. Repaid amount # noqa: E501
  229. :param repaid: The repaid of this CrossMarginLoan. # noqa: E501
  230. :type: str
  231. """
  232. self._repaid = repaid
  233. @property
  234. def repaid_interest(self):
  235. """Gets the repaid_interest of this CrossMarginLoan. # noqa: E501
  236. Repaid interest # noqa: E501
  237. :return: The repaid_interest of this CrossMarginLoan. # noqa: E501
  238. :rtype: str
  239. """
  240. return self._repaid_interest
  241. @repaid_interest.setter
  242. def repaid_interest(self, repaid_interest):
  243. """Sets the repaid_interest of this CrossMarginLoan.
  244. Repaid interest # noqa: E501
  245. :param repaid_interest: The repaid_interest of this CrossMarginLoan. # noqa: E501
  246. :type: str
  247. """
  248. self._repaid_interest = repaid_interest
  249. @property
  250. def unpaid_interest(self):
  251. """Gets the unpaid_interest of this CrossMarginLoan. # noqa: E501
  252. Outstanding interest yet to be paid # noqa: E501
  253. :return: The unpaid_interest of this CrossMarginLoan. # noqa: E501
  254. :rtype: str
  255. """
  256. return self._unpaid_interest
  257. @unpaid_interest.setter
  258. def unpaid_interest(self, unpaid_interest):
  259. """Sets the unpaid_interest of this CrossMarginLoan.
  260. Outstanding interest yet to be paid # noqa: E501
  261. :param unpaid_interest: The unpaid_interest of this CrossMarginLoan. # noqa: E501
  262. :type: str
  263. """
  264. self._unpaid_interest = unpaid_interest
  265. def to_dict(self):
  266. """Returns the model properties as a dict"""
  267. result = {}
  268. for attr, _ in six.iteritems(self.openapi_types):
  269. value = getattr(self, attr)
  270. if isinstance(value, list):
  271. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  272. elif hasattr(value, "to_dict"):
  273. result[attr] = value.to_dict()
  274. elif isinstance(value, dict):
  275. result[attr] = dict(
  276. map(
  277. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  278. value.items(),
  279. )
  280. )
  281. else:
  282. result[attr] = value
  283. return result
  284. def to_str(self):
  285. """Returns the string representation of the model"""
  286. return pprint.pformat(self.to_dict())
  287. def __repr__(self):
  288. """For `print` and `pprint`"""
  289. return self.to_str()
  290. def __eq__(self, other):
  291. """Returns true if both objects are equal"""
  292. if not isinstance(other, CrossMarginLoan):
  293. return False
  294. return self.to_dict() == other.to_dict()
  295. def __ne__(self, other):
  296. """Returns true if both objects are not equal"""
  297. if not isinstance(other, CrossMarginLoan):
  298. return True
  299. return self.to_dict() != other.to_dict()