KbAdvertAdvChannelResponse.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.KbAdvertAdvContentResponse import KbAdvertAdvContentResponse
  6. class KbAdvertAdvChannelResponse(object):
  7. def __init__(self):
  8. self._adv_content_list = None
  9. self._adv_id = None
  10. self._channel_id = None
  11. self._channel_name = None
  12. self._channel_type = None
  13. @property
  14. def adv_content_list(self):
  15. return self._adv_content_list
  16. @adv_content_list.setter
  17. def adv_content_list(self, value):
  18. if isinstance(value, list):
  19. self._adv_content_list = list()
  20. for i in value:
  21. if isinstance(i, KbAdvertAdvContentResponse):
  22. self._adv_content_list.append(i)
  23. else:
  24. self._adv_content_list.append(KbAdvertAdvContentResponse.from_alipay_dict(i))
  25. @property
  26. def adv_id(self):
  27. return self._adv_id
  28. @adv_id.setter
  29. def adv_id(self, value):
  30. self._adv_id = value
  31. @property
  32. def channel_id(self):
  33. return self._channel_id
  34. @channel_id.setter
  35. def channel_id(self, value):
  36. self._channel_id = value
  37. @property
  38. def channel_name(self):
  39. return self._channel_name
  40. @channel_name.setter
  41. def channel_name(self, value):
  42. self._channel_name = value
  43. @property
  44. def channel_type(self):
  45. return self._channel_type
  46. @channel_type.setter
  47. def channel_type(self, value):
  48. self._channel_type = value
  49. def to_alipay_dict(self):
  50. params = dict()
  51. if self.adv_content_list:
  52. if isinstance(self.adv_content_list, list):
  53. for i in range(0, len(self.adv_content_list)):
  54. element = self.adv_content_list[i]
  55. if hasattr(element, 'to_alipay_dict'):
  56. self.adv_content_list[i] = element.to_alipay_dict()
  57. if hasattr(self.adv_content_list, 'to_alipay_dict'):
  58. params['adv_content_list'] = self.adv_content_list.to_alipay_dict()
  59. else:
  60. params['adv_content_list'] = self.adv_content_list
  61. if self.adv_id:
  62. if hasattr(self.adv_id, 'to_alipay_dict'):
  63. params['adv_id'] = self.adv_id.to_alipay_dict()
  64. else:
  65. params['adv_id'] = self.adv_id
  66. if self.channel_id:
  67. if hasattr(self.channel_id, 'to_alipay_dict'):
  68. params['channel_id'] = self.channel_id.to_alipay_dict()
  69. else:
  70. params['channel_id'] = self.channel_id
  71. if self.channel_name:
  72. if hasattr(self.channel_name, 'to_alipay_dict'):
  73. params['channel_name'] = self.channel_name.to_alipay_dict()
  74. else:
  75. params['channel_name'] = self.channel_name
  76. if self.channel_type:
  77. if hasattr(self.channel_type, 'to_alipay_dict'):
  78. params['channel_type'] = self.channel_type.to_alipay_dict()
  79. else:
  80. params['channel_type'] = self.channel_type
  81. return params
  82. @staticmethod
  83. def from_alipay_dict(d):
  84. if not d:
  85. return None
  86. o = KbAdvertAdvChannelResponse()
  87. if 'adv_content_list' in d:
  88. o.adv_content_list = d['adv_content_list']
  89. if 'adv_id' in d:
  90. o.adv_id = d['adv_id']
  91. if 'channel_id' in d:
  92. o.channel_id = d['channel_id']
  93. if 'channel_name' in d:
  94. o.channel_name = d['channel_name']
  95. if 'channel_type' in d:
  96. o.channel_type = d['channel_type']
  97. return o