AlipayCommerceIotAdvertiserMaterialBatchqueryResponse.py 1.4 KB

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