AlipayMobileBeaconDeviceQueryResponse.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.BeaconDeviceInfo import BeaconDeviceInfo
  6. class AlipayMobileBeaconDeviceQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(AlipayMobileBeaconDeviceQueryResponse, self).__init__()
  9. self._beacon_device_info = None
  10. self._code = None
  11. self._msg = None
  12. @property
  13. def beacon_device_info(self):
  14. return self._beacon_device_info
  15. @beacon_device_info.setter
  16. def beacon_device_info(self, value):
  17. if isinstance(value, BeaconDeviceInfo):
  18. self._beacon_device_info = value
  19. else:
  20. self._beacon_device_info = BeaconDeviceInfo.from_alipay_dict(value)
  21. @property
  22. def code(self):
  23. return self._code
  24. @code.setter
  25. def code(self, value):
  26. self._code = value
  27. @property
  28. def msg(self):
  29. return self._msg
  30. @msg.setter
  31. def msg(self, value):
  32. self._msg = value
  33. def parse_response_content(self, response_content):
  34. response = super(AlipayMobileBeaconDeviceQueryResponse, self).parse_response_content(response_content)
  35. if 'beacon_device_info' in response:
  36. self.beacon_device_info = response['beacon_device_info']
  37. if 'code' in response:
  38. self.code = response['code']
  39. if 'msg' in response:
  40. self.msg = response['msg']