AntlbsKBDiscountInfo.py 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AntlbsKBDiscountInfo(object):
  6. def __init__(self):
  7. self._apply_condition = None
  8. self._buy_send_desc = None
  9. self._discount = None
  10. self._distance = None
  11. self._end_time = None
  12. self._image_url = None
  13. self._item_id = None
  14. self._item_name = None
  15. self._label = None
  16. self._original_price = None
  17. self._per_price = None
  18. self._price = None
  19. self._reason = None
  20. self._send_item_name = None
  21. self._shop_id = None
  22. self._shop_name = None
  23. self._sold = None
  24. self._start_time = None
  25. self._threshold_price = None
  26. self._top_price = None
  27. self._type = None
  28. self._vol_type = None
  29. @property
  30. def apply_condition(self):
  31. return self._apply_condition
  32. @apply_condition.setter
  33. def apply_condition(self, value):
  34. self._apply_condition = value
  35. @property
  36. def buy_send_desc(self):
  37. return self._buy_send_desc
  38. @buy_send_desc.setter
  39. def buy_send_desc(self, value):
  40. self._buy_send_desc = 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 distance(self):
  49. return self._distance
  50. @distance.setter
  51. def distance(self, value):
  52. self._distance = value
  53. @property
  54. def end_time(self):
  55. return self._end_time
  56. @end_time.setter
  57. def end_time(self, value):
  58. self._end_time = value
  59. @property
  60. def image_url(self):
  61. return self._image_url
  62. @image_url.setter
  63. def image_url(self, value):
  64. self._image_url = value
  65. @property
  66. def item_id(self):
  67. return self._item_id
  68. @item_id.setter
  69. def item_id(self, value):
  70. self._item_id = value
  71. @property
  72. def item_name(self):
  73. return self._item_name
  74. @item_name.setter
  75. def item_name(self, value):
  76. self._item_name = value
  77. @property
  78. def label(self):
  79. return self._label
  80. @label.setter
  81. def label(self, value):
  82. self._label = value
  83. @property
  84. def original_price(self):
  85. return self._original_price
  86. @original_price.setter
  87. def original_price(self, value):
  88. self._original_price = value
  89. @property
  90. def per_price(self):
  91. return self._per_price
  92. @per_price.setter
  93. def per_price(self, value):
  94. self._per_price = value
  95. @property
  96. def price(self):
  97. return self._price
  98. @price.setter
  99. def price(self, value):
  100. self._price = value
  101. @property
  102. def reason(self):
  103. return self._reason
  104. @reason.setter
  105. def reason(self, value):
  106. self._reason = value
  107. @property
  108. def send_item_name(self):
  109. return self._send_item_name
  110. @send_item_name.setter
  111. def send_item_name(self, value):
  112. self._send_item_name = value
  113. @property
  114. def shop_id(self):
  115. return self._shop_id
  116. @shop_id.setter
  117. def shop_id(self, value):
  118. self._shop_id = value
  119. @property
  120. def shop_name(self):
  121. return self._shop_name
  122. @shop_name.setter
  123. def shop_name(self, value):
  124. self._shop_name = value
  125. @property
  126. def sold(self):
  127. return self._sold
  128. @sold.setter
  129. def sold(self, value):
  130. self._sold = value
  131. @property
  132. def start_time(self):
  133. return self._start_time
  134. @start_time.setter
  135. def start_time(self, value):
  136. self._start_time = value
  137. @property
  138. def threshold_price(self):
  139. return self._threshold_price
  140. @threshold_price.setter
  141. def threshold_price(self, value):
  142. self._threshold_price = value
  143. @property
  144. def top_price(self):
  145. return self._top_price
  146. @top_price.setter
  147. def top_price(self, value):
  148. self._top_price = value
  149. @property
  150. def type(self):
  151. return self._type
  152. @type.setter
  153. def type(self, value):
  154. self._type = value
  155. @property
  156. def vol_type(self):
  157. return self._vol_type
  158. @vol_type.setter
  159. def vol_type(self, value):
  160. self._vol_type = value
  161. def to_alipay_dict(self):
  162. params = dict()
  163. if self.apply_condition:
  164. if hasattr(self.apply_condition, 'to_alipay_dict'):
  165. params['apply_condition'] = self.apply_condition.to_alipay_dict()
  166. else:
  167. params['apply_condition'] = self.apply_condition
  168. if self.buy_send_desc:
  169. if hasattr(self.buy_send_desc, 'to_alipay_dict'):
  170. params['buy_send_desc'] = self.buy_send_desc.to_alipay_dict()
  171. else:
  172. params['buy_send_desc'] = self.buy_send_desc
  173. if self.discount:
  174. if hasattr(self.discount, 'to_alipay_dict'):
  175. params['discount'] = self.discount.to_alipay_dict()
  176. else:
  177. params['discount'] = self.discount
  178. if self.distance:
  179. if hasattr(self.distance, 'to_alipay_dict'):
  180. params['distance'] = self.distance.to_alipay_dict()
  181. else:
  182. params['distance'] = self.distance
  183. if self.end_time:
  184. if hasattr(self.end_time, 'to_alipay_dict'):
  185. params['end_time'] = self.end_time.to_alipay_dict()
  186. else:
  187. params['end_time'] = self.end_time
  188. if self.image_url:
  189. if hasattr(self.image_url, 'to_alipay_dict'):
  190. params['image_url'] = self.image_url.to_alipay_dict()
  191. else:
  192. params['image_url'] = self.image_url
  193. if self.item_id:
  194. if hasattr(self.item_id, 'to_alipay_dict'):
  195. params['item_id'] = self.item_id.to_alipay_dict()
  196. else:
  197. params['item_id'] = self.item_id
  198. if self.item_name:
  199. if hasattr(self.item_name, 'to_alipay_dict'):
  200. params['item_name'] = self.item_name.to_alipay_dict()
  201. else:
  202. params['item_name'] = self.item_name
  203. if self.label:
  204. if hasattr(self.label, 'to_alipay_dict'):
  205. params['label'] = self.label.to_alipay_dict()
  206. else:
  207. params['label'] = self.label
  208. if self.original_price:
  209. if hasattr(self.original_price, 'to_alipay_dict'):
  210. params['original_price'] = self.original_price.to_alipay_dict()
  211. else:
  212. params['original_price'] = self.original_price
  213. if self.per_price:
  214. if hasattr(self.per_price, 'to_alipay_dict'):
  215. params['per_price'] = self.per_price.to_alipay_dict()
  216. else:
  217. params['per_price'] = self.per_price
  218. if self.price:
  219. if hasattr(self.price, 'to_alipay_dict'):
  220. params['price'] = self.price.to_alipay_dict()
  221. else:
  222. params['price'] = self.price
  223. if self.reason:
  224. if hasattr(self.reason, 'to_alipay_dict'):
  225. params['reason'] = self.reason.to_alipay_dict()
  226. else:
  227. params['reason'] = self.reason
  228. if self.send_item_name:
  229. if hasattr(self.send_item_name, 'to_alipay_dict'):
  230. params['send_item_name'] = self.send_item_name.to_alipay_dict()
  231. else:
  232. params['send_item_name'] = self.send_item_name
  233. if self.shop_id:
  234. if hasattr(self.shop_id, 'to_alipay_dict'):
  235. params['shop_id'] = self.shop_id.to_alipay_dict()
  236. else:
  237. params['shop_id'] = self.shop_id
  238. if self.shop_name:
  239. if hasattr(self.shop_name, 'to_alipay_dict'):
  240. params['shop_name'] = self.shop_name.to_alipay_dict()
  241. else:
  242. params['shop_name'] = self.shop_name
  243. if self.sold:
  244. if hasattr(self.sold, 'to_alipay_dict'):
  245. params['sold'] = self.sold.to_alipay_dict()
  246. else:
  247. params['sold'] = self.sold
  248. if self.start_time:
  249. if hasattr(self.start_time, 'to_alipay_dict'):
  250. params['start_time'] = self.start_time.to_alipay_dict()
  251. else:
  252. params['start_time'] = self.start_time
  253. if self.threshold_price:
  254. if hasattr(self.threshold_price, 'to_alipay_dict'):
  255. params['threshold_price'] = self.threshold_price.to_alipay_dict()
  256. else:
  257. params['threshold_price'] = self.threshold_price
  258. if self.top_price:
  259. if hasattr(self.top_price, 'to_alipay_dict'):
  260. params['top_price'] = self.top_price.to_alipay_dict()
  261. else:
  262. params['top_price'] = self.top_price
  263. if self.type:
  264. if hasattr(self.type, 'to_alipay_dict'):
  265. params['type'] = self.type.to_alipay_dict()
  266. else:
  267. params['type'] = self.type
  268. if self.vol_type:
  269. if hasattr(self.vol_type, 'to_alipay_dict'):
  270. params['vol_type'] = self.vol_type.to_alipay_dict()
  271. else:
  272. params['vol_type'] = self.vol_type
  273. return params
  274. @staticmethod
  275. def from_alipay_dict(d):
  276. if not d:
  277. return None
  278. o = AntlbsKBDiscountInfo()
  279. if 'apply_condition' in d:
  280. o.apply_condition = d['apply_condition']
  281. if 'buy_send_desc' in d:
  282. o.buy_send_desc = d['buy_send_desc']
  283. if 'discount' in d:
  284. o.discount = d['discount']
  285. if 'distance' in d:
  286. o.distance = d['distance']
  287. if 'end_time' in d:
  288. o.end_time = d['end_time']
  289. if 'image_url' in d:
  290. o.image_url = d['image_url']
  291. if 'item_id' in d:
  292. o.item_id = d['item_id']
  293. if 'item_name' in d:
  294. o.item_name = d['item_name']
  295. if 'label' in d:
  296. o.label = d['label']
  297. if 'original_price' in d:
  298. o.original_price = d['original_price']
  299. if 'per_price' in d:
  300. o.per_price = d['per_price']
  301. if 'price' in d:
  302. o.price = d['price']
  303. if 'reason' in d:
  304. o.reason = d['reason']
  305. if 'send_item_name' in d:
  306. o.send_item_name = d['send_item_name']
  307. if 'shop_id' in d:
  308. o.shop_id = d['shop_id']
  309. if 'shop_name' in d:
  310. o.shop_name = d['shop_name']
  311. if 'sold' in d:
  312. o.sold = d['sold']
  313. if 'start_time' in d:
  314. o.start_time = d['start_time']
  315. if 'threshold_price' in d:
  316. o.threshold_price = d['threshold_price']
  317. if 'top_price' in d:
  318. o.top_price = d['top_price']
  319. if 'type' in d:
  320. o.type = d['type']
  321. if 'vol_type' in d:
  322. o.vol_type = d['vol_type']
  323. return o