AlipayUserAgreementPageSignModel.py 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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.AccessParams import AccessParams
  6. from alipay.aop.api.domain.DeviceParams import DeviceParams
  7. from alipay.aop.api.domain.IdentityParams import IdentityParams
  8. from alipay.aop.api.domain.PeriodRuleParams import PeriodRuleParams
  9. from alipay.aop.api.domain.ProdParams import ProdParams
  10. from alipay.aop.api.domain.SubMerchantParams import SubMerchantParams
  11. from alipay.aop.api.domain.ZmAuthParams import ZmAuthParams
  12. class AlipayUserAgreementPageSignModel(object):
  13. def __init__(self):
  14. self._access_params = None
  15. self._agreement_effect_type = None
  16. self._allow_huazhi_degrade = None
  17. self._device_params = None
  18. self._external_agreement_no = None
  19. self._external_logon_id = None
  20. self._identity_params = None
  21. self._merchant_process_url = None
  22. self._period_rule_params = None
  23. self._personal_product_code = None
  24. self._prod_params = None
  25. self._product_code = None
  26. self._promo_params = None
  27. self._sign_scene = None
  28. self._sign_validity_period = None
  29. self._sub_merchant = None
  30. self._third_party_type = None
  31. self._user_age_range = None
  32. self._zm_auth_params = None
  33. @property
  34. def access_params(self):
  35. return self._access_params
  36. @access_params.setter
  37. def access_params(self, value):
  38. if isinstance(value, AccessParams):
  39. self._access_params = value
  40. else:
  41. self._access_params = AccessParams.from_alipay_dict(value)
  42. @property
  43. def agreement_effect_type(self):
  44. return self._agreement_effect_type
  45. @agreement_effect_type.setter
  46. def agreement_effect_type(self, value):
  47. self._agreement_effect_type = value
  48. @property
  49. def allow_huazhi_degrade(self):
  50. return self._allow_huazhi_degrade
  51. @allow_huazhi_degrade.setter
  52. def allow_huazhi_degrade(self, value):
  53. self._allow_huazhi_degrade = value
  54. @property
  55. def device_params(self):
  56. return self._device_params
  57. @device_params.setter
  58. def device_params(self, value):
  59. if isinstance(value, DeviceParams):
  60. self._device_params = value
  61. else:
  62. self._device_params = DeviceParams.from_alipay_dict(value)
  63. @property
  64. def external_agreement_no(self):
  65. return self._external_agreement_no
  66. @external_agreement_no.setter
  67. def external_agreement_no(self, value):
  68. self._external_agreement_no = value
  69. @property
  70. def external_logon_id(self):
  71. return self._external_logon_id
  72. @external_logon_id.setter
  73. def external_logon_id(self, value):
  74. self._external_logon_id = value
  75. @property
  76. def identity_params(self):
  77. return self._identity_params
  78. @identity_params.setter
  79. def identity_params(self, value):
  80. if isinstance(value, IdentityParams):
  81. self._identity_params = value
  82. else:
  83. self._identity_params = IdentityParams.from_alipay_dict(value)
  84. @property
  85. def merchant_process_url(self):
  86. return self._merchant_process_url
  87. @merchant_process_url.setter
  88. def merchant_process_url(self, value):
  89. self._merchant_process_url = value
  90. @property
  91. def period_rule_params(self):
  92. return self._period_rule_params
  93. @period_rule_params.setter
  94. def period_rule_params(self, value):
  95. if isinstance(value, PeriodRuleParams):
  96. self._period_rule_params = value
  97. else:
  98. self._period_rule_params = PeriodRuleParams.from_alipay_dict(value)
  99. @property
  100. def personal_product_code(self):
  101. return self._personal_product_code
  102. @personal_product_code.setter
  103. def personal_product_code(self, value):
  104. self._personal_product_code = value
  105. @property
  106. def prod_params(self):
  107. return self._prod_params
  108. @prod_params.setter
  109. def prod_params(self, value):
  110. if isinstance(value, ProdParams):
  111. self._prod_params = value
  112. else:
  113. self._prod_params = ProdParams.from_alipay_dict(value)
  114. @property
  115. def product_code(self):
  116. return self._product_code
  117. @product_code.setter
  118. def product_code(self, value):
  119. self._product_code = value
  120. @property
  121. def promo_params(self):
  122. return self._promo_params
  123. @promo_params.setter
  124. def promo_params(self, value):
  125. self._promo_params = value
  126. @property
  127. def sign_scene(self):
  128. return self._sign_scene
  129. @sign_scene.setter
  130. def sign_scene(self, value):
  131. self._sign_scene = value
  132. @property
  133. def sign_validity_period(self):
  134. return self._sign_validity_period
  135. @sign_validity_period.setter
  136. def sign_validity_period(self, value):
  137. self._sign_validity_period = value
  138. @property
  139. def sub_merchant(self):
  140. return self._sub_merchant
  141. @sub_merchant.setter
  142. def sub_merchant(self, value):
  143. if isinstance(value, SubMerchantParams):
  144. self._sub_merchant = value
  145. else:
  146. self._sub_merchant = SubMerchantParams.from_alipay_dict(value)
  147. @property
  148. def third_party_type(self):
  149. return self._third_party_type
  150. @third_party_type.setter
  151. def third_party_type(self, value):
  152. self._third_party_type = value
  153. @property
  154. def user_age_range(self):
  155. return self._user_age_range
  156. @user_age_range.setter
  157. def user_age_range(self, value):
  158. self._user_age_range = value
  159. @property
  160. def zm_auth_params(self):
  161. return self._zm_auth_params
  162. @zm_auth_params.setter
  163. def zm_auth_params(self, value):
  164. if isinstance(value, ZmAuthParams):
  165. self._zm_auth_params = value
  166. else:
  167. self._zm_auth_params = ZmAuthParams.from_alipay_dict(value)
  168. def to_alipay_dict(self):
  169. params = dict()
  170. if self.access_params:
  171. if hasattr(self.access_params, 'to_alipay_dict'):
  172. params['access_params'] = self.access_params.to_alipay_dict()
  173. else:
  174. params['access_params'] = self.access_params
  175. if self.agreement_effect_type:
  176. if hasattr(self.agreement_effect_type, 'to_alipay_dict'):
  177. params['agreement_effect_type'] = self.agreement_effect_type.to_alipay_dict()
  178. else:
  179. params['agreement_effect_type'] = self.agreement_effect_type
  180. if self.allow_huazhi_degrade:
  181. if hasattr(self.allow_huazhi_degrade, 'to_alipay_dict'):
  182. params['allow_huazhi_degrade'] = self.allow_huazhi_degrade.to_alipay_dict()
  183. else:
  184. params['allow_huazhi_degrade'] = self.allow_huazhi_degrade
  185. if self.device_params:
  186. if hasattr(self.device_params, 'to_alipay_dict'):
  187. params['device_params'] = self.device_params.to_alipay_dict()
  188. else:
  189. params['device_params'] = self.device_params
  190. if self.external_agreement_no:
  191. if hasattr(self.external_agreement_no, 'to_alipay_dict'):
  192. params['external_agreement_no'] = self.external_agreement_no.to_alipay_dict()
  193. else:
  194. params['external_agreement_no'] = self.external_agreement_no
  195. if self.external_logon_id:
  196. if hasattr(self.external_logon_id, 'to_alipay_dict'):
  197. params['external_logon_id'] = self.external_logon_id.to_alipay_dict()
  198. else:
  199. params['external_logon_id'] = self.external_logon_id
  200. if self.identity_params:
  201. if hasattr(self.identity_params, 'to_alipay_dict'):
  202. params['identity_params'] = self.identity_params.to_alipay_dict()
  203. else:
  204. params['identity_params'] = self.identity_params
  205. if self.merchant_process_url:
  206. if hasattr(self.merchant_process_url, 'to_alipay_dict'):
  207. params['merchant_process_url'] = self.merchant_process_url.to_alipay_dict()
  208. else:
  209. params['merchant_process_url'] = self.merchant_process_url
  210. if self.period_rule_params:
  211. if hasattr(self.period_rule_params, 'to_alipay_dict'):
  212. params['period_rule_params'] = self.period_rule_params.to_alipay_dict()
  213. else:
  214. params['period_rule_params'] = self.period_rule_params
  215. if self.personal_product_code:
  216. if hasattr(self.personal_product_code, 'to_alipay_dict'):
  217. params['personal_product_code'] = self.personal_product_code.to_alipay_dict()
  218. else:
  219. params['personal_product_code'] = self.personal_product_code
  220. if self.prod_params:
  221. if hasattr(self.prod_params, 'to_alipay_dict'):
  222. params['prod_params'] = self.prod_params.to_alipay_dict()
  223. else:
  224. params['prod_params'] = self.prod_params
  225. if self.product_code:
  226. if hasattr(self.product_code, 'to_alipay_dict'):
  227. params['product_code'] = self.product_code.to_alipay_dict()
  228. else:
  229. params['product_code'] = self.product_code
  230. if self.promo_params:
  231. if hasattr(self.promo_params, 'to_alipay_dict'):
  232. params['promo_params'] = self.promo_params.to_alipay_dict()
  233. else:
  234. params['promo_params'] = self.promo_params
  235. if self.sign_scene:
  236. if hasattr(self.sign_scene, 'to_alipay_dict'):
  237. params['sign_scene'] = self.sign_scene.to_alipay_dict()
  238. else:
  239. params['sign_scene'] = self.sign_scene
  240. if self.sign_validity_period:
  241. if hasattr(self.sign_validity_period, 'to_alipay_dict'):
  242. params['sign_validity_period'] = self.sign_validity_period.to_alipay_dict()
  243. else:
  244. params['sign_validity_period'] = self.sign_validity_period
  245. if self.sub_merchant:
  246. if hasattr(self.sub_merchant, 'to_alipay_dict'):
  247. params['sub_merchant'] = self.sub_merchant.to_alipay_dict()
  248. else:
  249. params['sub_merchant'] = self.sub_merchant
  250. if self.third_party_type:
  251. if hasattr(self.third_party_type, 'to_alipay_dict'):
  252. params['third_party_type'] = self.third_party_type.to_alipay_dict()
  253. else:
  254. params['third_party_type'] = self.third_party_type
  255. if self.user_age_range:
  256. if hasattr(self.user_age_range, 'to_alipay_dict'):
  257. params['user_age_range'] = self.user_age_range.to_alipay_dict()
  258. else:
  259. params['user_age_range'] = self.user_age_range
  260. if self.zm_auth_params:
  261. if hasattr(self.zm_auth_params, 'to_alipay_dict'):
  262. params['zm_auth_params'] = self.zm_auth_params.to_alipay_dict()
  263. else:
  264. params['zm_auth_params'] = self.zm_auth_params
  265. return params
  266. @staticmethod
  267. def from_alipay_dict(d):
  268. if not d:
  269. return None
  270. o = AlipayUserAgreementPageSignModel()
  271. if 'access_params' in d:
  272. o.access_params = d['access_params']
  273. if 'agreement_effect_type' in d:
  274. o.agreement_effect_type = d['agreement_effect_type']
  275. if 'allow_huazhi_degrade' in d:
  276. o.allow_huazhi_degrade = d['allow_huazhi_degrade']
  277. if 'device_params' in d:
  278. o.device_params = d['device_params']
  279. if 'external_agreement_no' in d:
  280. o.external_agreement_no = d['external_agreement_no']
  281. if 'external_logon_id' in d:
  282. o.external_logon_id = d['external_logon_id']
  283. if 'identity_params' in d:
  284. o.identity_params = d['identity_params']
  285. if 'merchant_process_url' in d:
  286. o.merchant_process_url = d['merchant_process_url']
  287. if 'period_rule_params' in d:
  288. o.period_rule_params = d['period_rule_params']
  289. if 'personal_product_code' in d:
  290. o.personal_product_code = d['personal_product_code']
  291. if 'prod_params' in d:
  292. o.prod_params = d['prod_params']
  293. if 'product_code' in d:
  294. o.product_code = d['product_code']
  295. if 'promo_params' in d:
  296. o.promo_params = d['promo_params']
  297. if 'sign_scene' in d:
  298. o.sign_scene = d['sign_scene']
  299. if 'sign_validity_period' in d:
  300. o.sign_validity_period = d['sign_validity_period']
  301. if 'sub_merchant' in d:
  302. o.sub_merchant = d['sub_merchant']
  303. if 'third_party_type' in d:
  304. o.third_party_type = d['third_party_type']
  305. if 'user_age_range' in d:
  306. o.user_age_range = d['user_age_range']
  307. if 'zm_auth_params' in d:
  308. o.zm_auth_params = d['zm_auth_params']
  309. return o