AlipayUserAccountDeviceInfoQueryResponse.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.DeviceResultInfo import DeviceResultInfo
  6. class AlipayUserAccountDeviceInfoQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(AlipayUserAccountDeviceInfoQueryResponse, self).__init__()
  9. self._device_infos = None
  10. self._device_type = None
  11. self._encrypt_type = None
  12. self._result_code = None
  13. @property
  14. def device_infos(self):
  15. return self._device_infos
  16. @device_infos.setter
  17. def device_infos(self, value):
  18. if isinstance(value, list):
  19. self._device_infos = list()
  20. for i in value:
  21. if isinstance(i, DeviceResultInfo):
  22. self._device_infos.append(i)
  23. else:
  24. self._device_infos.append(DeviceResultInfo.from_alipay_dict(i))
  25. @property
  26. def device_type(self):
  27. return self._device_type
  28. @device_type.setter
  29. def device_type(self, value):
  30. self._device_type = value
  31. @property
  32. def encrypt_type(self):
  33. return self._encrypt_type
  34. @encrypt_type.setter
  35. def encrypt_type(self, value):
  36. self._encrypt_type = value
  37. @property
  38. def result_code(self):
  39. return self._result_code
  40. @result_code.setter
  41. def result_code(self, value):
  42. self._result_code = value
  43. def parse_response_content(self, response_content):
  44. response = super(AlipayUserAccountDeviceInfoQueryResponse, self).parse_response_content(response_content)
  45. if 'device_infos' in response:
  46. self.device_infos = response['device_infos']
  47. if 'device_type' in response:
  48. self.device_type = response['device_type']
  49. if 'encrypt_type' in response:
  50. self.encrypt_type = response['encrypt_type']
  51. if 'result_code' in response:
  52. self.result_code = response['result_code']