KoubeiMerchantDepartmentDetailQueryResponse.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.SimpleShopModel import SimpleShopModel
  6. class KoubeiMerchantDepartmentDetailQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(KoubeiMerchantDepartmentDetailQueryResponse, self).__init__()
  9. self._dept_id = None
  10. self._dept_name = None
  11. self._label_code = None
  12. self._parent_dept_id = None
  13. self._shops = None
  14. self._type = None
  15. @property
  16. def dept_id(self):
  17. return self._dept_id
  18. @dept_id.setter
  19. def dept_id(self, value):
  20. self._dept_id = value
  21. @property
  22. def dept_name(self):
  23. return self._dept_name
  24. @dept_name.setter
  25. def dept_name(self, value):
  26. self._dept_name = value
  27. @property
  28. def label_code(self):
  29. return self._label_code
  30. @label_code.setter
  31. def label_code(self, value):
  32. self._label_code = value
  33. @property
  34. def parent_dept_id(self):
  35. return self._parent_dept_id
  36. @parent_dept_id.setter
  37. def parent_dept_id(self, value):
  38. self._parent_dept_id = value
  39. @property
  40. def shops(self):
  41. return self._shops
  42. @shops.setter
  43. def shops(self, value):
  44. if isinstance(value, list):
  45. self._shops = list()
  46. for i in value:
  47. if isinstance(i, SimpleShopModel):
  48. self._shops.append(i)
  49. else:
  50. self._shops.append(SimpleShopModel.from_alipay_dict(i))
  51. @property
  52. def type(self):
  53. return self._type
  54. @type.setter
  55. def type(self, value):
  56. self._type = value
  57. def parse_response_content(self, response_content):
  58. response = super(KoubeiMerchantDepartmentDetailQueryResponse, self).parse_response_content(response_content)
  59. if 'dept_id' in response:
  60. self.dept_id = response['dept_id']
  61. if 'dept_name' in response:
  62. self.dept_name = response['dept_name']
  63. if 'label_code' in response:
  64. self.label_code = response['label_code']
  65. if 'parent_dept_id' in response:
  66. self.parent_dept_id = response['parent_dept_id']
  67. if 'shops' in response:
  68. self.shops = response['shops']
  69. if 'type' in response:
  70. self.type = response['type']