AlipayMarketingCampaignDrawcampCreateModel.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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.MpPrizeInfoModel import MpPrizeInfoModel
  6. class AlipayMarketingCampaignDrawcampCreateModel(object):
  7. def __init__(self):
  8. self._account_count = None
  9. self._appid_count = None
  10. self._award_count = None
  11. self._award_rate = None
  12. self._camp_code = None
  13. self._camp_end_time = None
  14. self._camp_name = None
  15. self._camp_start_time = None
  16. self._cert_rule_id = None
  17. self._certification_count = None
  18. self._crowd_rule_id = None
  19. self._mobile_count = None
  20. self._mpid = None
  21. self._prize_list = None
  22. self._promo_rule_id = None
  23. self._trigger_type = None
  24. self._trigger_user_rule_id = None
  25. self._user_rule_id = None
  26. @property
  27. def account_count(self):
  28. return self._account_count
  29. @account_count.setter
  30. def account_count(self, value):
  31. self._account_count = value
  32. @property
  33. def appid_count(self):
  34. return self._appid_count
  35. @appid_count.setter
  36. def appid_count(self, value):
  37. self._appid_count = value
  38. @property
  39. def award_count(self):
  40. return self._award_count
  41. @award_count.setter
  42. def award_count(self, value):
  43. self._award_count = value
  44. @property
  45. def award_rate(self):
  46. return self._award_rate
  47. @award_rate.setter
  48. def award_rate(self, value):
  49. self._award_rate = value
  50. @property
  51. def camp_code(self):
  52. return self._camp_code
  53. @camp_code.setter
  54. def camp_code(self, value):
  55. self._camp_code = value
  56. @property
  57. def camp_end_time(self):
  58. return self._camp_end_time
  59. @camp_end_time.setter
  60. def camp_end_time(self, value):
  61. self._camp_end_time = value
  62. @property
  63. def camp_name(self):
  64. return self._camp_name
  65. @camp_name.setter
  66. def camp_name(self, value):
  67. self._camp_name = value
  68. @property
  69. def camp_start_time(self):
  70. return self._camp_start_time
  71. @camp_start_time.setter
  72. def camp_start_time(self, value):
  73. self._camp_start_time = value
  74. @property
  75. def cert_rule_id(self):
  76. return self._cert_rule_id
  77. @cert_rule_id.setter
  78. def cert_rule_id(self, value):
  79. self._cert_rule_id = value
  80. @property
  81. def certification_count(self):
  82. return self._certification_count
  83. @certification_count.setter
  84. def certification_count(self, value):
  85. self._certification_count = value
  86. @property
  87. def crowd_rule_id(self):
  88. return self._crowd_rule_id
  89. @crowd_rule_id.setter
  90. def crowd_rule_id(self, value):
  91. self._crowd_rule_id = value
  92. @property
  93. def mobile_count(self):
  94. return self._mobile_count
  95. @mobile_count.setter
  96. def mobile_count(self, value):
  97. self._mobile_count = value
  98. @property
  99. def mpid(self):
  100. return self._mpid
  101. @mpid.setter
  102. def mpid(self, value):
  103. self._mpid = value
  104. @property
  105. def prize_list(self):
  106. return self._prize_list
  107. @prize_list.setter
  108. def prize_list(self, value):
  109. if isinstance(value, list):
  110. self._prize_list = list()
  111. for i in value:
  112. if isinstance(i, MpPrizeInfoModel):
  113. self._prize_list.append(i)
  114. else:
  115. self._prize_list.append(MpPrizeInfoModel.from_alipay_dict(i))
  116. @property
  117. def promo_rule_id(self):
  118. return self._promo_rule_id
  119. @promo_rule_id.setter
  120. def promo_rule_id(self, value):
  121. self._promo_rule_id = value
  122. @property
  123. def trigger_type(self):
  124. return self._trigger_type
  125. @trigger_type.setter
  126. def trigger_type(self, value):
  127. self._trigger_type = value
  128. @property
  129. def trigger_user_rule_id(self):
  130. return self._trigger_user_rule_id
  131. @trigger_user_rule_id.setter
  132. def trigger_user_rule_id(self, value):
  133. self._trigger_user_rule_id = value
  134. @property
  135. def user_rule_id(self):
  136. return self._user_rule_id
  137. @user_rule_id.setter
  138. def user_rule_id(self, value):
  139. self._user_rule_id = value
  140. def to_alipay_dict(self):
  141. params = dict()
  142. if self.account_count:
  143. if hasattr(self.account_count, 'to_alipay_dict'):
  144. params['account_count'] = self.account_count.to_alipay_dict()
  145. else:
  146. params['account_count'] = self.account_count
  147. if self.appid_count:
  148. if hasattr(self.appid_count, 'to_alipay_dict'):
  149. params['appid_count'] = self.appid_count.to_alipay_dict()
  150. else:
  151. params['appid_count'] = self.appid_count
  152. if self.award_count:
  153. if hasattr(self.award_count, 'to_alipay_dict'):
  154. params['award_count'] = self.award_count.to_alipay_dict()
  155. else:
  156. params['award_count'] = self.award_count
  157. if self.award_rate:
  158. if hasattr(self.award_rate, 'to_alipay_dict'):
  159. params['award_rate'] = self.award_rate.to_alipay_dict()
  160. else:
  161. params['award_rate'] = self.award_rate
  162. if self.camp_code:
  163. if hasattr(self.camp_code, 'to_alipay_dict'):
  164. params['camp_code'] = self.camp_code.to_alipay_dict()
  165. else:
  166. params['camp_code'] = self.camp_code
  167. if self.camp_end_time:
  168. if hasattr(self.camp_end_time, 'to_alipay_dict'):
  169. params['camp_end_time'] = self.camp_end_time.to_alipay_dict()
  170. else:
  171. params['camp_end_time'] = self.camp_end_time
  172. if self.camp_name:
  173. if hasattr(self.camp_name, 'to_alipay_dict'):
  174. params['camp_name'] = self.camp_name.to_alipay_dict()
  175. else:
  176. params['camp_name'] = self.camp_name
  177. if self.camp_start_time:
  178. if hasattr(self.camp_start_time, 'to_alipay_dict'):
  179. params['camp_start_time'] = self.camp_start_time.to_alipay_dict()
  180. else:
  181. params['camp_start_time'] = self.camp_start_time
  182. if self.cert_rule_id:
  183. if hasattr(self.cert_rule_id, 'to_alipay_dict'):
  184. params['cert_rule_id'] = self.cert_rule_id.to_alipay_dict()
  185. else:
  186. params['cert_rule_id'] = self.cert_rule_id
  187. if self.certification_count:
  188. if hasattr(self.certification_count, 'to_alipay_dict'):
  189. params['certification_count'] = self.certification_count.to_alipay_dict()
  190. else:
  191. params['certification_count'] = self.certification_count
  192. if self.crowd_rule_id:
  193. if hasattr(self.crowd_rule_id, 'to_alipay_dict'):
  194. params['crowd_rule_id'] = self.crowd_rule_id.to_alipay_dict()
  195. else:
  196. params['crowd_rule_id'] = self.crowd_rule_id
  197. if self.mobile_count:
  198. if hasattr(self.mobile_count, 'to_alipay_dict'):
  199. params['mobile_count'] = self.mobile_count.to_alipay_dict()
  200. else:
  201. params['mobile_count'] = self.mobile_count
  202. if self.mpid:
  203. if hasattr(self.mpid, 'to_alipay_dict'):
  204. params['mpid'] = self.mpid.to_alipay_dict()
  205. else:
  206. params['mpid'] = self.mpid
  207. if self.prize_list:
  208. if isinstance(self.prize_list, list):
  209. for i in range(0, len(self.prize_list)):
  210. element = self.prize_list[i]
  211. if hasattr(element, 'to_alipay_dict'):
  212. self.prize_list[i] = element.to_alipay_dict()
  213. if hasattr(self.prize_list, 'to_alipay_dict'):
  214. params['prize_list'] = self.prize_list.to_alipay_dict()
  215. else:
  216. params['prize_list'] = self.prize_list
  217. if self.promo_rule_id:
  218. if hasattr(self.promo_rule_id, 'to_alipay_dict'):
  219. params['promo_rule_id'] = self.promo_rule_id.to_alipay_dict()
  220. else:
  221. params['promo_rule_id'] = self.promo_rule_id
  222. if self.trigger_type:
  223. if hasattr(self.trigger_type, 'to_alipay_dict'):
  224. params['trigger_type'] = self.trigger_type.to_alipay_dict()
  225. else:
  226. params['trigger_type'] = self.trigger_type
  227. if self.trigger_user_rule_id:
  228. if hasattr(self.trigger_user_rule_id, 'to_alipay_dict'):
  229. params['trigger_user_rule_id'] = self.trigger_user_rule_id.to_alipay_dict()
  230. else:
  231. params['trigger_user_rule_id'] = self.trigger_user_rule_id
  232. if self.user_rule_id:
  233. if hasattr(self.user_rule_id, 'to_alipay_dict'):
  234. params['user_rule_id'] = self.user_rule_id.to_alipay_dict()
  235. else:
  236. params['user_rule_id'] = self.user_rule_id
  237. return params
  238. @staticmethod
  239. def from_alipay_dict(d):
  240. if not d:
  241. return None
  242. o = AlipayMarketingCampaignDrawcampCreateModel()
  243. if 'account_count' in d:
  244. o.account_count = d['account_count']
  245. if 'appid_count' in d:
  246. o.appid_count = d['appid_count']
  247. if 'award_count' in d:
  248. o.award_count = d['award_count']
  249. if 'award_rate' in d:
  250. o.award_rate = d['award_rate']
  251. if 'camp_code' in d:
  252. o.camp_code = d['camp_code']
  253. if 'camp_end_time' in d:
  254. o.camp_end_time = d['camp_end_time']
  255. if 'camp_name' in d:
  256. o.camp_name = d['camp_name']
  257. if 'camp_start_time' in d:
  258. o.camp_start_time = d['camp_start_time']
  259. if 'cert_rule_id' in d:
  260. o.cert_rule_id = d['cert_rule_id']
  261. if 'certification_count' in d:
  262. o.certification_count = d['certification_count']
  263. if 'crowd_rule_id' in d:
  264. o.crowd_rule_id = d['crowd_rule_id']
  265. if 'mobile_count' in d:
  266. o.mobile_count = d['mobile_count']
  267. if 'mpid' in d:
  268. o.mpid = d['mpid']
  269. if 'prize_list' in d:
  270. o.prize_list = d['prize_list']
  271. if 'promo_rule_id' in d:
  272. o.promo_rule_id = d['promo_rule_id']
  273. if 'trigger_type' in d:
  274. o.trigger_type = d['trigger_type']
  275. if 'trigger_user_rule_id' in d:
  276. o.trigger_user_rule_id = d['trigger_user_rule_id']
  277. if 'user_rule_id' in d:
  278. o.user_rule_id = d['user_rule_id']
  279. return o