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