AlipayOpenAuthAppContentQueryResponse.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.response.AlipayResponse import AlipayResponse
  5. from alipay.aop.api.domain.Agreement import Agreement
  6. class AlipayOpenAuthAppContentQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(AlipayOpenAuthAppContentQueryResponse, self).__init__()
  9. self._agreement = None
  10. self._auth_text = None
  11. @property
  12. def agreement(self):
  13. return self._agreement
  14. @agreement.setter
  15. def agreement(self, value):
  16. if isinstance(value, list):
  17. self._agreement = list()
  18. for i in value:
  19. if isinstance(i, Agreement):
  20. self._agreement.append(i)
  21. else:
  22. self._agreement.append(Agreement.from_alipay_dict(i))
  23. @property
  24. def auth_text(self):
  25. return self._auth_text
  26. @auth_text.setter
  27. def auth_text(self, value):
  28. if isinstance(value, list):
  29. self._auth_text = list()
  30. for i in value:
  31. self._auth_text.append(i)
  32. def parse_response_content(self, response_content):
  33. response = super(AlipayOpenAuthAppContentQueryResponse, self).parse_response_content(response_content)
  34. if 'agreement' in response:
  35. self.agreement = response['agreement']
  36. if 'auth_text' in response:
  37. self.auth_text = response['auth_text']