AlipayMarketingCampaignPrizepoolPrizeCreateModel.py 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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.CountControlConfig import CountControlConfig
  6. from alipay.aop.api.domain.PrizePriceStrategy import PrizePriceStrategy
  7. class AlipayMarketingCampaignPrizepoolPrizeCreateModel(object):
  8. def __init__(self):
  9. self._budget_amount = None
  10. self._budget_type = None
  11. self._count_control_config = None
  12. self._ext_properties = None
  13. self._gmt_begin = None
  14. self._gmt_end = None
  15. self._modulus = None
  16. self._out_biz_id = None
  17. self._owner = None
  18. self._pool_id = None
  19. self._prize_name = None
  20. self._prize_price_strategy = None
  21. self._prize_sub_type = None
  22. self._prize_type = None
  23. self._source = None
  24. self._template_id = None
  25. @property
  26. def budget_amount(self):
  27. return self._budget_amount
  28. @budget_amount.setter
  29. def budget_amount(self, value):
  30. self._budget_amount = value
  31. @property
  32. def budget_type(self):
  33. return self._budget_type
  34. @budget_type.setter
  35. def budget_type(self, value):
  36. self._budget_type = value
  37. @property
  38. def count_control_config(self):
  39. return self._count_control_config
  40. @count_control_config.setter
  41. def count_control_config(self, value):
  42. if isinstance(value, list):
  43. self._count_control_config = list()
  44. for i in value:
  45. if isinstance(i, CountControlConfig):
  46. self._count_control_config.append(i)
  47. else:
  48. self._count_control_config.append(CountControlConfig.from_alipay_dict(i))
  49. @property
  50. def ext_properties(self):
  51. return self._ext_properties
  52. @ext_properties.setter
  53. def ext_properties(self, value):
  54. self._ext_properties = value
  55. @property
  56. def gmt_begin(self):
  57. return self._gmt_begin
  58. @gmt_begin.setter
  59. def gmt_begin(self, value):
  60. self._gmt_begin = value
  61. @property
  62. def gmt_end(self):
  63. return self._gmt_end
  64. @gmt_end.setter
  65. def gmt_end(self, value):
  66. self._gmt_end = value
  67. @property
  68. def modulus(self):
  69. return self._modulus
  70. @modulus.setter
  71. def modulus(self, value):
  72. self._modulus = value
  73. @property
  74. def out_biz_id(self):
  75. return self._out_biz_id
  76. @out_biz_id.setter
  77. def out_biz_id(self, value):
  78. self._out_biz_id = value
  79. @property
  80. def owner(self):
  81. return self._owner
  82. @owner.setter
  83. def owner(self, value):
  84. self._owner = value
  85. @property
  86. def pool_id(self):
  87. return self._pool_id
  88. @pool_id.setter
  89. def pool_id(self, value):
  90. self._pool_id = value
  91. @property
  92. def prize_name(self):
  93. return self._prize_name
  94. @prize_name.setter
  95. def prize_name(self, value):
  96. self._prize_name = value
  97. @property
  98. def prize_price_strategy(self):
  99. return self._prize_price_strategy
  100. @prize_price_strategy.setter
  101. def prize_price_strategy(self, value):
  102. if isinstance(value, PrizePriceStrategy):
  103. self._prize_price_strategy = value
  104. else:
  105. self._prize_price_strategy = PrizePriceStrategy.from_alipay_dict(value)
  106. @property
  107. def prize_sub_type(self):
  108. return self._prize_sub_type
  109. @prize_sub_type.setter
  110. def prize_sub_type(self, value):
  111. self._prize_sub_type = value
  112. @property
  113. def prize_type(self):
  114. return self._prize_type
  115. @prize_type.setter
  116. def prize_type(self, value):
  117. self._prize_type = value
  118. @property
  119. def source(self):
  120. return self._source
  121. @source.setter
  122. def source(self, value):
  123. self._source = value
  124. @property
  125. def template_id(self):
  126. return self._template_id
  127. @template_id.setter
  128. def template_id(self, value):
  129. self._template_id = value
  130. def to_alipay_dict(self):
  131. params = dict()
  132. if self.budget_amount:
  133. if hasattr(self.budget_amount, 'to_alipay_dict'):
  134. params['budget_amount'] = self.budget_amount.to_alipay_dict()
  135. else:
  136. params['budget_amount'] = self.budget_amount
  137. if self.budget_type:
  138. if hasattr(self.budget_type, 'to_alipay_dict'):
  139. params['budget_type'] = self.budget_type.to_alipay_dict()
  140. else:
  141. params['budget_type'] = self.budget_type
  142. if self.count_control_config:
  143. if isinstance(self.count_control_config, list):
  144. for i in range(0, len(self.count_control_config)):
  145. element = self.count_control_config[i]
  146. if hasattr(element, 'to_alipay_dict'):
  147. self.count_control_config[i] = element.to_alipay_dict()
  148. if hasattr(self.count_control_config, 'to_alipay_dict'):
  149. params['count_control_config'] = self.count_control_config.to_alipay_dict()
  150. else:
  151. params['count_control_config'] = self.count_control_config
  152. if self.ext_properties:
  153. if hasattr(self.ext_properties, 'to_alipay_dict'):
  154. params['ext_properties'] = self.ext_properties.to_alipay_dict()
  155. else:
  156. params['ext_properties'] = self.ext_properties
  157. if self.gmt_begin:
  158. if hasattr(self.gmt_begin, 'to_alipay_dict'):
  159. params['gmt_begin'] = self.gmt_begin.to_alipay_dict()
  160. else:
  161. params['gmt_begin'] = self.gmt_begin
  162. if self.gmt_end:
  163. if hasattr(self.gmt_end, 'to_alipay_dict'):
  164. params['gmt_end'] = self.gmt_end.to_alipay_dict()
  165. else:
  166. params['gmt_end'] = self.gmt_end
  167. if self.modulus:
  168. if hasattr(self.modulus, 'to_alipay_dict'):
  169. params['modulus'] = self.modulus.to_alipay_dict()
  170. else:
  171. params['modulus'] = self.modulus
  172. if self.out_biz_id:
  173. if hasattr(self.out_biz_id, 'to_alipay_dict'):
  174. params['out_biz_id'] = self.out_biz_id.to_alipay_dict()
  175. else:
  176. params['out_biz_id'] = self.out_biz_id
  177. if self.owner:
  178. if hasattr(self.owner, 'to_alipay_dict'):
  179. params['owner'] = self.owner.to_alipay_dict()
  180. else:
  181. params['owner'] = self.owner
  182. if self.pool_id:
  183. if hasattr(self.pool_id, 'to_alipay_dict'):
  184. params['pool_id'] = self.pool_id.to_alipay_dict()
  185. else:
  186. params['pool_id'] = self.pool_id
  187. if self.prize_name:
  188. if hasattr(self.prize_name, 'to_alipay_dict'):
  189. params['prize_name'] = self.prize_name.to_alipay_dict()
  190. else:
  191. params['prize_name'] = self.prize_name
  192. if self.prize_price_strategy:
  193. if hasattr(self.prize_price_strategy, 'to_alipay_dict'):
  194. params['prize_price_strategy'] = self.prize_price_strategy.to_alipay_dict()
  195. else:
  196. params['prize_price_strategy'] = self.prize_price_strategy
  197. if self.prize_sub_type:
  198. if hasattr(self.prize_sub_type, 'to_alipay_dict'):
  199. params['prize_sub_type'] = self.prize_sub_type.to_alipay_dict()
  200. else:
  201. params['prize_sub_type'] = self.prize_sub_type
  202. if self.prize_type:
  203. if hasattr(self.prize_type, 'to_alipay_dict'):
  204. params['prize_type'] = self.prize_type.to_alipay_dict()
  205. else:
  206. params['prize_type'] = self.prize_type
  207. if self.source:
  208. if hasattr(self.source, 'to_alipay_dict'):
  209. params['source'] = self.source.to_alipay_dict()
  210. else:
  211. params['source'] = self.source
  212. if self.template_id:
  213. if hasattr(self.template_id, 'to_alipay_dict'):
  214. params['template_id'] = self.template_id.to_alipay_dict()
  215. else:
  216. params['template_id'] = self.template_id
  217. return params
  218. @staticmethod
  219. def from_alipay_dict(d):
  220. if not d:
  221. return None
  222. o = AlipayMarketingCampaignPrizepoolPrizeCreateModel()
  223. if 'budget_amount' in d:
  224. o.budget_amount = d['budget_amount']
  225. if 'budget_type' in d:
  226. o.budget_type = d['budget_type']
  227. if 'count_control_config' in d:
  228. o.count_control_config = d['count_control_config']
  229. if 'ext_properties' in d:
  230. o.ext_properties = d['ext_properties']
  231. if 'gmt_begin' in d:
  232. o.gmt_begin = d['gmt_begin']
  233. if 'gmt_end' in d:
  234. o.gmt_end = d['gmt_end']
  235. if 'modulus' in d:
  236. o.modulus = d['modulus']
  237. if 'out_biz_id' in d:
  238. o.out_biz_id = d['out_biz_id']
  239. if 'owner' in d:
  240. o.owner = d['owner']
  241. if 'pool_id' in d:
  242. o.pool_id = d['pool_id']
  243. if 'prize_name' in d:
  244. o.prize_name = d['prize_name']
  245. if 'prize_price_strategy' in d:
  246. o.prize_price_strategy = d['prize_price_strategy']
  247. if 'prize_sub_type' in d:
  248. o.prize_sub_type = d['prize_sub_type']
  249. if 'prize_type' in d:
  250. o.prize_type = d['prize_type']
  251. if 'source' in d:
  252. o.source = d['source']
  253. if 'template_id' in d:
  254. o.template_id = d['template_id']
  255. return o