ShopSummaryQueryResponse.py 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.ShopCategoryInfo import ShopCategoryInfo
  6. from alipay.aop.api.domain.ShopCommentInfo import ShopCommentInfo
  7. class ShopSummaryQueryResponse(object):
  8. def __init__(self):
  9. self._address = None
  10. self._branch_shop_name = None
  11. self._brand_name = None
  12. self._business_time = None
  13. self._category_infos = None
  14. self._city_code = None
  15. self._district_code = None
  16. self._ext_info = None
  17. self._gmt_create = None
  18. self._is_show = None
  19. self._latitude = None
  20. self._longitude = None
  21. self._main_image = None
  22. self._main_shop_name = None
  23. self._per_pay = None
  24. self._pic_coll = None
  25. self._province_code = None
  26. self._shop_comment_info = None
  27. self._shop_id = None
  28. self._shop_type = None
  29. self._status = None
  30. @property
  31. def address(self):
  32. return self._address
  33. @address.setter
  34. def address(self, value):
  35. self._address = value
  36. @property
  37. def branch_shop_name(self):
  38. return self._branch_shop_name
  39. @branch_shop_name.setter
  40. def branch_shop_name(self, value):
  41. self._branch_shop_name = value
  42. @property
  43. def brand_name(self):
  44. return self._brand_name
  45. @brand_name.setter
  46. def brand_name(self, value):
  47. self._brand_name = value
  48. @property
  49. def business_time(self):
  50. return self._business_time
  51. @business_time.setter
  52. def business_time(self, value):
  53. self._business_time = value
  54. @property
  55. def category_infos(self):
  56. return self._category_infos
  57. @category_infos.setter
  58. def category_infos(self, value):
  59. if isinstance(value, list):
  60. self._category_infos = list()
  61. for i in value:
  62. if isinstance(i, ShopCategoryInfo):
  63. self._category_infos.append(i)
  64. else:
  65. self._category_infos.append(ShopCategoryInfo.from_alipay_dict(i))
  66. @property
  67. def city_code(self):
  68. return self._city_code
  69. @city_code.setter
  70. def city_code(self, value):
  71. self._city_code = value
  72. @property
  73. def district_code(self):
  74. return self._district_code
  75. @district_code.setter
  76. def district_code(self, value):
  77. self._district_code = value
  78. @property
  79. def ext_info(self):
  80. return self._ext_info
  81. @ext_info.setter
  82. def ext_info(self, value):
  83. self._ext_info = value
  84. @property
  85. def gmt_create(self):
  86. return self._gmt_create
  87. @gmt_create.setter
  88. def gmt_create(self, value):
  89. self._gmt_create = value
  90. @property
  91. def is_show(self):
  92. return self._is_show
  93. @is_show.setter
  94. def is_show(self, value):
  95. self._is_show = value
  96. @property
  97. def latitude(self):
  98. return self._latitude
  99. @latitude.setter
  100. def latitude(self, value):
  101. self._latitude = value
  102. @property
  103. def longitude(self):
  104. return self._longitude
  105. @longitude.setter
  106. def longitude(self, value):
  107. self._longitude = value
  108. @property
  109. def main_image(self):
  110. return self._main_image
  111. @main_image.setter
  112. def main_image(self, value):
  113. self._main_image = value
  114. @property
  115. def main_shop_name(self):
  116. return self._main_shop_name
  117. @main_shop_name.setter
  118. def main_shop_name(self, value):
  119. self._main_shop_name = value
  120. @property
  121. def per_pay(self):
  122. return self._per_pay
  123. @per_pay.setter
  124. def per_pay(self, value):
  125. self._per_pay = value
  126. @property
  127. def pic_coll(self):
  128. return self._pic_coll
  129. @pic_coll.setter
  130. def pic_coll(self, value):
  131. self._pic_coll = value
  132. @property
  133. def province_code(self):
  134. return self._province_code
  135. @province_code.setter
  136. def province_code(self, value):
  137. self._province_code = value
  138. @property
  139. def shop_comment_info(self):
  140. return self._shop_comment_info
  141. @shop_comment_info.setter
  142. def shop_comment_info(self, value):
  143. if isinstance(value, ShopCommentInfo):
  144. self._shop_comment_info = value
  145. else:
  146. self._shop_comment_info = ShopCommentInfo.from_alipay_dict(value)
  147. @property
  148. def shop_id(self):
  149. return self._shop_id
  150. @shop_id.setter
  151. def shop_id(self, value):
  152. self._shop_id = value
  153. @property
  154. def shop_type(self):
  155. return self._shop_type
  156. @shop_type.setter
  157. def shop_type(self, value):
  158. self._shop_type = value
  159. @property
  160. def status(self):
  161. return self._status
  162. @status.setter
  163. def status(self, value):
  164. self._status = value
  165. def to_alipay_dict(self):
  166. params = dict()
  167. if self.address:
  168. if hasattr(self.address, 'to_alipay_dict'):
  169. params['address'] = self.address.to_alipay_dict()
  170. else:
  171. params['address'] = self.address
  172. if self.branch_shop_name:
  173. if hasattr(self.branch_shop_name, 'to_alipay_dict'):
  174. params['branch_shop_name'] = self.branch_shop_name.to_alipay_dict()
  175. else:
  176. params['branch_shop_name'] = self.branch_shop_name
  177. if self.brand_name:
  178. if hasattr(self.brand_name, 'to_alipay_dict'):
  179. params['brand_name'] = self.brand_name.to_alipay_dict()
  180. else:
  181. params['brand_name'] = self.brand_name
  182. if self.business_time:
  183. if hasattr(self.business_time, 'to_alipay_dict'):
  184. params['business_time'] = self.business_time.to_alipay_dict()
  185. else:
  186. params['business_time'] = self.business_time
  187. if self.category_infos:
  188. if isinstance(self.category_infos, list):
  189. for i in range(0, len(self.category_infos)):
  190. element = self.category_infos[i]
  191. if hasattr(element, 'to_alipay_dict'):
  192. self.category_infos[i] = element.to_alipay_dict()
  193. if hasattr(self.category_infos, 'to_alipay_dict'):
  194. params['category_infos'] = self.category_infos.to_alipay_dict()
  195. else:
  196. params['category_infos'] = self.category_infos
  197. if self.city_code:
  198. if hasattr(self.city_code, 'to_alipay_dict'):
  199. params['city_code'] = self.city_code.to_alipay_dict()
  200. else:
  201. params['city_code'] = self.city_code
  202. if self.district_code:
  203. if hasattr(self.district_code, 'to_alipay_dict'):
  204. params['district_code'] = self.district_code.to_alipay_dict()
  205. else:
  206. params['district_code'] = self.district_code
  207. if self.ext_info:
  208. if hasattr(self.ext_info, 'to_alipay_dict'):
  209. params['ext_info'] = self.ext_info.to_alipay_dict()
  210. else:
  211. params['ext_info'] = self.ext_info
  212. if self.gmt_create:
  213. if hasattr(self.gmt_create, 'to_alipay_dict'):
  214. params['gmt_create'] = self.gmt_create.to_alipay_dict()
  215. else:
  216. params['gmt_create'] = self.gmt_create
  217. if self.is_show:
  218. if hasattr(self.is_show, 'to_alipay_dict'):
  219. params['is_show'] = self.is_show.to_alipay_dict()
  220. else:
  221. params['is_show'] = self.is_show
  222. if self.latitude:
  223. if hasattr(self.latitude, 'to_alipay_dict'):
  224. params['latitude'] = self.latitude.to_alipay_dict()
  225. else:
  226. params['latitude'] = self.latitude
  227. if self.longitude:
  228. if hasattr(self.longitude, 'to_alipay_dict'):
  229. params['longitude'] = self.longitude.to_alipay_dict()
  230. else:
  231. params['longitude'] = self.longitude
  232. if self.main_image:
  233. if hasattr(self.main_image, 'to_alipay_dict'):
  234. params['main_image'] = self.main_image.to_alipay_dict()
  235. else:
  236. params['main_image'] = self.main_image
  237. if self.main_shop_name:
  238. if hasattr(self.main_shop_name, 'to_alipay_dict'):
  239. params['main_shop_name'] = self.main_shop_name.to_alipay_dict()
  240. else:
  241. params['main_shop_name'] = self.main_shop_name
  242. if self.per_pay:
  243. if hasattr(self.per_pay, 'to_alipay_dict'):
  244. params['per_pay'] = self.per_pay.to_alipay_dict()
  245. else:
  246. params['per_pay'] = self.per_pay
  247. if self.pic_coll:
  248. if hasattr(self.pic_coll, 'to_alipay_dict'):
  249. params['pic_coll'] = self.pic_coll.to_alipay_dict()
  250. else:
  251. params['pic_coll'] = self.pic_coll
  252. if self.province_code:
  253. if hasattr(self.province_code, 'to_alipay_dict'):
  254. params['province_code'] = self.province_code.to_alipay_dict()
  255. else:
  256. params['province_code'] = self.province_code
  257. if self.shop_comment_info:
  258. if hasattr(self.shop_comment_info, 'to_alipay_dict'):
  259. params['shop_comment_info'] = self.shop_comment_info.to_alipay_dict()
  260. else:
  261. params['shop_comment_info'] = self.shop_comment_info
  262. if self.shop_id:
  263. if hasattr(self.shop_id, 'to_alipay_dict'):
  264. params['shop_id'] = self.shop_id.to_alipay_dict()
  265. else:
  266. params['shop_id'] = self.shop_id
  267. if self.shop_type:
  268. if hasattr(self.shop_type, 'to_alipay_dict'):
  269. params['shop_type'] = self.shop_type.to_alipay_dict()
  270. else:
  271. params['shop_type'] = self.shop_type
  272. if self.status:
  273. if hasattr(self.status, 'to_alipay_dict'):
  274. params['status'] = self.status.to_alipay_dict()
  275. else:
  276. params['status'] = self.status
  277. return params
  278. @staticmethod
  279. def from_alipay_dict(d):
  280. if not d:
  281. return None
  282. o = ShopSummaryQueryResponse()
  283. if 'address' in d:
  284. o.address = d['address']
  285. if 'branch_shop_name' in d:
  286. o.branch_shop_name = d['branch_shop_name']
  287. if 'brand_name' in d:
  288. o.brand_name = d['brand_name']
  289. if 'business_time' in d:
  290. o.business_time = d['business_time']
  291. if 'category_infos' in d:
  292. o.category_infos = d['category_infos']
  293. if 'city_code' in d:
  294. o.city_code = d['city_code']
  295. if 'district_code' in d:
  296. o.district_code = d['district_code']
  297. if 'ext_info' in d:
  298. o.ext_info = d['ext_info']
  299. if 'gmt_create' in d:
  300. o.gmt_create = d['gmt_create']
  301. if 'is_show' in d:
  302. o.is_show = d['is_show']
  303. if 'latitude' in d:
  304. o.latitude = d['latitude']
  305. if 'longitude' in d:
  306. o.longitude = d['longitude']
  307. if 'main_image' in d:
  308. o.main_image = d['main_image']
  309. if 'main_shop_name' in d:
  310. o.main_shop_name = d['main_shop_name']
  311. if 'per_pay' in d:
  312. o.per_pay = d['per_pay']
  313. if 'pic_coll' in d:
  314. o.pic_coll = d['pic_coll']
  315. if 'province_code' in d:
  316. o.province_code = d['province_code']
  317. if 'shop_comment_info' in d:
  318. o.shop_comment_info = d['shop_comment_info']
  319. if 'shop_id' in d:
  320. o.shop_id = d['shop_id']
  321. if 'shop_type' in d:
  322. o.shop_type = d['shop_type']
  323. if 'status' in d:
  324. o.status = d['status']
  325. return o