KoubeiMarketingToolIsvMerchantQueryResponse.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.IsvMerchantInfo import IsvMerchantInfo
  6. from alipay.aop.api.domain.ShopSummaryInfo import ShopSummaryInfo
  7. class KoubeiMarketingToolIsvMerchantQueryResponse(AlipayResponse):
  8. def __init__(self):
  9. super(KoubeiMarketingToolIsvMerchantQueryResponse, self).__init__()
  10. self._merchant_infos = None
  11. self._shop_count = None
  12. self._shop_summary_infos = None
  13. @property
  14. def merchant_infos(self):
  15. return self._merchant_infos
  16. @merchant_infos.setter
  17. def merchant_infos(self, value):
  18. if isinstance(value, list):
  19. self._merchant_infos = list()
  20. for i in value:
  21. if isinstance(i, IsvMerchantInfo):
  22. self._merchant_infos.append(i)
  23. else:
  24. self._merchant_infos.append(IsvMerchantInfo.from_alipay_dict(i))
  25. @property
  26. def shop_count(self):
  27. return self._shop_count
  28. @shop_count.setter
  29. def shop_count(self, value):
  30. self._shop_count = value
  31. @property
  32. def shop_summary_infos(self):
  33. return self._shop_summary_infos
  34. @shop_summary_infos.setter
  35. def shop_summary_infos(self, value):
  36. if isinstance(value, list):
  37. self._shop_summary_infos = list()
  38. for i in value:
  39. if isinstance(i, ShopSummaryInfo):
  40. self._shop_summary_infos.append(i)
  41. else:
  42. self._shop_summary_infos.append(ShopSummaryInfo.from_alipay_dict(i))
  43. def parse_response_content(self, response_content):
  44. response = super(KoubeiMarketingToolIsvMerchantQueryResponse, self).parse_response_content(response_content)
  45. if 'merchant_infos' in response:
  46. self.merchant_infos = response['merchant_infos']
  47. if 'shop_count' in response:
  48. self.shop_count = response['shop_count']
  49. if 'shop_summary_infos' in response:
  50. self.shop_summary_infos = response['shop_summary_infos']