ItemResp.py 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class ItemResp(object):
  6. def __init__(self):
  7. self._category = None
  8. self._has_recive = None
  9. self._icon = None
  10. self._image = None
  11. self._item_id = None
  12. self._meaning = None
  13. self._org_price = None
  14. self._price = None
  15. self._shop_id = None
  16. self._summary = None
  17. self._tags = None
  18. self._tips = None
  19. self._title = None
  20. self._type = None
  21. self._url = None
  22. @property
  23. def category(self):
  24. return self._category
  25. @category.setter
  26. def category(self, value):
  27. self._category = value
  28. @property
  29. def has_recive(self):
  30. return self._has_recive
  31. @has_recive.setter
  32. def has_recive(self, value):
  33. self._has_recive = value
  34. @property
  35. def icon(self):
  36. return self._icon
  37. @icon.setter
  38. def icon(self, value):
  39. self._icon = value
  40. @property
  41. def image(self):
  42. return self._image
  43. @image.setter
  44. def image(self, value):
  45. self._image = value
  46. @property
  47. def item_id(self):
  48. return self._item_id
  49. @item_id.setter
  50. def item_id(self, value):
  51. self._item_id = value
  52. @property
  53. def meaning(self):
  54. return self._meaning
  55. @meaning.setter
  56. def meaning(self, value):
  57. self._meaning = value
  58. @property
  59. def org_price(self):
  60. return self._org_price
  61. @org_price.setter
  62. def org_price(self, value):
  63. self._org_price = value
  64. @property
  65. def price(self):
  66. return self._price
  67. @price.setter
  68. def price(self, value):
  69. self._price = value
  70. @property
  71. def shop_id(self):
  72. return self._shop_id
  73. @shop_id.setter
  74. def shop_id(self, value):
  75. self._shop_id = value
  76. @property
  77. def summary(self):
  78. return self._summary
  79. @summary.setter
  80. def summary(self, value):
  81. self._summary = value
  82. @property
  83. def tags(self):
  84. return self._tags
  85. @tags.setter
  86. def tags(self, value):
  87. self._tags = value
  88. @property
  89. def tips(self):
  90. return self._tips
  91. @tips.setter
  92. def tips(self, value):
  93. self._tips = value
  94. @property
  95. def title(self):
  96. return self._title
  97. @title.setter
  98. def title(self, value):
  99. self._title = value
  100. @property
  101. def type(self):
  102. return self._type
  103. @type.setter
  104. def type(self, value):
  105. self._type = value
  106. @property
  107. def url(self):
  108. return self._url
  109. @url.setter
  110. def url(self, value):
  111. self._url = value
  112. def to_alipay_dict(self):
  113. params = dict()
  114. if self.category:
  115. if hasattr(self.category, 'to_alipay_dict'):
  116. params['category'] = self.category.to_alipay_dict()
  117. else:
  118. params['category'] = self.category
  119. if self.has_recive:
  120. if hasattr(self.has_recive, 'to_alipay_dict'):
  121. params['has_recive'] = self.has_recive.to_alipay_dict()
  122. else:
  123. params['has_recive'] = self.has_recive
  124. if self.icon:
  125. if hasattr(self.icon, 'to_alipay_dict'):
  126. params['icon'] = self.icon.to_alipay_dict()
  127. else:
  128. params['icon'] = self.icon
  129. if self.image:
  130. if hasattr(self.image, 'to_alipay_dict'):
  131. params['image'] = self.image.to_alipay_dict()
  132. else:
  133. params['image'] = self.image
  134. if self.item_id:
  135. if hasattr(self.item_id, 'to_alipay_dict'):
  136. params['item_id'] = self.item_id.to_alipay_dict()
  137. else:
  138. params['item_id'] = self.item_id
  139. if self.meaning:
  140. if hasattr(self.meaning, 'to_alipay_dict'):
  141. params['meaning'] = self.meaning.to_alipay_dict()
  142. else:
  143. params['meaning'] = self.meaning
  144. if self.org_price:
  145. if hasattr(self.org_price, 'to_alipay_dict'):
  146. params['org_price'] = self.org_price.to_alipay_dict()
  147. else:
  148. params['org_price'] = self.org_price
  149. if self.price:
  150. if hasattr(self.price, 'to_alipay_dict'):
  151. params['price'] = self.price.to_alipay_dict()
  152. else:
  153. params['price'] = self.price
  154. if self.shop_id:
  155. if hasattr(self.shop_id, 'to_alipay_dict'):
  156. params['shop_id'] = self.shop_id.to_alipay_dict()
  157. else:
  158. params['shop_id'] = self.shop_id
  159. if self.summary:
  160. if hasattr(self.summary, 'to_alipay_dict'):
  161. params['summary'] = self.summary.to_alipay_dict()
  162. else:
  163. params['summary'] = self.summary
  164. if self.tags:
  165. if hasattr(self.tags, 'to_alipay_dict'):
  166. params['tags'] = self.tags.to_alipay_dict()
  167. else:
  168. params['tags'] = self.tags
  169. if self.tips:
  170. if hasattr(self.tips, 'to_alipay_dict'):
  171. params['tips'] = self.tips.to_alipay_dict()
  172. else:
  173. params['tips'] = self.tips
  174. if self.title:
  175. if hasattr(self.title, 'to_alipay_dict'):
  176. params['title'] = self.title.to_alipay_dict()
  177. else:
  178. params['title'] = self.title
  179. if self.type:
  180. if hasattr(self.type, 'to_alipay_dict'):
  181. params['type'] = self.type.to_alipay_dict()
  182. else:
  183. params['type'] = self.type
  184. if self.url:
  185. if hasattr(self.url, 'to_alipay_dict'):
  186. params['url'] = self.url.to_alipay_dict()
  187. else:
  188. params['url'] = self.url
  189. return params
  190. @staticmethod
  191. def from_alipay_dict(d):
  192. if not d:
  193. return None
  194. o = ItemResp()
  195. if 'category' in d:
  196. o.category = d['category']
  197. if 'has_recive' in d:
  198. o.has_recive = d['has_recive']
  199. if 'icon' in d:
  200. o.icon = d['icon']
  201. if 'image' in d:
  202. o.image = d['image']
  203. if 'item_id' in d:
  204. o.item_id = d['item_id']
  205. if 'meaning' in d:
  206. o.meaning = d['meaning']
  207. if 'org_price' in d:
  208. o.org_price = d['org_price']
  209. if 'price' in d:
  210. o.price = d['price']
  211. if 'shop_id' in d:
  212. o.shop_id = d['shop_id']
  213. if 'summary' in d:
  214. o.summary = d['summary']
  215. if 'tags' in d:
  216. o.tags = d['tags']
  217. if 'tips' in d:
  218. o.tips = d['tips']
  219. if 'title' in d:
  220. o.title = d['title']
  221. if 'type' in d:
  222. o.type = d['type']
  223. if 'url' in d:
  224. o.url = d['url']
  225. return o