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