KoubeiMarketingCampaignActivityModifyModel.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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.BudgetInfo import BudgetInfo
  6. from alipay.aop.api.domain.ConstraintInfo import ConstraintInfo
  7. from alipay.aop.api.domain.PromoTool import PromoTool
  8. from alipay.aop.api.domain.PublishChannel import PublishChannel
  9. from alipay.aop.api.domain.RecruitTool import RecruitTool
  10. class KoubeiMarketingCampaignActivityModifyModel(object):
  11. def __init__(self):
  12. self._auto_delay_flag = None
  13. self._budget_info = None
  14. self._camp_id = None
  15. self._constraint_info = None
  16. self._desc = None
  17. self._end_time = None
  18. self._ext_info = None
  19. self._name = None
  20. self._operator_id = None
  21. self._operator_type = None
  22. self._out_biz_no = None
  23. self._promo_tools = None
  24. self._publish_channels = None
  25. self._recruit_tool = None
  26. self._start_time = None
  27. self._type = None
  28. @property
  29. def auto_delay_flag(self):
  30. return self._auto_delay_flag
  31. @auto_delay_flag.setter
  32. def auto_delay_flag(self, value):
  33. self._auto_delay_flag = value
  34. @property
  35. def budget_info(self):
  36. return self._budget_info
  37. @budget_info.setter
  38. def budget_info(self, value):
  39. if isinstance(value, BudgetInfo):
  40. self._budget_info = value
  41. else:
  42. self._budget_info = BudgetInfo.from_alipay_dict(value)
  43. @property
  44. def camp_id(self):
  45. return self._camp_id
  46. @camp_id.setter
  47. def camp_id(self, value):
  48. self._camp_id = value
  49. @property
  50. def constraint_info(self):
  51. return self._constraint_info
  52. @constraint_info.setter
  53. def constraint_info(self, value):
  54. if isinstance(value, ConstraintInfo):
  55. self._constraint_info = value
  56. else:
  57. self._constraint_info = ConstraintInfo.from_alipay_dict(value)
  58. @property
  59. def desc(self):
  60. return self._desc
  61. @desc.setter
  62. def desc(self, value):
  63. self._desc = value
  64. @property
  65. def end_time(self):
  66. return self._end_time
  67. @end_time.setter
  68. def end_time(self, value):
  69. self._end_time = value
  70. @property
  71. def ext_info(self):
  72. return self._ext_info
  73. @ext_info.setter
  74. def ext_info(self, value):
  75. self._ext_info = value
  76. @property
  77. def name(self):
  78. return self._name
  79. @name.setter
  80. def name(self, value):
  81. self._name = value
  82. @property
  83. def operator_id(self):
  84. return self._operator_id
  85. @operator_id.setter
  86. def operator_id(self, value):
  87. self._operator_id = value
  88. @property
  89. def operator_type(self):
  90. return self._operator_type
  91. @operator_type.setter
  92. def operator_type(self, value):
  93. self._operator_type = value
  94. @property
  95. def out_biz_no(self):
  96. return self._out_biz_no
  97. @out_biz_no.setter
  98. def out_biz_no(self, value):
  99. self._out_biz_no = value
  100. @property
  101. def promo_tools(self):
  102. return self._promo_tools
  103. @promo_tools.setter
  104. def promo_tools(self, value):
  105. if isinstance(value, list):
  106. self._promo_tools = list()
  107. for i in value:
  108. if isinstance(i, PromoTool):
  109. self._promo_tools.append(i)
  110. else:
  111. self._promo_tools.append(PromoTool.from_alipay_dict(i))
  112. @property
  113. def publish_channels(self):
  114. return self._publish_channels
  115. @publish_channels.setter
  116. def publish_channels(self, value):
  117. if isinstance(value, list):
  118. self._publish_channels = list()
  119. for i in value:
  120. if isinstance(i, PublishChannel):
  121. self._publish_channels.append(i)
  122. else:
  123. self._publish_channels.append(PublishChannel.from_alipay_dict(i))
  124. @property
  125. def recruit_tool(self):
  126. return self._recruit_tool
  127. @recruit_tool.setter
  128. def recruit_tool(self, value):
  129. if isinstance(value, RecruitTool):
  130. self._recruit_tool = value
  131. else:
  132. self._recruit_tool = RecruitTool.from_alipay_dict(value)
  133. @property
  134. def start_time(self):
  135. return self._start_time
  136. @start_time.setter
  137. def start_time(self, value):
  138. self._start_time = value
  139. @property
  140. def type(self):
  141. return self._type
  142. @type.setter
  143. def type(self, value):
  144. self._type = value
  145. def to_alipay_dict(self):
  146. params = dict()
  147. if self.auto_delay_flag:
  148. if hasattr(self.auto_delay_flag, 'to_alipay_dict'):
  149. params['auto_delay_flag'] = self.auto_delay_flag.to_alipay_dict()
  150. else:
  151. params['auto_delay_flag'] = self.auto_delay_flag
  152. if self.budget_info:
  153. if hasattr(self.budget_info, 'to_alipay_dict'):
  154. params['budget_info'] = self.budget_info.to_alipay_dict()
  155. else:
  156. params['budget_info'] = self.budget_info
  157. if self.camp_id:
  158. if hasattr(self.camp_id, 'to_alipay_dict'):
  159. params['camp_id'] = self.camp_id.to_alipay_dict()
  160. else:
  161. params['camp_id'] = self.camp_id
  162. if self.constraint_info:
  163. if hasattr(self.constraint_info, 'to_alipay_dict'):
  164. params['constraint_info'] = self.constraint_info.to_alipay_dict()
  165. else:
  166. params['constraint_info'] = self.constraint_info
  167. if self.desc:
  168. if hasattr(self.desc, 'to_alipay_dict'):
  169. params['desc'] = self.desc.to_alipay_dict()
  170. else:
  171. params['desc'] = self.desc
  172. if self.end_time:
  173. if hasattr(self.end_time, 'to_alipay_dict'):
  174. params['end_time'] = self.end_time.to_alipay_dict()
  175. else:
  176. params['end_time'] = self.end_time
  177. if self.ext_info:
  178. if hasattr(self.ext_info, 'to_alipay_dict'):
  179. params['ext_info'] = self.ext_info.to_alipay_dict()
  180. else:
  181. params['ext_info'] = self.ext_info
  182. if self.name:
  183. if hasattr(self.name, 'to_alipay_dict'):
  184. params['name'] = self.name.to_alipay_dict()
  185. else:
  186. params['name'] = self.name
  187. if self.operator_id:
  188. if hasattr(self.operator_id, 'to_alipay_dict'):
  189. params['operator_id'] = self.operator_id.to_alipay_dict()
  190. else:
  191. params['operator_id'] = self.operator_id
  192. if self.operator_type:
  193. if hasattr(self.operator_type, 'to_alipay_dict'):
  194. params['operator_type'] = self.operator_type.to_alipay_dict()
  195. else:
  196. params['operator_type'] = self.operator_type
  197. if self.out_biz_no:
  198. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  199. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  200. else:
  201. params['out_biz_no'] = self.out_biz_no
  202. if self.promo_tools:
  203. if isinstance(self.promo_tools, list):
  204. for i in range(0, len(self.promo_tools)):
  205. element = self.promo_tools[i]
  206. if hasattr(element, 'to_alipay_dict'):
  207. self.promo_tools[i] = element.to_alipay_dict()
  208. if hasattr(self.promo_tools, 'to_alipay_dict'):
  209. params['promo_tools'] = self.promo_tools.to_alipay_dict()
  210. else:
  211. params['promo_tools'] = self.promo_tools
  212. if self.publish_channels:
  213. if isinstance(self.publish_channels, list):
  214. for i in range(0, len(self.publish_channels)):
  215. element = self.publish_channels[i]
  216. if hasattr(element, 'to_alipay_dict'):
  217. self.publish_channels[i] = element.to_alipay_dict()
  218. if hasattr(self.publish_channels, 'to_alipay_dict'):
  219. params['publish_channels'] = self.publish_channels.to_alipay_dict()
  220. else:
  221. params['publish_channels'] = self.publish_channels
  222. if self.recruit_tool:
  223. if hasattr(self.recruit_tool, 'to_alipay_dict'):
  224. params['recruit_tool'] = self.recruit_tool.to_alipay_dict()
  225. else:
  226. params['recruit_tool'] = self.recruit_tool
  227. if self.start_time:
  228. if hasattr(self.start_time, 'to_alipay_dict'):
  229. params['start_time'] = self.start_time.to_alipay_dict()
  230. else:
  231. params['start_time'] = self.start_time
  232. if self.type:
  233. if hasattr(self.type, 'to_alipay_dict'):
  234. params['type'] = self.type.to_alipay_dict()
  235. else:
  236. params['type'] = self.type
  237. return params
  238. @staticmethod
  239. def from_alipay_dict(d):
  240. if not d:
  241. return None
  242. o = KoubeiMarketingCampaignActivityModifyModel()
  243. if 'auto_delay_flag' in d:
  244. o.auto_delay_flag = d['auto_delay_flag']
  245. if 'budget_info' in d:
  246. o.budget_info = d['budget_info']
  247. if 'camp_id' in d:
  248. o.camp_id = d['camp_id']
  249. if 'constraint_info' in d:
  250. o.constraint_info = d['constraint_info']
  251. if 'desc' in d:
  252. o.desc = d['desc']
  253. if 'end_time' in d:
  254. o.end_time = d['end_time']
  255. if 'ext_info' in d:
  256. o.ext_info = d['ext_info']
  257. if 'name' in d:
  258. o.name = d['name']
  259. if 'operator_id' in d:
  260. o.operator_id = d['operator_id']
  261. if 'operator_type' in d:
  262. o.operator_type = d['operator_type']
  263. if 'out_biz_no' in d:
  264. o.out_biz_no = d['out_biz_no']
  265. if 'promo_tools' in d:
  266. o.promo_tools = d['promo_tools']
  267. if 'publish_channels' in d:
  268. o.publish_channels = d['publish_channels']
  269. if 'recruit_tool' in d:
  270. o.recruit_tool = d['recruit_tool']
  271. if 'start_time' in d:
  272. o.start_time = d['start_time']
  273. if 'type' in d:
  274. o.type = d['type']
  275. return o