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