AlipayCommerceIotDeviceGeofenceQueryResponse.py 1.5 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.FenceEvent import FenceEvent
  6. class AlipayCommerceIotDeviceGeofenceQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(AlipayCommerceIotDeviceGeofenceQueryResponse, self).__init__()
  9. self._bind_device = None
  10. self._fence_events = None
  11. @property
  12. def bind_device(self):
  13. return self._bind_device
  14. @bind_device.setter
  15. def bind_device(self, value):
  16. if isinstance(value, list):
  17. self._bind_device = list()
  18. for i in value:
  19. self._bind_device.append(i)
  20. @property
  21. def fence_events(self):
  22. return self._fence_events
  23. @fence_events.setter
  24. def fence_events(self, value):
  25. if isinstance(value, list):
  26. self._fence_events = list()
  27. for i in value:
  28. if isinstance(i, FenceEvent):
  29. self._fence_events.append(i)
  30. else:
  31. self._fence_events.append(FenceEvent.from_alipay_dict(i))
  32. def parse_response_content(self, response_content):
  33. response = super(AlipayCommerceIotDeviceGeofenceQueryResponse, self).parse_response_content(response_content)
  34. if 'bind_device' in response:
  35. self.bind_device = response['bind_device']
  36. if 'fence_events' in response:
  37. self.fence_events = response['fence_events']