RoyaltyDetailInfo.py 7.4 KB

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