AlipayMarketingCashitemvoucherTemplateCreateModel.py 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayMarketingCashitemvoucherTemplateCreateModel(object):
  6. def __init__(self):
  7. self._amount = None
  8. self._brand_name = None
  9. self._discount = None
  10. self._floor_amount = None
  11. self._fund_account = None
  12. self._goods_ceiling_quantity = None
  13. self._goods_cover_image_id = None
  14. self._goods_detail_image_ids = None
  15. self._goods_id = None
  16. self._goods_info = None
  17. self._goods_name = None
  18. self._goods_origin_price = None
  19. self._notify_uri = None
  20. self._out_biz_no = None
  21. self._publish_end_time = None
  22. self._publish_start_time = None
  23. self._redirect_uri = None
  24. self._rule_conf = None
  25. self._special_price = None
  26. self._voucher_available_time = None
  27. self._voucher_description = None
  28. self._voucher_quantity = None
  29. self._voucher_type = None
  30. self._voucher_valid_period = None
  31. @property
  32. def amount(self):
  33. return self._amount
  34. @amount.setter
  35. def amount(self, value):
  36. self._amount = value
  37. @property
  38. def brand_name(self):
  39. return self._brand_name
  40. @brand_name.setter
  41. def brand_name(self, value):
  42. self._brand_name = value
  43. @property
  44. def discount(self):
  45. return self._discount
  46. @discount.setter
  47. def discount(self, value):
  48. self._discount = value
  49. @property
  50. def floor_amount(self):
  51. return self._floor_amount
  52. @floor_amount.setter
  53. def floor_amount(self, value):
  54. self._floor_amount = value
  55. @property
  56. def fund_account(self):
  57. return self._fund_account
  58. @fund_account.setter
  59. def fund_account(self, value):
  60. self._fund_account = value
  61. @property
  62. def goods_ceiling_quantity(self):
  63. return self._goods_ceiling_quantity
  64. @goods_ceiling_quantity.setter
  65. def goods_ceiling_quantity(self, value):
  66. self._goods_ceiling_quantity = value
  67. @property
  68. def goods_cover_image_id(self):
  69. return self._goods_cover_image_id
  70. @goods_cover_image_id.setter
  71. def goods_cover_image_id(self, value):
  72. self._goods_cover_image_id = value
  73. @property
  74. def goods_detail_image_ids(self):
  75. return self._goods_detail_image_ids
  76. @goods_detail_image_ids.setter
  77. def goods_detail_image_ids(self, value):
  78. self._goods_detail_image_ids = value
  79. @property
  80. def goods_id(self):
  81. return self._goods_id
  82. @goods_id.setter
  83. def goods_id(self, value):
  84. self._goods_id = value
  85. @property
  86. def goods_info(self):
  87. return self._goods_info
  88. @goods_info.setter
  89. def goods_info(self, value):
  90. self._goods_info = value
  91. @property
  92. def goods_name(self):
  93. return self._goods_name
  94. @goods_name.setter
  95. def goods_name(self, value):
  96. self._goods_name = value
  97. @property
  98. def goods_origin_price(self):
  99. return self._goods_origin_price
  100. @goods_origin_price.setter
  101. def goods_origin_price(self, value):
  102. self._goods_origin_price = value
  103. @property
  104. def notify_uri(self):
  105. return self._notify_uri
  106. @notify_uri.setter
  107. def notify_uri(self, value):
  108. self._notify_uri = value
  109. @property
  110. def out_biz_no(self):
  111. return self._out_biz_no
  112. @out_biz_no.setter
  113. def out_biz_no(self, value):
  114. self._out_biz_no = value
  115. @property
  116. def publish_end_time(self):
  117. return self._publish_end_time
  118. @publish_end_time.setter
  119. def publish_end_time(self, value):
  120. self._publish_end_time = value
  121. @property
  122. def publish_start_time(self):
  123. return self._publish_start_time
  124. @publish_start_time.setter
  125. def publish_start_time(self, value):
  126. self._publish_start_time = value
  127. @property
  128. def redirect_uri(self):
  129. return self._redirect_uri
  130. @redirect_uri.setter
  131. def redirect_uri(self, value):
  132. self._redirect_uri = value
  133. @property
  134. def rule_conf(self):
  135. return self._rule_conf
  136. @rule_conf.setter
  137. def rule_conf(self, value):
  138. self._rule_conf = value
  139. @property
  140. def special_price(self):
  141. return self._special_price
  142. @special_price.setter
  143. def special_price(self, value):
  144. self._special_price = value
  145. @property
  146. def voucher_available_time(self):
  147. return self._voucher_available_time
  148. @voucher_available_time.setter
  149. def voucher_available_time(self, value):
  150. self._voucher_available_time = value
  151. @property
  152. def voucher_description(self):
  153. return self._voucher_description
  154. @voucher_description.setter
  155. def voucher_description(self, value):
  156. self._voucher_description = value
  157. @property
  158. def voucher_quantity(self):
  159. return self._voucher_quantity
  160. @voucher_quantity.setter
  161. def voucher_quantity(self, value):
  162. self._voucher_quantity = value
  163. @property
  164. def voucher_type(self):
  165. return self._voucher_type
  166. @voucher_type.setter
  167. def voucher_type(self, value):
  168. self._voucher_type = value
  169. @property
  170. def voucher_valid_period(self):
  171. return self._voucher_valid_period
  172. @voucher_valid_period.setter
  173. def voucher_valid_period(self, value):
  174. self._voucher_valid_period = value
  175. def to_alipay_dict(self):
  176. params = dict()
  177. if self.amount:
  178. if hasattr(self.amount, 'to_alipay_dict'):
  179. params['amount'] = self.amount.to_alipay_dict()
  180. else:
  181. params['amount'] = self.amount
  182. if self.brand_name:
  183. if hasattr(self.brand_name, 'to_alipay_dict'):
  184. params['brand_name'] = self.brand_name.to_alipay_dict()
  185. else:
  186. params['brand_name'] = self.brand_name
  187. if self.discount:
  188. if hasattr(self.discount, 'to_alipay_dict'):
  189. params['discount'] = self.discount.to_alipay_dict()
  190. else:
  191. params['discount'] = self.discount
  192. if self.floor_amount:
  193. if hasattr(self.floor_amount, 'to_alipay_dict'):
  194. params['floor_amount'] = self.floor_amount.to_alipay_dict()
  195. else:
  196. params['floor_amount'] = self.floor_amount
  197. if self.fund_account:
  198. if hasattr(self.fund_account, 'to_alipay_dict'):
  199. params['fund_account'] = self.fund_account.to_alipay_dict()
  200. else:
  201. params['fund_account'] = self.fund_account
  202. if self.goods_ceiling_quantity:
  203. if hasattr(self.goods_ceiling_quantity, 'to_alipay_dict'):
  204. params['goods_ceiling_quantity'] = self.goods_ceiling_quantity.to_alipay_dict()
  205. else:
  206. params['goods_ceiling_quantity'] = self.goods_ceiling_quantity
  207. if self.goods_cover_image_id:
  208. if hasattr(self.goods_cover_image_id, 'to_alipay_dict'):
  209. params['goods_cover_image_id'] = self.goods_cover_image_id.to_alipay_dict()
  210. else:
  211. params['goods_cover_image_id'] = self.goods_cover_image_id
  212. if self.goods_detail_image_ids:
  213. if hasattr(self.goods_detail_image_ids, 'to_alipay_dict'):
  214. params['goods_detail_image_ids'] = self.goods_detail_image_ids.to_alipay_dict()
  215. else:
  216. params['goods_detail_image_ids'] = self.goods_detail_image_ids
  217. if self.goods_id:
  218. if hasattr(self.goods_id, 'to_alipay_dict'):
  219. params['goods_id'] = self.goods_id.to_alipay_dict()
  220. else:
  221. params['goods_id'] = self.goods_id
  222. if self.goods_info:
  223. if hasattr(self.goods_info, 'to_alipay_dict'):
  224. params['goods_info'] = self.goods_info.to_alipay_dict()
  225. else:
  226. params['goods_info'] = self.goods_info
  227. if self.goods_name:
  228. if hasattr(self.goods_name, 'to_alipay_dict'):
  229. params['goods_name'] = self.goods_name.to_alipay_dict()
  230. else:
  231. params['goods_name'] = self.goods_name
  232. if self.goods_origin_price:
  233. if hasattr(self.goods_origin_price, 'to_alipay_dict'):
  234. params['goods_origin_price'] = self.goods_origin_price.to_alipay_dict()
  235. else:
  236. params['goods_origin_price'] = self.goods_origin_price
  237. if self.notify_uri:
  238. if hasattr(self.notify_uri, 'to_alipay_dict'):
  239. params['notify_uri'] = self.notify_uri.to_alipay_dict()
  240. else:
  241. params['notify_uri'] = self.notify_uri
  242. if self.out_biz_no:
  243. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  244. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  245. else:
  246. params['out_biz_no'] = self.out_biz_no
  247. if self.publish_end_time:
  248. if hasattr(self.publish_end_time, 'to_alipay_dict'):
  249. params['publish_end_time'] = self.publish_end_time.to_alipay_dict()
  250. else:
  251. params['publish_end_time'] = self.publish_end_time
  252. if self.publish_start_time:
  253. if hasattr(self.publish_start_time, 'to_alipay_dict'):
  254. params['publish_start_time'] = self.publish_start_time.to_alipay_dict()
  255. else:
  256. params['publish_start_time'] = self.publish_start_time
  257. if self.redirect_uri:
  258. if hasattr(self.redirect_uri, 'to_alipay_dict'):
  259. params['redirect_uri'] = self.redirect_uri.to_alipay_dict()
  260. else:
  261. params['redirect_uri'] = self.redirect_uri
  262. if self.rule_conf:
  263. if hasattr(self.rule_conf, 'to_alipay_dict'):
  264. params['rule_conf'] = self.rule_conf.to_alipay_dict()
  265. else:
  266. params['rule_conf'] = self.rule_conf
  267. if self.special_price:
  268. if hasattr(self.special_price, 'to_alipay_dict'):
  269. params['special_price'] = self.special_price.to_alipay_dict()
  270. else:
  271. params['special_price'] = self.special_price
  272. if self.voucher_available_time:
  273. if hasattr(self.voucher_available_time, 'to_alipay_dict'):
  274. params['voucher_available_time'] = self.voucher_available_time.to_alipay_dict()
  275. else:
  276. params['voucher_available_time'] = self.voucher_available_time
  277. if self.voucher_description:
  278. if hasattr(self.voucher_description, 'to_alipay_dict'):
  279. params['voucher_description'] = self.voucher_description.to_alipay_dict()
  280. else:
  281. params['voucher_description'] = self.voucher_description
  282. if self.voucher_quantity:
  283. if hasattr(self.voucher_quantity, 'to_alipay_dict'):
  284. params['voucher_quantity'] = self.voucher_quantity.to_alipay_dict()
  285. else:
  286. params['voucher_quantity'] = self.voucher_quantity
  287. if self.voucher_type:
  288. if hasattr(self.voucher_type, 'to_alipay_dict'):
  289. params['voucher_type'] = self.voucher_type.to_alipay_dict()
  290. else:
  291. params['voucher_type'] = self.voucher_type
  292. if self.voucher_valid_period:
  293. if hasattr(self.voucher_valid_period, 'to_alipay_dict'):
  294. params['voucher_valid_period'] = self.voucher_valid_period.to_alipay_dict()
  295. else:
  296. params['voucher_valid_period'] = self.voucher_valid_period
  297. return params
  298. @staticmethod
  299. def from_alipay_dict(d):
  300. if not d:
  301. return None
  302. o = AlipayMarketingCashitemvoucherTemplateCreateModel()
  303. if 'amount' in d:
  304. o.amount = d['amount']
  305. if 'brand_name' in d:
  306. o.brand_name = d['brand_name']
  307. if 'discount' in d:
  308. o.discount = d['discount']
  309. if 'floor_amount' in d:
  310. o.floor_amount = d['floor_amount']
  311. if 'fund_account' in d:
  312. o.fund_account = d['fund_account']
  313. if 'goods_ceiling_quantity' in d:
  314. o.goods_ceiling_quantity = d['goods_ceiling_quantity']
  315. if 'goods_cover_image_id' in d:
  316. o.goods_cover_image_id = d['goods_cover_image_id']
  317. if 'goods_detail_image_ids' in d:
  318. o.goods_detail_image_ids = d['goods_detail_image_ids']
  319. if 'goods_id' in d:
  320. o.goods_id = d['goods_id']
  321. if 'goods_info' in d:
  322. o.goods_info = d['goods_info']
  323. if 'goods_name' in d:
  324. o.goods_name = d['goods_name']
  325. if 'goods_origin_price' in d:
  326. o.goods_origin_price = d['goods_origin_price']
  327. if 'notify_uri' in d:
  328. o.notify_uri = d['notify_uri']
  329. if 'out_biz_no' in d:
  330. o.out_biz_no = d['out_biz_no']
  331. if 'publish_end_time' in d:
  332. o.publish_end_time = d['publish_end_time']
  333. if 'publish_start_time' in d:
  334. o.publish_start_time = d['publish_start_time']
  335. if 'redirect_uri' in d:
  336. o.redirect_uri = d['redirect_uri']
  337. if 'rule_conf' in d:
  338. o.rule_conf = d['rule_conf']
  339. if 'special_price' in d:
  340. o.special_price = d['special_price']
  341. if 'voucher_available_time' in d:
  342. o.voucher_available_time = d['voucher_available_time']
  343. if 'voucher_description' in d:
  344. o.voucher_description = d['voucher_description']
  345. if 'voucher_quantity' in d:
  346. o.voucher_quantity = d['voucher_quantity']
  347. if 'voucher_type' in d:
  348. o.voucher_type = d['voucher_type']
  349. if 'voucher_valid_period' in d:
  350. o.voucher_valid_period = d['voucher_valid_period']
  351. return o