VoucherRec.py 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class VoucherRec(object):
  6. def __init__(self):
  7. self._all_keep_count = None
  8. self._code = None
  9. self._cover = None
  10. self._crowds = None
  11. self._discount = None
  12. self._ext_info = None
  13. self._has_crowd = None
  14. self._is_auto_obtain = None
  15. self._is_mall_voucher = None
  16. self._item_brand_name = None
  17. self._item_gmt_end = None
  18. self._item_gmt_start = None
  19. self._item_id = None
  20. self._item_name = None
  21. self._item_quantity = None
  22. self._item_sales_mode = None
  23. self._item_sold_quantity = None
  24. self._original_amount = None
  25. self._per_value_amount = None
  26. self._picture_details = None
  27. self._price_mode = None
  28. self._purchase_mode = None
  29. self._send_item_name = None
  30. self._shop_id = None
  31. self._shop_name = None
  32. self._threshold_amount = None
  33. self._use_condition_amount = None
  34. self._valid_times = None
  35. self._value_amount = None
  36. self._voucher_detail_url = None
  37. self._voucher_logo_url = None
  38. self._voucher_type = None
  39. @property
  40. def all_keep_count(self):
  41. return self._all_keep_count
  42. @all_keep_count.setter
  43. def all_keep_count(self, value):
  44. self._all_keep_count = value
  45. @property
  46. def code(self):
  47. return self._code
  48. @code.setter
  49. def code(self, value):
  50. self._code = value
  51. @property
  52. def cover(self):
  53. return self._cover
  54. @cover.setter
  55. def cover(self, value):
  56. self._cover = value
  57. @property
  58. def crowds(self):
  59. return self._crowds
  60. @crowds.setter
  61. def crowds(self, value):
  62. self._crowds = value
  63. @property
  64. def discount(self):
  65. return self._discount
  66. @discount.setter
  67. def discount(self, value):
  68. self._discount = value
  69. @property
  70. def ext_info(self):
  71. return self._ext_info
  72. @ext_info.setter
  73. def ext_info(self, value):
  74. self._ext_info = value
  75. @property
  76. def has_crowd(self):
  77. return self._has_crowd
  78. @has_crowd.setter
  79. def has_crowd(self, value):
  80. self._has_crowd = value
  81. @property
  82. def is_auto_obtain(self):
  83. return self._is_auto_obtain
  84. @is_auto_obtain.setter
  85. def is_auto_obtain(self, value):
  86. self._is_auto_obtain = value
  87. @property
  88. def is_mall_voucher(self):
  89. return self._is_mall_voucher
  90. @is_mall_voucher.setter
  91. def is_mall_voucher(self, value):
  92. self._is_mall_voucher = value
  93. @property
  94. def item_brand_name(self):
  95. return self._item_brand_name
  96. @item_brand_name.setter
  97. def item_brand_name(self, value):
  98. self._item_brand_name = value
  99. @property
  100. def item_gmt_end(self):
  101. return self._item_gmt_end
  102. @item_gmt_end.setter
  103. def item_gmt_end(self, value):
  104. self._item_gmt_end = value
  105. @property
  106. def item_gmt_start(self):
  107. return self._item_gmt_start
  108. @item_gmt_start.setter
  109. def item_gmt_start(self, value):
  110. self._item_gmt_start = value
  111. @property
  112. def item_id(self):
  113. return self._item_id
  114. @item_id.setter
  115. def item_id(self, value):
  116. self._item_id = value
  117. @property
  118. def item_name(self):
  119. return self._item_name
  120. @item_name.setter
  121. def item_name(self, value):
  122. self._item_name = value
  123. @property
  124. def item_quantity(self):
  125. return self._item_quantity
  126. @item_quantity.setter
  127. def item_quantity(self, value):
  128. self._item_quantity = value
  129. @property
  130. def item_sales_mode(self):
  131. return self._item_sales_mode
  132. @item_sales_mode.setter
  133. def item_sales_mode(self, value):
  134. self._item_sales_mode = value
  135. @property
  136. def item_sold_quantity(self):
  137. return self._item_sold_quantity
  138. @item_sold_quantity.setter
  139. def item_sold_quantity(self, value):
  140. self._item_sold_quantity = value
  141. @property
  142. def original_amount(self):
  143. return self._original_amount
  144. @original_amount.setter
  145. def original_amount(self, value):
  146. self._original_amount = value
  147. @property
  148. def per_value_amount(self):
  149. return self._per_value_amount
  150. @per_value_amount.setter
  151. def per_value_amount(self, value):
  152. self._per_value_amount = value
  153. @property
  154. def picture_details(self):
  155. return self._picture_details
  156. @picture_details.setter
  157. def picture_details(self, value):
  158. self._picture_details = value
  159. @property
  160. def price_mode(self):
  161. return self._price_mode
  162. @price_mode.setter
  163. def price_mode(self, value):
  164. self._price_mode = value
  165. @property
  166. def purchase_mode(self):
  167. return self._purchase_mode
  168. @purchase_mode.setter
  169. def purchase_mode(self, value):
  170. self._purchase_mode = value
  171. @property
  172. def send_item_name(self):
  173. return self._send_item_name
  174. @send_item_name.setter
  175. def send_item_name(self, value):
  176. self._send_item_name = value
  177. @property
  178. def shop_id(self):
  179. return self._shop_id
  180. @shop_id.setter
  181. def shop_id(self, value):
  182. self._shop_id = value
  183. @property
  184. def shop_name(self):
  185. return self._shop_name
  186. @shop_name.setter
  187. def shop_name(self, value):
  188. self._shop_name = value
  189. @property
  190. def threshold_amount(self):
  191. return self._threshold_amount
  192. @threshold_amount.setter
  193. def threshold_amount(self, value):
  194. self._threshold_amount = value
  195. @property
  196. def use_condition_amount(self):
  197. return self._use_condition_amount
  198. @use_condition_amount.setter
  199. def use_condition_amount(self, value):
  200. self._use_condition_amount = value
  201. @property
  202. def valid_times(self):
  203. return self._valid_times
  204. @valid_times.setter
  205. def valid_times(self, value):
  206. self._valid_times = value
  207. @property
  208. def value_amount(self):
  209. return self._value_amount
  210. @value_amount.setter
  211. def value_amount(self, value):
  212. self._value_amount = value
  213. @property
  214. def voucher_detail_url(self):
  215. return self._voucher_detail_url
  216. @voucher_detail_url.setter
  217. def voucher_detail_url(self, value):
  218. self._voucher_detail_url = value
  219. @property
  220. def voucher_logo_url(self):
  221. return self._voucher_logo_url
  222. @voucher_logo_url.setter
  223. def voucher_logo_url(self, value):
  224. self._voucher_logo_url = value
  225. @property
  226. def voucher_type(self):
  227. return self._voucher_type
  228. @voucher_type.setter
  229. def voucher_type(self, value):
  230. self._voucher_type = value
  231. def to_alipay_dict(self):
  232. params = dict()
  233. if self.all_keep_count:
  234. if hasattr(self.all_keep_count, 'to_alipay_dict'):
  235. params['all_keep_count'] = self.all_keep_count.to_alipay_dict()
  236. else:
  237. params['all_keep_count'] = self.all_keep_count
  238. if self.code:
  239. if hasattr(self.code, 'to_alipay_dict'):
  240. params['code'] = self.code.to_alipay_dict()
  241. else:
  242. params['code'] = self.code
  243. if self.cover:
  244. if hasattr(self.cover, 'to_alipay_dict'):
  245. params['cover'] = self.cover.to_alipay_dict()
  246. else:
  247. params['cover'] = self.cover
  248. if self.crowds:
  249. if hasattr(self.crowds, 'to_alipay_dict'):
  250. params['crowds'] = self.crowds.to_alipay_dict()
  251. else:
  252. params['crowds'] = self.crowds
  253. if self.discount:
  254. if hasattr(self.discount, 'to_alipay_dict'):
  255. params['discount'] = self.discount.to_alipay_dict()
  256. else:
  257. params['discount'] = self.discount
  258. if self.ext_info:
  259. if hasattr(self.ext_info, 'to_alipay_dict'):
  260. params['ext_info'] = self.ext_info.to_alipay_dict()
  261. else:
  262. params['ext_info'] = self.ext_info
  263. if self.has_crowd:
  264. if hasattr(self.has_crowd, 'to_alipay_dict'):
  265. params['has_crowd'] = self.has_crowd.to_alipay_dict()
  266. else:
  267. params['has_crowd'] = self.has_crowd
  268. if self.is_auto_obtain:
  269. if hasattr(self.is_auto_obtain, 'to_alipay_dict'):
  270. params['is_auto_obtain'] = self.is_auto_obtain.to_alipay_dict()
  271. else:
  272. params['is_auto_obtain'] = self.is_auto_obtain
  273. if self.is_mall_voucher:
  274. if hasattr(self.is_mall_voucher, 'to_alipay_dict'):
  275. params['is_mall_voucher'] = self.is_mall_voucher.to_alipay_dict()
  276. else:
  277. params['is_mall_voucher'] = self.is_mall_voucher
  278. if self.item_brand_name:
  279. if hasattr(self.item_brand_name, 'to_alipay_dict'):
  280. params['item_brand_name'] = self.item_brand_name.to_alipay_dict()
  281. else:
  282. params['item_brand_name'] = self.item_brand_name
  283. if self.item_gmt_end:
  284. if hasattr(self.item_gmt_end, 'to_alipay_dict'):
  285. params['item_gmt_end'] = self.item_gmt_end.to_alipay_dict()
  286. else:
  287. params['item_gmt_end'] = self.item_gmt_end
  288. if self.item_gmt_start:
  289. if hasattr(self.item_gmt_start, 'to_alipay_dict'):
  290. params['item_gmt_start'] = self.item_gmt_start.to_alipay_dict()
  291. else:
  292. params['item_gmt_start'] = self.item_gmt_start
  293. if self.item_id:
  294. if hasattr(self.item_id, 'to_alipay_dict'):
  295. params['item_id'] = self.item_id.to_alipay_dict()
  296. else:
  297. params['item_id'] = self.item_id
  298. if self.item_name:
  299. if hasattr(self.item_name, 'to_alipay_dict'):
  300. params['item_name'] = self.item_name.to_alipay_dict()
  301. else:
  302. params['item_name'] = self.item_name
  303. if self.item_quantity:
  304. if hasattr(self.item_quantity, 'to_alipay_dict'):
  305. params['item_quantity'] = self.item_quantity.to_alipay_dict()
  306. else:
  307. params['item_quantity'] = self.item_quantity
  308. if self.item_sales_mode:
  309. if hasattr(self.item_sales_mode, 'to_alipay_dict'):
  310. params['item_sales_mode'] = self.item_sales_mode.to_alipay_dict()
  311. else:
  312. params['item_sales_mode'] = self.item_sales_mode
  313. if self.item_sold_quantity:
  314. if hasattr(self.item_sold_quantity, 'to_alipay_dict'):
  315. params['item_sold_quantity'] = self.item_sold_quantity.to_alipay_dict()
  316. else:
  317. params['item_sold_quantity'] = self.item_sold_quantity
  318. if self.original_amount:
  319. if hasattr(self.original_amount, 'to_alipay_dict'):
  320. params['original_amount'] = self.original_amount.to_alipay_dict()
  321. else:
  322. params['original_amount'] = self.original_amount
  323. if self.per_value_amount:
  324. if hasattr(self.per_value_amount, 'to_alipay_dict'):
  325. params['per_value_amount'] = self.per_value_amount.to_alipay_dict()
  326. else:
  327. params['per_value_amount'] = self.per_value_amount
  328. if self.picture_details:
  329. if hasattr(self.picture_details, 'to_alipay_dict'):
  330. params['picture_details'] = self.picture_details.to_alipay_dict()
  331. else:
  332. params['picture_details'] = self.picture_details
  333. if self.price_mode:
  334. if hasattr(self.price_mode, 'to_alipay_dict'):
  335. params['price_mode'] = self.price_mode.to_alipay_dict()
  336. else:
  337. params['price_mode'] = self.price_mode
  338. if self.purchase_mode:
  339. if hasattr(self.purchase_mode, 'to_alipay_dict'):
  340. params['purchase_mode'] = self.purchase_mode.to_alipay_dict()
  341. else:
  342. params['purchase_mode'] = self.purchase_mode
  343. if self.send_item_name:
  344. if hasattr(self.send_item_name, 'to_alipay_dict'):
  345. params['send_item_name'] = self.send_item_name.to_alipay_dict()
  346. else:
  347. params['send_item_name'] = self.send_item_name
  348. if self.shop_id:
  349. if hasattr(self.shop_id, 'to_alipay_dict'):
  350. params['shop_id'] = self.shop_id.to_alipay_dict()
  351. else:
  352. params['shop_id'] = self.shop_id
  353. if self.shop_name:
  354. if hasattr(self.shop_name, 'to_alipay_dict'):
  355. params['shop_name'] = self.shop_name.to_alipay_dict()
  356. else:
  357. params['shop_name'] = self.shop_name
  358. if self.threshold_amount:
  359. if hasattr(self.threshold_amount, 'to_alipay_dict'):
  360. params['threshold_amount'] = self.threshold_amount.to_alipay_dict()
  361. else:
  362. params['threshold_amount'] = self.threshold_amount
  363. if self.use_condition_amount:
  364. if hasattr(self.use_condition_amount, 'to_alipay_dict'):
  365. params['use_condition_amount'] = self.use_condition_amount.to_alipay_dict()
  366. else:
  367. params['use_condition_amount'] = self.use_condition_amount
  368. if self.valid_times:
  369. if hasattr(self.valid_times, 'to_alipay_dict'):
  370. params['valid_times'] = self.valid_times.to_alipay_dict()
  371. else:
  372. params['valid_times'] = self.valid_times
  373. if self.value_amount:
  374. if hasattr(self.value_amount, 'to_alipay_dict'):
  375. params['value_amount'] = self.value_amount.to_alipay_dict()
  376. else:
  377. params['value_amount'] = self.value_amount
  378. if self.voucher_detail_url:
  379. if hasattr(self.voucher_detail_url, 'to_alipay_dict'):
  380. params['voucher_detail_url'] = self.voucher_detail_url.to_alipay_dict()
  381. else:
  382. params['voucher_detail_url'] = self.voucher_detail_url
  383. if self.voucher_logo_url:
  384. if hasattr(self.voucher_logo_url, 'to_alipay_dict'):
  385. params['voucher_logo_url'] = self.voucher_logo_url.to_alipay_dict()
  386. else:
  387. params['voucher_logo_url'] = self.voucher_logo_url
  388. if self.voucher_type:
  389. if hasattr(self.voucher_type, 'to_alipay_dict'):
  390. params['voucher_type'] = self.voucher_type.to_alipay_dict()
  391. else:
  392. params['voucher_type'] = self.voucher_type
  393. return params
  394. @staticmethod
  395. def from_alipay_dict(d):
  396. if not d:
  397. return None
  398. o = VoucherRec()
  399. if 'all_keep_count' in d:
  400. o.all_keep_count = d['all_keep_count']
  401. if 'code' in d:
  402. o.code = d['code']
  403. if 'cover' in d:
  404. o.cover = d['cover']
  405. if 'crowds' in d:
  406. o.crowds = d['crowds']
  407. if 'discount' in d:
  408. o.discount = d['discount']
  409. if 'ext_info' in d:
  410. o.ext_info = d['ext_info']
  411. if 'has_crowd' in d:
  412. o.has_crowd = d['has_crowd']
  413. if 'is_auto_obtain' in d:
  414. o.is_auto_obtain = d['is_auto_obtain']
  415. if 'is_mall_voucher' in d:
  416. o.is_mall_voucher = d['is_mall_voucher']
  417. if 'item_brand_name' in d:
  418. o.item_brand_name = d['item_brand_name']
  419. if 'item_gmt_end' in d:
  420. o.item_gmt_end = d['item_gmt_end']
  421. if 'item_gmt_start' in d:
  422. o.item_gmt_start = d['item_gmt_start']
  423. if 'item_id' in d:
  424. o.item_id = d['item_id']
  425. if 'item_name' in d:
  426. o.item_name = d['item_name']
  427. if 'item_quantity' in d:
  428. o.item_quantity = d['item_quantity']
  429. if 'item_sales_mode' in d:
  430. o.item_sales_mode = d['item_sales_mode']
  431. if 'item_sold_quantity' in d:
  432. o.item_sold_quantity = d['item_sold_quantity']
  433. if 'original_amount' in d:
  434. o.original_amount = d['original_amount']
  435. if 'per_value_amount' in d:
  436. o.per_value_amount = d['per_value_amount']
  437. if 'picture_details' in d:
  438. o.picture_details = d['picture_details']
  439. if 'price_mode' in d:
  440. o.price_mode = d['price_mode']
  441. if 'purchase_mode' in d:
  442. o.purchase_mode = d['purchase_mode']
  443. if 'send_item_name' in d:
  444. o.send_item_name = d['send_item_name']
  445. if 'shop_id' in d:
  446. o.shop_id = d['shop_id']
  447. if 'shop_name' in d:
  448. o.shop_name = d['shop_name']
  449. if 'threshold_amount' in d:
  450. o.threshold_amount = d['threshold_amount']
  451. if 'use_condition_amount' in d:
  452. o.use_condition_amount = d['use_condition_amount']
  453. if 'valid_times' in d:
  454. o.valid_times = d['valid_times']
  455. if 'value_amount' in d:
  456. o.value_amount = d['value_amount']
  457. if 'voucher_detail_url' in d:
  458. o.voucher_detail_url = d['voucher_detail_url']
  459. if 'voucher_logo_url' in d:
  460. o.voucher_logo_url = d['voucher_logo_url']
  461. if 'voucher_type' in d:
  462. o.voucher_type = d['voucher_type']
  463. return o