AlipayInsSceneClaimApplyModel.py 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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.InsPerson import InsPerson
  6. from alipay.aop.api.domain.InsClaimPolicy import InsClaimPolicy
  7. from alipay.aop.api.domain.InsPerson import InsPerson
  8. class AlipayInsSceneClaimApplyModel(object):
  9. def __init__(self):
  10. self._accident_address = None
  11. self._accident_desc = None
  12. self._accident_time = None
  13. self._beneficiary = None
  14. self._bill_title = None
  15. self._biz_data = None
  16. self._claim_fee = None
  17. self._claim_policy_list = None
  18. self._out_biz_no = None
  19. self._out_request_no = None
  20. self._prod_code = None
  21. self._reporter = None
  22. @property
  23. def accident_address(self):
  24. return self._accident_address
  25. @accident_address.setter
  26. def accident_address(self, value):
  27. self._accident_address = value
  28. @property
  29. def accident_desc(self):
  30. return self._accident_desc
  31. @accident_desc.setter
  32. def accident_desc(self, value):
  33. self._accident_desc = value
  34. @property
  35. def accident_time(self):
  36. return self._accident_time
  37. @accident_time.setter
  38. def accident_time(self, value):
  39. self._accident_time = value
  40. @property
  41. def beneficiary(self):
  42. return self._beneficiary
  43. @beneficiary.setter
  44. def beneficiary(self, value):
  45. if isinstance(value, InsPerson):
  46. self._beneficiary = value
  47. else:
  48. self._beneficiary = InsPerson.from_alipay_dict(value)
  49. @property
  50. def bill_title(self):
  51. return self._bill_title
  52. @bill_title.setter
  53. def bill_title(self, value):
  54. self._bill_title = value
  55. @property
  56. def biz_data(self):
  57. return self._biz_data
  58. @biz_data.setter
  59. def biz_data(self, value):
  60. self._biz_data = value
  61. @property
  62. def claim_fee(self):
  63. return self._claim_fee
  64. @claim_fee.setter
  65. def claim_fee(self, value):
  66. self._claim_fee = value
  67. @property
  68. def claim_policy_list(self):
  69. return self._claim_policy_list
  70. @claim_policy_list.setter
  71. def claim_policy_list(self, value):
  72. if isinstance(value, list):
  73. self._claim_policy_list = list()
  74. for i in value:
  75. if isinstance(i, InsClaimPolicy):
  76. self._claim_policy_list.append(i)
  77. else:
  78. self._claim_policy_list.append(InsClaimPolicy.from_alipay_dict(i))
  79. @property
  80. def out_biz_no(self):
  81. return self._out_biz_no
  82. @out_biz_no.setter
  83. def out_biz_no(self, value):
  84. self._out_biz_no = value
  85. @property
  86. def out_request_no(self):
  87. return self._out_request_no
  88. @out_request_no.setter
  89. def out_request_no(self, value):
  90. self._out_request_no = value
  91. @property
  92. def prod_code(self):
  93. return self._prod_code
  94. @prod_code.setter
  95. def prod_code(self, value):
  96. self._prod_code = value
  97. @property
  98. def reporter(self):
  99. return self._reporter
  100. @reporter.setter
  101. def reporter(self, value):
  102. if isinstance(value, InsPerson):
  103. self._reporter = value
  104. else:
  105. self._reporter = InsPerson.from_alipay_dict(value)
  106. def to_alipay_dict(self):
  107. params = dict()
  108. if self.accident_address:
  109. if hasattr(self.accident_address, 'to_alipay_dict'):
  110. params['accident_address'] = self.accident_address.to_alipay_dict()
  111. else:
  112. params['accident_address'] = self.accident_address
  113. if self.accident_desc:
  114. if hasattr(self.accident_desc, 'to_alipay_dict'):
  115. params['accident_desc'] = self.accident_desc.to_alipay_dict()
  116. else:
  117. params['accident_desc'] = self.accident_desc
  118. if self.accident_time:
  119. if hasattr(self.accident_time, 'to_alipay_dict'):
  120. params['accident_time'] = self.accident_time.to_alipay_dict()
  121. else:
  122. params['accident_time'] = self.accident_time
  123. if self.beneficiary:
  124. if hasattr(self.beneficiary, 'to_alipay_dict'):
  125. params['beneficiary'] = self.beneficiary.to_alipay_dict()
  126. else:
  127. params['beneficiary'] = self.beneficiary
  128. if self.bill_title:
  129. if hasattr(self.bill_title, 'to_alipay_dict'):
  130. params['bill_title'] = self.bill_title.to_alipay_dict()
  131. else:
  132. params['bill_title'] = self.bill_title
  133. if self.biz_data:
  134. if hasattr(self.biz_data, 'to_alipay_dict'):
  135. params['biz_data'] = self.biz_data.to_alipay_dict()
  136. else:
  137. params['biz_data'] = self.biz_data
  138. if self.claim_fee:
  139. if hasattr(self.claim_fee, 'to_alipay_dict'):
  140. params['claim_fee'] = self.claim_fee.to_alipay_dict()
  141. else:
  142. params['claim_fee'] = self.claim_fee
  143. if self.claim_policy_list:
  144. if isinstance(self.claim_policy_list, list):
  145. for i in range(0, len(self.claim_policy_list)):
  146. element = self.claim_policy_list[i]
  147. if hasattr(element, 'to_alipay_dict'):
  148. self.claim_policy_list[i] = element.to_alipay_dict()
  149. if hasattr(self.claim_policy_list, 'to_alipay_dict'):
  150. params['claim_policy_list'] = self.claim_policy_list.to_alipay_dict()
  151. else:
  152. params['claim_policy_list'] = self.claim_policy_list
  153. if self.out_biz_no:
  154. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  155. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  156. else:
  157. params['out_biz_no'] = self.out_biz_no
  158. if self.out_request_no:
  159. if hasattr(self.out_request_no, 'to_alipay_dict'):
  160. params['out_request_no'] = self.out_request_no.to_alipay_dict()
  161. else:
  162. params['out_request_no'] = self.out_request_no
  163. if self.prod_code:
  164. if hasattr(self.prod_code, 'to_alipay_dict'):
  165. params['prod_code'] = self.prod_code.to_alipay_dict()
  166. else:
  167. params['prod_code'] = self.prod_code
  168. if self.reporter:
  169. if hasattr(self.reporter, 'to_alipay_dict'):
  170. params['reporter'] = self.reporter.to_alipay_dict()
  171. else:
  172. params['reporter'] = self.reporter
  173. return params
  174. @staticmethod
  175. def from_alipay_dict(d):
  176. if not d:
  177. return None
  178. o = AlipayInsSceneClaimApplyModel()
  179. if 'accident_address' in d:
  180. o.accident_address = d['accident_address']
  181. if 'accident_desc' in d:
  182. o.accident_desc = d['accident_desc']
  183. if 'accident_time' in d:
  184. o.accident_time = d['accident_time']
  185. if 'beneficiary' in d:
  186. o.beneficiary = d['beneficiary']
  187. if 'bill_title' in d:
  188. o.bill_title = d['bill_title']
  189. if 'biz_data' in d:
  190. o.biz_data = d['biz_data']
  191. if 'claim_fee' in d:
  192. o.claim_fee = d['claim_fee']
  193. if 'claim_policy_list' in d:
  194. o.claim_policy_list = d['claim_policy_list']
  195. if 'out_biz_no' in d:
  196. o.out_biz_no = d['out_biz_no']
  197. if 'out_request_no' in d:
  198. o.out_request_no = d['out_request_no']
  199. if 'prod_code' in d:
  200. o.prod_code = d['prod_code']
  201. if 'reporter' in d:
  202. o.reporter = d['reporter']
  203. return o