KoubeiMarketingCampaignActivityCreateModel.py 9.6 KB

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