AlipayOpenMiniPoiQueryResponse.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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.NearbyAddressInfo import NearbyAddressInfo
  6. class AlipayOpenMiniPoiQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(AlipayOpenMiniPoiQueryResponse, self).__init__()
  9. self._max_count = None
  10. self._nearby_address_info_list = None
  11. self._total_count = None
  12. @property
  13. def max_count(self):
  14. return self._max_count
  15. @max_count.setter
  16. def max_count(self, value):
  17. self._max_count = value
  18. @property
  19. def nearby_address_info_list(self):
  20. return self._nearby_address_info_list
  21. @nearby_address_info_list.setter
  22. def nearby_address_info_list(self, value):
  23. if isinstance(value, list):
  24. self._nearby_address_info_list = list()
  25. for i in value:
  26. if isinstance(i, NearbyAddressInfo):
  27. self._nearby_address_info_list.append(i)
  28. else:
  29. self._nearby_address_info_list.append(NearbyAddressInfo.from_alipay_dict(i))
  30. @property
  31. def total_count(self):
  32. return self._total_count
  33. @total_count.setter
  34. def total_count(self, value):
  35. self._total_count = value
  36. def parse_response_content(self, response_content):
  37. response = super(AlipayOpenMiniPoiQueryResponse, self).parse_response_content(response_content)
  38. if 'max_count' in response:
  39. self.max_count = response['max_count']
  40. if 'nearby_address_info_list' in response:
  41. self.nearby_address_info_list = response['nearby_address_info_list']
  42. if 'total_count' in response:
  43. self.total_count = response['total_count']