AlipayUserAgreementAuthApplyModel.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayUserAgreementAuthApplyModel(object):
  6. def __init__(self):
  7. self._agreement_no = None
  8. self._auth_confirm_type = None
  9. self._auth_scene = None
  10. @property
  11. def agreement_no(self):
  12. return self._agreement_no
  13. @agreement_no.setter
  14. def agreement_no(self, value):
  15. self._agreement_no = value
  16. @property
  17. def auth_confirm_type(self):
  18. return self._auth_confirm_type
  19. @auth_confirm_type.setter
  20. def auth_confirm_type(self, value):
  21. self._auth_confirm_type = value
  22. @property
  23. def auth_scene(self):
  24. return self._auth_scene
  25. @auth_scene.setter
  26. def auth_scene(self, value):
  27. self._auth_scene = value
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.agreement_no:
  31. if hasattr(self.agreement_no, 'to_alipay_dict'):
  32. params['agreement_no'] = self.agreement_no.to_alipay_dict()
  33. else:
  34. params['agreement_no'] = self.agreement_no
  35. if self.auth_confirm_type:
  36. if hasattr(self.auth_confirm_type, 'to_alipay_dict'):
  37. params['auth_confirm_type'] = self.auth_confirm_type.to_alipay_dict()
  38. else:
  39. params['auth_confirm_type'] = self.auth_confirm_type
  40. if self.auth_scene:
  41. if hasattr(self.auth_scene, 'to_alipay_dict'):
  42. params['auth_scene'] = self.auth_scene.to_alipay_dict()
  43. else:
  44. params['auth_scene'] = self.auth_scene
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = AlipayUserAgreementAuthApplyModel()
  51. if 'agreement_no' in d:
  52. o.agreement_no = d['agreement_no']
  53. if 'auth_confirm_type' in d:
  54. o.auth_confirm_type = d['auth_confirm_type']
  55. if 'auth_scene' in d:
  56. o.auth_scene = d['auth_scene']
  57. return o