BatchRoyaltyDetail.py 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. from alipay.aop.api.domain.SubMerchant import SubMerchant
  7. class BatchRoyaltyDetail(object):
  8. def __init__(self):
  9. self._amount = None
  10. self._desc = None
  11. self._error_code = None
  12. self._status = None
  13. self._trans_in_account_id = None
  14. self._trans_in_account_id_type = None
  15. self._trans_in_account_type = None
  16. self._trans_in_entity_id = None
  17. self._trans_in_entity_type = None
  18. self._trans_in_sub_merchant = None
  19. self._trans_out_entity_id = None
  20. self._trans_out_entity_type = None
  21. self._trans_out_sub_merchant = None
  22. @property
  23. def amount(self):
  24. return self._amount
  25. @amount.setter
  26. def amount(self, value):
  27. self._amount = value
  28. @property
  29. def desc(self):
  30. return self._desc
  31. @desc.setter
  32. def desc(self, value):
  33. self._desc = value
  34. @property
  35. def error_code(self):
  36. return self._error_code
  37. @error_code.setter
  38. def error_code(self, value):
  39. self._error_code = value
  40. @property
  41. def status(self):
  42. return self._status
  43. @status.setter
  44. def status(self, value):
  45. self._status = value
  46. @property
  47. def trans_in_account_id(self):
  48. return self._trans_in_account_id
  49. @trans_in_account_id.setter
  50. def trans_in_account_id(self, value):
  51. self._trans_in_account_id = value
  52. @property
  53. def trans_in_account_id_type(self):
  54. return self._trans_in_account_id_type
  55. @trans_in_account_id_type.setter
  56. def trans_in_account_id_type(self, value):
  57. self._trans_in_account_id_type = value
  58. @property
  59. def trans_in_account_type(self):
  60. return self._trans_in_account_type
  61. @trans_in_account_type.setter
  62. def trans_in_account_type(self, value):
  63. self._trans_in_account_type = value
  64. @property
  65. def trans_in_entity_id(self):
  66. return self._trans_in_entity_id
  67. @trans_in_entity_id.setter
  68. def trans_in_entity_id(self, value):
  69. self._trans_in_entity_id = value
  70. @property
  71. def trans_in_entity_type(self):
  72. return self._trans_in_entity_type
  73. @trans_in_entity_type.setter
  74. def trans_in_entity_type(self, value):
  75. self._trans_in_entity_type = value
  76. @property
  77. def trans_in_sub_merchant(self):
  78. return self._trans_in_sub_merchant
  79. @trans_in_sub_merchant.setter
  80. def trans_in_sub_merchant(self, value):
  81. if isinstance(value, SubMerchant):
  82. self._trans_in_sub_merchant = value
  83. else:
  84. self._trans_in_sub_merchant = SubMerchant.from_alipay_dict(value)
  85. @property
  86. def trans_out_entity_id(self):
  87. return self._trans_out_entity_id
  88. @trans_out_entity_id.setter
  89. def trans_out_entity_id(self, value):
  90. self._trans_out_entity_id = value
  91. @property
  92. def trans_out_entity_type(self):
  93. return self._trans_out_entity_type
  94. @trans_out_entity_type.setter
  95. def trans_out_entity_type(self, value):
  96. self._trans_out_entity_type = value
  97. @property
  98. def trans_out_sub_merchant(self):
  99. return self._trans_out_sub_merchant
  100. @trans_out_sub_merchant.setter
  101. def trans_out_sub_merchant(self, value):
  102. if isinstance(value, SubMerchant):
  103. self._trans_out_sub_merchant = value
  104. else:
  105. self._trans_out_sub_merchant = SubMerchant.from_alipay_dict(value)
  106. def to_alipay_dict(self):
  107. params = dict()
  108. if self.amount:
  109. if hasattr(self.amount, 'to_alipay_dict'):
  110. params['amount'] = self.amount.to_alipay_dict()
  111. else:
  112. params['amount'] = self.amount
  113. if self.desc:
  114. if hasattr(self.desc, 'to_alipay_dict'):
  115. params['desc'] = self.desc.to_alipay_dict()
  116. else:
  117. params['desc'] = self.desc
  118. if self.error_code:
  119. if hasattr(self.error_code, 'to_alipay_dict'):
  120. params['error_code'] = self.error_code.to_alipay_dict()
  121. else:
  122. params['error_code'] = self.error_code
  123. if self.status:
  124. if hasattr(self.status, 'to_alipay_dict'):
  125. params['status'] = self.status.to_alipay_dict()
  126. else:
  127. params['status'] = self.status
  128. if self.trans_in_account_id:
  129. if hasattr(self.trans_in_account_id, 'to_alipay_dict'):
  130. params['trans_in_account_id'] = self.trans_in_account_id.to_alipay_dict()
  131. else:
  132. params['trans_in_account_id'] = self.trans_in_account_id
  133. if self.trans_in_account_id_type:
  134. if hasattr(self.trans_in_account_id_type, 'to_alipay_dict'):
  135. params['trans_in_account_id_type'] = self.trans_in_account_id_type.to_alipay_dict()
  136. else:
  137. params['trans_in_account_id_type'] = self.trans_in_account_id_type
  138. if self.trans_in_account_type:
  139. if hasattr(self.trans_in_account_type, 'to_alipay_dict'):
  140. params['trans_in_account_type'] = self.trans_in_account_type.to_alipay_dict()
  141. else:
  142. params['trans_in_account_type'] = self.trans_in_account_type
  143. if self.trans_in_entity_id:
  144. if hasattr(self.trans_in_entity_id, 'to_alipay_dict'):
  145. params['trans_in_entity_id'] = self.trans_in_entity_id.to_alipay_dict()
  146. else:
  147. params['trans_in_entity_id'] = self.trans_in_entity_id
  148. if self.trans_in_entity_type:
  149. if hasattr(self.trans_in_entity_type, 'to_alipay_dict'):
  150. params['trans_in_entity_type'] = self.trans_in_entity_type.to_alipay_dict()
  151. else:
  152. params['trans_in_entity_type'] = self.trans_in_entity_type
  153. if self.trans_in_sub_merchant:
  154. if hasattr(self.trans_in_sub_merchant, 'to_alipay_dict'):
  155. params['trans_in_sub_merchant'] = self.trans_in_sub_merchant.to_alipay_dict()
  156. else:
  157. params['trans_in_sub_merchant'] = self.trans_in_sub_merchant
  158. if self.trans_out_entity_id:
  159. if hasattr(self.trans_out_entity_id, 'to_alipay_dict'):
  160. params['trans_out_entity_id'] = self.trans_out_entity_id.to_alipay_dict()
  161. else:
  162. params['trans_out_entity_id'] = self.trans_out_entity_id
  163. if self.trans_out_entity_type:
  164. if hasattr(self.trans_out_entity_type, 'to_alipay_dict'):
  165. params['trans_out_entity_type'] = self.trans_out_entity_type.to_alipay_dict()
  166. else:
  167. params['trans_out_entity_type'] = self.trans_out_entity_type
  168. if self.trans_out_sub_merchant:
  169. if hasattr(self.trans_out_sub_merchant, 'to_alipay_dict'):
  170. params['trans_out_sub_merchant'] = self.trans_out_sub_merchant.to_alipay_dict()
  171. else:
  172. params['trans_out_sub_merchant'] = self.trans_out_sub_merchant
  173. return params
  174. @staticmethod
  175. def from_alipay_dict(d):
  176. if not d:
  177. return None
  178. o = BatchRoyaltyDetail()
  179. if 'amount' in d:
  180. o.amount = d['amount']
  181. if 'desc' in d:
  182. o.desc = d['desc']
  183. if 'error_code' in d:
  184. o.error_code = d['error_code']
  185. if 'status' in d:
  186. o.status = d['status']
  187. if 'trans_in_account_id' in d:
  188. o.trans_in_account_id = d['trans_in_account_id']
  189. if 'trans_in_account_id_type' in d:
  190. o.trans_in_account_id_type = d['trans_in_account_id_type']
  191. if 'trans_in_account_type' in d:
  192. o.trans_in_account_type = d['trans_in_account_type']
  193. if 'trans_in_entity_id' in d:
  194. o.trans_in_entity_id = d['trans_in_entity_id']
  195. if 'trans_in_entity_type' in d:
  196. o.trans_in_entity_type = d['trans_in_entity_type']
  197. if 'trans_in_sub_merchant' in d:
  198. o.trans_in_sub_merchant = d['trans_in_sub_merchant']
  199. if 'trans_out_entity_id' in d:
  200. o.trans_out_entity_id = d['trans_out_entity_id']
  201. if 'trans_out_entity_type' in d:
  202. o.trans_out_entity_type = d['trans_out_entity_type']
  203. if 'trans_out_sub_merchant' in d:
  204. o.trans_out_sub_merchant = d['trans_out_sub_merchant']
  205. return o