KoubeiAdvertCommissionSpecialadvcontentModifyModel.py 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.KbAdvertSpecialAdvContentRequest import KbAdvertSpecialAdvContentRequest
  6. class KoubeiAdvertCommissionSpecialadvcontentModifyModel(object):
  7. def __init__(self):
  8. self._adv_id = None
  9. self._channel_id = None
  10. self._content_list = None
  11. self._modify_type = None
  12. @property
  13. def adv_id(self):
  14. return self._adv_id
  15. @adv_id.setter
  16. def adv_id(self, value):
  17. self._adv_id = value
  18. @property
  19. def channel_id(self):
  20. return self._channel_id
  21. @channel_id.setter
  22. def channel_id(self, value):
  23. self._channel_id = value
  24. @property
  25. def content_list(self):
  26. return self._content_list
  27. @content_list.setter
  28. def content_list(self, value):
  29. if isinstance(value, list):
  30. self._content_list = list()
  31. for i in value:
  32. if isinstance(i, KbAdvertSpecialAdvContentRequest):
  33. self._content_list.append(i)
  34. else:
  35. self._content_list.append(KbAdvertSpecialAdvContentRequest.from_alipay_dict(i))
  36. @property
  37. def modify_type(self):
  38. return self._modify_type
  39. @modify_type.setter
  40. def modify_type(self, value):
  41. self._modify_type = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.adv_id:
  45. if hasattr(self.adv_id, 'to_alipay_dict'):
  46. params['adv_id'] = self.adv_id.to_alipay_dict()
  47. else:
  48. params['adv_id'] = self.adv_id
  49. if self.channel_id:
  50. if hasattr(self.channel_id, 'to_alipay_dict'):
  51. params['channel_id'] = self.channel_id.to_alipay_dict()
  52. else:
  53. params['channel_id'] = self.channel_id
  54. if self.content_list:
  55. if isinstance(self.content_list, list):
  56. for i in range(0, len(self.content_list)):
  57. element = self.content_list[i]
  58. if hasattr(element, 'to_alipay_dict'):
  59. self.content_list[i] = element.to_alipay_dict()
  60. if hasattr(self.content_list, 'to_alipay_dict'):
  61. params['content_list'] = self.content_list.to_alipay_dict()
  62. else:
  63. params['content_list'] = self.content_list
  64. if self.modify_type:
  65. if hasattr(self.modify_type, 'to_alipay_dict'):
  66. params['modify_type'] = self.modify_type.to_alipay_dict()
  67. else:
  68. params['modify_type'] = self.modify_type
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = KoubeiAdvertCommissionSpecialadvcontentModifyModel()
  75. if 'adv_id' in d:
  76. o.adv_id = d['adv_id']
  77. if 'channel_id' in d:
  78. o.channel_id = d['channel_id']
  79. if 'content_list' in d:
  80. o.content_list = d['content_list']
  81. if 'modify_type' in d:
  82. o.modify_type = d['modify_type']
  83. return o