ExtShopItem.py 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class ExtShopItem(object):
  6. def __init__(self):
  7. self._brand_code = None
  8. self._category_code = None
  9. self._count = None
  10. self._country = None
  11. self._description = None
  12. self._ext_goods_info = None
  13. self._id = None
  14. self._item_code = None
  15. self._kb_shop_id = None
  16. self._picture = None
  17. self._price = None
  18. self._specification = None
  19. self._system_provider_id = None
  20. self._title = None
  21. @property
  22. def brand_code(self):
  23. return self._brand_code
  24. @brand_code.setter
  25. def brand_code(self, value):
  26. self._brand_code = value
  27. @property
  28. def category_code(self):
  29. return self._category_code
  30. @category_code.setter
  31. def category_code(self, value):
  32. self._category_code = value
  33. @property
  34. def count(self):
  35. return self._count
  36. @count.setter
  37. def count(self, value):
  38. self._count = value
  39. @property
  40. def country(self):
  41. return self._country
  42. @country.setter
  43. def country(self, value):
  44. self._country = value
  45. @property
  46. def description(self):
  47. return self._description
  48. @description.setter
  49. def description(self, value):
  50. self._description = value
  51. @property
  52. def ext_goods_info(self):
  53. return self._ext_goods_info
  54. @ext_goods_info.setter
  55. def ext_goods_info(self, value):
  56. self._ext_goods_info = value
  57. @property
  58. def id(self):
  59. return self._id
  60. @id.setter
  61. def id(self, value):
  62. self._id = value
  63. @property
  64. def item_code(self):
  65. return self._item_code
  66. @item_code.setter
  67. def item_code(self, value):
  68. self._item_code = value
  69. @property
  70. def kb_shop_id(self):
  71. return self._kb_shop_id
  72. @kb_shop_id.setter
  73. def kb_shop_id(self, value):
  74. self._kb_shop_id = value
  75. @property
  76. def picture(self):
  77. return self._picture
  78. @picture.setter
  79. def picture(self, value):
  80. self._picture = value
  81. @property
  82. def price(self):
  83. return self._price
  84. @price.setter
  85. def price(self, value):
  86. self._price = value
  87. @property
  88. def specification(self):
  89. return self._specification
  90. @specification.setter
  91. def specification(self, value):
  92. self._specification = value
  93. @property
  94. def system_provider_id(self):
  95. return self._system_provider_id
  96. @system_provider_id.setter
  97. def system_provider_id(self, value):
  98. self._system_provider_id = value
  99. @property
  100. def title(self):
  101. return self._title
  102. @title.setter
  103. def title(self, value):
  104. self._title = value
  105. def to_alipay_dict(self):
  106. params = dict()
  107. if self.brand_code:
  108. if hasattr(self.brand_code, 'to_alipay_dict'):
  109. params['brand_code'] = self.brand_code.to_alipay_dict()
  110. else:
  111. params['brand_code'] = self.brand_code
  112. if self.category_code:
  113. if hasattr(self.category_code, 'to_alipay_dict'):
  114. params['category_code'] = self.category_code.to_alipay_dict()
  115. else:
  116. params['category_code'] = self.category_code
  117. if self.count:
  118. if hasattr(self.count, 'to_alipay_dict'):
  119. params['count'] = self.count.to_alipay_dict()
  120. else:
  121. params['count'] = self.count
  122. if self.country:
  123. if hasattr(self.country, 'to_alipay_dict'):
  124. params['country'] = self.country.to_alipay_dict()
  125. else:
  126. params['country'] = self.country
  127. if self.description:
  128. if hasattr(self.description, 'to_alipay_dict'):
  129. params['description'] = self.description.to_alipay_dict()
  130. else:
  131. params['description'] = self.description
  132. if self.ext_goods_info:
  133. if hasattr(self.ext_goods_info, 'to_alipay_dict'):
  134. params['ext_goods_info'] = self.ext_goods_info.to_alipay_dict()
  135. else:
  136. params['ext_goods_info'] = self.ext_goods_info
  137. if self.id:
  138. if hasattr(self.id, 'to_alipay_dict'):
  139. params['id'] = self.id.to_alipay_dict()
  140. else:
  141. params['id'] = self.id
  142. if self.item_code:
  143. if hasattr(self.item_code, 'to_alipay_dict'):
  144. params['item_code'] = self.item_code.to_alipay_dict()
  145. else:
  146. params['item_code'] = self.item_code
  147. if self.kb_shop_id:
  148. if hasattr(self.kb_shop_id, 'to_alipay_dict'):
  149. params['kb_shop_id'] = self.kb_shop_id.to_alipay_dict()
  150. else:
  151. params['kb_shop_id'] = self.kb_shop_id
  152. if self.picture:
  153. if hasattr(self.picture, 'to_alipay_dict'):
  154. params['picture'] = self.picture.to_alipay_dict()
  155. else:
  156. params['picture'] = self.picture
  157. if self.price:
  158. if hasattr(self.price, 'to_alipay_dict'):
  159. params['price'] = self.price.to_alipay_dict()
  160. else:
  161. params['price'] = self.price
  162. if self.specification:
  163. if hasattr(self.specification, 'to_alipay_dict'):
  164. params['specification'] = self.specification.to_alipay_dict()
  165. else:
  166. params['specification'] = self.specification
  167. if self.system_provider_id:
  168. if hasattr(self.system_provider_id, 'to_alipay_dict'):
  169. params['system_provider_id'] = self.system_provider_id.to_alipay_dict()
  170. else:
  171. params['system_provider_id'] = self.system_provider_id
  172. if self.title:
  173. if hasattr(self.title, 'to_alipay_dict'):
  174. params['title'] = self.title.to_alipay_dict()
  175. else:
  176. params['title'] = self.title
  177. return params
  178. @staticmethod
  179. def from_alipay_dict(d):
  180. if not d:
  181. return None
  182. o = ExtShopItem()
  183. if 'brand_code' in d:
  184. o.brand_code = d['brand_code']
  185. if 'category_code' in d:
  186. o.category_code = d['category_code']
  187. if 'count' in d:
  188. o.count = d['count']
  189. if 'country' in d:
  190. o.country = d['country']
  191. if 'description' in d:
  192. o.description = d['description']
  193. if 'ext_goods_info' in d:
  194. o.ext_goods_info = d['ext_goods_info']
  195. if 'id' in d:
  196. o.id = d['id']
  197. if 'item_code' in d:
  198. o.item_code = d['item_code']
  199. if 'kb_shop_id' in d:
  200. o.kb_shop_id = d['kb_shop_id']
  201. if 'picture' in d:
  202. o.picture = d['picture']
  203. if 'price' in d:
  204. o.price = d['price']
  205. if 'specification' in d:
  206. o.specification = d['specification']
  207. if 'system_provider_id' in d:
  208. o.system_provider_id = d['system_provider_id']
  209. if 'title' in d:
  210. o.title = d['title']
  211. return o