AlipayInsAutoAutoinsprodEnquriyApplyModel.py 7.5 KB

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