KoubeiItemTaobaoIndexQueryResponse.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.KbItemInfo import KbItemInfo
  6. class KoubeiItemTaobaoIndexQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(KoubeiItemTaobaoIndexQueryResponse, self).__init__()
  9. self._column_title = None
  10. self._ext_info = None
  11. self._item_list = None
  12. self._time_icon = None
  13. self._time_title = None
  14. self._url = None
  15. @property
  16. def column_title(self):
  17. return self._column_title
  18. @column_title.setter
  19. def column_title(self, value):
  20. self._column_title = value
  21. @property
  22. def ext_info(self):
  23. return self._ext_info
  24. @ext_info.setter
  25. def ext_info(self, value):
  26. self._ext_info = value
  27. @property
  28. def item_list(self):
  29. return self._item_list
  30. @item_list.setter
  31. def item_list(self, value):
  32. if isinstance(value, list):
  33. self._item_list = list()
  34. for i in value:
  35. if isinstance(i, KbItemInfo):
  36. self._item_list.append(i)
  37. else:
  38. self._item_list.append(KbItemInfo.from_alipay_dict(i))
  39. @property
  40. def time_icon(self):
  41. return self._time_icon
  42. @time_icon.setter
  43. def time_icon(self, value):
  44. self._time_icon = value
  45. @property
  46. def time_title(self):
  47. return self._time_title
  48. @time_title.setter
  49. def time_title(self, value):
  50. self._time_title = value
  51. @property
  52. def url(self):
  53. return self._url
  54. @url.setter
  55. def url(self, value):
  56. self._url = value
  57. def parse_response_content(self, response_content):
  58. response = super(KoubeiItemTaobaoIndexQueryResponse, self).parse_response_content(response_content)
  59. if 'column_title' in response:
  60. self.column_title = response['column_title']
  61. if 'ext_info' in response:
  62. self.ext_info = response['ext_info']
  63. if 'item_list' in response:
  64. self.item_list = response['item_list']
  65. if 'time_icon' in response:
  66. self.time_icon = response['time_icon']
  67. if 'time_title' in response:
  68. self.time_title = response['time_title']
  69. if 'url' in response:
  70. self.url = response['url']