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