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