AlipayMarketingCashlessitemvoucherTemplateCreateModel.py 13 KB

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