AlipayCommerceOperationContentQueryResponse.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.BoothContentInfoModel import BoothContentInfoModel
  6. from alipay.aop.api.domain.OperationExtDataModel import OperationExtDataModel
  7. class AlipayCommerceOperationContentQueryResponse(AlipayResponse):
  8. def __init__(self):
  9. super(AlipayCommerceOperationContentQueryResponse, self).__init__()
  10. self._content_infos = None
  11. self._ext_data = None
  12. @property
  13. def content_infos(self):
  14. return self._content_infos
  15. @content_infos.setter
  16. def content_infos(self, value):
  17. if isinstance(value, list):
  18. self._content_infos = list()
  19. for i in value:
  20. if isinstance(i, BoothContentInfoModel):
  21. self._content_infos.append(i)
  22. else:
  23. self._content_infos.append(BoothContentInfoModel.from_alipay_dict(i))
  24. @property
  25. def ext_data(self):
  26. return self._ext_data
  27. @ext_data.setter
  28. def ext_data(self, value):
  29. if isinstance(value, OperationExtDataModel):
  30. self._ext_data = value
  31. else:
  32. self._ext_data = OperationExtDataModel.from_alipay_dict(value)
  33. def parse_response_content(self, response_content):
  34. response = super(AlipayCommerceOperationContentQueryResponse, self).parse_response_content(response_content)
  35. if 'content_infos' in response:
  36. self.content_infos = response['content_infos']
  37. if 'ext_data' in response:
  38. self.ext_data = response['ext_data']