AlipaySecurityRiskAuthenticationCancelModel.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.AuthenticationScene import AuthenticationScene
  6. class AlipaySecurityRiskAuthenticationCancelModel(object):
  7. def __init__(self):
  8. self._authentication_scene = None
  9. self._biz_id = None
  10. self._biz_info = None
  11. self._token_id = None
  12. @property
  13. def authentication_scene(self):
  14. return self._authentication_scene
  15. @authentication_scene.setter
  16. def authentication_scene(self, value):
  17. if isinstance(value, AuthenticationScene):
  18. self._authentication_scene = value
  19. else:
  20. self._authentication_scene = AuthenticationScene.from_alipay_dict(value)
  21. @property
  22. def biz_id(self):
  23. return self._biz_id
  24. @biz_id.setter
  25. def biz_id(self, value):
  26. self._biz_id = value
  27. @property
  28. def biz_info(self):
  29. return self._biz_info
  30. @biz_info.setter
  31. def biz_info(self, value):
  32. self._biz_info = value
  33. @property
  34. def token_id(self):
  35. return self._token_id
  36. @token_id.setter
  37. def token_id(self, value):
  38. self._token_id = value
  39. def to_alipay_dict(self):
  40. params = dict()
  41. if self.authentication_scene:
  42. if hasattr(self.authentication_scene, 'to_alipay_dict'):
  43. params['authentication_scene'] = self.authentication_scene.to_alipay_dict()
  44. else:
  45. params['authentication_scene'] = self.authentication_scene
  46. if self.biz_id:
  47. if hasattr(self.biz_id, 'to_alipay_dict'):
  48. params['biz_id'] = self.biz_id.to_alipay_dict()
  49. else:
  50. params['biz_id'] = self.biz_id
  51. if self.biz_info:
  52. if hasattr(self.biz_info, 'to_alipay_dict'):
  53. params['biz_info'] = self.biz_info.to_alipay_dict()
  54. else:
  55. params['biz_info'] = self.biz_info
  56. if self.token_id:
  57. if hasattr(self.token_id, 'to_alipay_dict'):
  58. params['token_id'] = self.token_id.to_alipay_dict()
  59. else:
  60. params['token_id'] = self.token_id
  61. return params
  62. @staticmethod
  63. def from_alipay_dict(d):
  64. if not d:
  65. return None
  66. o = AlipaySecurityRiskAuthenticationCancelModel()
  67. if 'authentication_scene' in d:
  68. o.authentication_scene = d['authentication_scene']
  69. if 'biz_id' in d:
  70. o.biz_id = d['biz_id']
  71. if 'biz_info' in d:
  72. o.biz_info = d['biz_info']
  73. if 'token_id' in d:
  74. o.token_id = d['token_id']
  75. return o