FinanceReceivableResultInfo.py 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.FinanceBankAccountInfo import FinanceBankAccountInfo
  6. class FinanceReceivableResultInfo(object):
  7. def __init__(self):
  8. self._accept_tx_hash = None
  9. self._asset_id = None
  10. self._factoring_account_info = None
  11. self._issue_date = None
  12. self._out_asset_id = None
  13. self._review_tx_hash = None
  14. self._submit_tx_hash = None
  15. @property
  16. def accept_tx_hash(self):
  17. return self._accept_tx_hash
  18. @accept_tx_hash.setter
  19. def accept_tx_hash(self, value):
  20. self._accept_tx_hash = value
  21. @property
  22. def asset_id(self):
  23. return self._asset_id
  24. @asset_id.setter
  25. def asset_id(self, value):
  26. self._asset_id = value
  27. @property
  28. def factoring_account_info(self):
  29. return self._factoring_account_info
  30. @factoring_account_info.setter
  31. def factoring_account_info(self, value):
  32. if isinstance(value, FinanceBankAccountInfo):
  33. self._factoring_account_info = value
  34. else:
  35. self._factoring_account_info = FinanceBankAccountInfo.from_alipay_dict(value)
  36. @property
  37. def issue_date(self):
  38. return self._issue_date
  39. @issue_date.setter
  40. def issue_date(self, value):
  41. self._issue_date = value
  42. @property
  43. def out_asset_id(self):
  44. return self._out_asset_id
  45. @out_asset_id.setter
  46. def out_asset_id(self, value):
  47. self._out_asset_id = value
  48. @property
  49. def review_tx_hash(self):
  50. return self._review_tx_hash
  51. @review_tx_hash.setter
  52. def review_tx_hash(self, value):
  53. self._review_tx_hash = value
  54. @property
  55. def submit_tx_hash(self):
  56. return self._submit_tx_hash
  57. @submit_tx_hash.setter
  58. def submit_tx_hash(self, value):
  59. self._submit_tx_hash = value
  60. def to_alipay_dict(self):
  61. params = dict()
  62. if self.accept_tx_hash:
  63. if hasattr(self.accept_tx_hash, 'to_alipay_dict'):
  64. params['accept_tx_hash'] = self.accept_tx_hash.to_alipay_dict()
  65. else:
  66. params['accept_tx_hash'] = self.accept_tx_hash
  67. if self.asset_id:
  68. if hasattr(self.asset_id, 'to_alipay_dict'):
  69. params['asset_id'] = self.asset_id.to_alipay_dict()
  70. else:
  71. params['asset_id'] = self.asset_id
  72. if self.factoring_account_info:
  73. if hasattr(self.factoring_account_info, 'to_alipay_dict'):
  74. params['factoring_account_info'] = self.factoring_account_info.to_alipay_dict()
  75. else:
  76. params['factoring_account_info'] = self.factoring_account_info
  77. if self.issue_date:
  78. if hasattr(self.issue_date, 'to_alipay_dict'):
  79. params['issue_date'] = self.issue_date.to_alipay_dict()
  80. else:
  81. params['issue_date'] = self.issue_date
  82. if self.out_asset_id:
  83. if hasattr(self.out_asset_id, 'to_alipay_dict'):
  84. params['out_asset_id'] = self.out_asset_id.to_alipay_dict()
  85. else:
  86. params['out_asset_id'] = self.out_asset_id
  87. if self.review_tx_hash:
  88. if hasattr(self.review_tx_hash, 'to_alipay_dict'):
  89. params['review_tx_hash'] = self.review_tx_hash.to_alipay_dict()
  90. else:
  91. params['review_tx_hash'] = self.review_tx_hash
  92. if self.submit_tx_hash:
  93. if hasattr(self.submit_tx_hash, 'to_alipay_dict'):
  94. params['submit_tx_hash'] = self.submit_tx_hash.to_alipay_dict()
  95. else:
  96. params['submit_tx_hash'] = self.submit_tx_hash
  97. return params
  98. @staticmethod
  99. def from_alipay_dict(d):
  100. if not d:
  101. return None
  102. o = FinanceReceivableResultInfo()
  103. if 'accept_tx_hash' in d:
  104. o.accept_tx_hash = d['accept_tx_hash']
  105. if 'asset_id' in d:
  106. o.asset_id = d['asset_id']
  107. if 'factoring_account_info' in d:
  108. o.factoring_account_info = d['factoring_account_info']
  109. if 'issue_date' in d:
  110. o.issue_date = d['issue_date']
  111. if 'out_asset_id' in d:
  112. o.out_asset_id = d['out_asset_id']
  113. if 'review_tx_hash' in d:
  114. o.review_tx_hash = d['review_tx_hash']
  115. if 'submit_tx_hash' in d:
  116. o.submit_tx_hash = d['submit_tx_hash']
  117. return o