BatchSettleDetail.py 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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.SubMerchant import SubMerchant
  6. class BatchSettleDetail(object):
  7. def __init__(self):
  8. self._amount = None
  9. self._currency = None
  10. self._error_code = None
  11. self._error_desc = None
  12. self._settle_account_id = None
  13. self._settle_account_id_type = None
  14. self._settle_account_type = None
  15. self._settle_entity_id = None
  16. self._settle_entity_type = None
  17. self._status = None
  18. self._sub_merchant = None
  19. @property
  20. def amount(self):
  21. return self._amount
  22. @amount.setter
  23. def amount(self, value):
  24. self._amount = value
  25. @property
  26. def currency(self):
  27. return self._currency
  28. @currency.setter
  29. def currency(self, value):
  30. self._currency = value
  31. @property
  32. def error_code(self):
  33. return self._error_code
  34. @error_code.setter
  35. def error_code(self, value):
  36. self._error_code = value
  37. @property
  38. def error_desc(self):
  39. return self._error_desc
  40. @error_desc.setter
  41. def error_desc(self, value):
  42. self._error_desc = value
  43. @property
  44. def settle_account_id(self):
  45. return self._settle_account_id
  46. @settle_account_id.setter
  47. def settle_account_id(self, value):
  48. self._settle_account_id = value
  49. @property
  50. def settle_account_id_type(self):
  51. return self._settle_account_id_type
  52. @settle_account_id_type.setter
  53. def settle_account_id_type(self, value):
  54. self._settle_account_id_type = value
  55. @property
  56. def settle_account_type(self):
  57. return self._settle_account_type
  58. @settle_account_type.setter
  59. def settle_account_type(self, value):
  60. self._settle_account_type = value
  61. @property
  62. def settle_entity_id(self):
  63. return self._settle_entity_id
  64. @settle_entity_id.setter
  65. def settle_entity_id(self, value):
  66. self._settle_entity_id = value
  67. @property
  68. def settle_entity_type(self):
  69. return self._settle_entity_type
  70. @settle_entity_type.setter
  71. def settle_entity_type(self, value):
  72. self._settle_entity_type = value
  73. @property
  74. def status(self):
  75. return self._status
  76. @status.setter
  77. def status(self, value):
  78. self._status = value
  79. @property
  80. def sub_merchant(self):
  81. return self._sub_merchant
  82. @sub_merchant.setter
  83. def sub_merchant(self, value):
  84. if isinstance(value, SubMerchant):
  85. self._sub_merchant = value
  86. else:
  87. self._sub_merchant = SubMerchant.from_alipay_dict(value)
  88. def to_alipay_dict(self):
  89. params = dict()
  90. if self.amount:
  91. if hasattr(self.amount, 'to_alipay_dict'):
  92. params['amount'] = self.amount.to_alipay_dict()
  93. else:
  94. params['amount'] = self.amount
  95. if self.currency:
  96. if hasattr(self.currency, 'to_alipay_dict'):
  97. params['currency'] = self.currency.to_alipay_dict()
  98. else:
  99. params['currency'] = self.currency
  100. if self.error_code:
  101. if hasattr(self.error_code, 'to_alipay_dict'):
  102. params['error_code'] = self.error_code.to_alipay_dict()
  103. else:
  104. params['error_code'] = self.error_code
  105. if self.error_desc:
  106. if hasattr(self.error_desc, 'to_alipay_dict'):
  107. params['error_desc'] = self.error_desc.to_alipay_dict()
  108. else:
  109. params['error_desc'] = self.error_desc
  110. if self.settle_account_id:
  111. if hasattr(self.settle_account_id, 'to_alipay_dict'):
  112. params['settle_account_id'] = self.settle_account_id.to_alipay_dict()
  113. else:
  114. params['settle_account_id'] = self.settle_account_id
  115. if self.settle_account_id_type:
  116. if hasattr(self.settle_account_id_type, 'to_alipay_dict'):
  117. params['settle_account_id_type'] = self.settle_account_id_type.to_alipay_dict()
  118. else:
  119. params['settle_account_id_type'] = self.settle_account_id_type
  120. if self.settle_account_type:
  121. if hasattr(self.settle_account_type, 'to_alipay_dict'):
  122. params['settle_account_type'] = self.settle_account_type.to_alipay_dict()
  123. else:
  124. params['settle_account_type'] = self.settle_account_type
  125. if self.settle_entity_id:
  126. if hasattr(self.settle_entity_id, 'to_alipay_dict'):
  127. params['settle_entity_id'] = self.settle_entity_id.to_alipay_dict()
  128. else:
  129. params['settle_entity_id'] = self.settle_entity_id
  130. if self.settle_entity_type:
  131. if hasattr(self.settle_entity_type, 'to_alipay_dict'):
  132. params['settle_entity_type'] = self.settle_entity_type.to_alipay_dict()
  133. else:
  134. params['settle_entity_type'] = self.settle_entity_type
  135. if self.status:
  136. if hasattr(self.status, 'to_alipay_dict'):
  137. params['status'] = self.status.to_alipay_dict()
  138. else:
  139. params['status'] = self.status
  140. if self.sub_merchant:
  141. if hasattr(self.sub_merchant, 'to_alipay_dict'):
  142. params['sub_merchant'] = self.sub_merchant.to_alipay_dict()
  143. else:
  144. params['sub_merchant'] = self.sub_merchant
  145. return params
  146. @staticmethod
  147. def from_alipay_dict(d):
  148. if not d:
  149. return None
  150. o = BatchSettleDetail()
  151. if 'amount' in d:
  152. o.amount = d['amount']
  153. if 'currency' in d:
  154. o.currency = d['currency']
  155. if 'error_code' in d:
  156. o.error_code = d['error_code']
  157. if 'error_desc' in d:
  158. o.error_desc = d['error_desc']
  159. if 'settle_account_id' in d:
  160. o.settle_account_id = d['settle_account_id']
  161. if 'settle_account_id_type' in d:
  162. o.settle_account_id_type = d['settle_account_id_type']
  163. if 'settle_account_type' in d:
  164. o.settle_account_type = d['settle_account_type']
  165. if 'settle_entity_id' in d:
  166. o.settle_entity_id = d['settle_entity_id']
  167. if 'settle_entity_type' in d:
  168. o.settle_entity_type = d['settle_entity_type']
  169. if 'status' in d:
  170. o.status = d['status']
  171. if 'sub_merchant' in d:
  172. o.sub_merchant = d['sub_merchant']
  173. return o