ShopSummaryInfo.py 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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. class ShopSummaryInfo(object):
  7. def __init__(self):
  8. self._address = None
  9. self._branch_shop_name = None
  10. self._brand_name = None
  11. self._business_time = None
  12. self._category_infos = None
  13. self._city_code = None
  14. self._city_name = None
  15. self._display_status = None
  16. self._district_code = None
  17. self._district_name = None
  18. self._landline_no = None
  19. self._latitude = None
  20. self._logo = None
  21. self._logo_url = None
  22. self._longitude = None
  23. self._main_image = None
  24. self._main_image_url = None
  25. self._main_shop_name = None
  26. self._mobile_no = None
  27. self._per_pay = None
  28. self._principal_id = None
  29. self._province_code = None
  30. self._province_name = None
  31. self._shop_id = None
  32. self._status = None
  33. @property
  34. def address(self):
  35. return self._address
  36. @address.setter
  37. def address(self, value):
  38. self._address = value
  39. @property
  40. def branch_shop_name(self):
  41. return self._branch_shop_name
  42. @branch_shop_name.setter
  43. def branch_shop_name(self, value):
  44. self._branch_shop_name = value
  45. @property
  46. def brand_name(self):
  47. return self._brand_name
  48. @brand_name.setter
  49. def brand_name(self, value):
  50. self._brand_name = value
  51. @property
  52. def business_time(self):
  53. return self._business_time
  54. @business_time.setter
  55. def business_time(self, value):
  56. self._business_time = value
  57. @property
  58. def category_infos(self):
  59. return self._category_infos
  60. @category_infos.setter
  61. def category_infos(self, value):
  62. if isinstance(value, list):
  63. self._category_infos = list()
  64. for i in value:
  65. if isinstance(i, ShopCategoryInfo):
  66. self._category_infos.append(i)
  67. else:
  68. self._category_infos.append(ShopCategoryInfo.from_alipay_dict(i))
  69. @property
  70. def city_code(self):
  71. return self._city_code
  72. @city_code.setter
  73. def city_code(self, value):
  74. self._city_code = value
  75. @property
  76. def city_name(self):
  77. return self._city_name
  78. @city_name.setter
  79. def city_name(self, value):
  80. self._city_name = value
  81. @property
  82. def display_status(self):
  83. return self._display_status
  84. @display_status.setter
  85. def display_status(self, value):
  86. self._display_status = value
  87. @property
  88. def district_code(self):
  89. return self._district_code
  90. @district_code.setter
  91. def district_code(self, value):
  92. self._district_code = value
  93. @property
  94. def district_name(self):
  95. return self._district_name
  96. @district_name.setter
  97. def district_name(self, value):
  98. self._district_name = value
  99. @property
  100. def landline_no(self):
  101. return self._landline_no
  102. @landline_no.setter
  103. def landline_no(self, value):
  104. self._landline_no = value
  105. @property
  106. def latitude(self):
  107. return self._latitude
  108. @latitude.setter
  109. def latitude(self, value):
  110. self._latitude = value
  111. @property
  112. def logo(self):
  113. return self._logo
  114. @logo.setter
  115. def logo(self, value):
  116. self._logo = value
  117. @property
  118. def logo_url(self):
  119. return self._logo_url
  120. @logo_url.setter
  121. def logo_url(self, value):
  122. self._logo_url = value
  123. @property
  124. def longitude(self):
  125. return self._longitude
  126. @longitude.setter
  127. def longitude(self, value):
  128. self._longitude = value
  129. @property
  130. def main_image(self):
  131. return self._main_image
  132. @main_image.setter
  133. def main_image(self, value):
  134. self._main_image = value
  135. @property
  136. def main_image_url(self):
  137. return self._main_image_url
  138. @main_image_url.setter
  139. def main_image_url(self, value):
  140. self._main_image_url = value
  141. @property
  142. def main_shop_name(self):
  143. return self._main_shop_name
  144. @main_shop_name.setter
  145. def main_shop_name(self, value):
  146. self._main_shop_name = value
  147. @property
  148. def mobile_no(self):
  149. return self._mobile_no
  150. @mobile_no.setter
  151. def mobile_no(self, value):
  152. self._mobile_no = value
  153. @property
  154. def per_pay(self):
  155. return self._per_pay
  156. @per_pay.setter
  157. def per_pay(self, value):
  158. self._per_pay = value
  159. @property
  160. def principal_id(self):
  161. return self._principal_id
  162. @principal_id.setter
  163. def principal_id(self, value):
  164. self._principal_id = value
  165. @property
  166. def province_code(self):
  167. return self._province_code
  168. @province_code.setter
  169. def province_code(self, value):
  170. self._province_code = value
  171. @property
  172. def province_name(self):
  173. return self._province_name
  174. @province_name.setter
  175. def province_name(self, value):
  176. self._province_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 status(self):
  185. return self._status
  186. @status.setter
  187. def status(self, value):
  188. self._status = value
  189. def to_alipay_dict(self):
  190. params = dict()
  191. if self.address:
  192. if hasattr(self.address, 'to_alipay_dict'):
  193. params['address'] = self.address.to_alipay_dict()
  194. else:
  195. params['address'] = self.address
  196. if self.branch_shop_name:
  197. if hasattr(self.branch_shop_name, 'to_alipay_dict'):
  198. params['branch_shop_name'] = self.branch_shop_name.to_alipay_dict()
  199. else:
  200. params['branch_shop_name'] = self.branch_shop_name
  201. if self.brand_name:
  202. if hasattr(self.brand_name, 'to_alipay_dict'):
  203. params['brand_name'] = self.brand_name.to_alipay_dict()
  204. else:
  205. params['brand_name'] = self.brand_name
  206. if self.business_time:
  207. if hasattr(self.business_time, 'to_alipay_dict'):
  208. params['business_time'] = self.business_time.to_alipay_dict()
  209. else:
  210. params['business_time'] = self.business_time
  211. if self.category_infos:
  212. if isinstance(self.category_infos, list):
  213. for i in range(0, len(self.category_infos)):
  214. element = self.category_infos[i]
  215. if hasattr(element, 'to_alipay_dict'):
  216. self.category_infos[i] = element.to_alipay_dict()
  217. if hasattr(self.category_infos, 'to_alipay_dict'):
  218. params['category_infos'] = self.category_infos.to_alipay_dict()
  219. else:
  220. params['category_infos'] = self.category_infos
  221. if self.city_code:
  222. if hasattr(self.city_code, 'to_alipay_dict'):
  223. params['city_code'] = self.city_code.to_alipay_dict()
  224. else:
  225. params['city_code'] = self.city_code
  226. if self.city_name:
  227. if hasattr(self.city_name, 'to_alipay_dict'):
  228. params['city_name'] = self.city_name.to_alipay_dict()
  229. else:
  230. params['city_name'] = self.city_name
  231. if self.display_status:
  232. if hasattr(self.display_status, 'to_alipay_dict'):
  233. params['display_status'] = self.display_status.to_alipay_dict()
  234. else:
  235. params['display_status'] = self.display_status
  236. if self.district_code:
  237. if hasattr(self.district_code, 'to_alipay_dict'):
  238. params['district_code'] = self.district_code.to_alipay_dict()
  239. else:
  240. params['district_code'] = self.district_code
  241. if self.district_name:
  242. if hasattr(self.district_name, 'to_alipay_dict'):
  243. params['district_name'] = self.district_name.to_alipay_dict()
  244. else:
  245. params['district_name'] = self.district_name
  246. if self.landline_no:
  247. if hasattr(self.landline_no, 'to_alipay_dict'):
  248. params['landline_no'] = self.landline_no.to_alipay_dict()
  249. else:
  250. params['landline_no'] = self.landline_no
  251. if self.latitude:
  252. if hasattr(self.latitude, 'to_alipay_dict'):
  253. params['latitude'] = self.latitude.to_alipay_dict()
  254. else:
  255. params['latitude'] = self.latitude
  256. if self.logo:
  257. if hasattr(self.logo, 'to_alipay_dict'):
  258. params['logo'] = self.logo.to_alipay_dict()
  259. else:
  260. params['logo'] = self.logo
  261. if self.logo_url:
  262. if hasattr(self.logo_url, 'to_alipay_dict'):
  263. params['logo_url'] = self.logo_url.to_alipay_dict()
  264. else:
  265. params['logo_url'] = self.logo_url
  266. if self.longitude:
  267. if hasattr(self.longitude, 'to_alipay_dict'):
  268. params['longitude'] = self.longitude.to_alipay_dict()
  269. else:
  270. params['longitude'] = self.longitude
  271. if self.main_image:
  272. if hasattr(self.main_image, 'to_alipay_dict'):
  273. params['main_image'] = self.main_image.to_alipay_dict()
  274. else:
  275. params['main_image'] = self.main_image
  276. if self.main_image_url:
  277. if hasattr(self.main_image_url, 'to_alipay_dict'):
  278. params['main_image_url'] = self.main_image_url.to_alipay_dict()
  279. else:
  280. params['main_image_url'] = self.main_image_url
  281. if self.main_shop_name:
  282. if hasattr(self.main_shop_name, 'to_alipay_dict'):
  283. params['main_shop_name'] = self.main_shop_name.to_alipay_dict()
  284. else:
  285. params['main_shop_name'] = self.main_shop_name
  286. if self.mobile_no:
  287. if hasattr(self.mobile_no, 'to_alipay_dict'):
  288. params['mobile_no'] = self.mobile_no.to_alipay_dict()
  289. else:
  290. params['mobile_no'] = self.mobile_no
  291. if self.per_pay:
  292. if hasattr(self.per_pay, 'to_alipay_dict'):
  293. params['per_pay'] = self.per_pay.to_alipay_dict()
  294. else:
  295. params['per_pay'] = self.per_pay
  296. if self.principal_id:
  297. if hasattr(self.principal_id, 'to_alipay_dict'):
  298. params['principal_id'] = self.principal_id.to_alipay_dict()
  299. else:
  300. params['principal_id'] = self.principal_id
  301. if self.province_code:
  302. if hasattr(self.province_code, 'to_alipay_dict'):
  303. params['province_code'] = self.province_code.to_alipay_dict()
  304. else:
  305. params['province_code'] = self.province_code
  306. if self.province_name:
  307. if hasattr(self.province_name, 'to_alipay_dict'):
  308. params['province_name'] = self.province_name.to_alipay_dict()
  309. else:
  310. params['province_name'] = self.province_name
  311. if self.shop_id:
  312. if hasattr(self.shop_id, 'to_alipay_dict'):
  313. params['shop_id'] = self.shop_id.to_alipay_dict()
  314. else:
  315. params['shop_id'] = self.shop_id
  316. if self.status:
  317. if hasattr(self.status, 'to_alipay_dict'):
  318. params['status'] = self.status.to_alipay_dict()
  319. else:
  320. params['status'] = self.status
  321. return params
  322. @staticmethod
  323. def from_alipay_dict(d):
  324. if not d:
  325. return None
  326. o = ShopSummaryInfo()
  327. if 'address' in d:
  328. o.address = d['address']
  329. if 'branch_shop_name' in d:
  330. o.branch_shop_name = d['branch_shop_name']
  331. if 'brand_name' in d:
  332. o.brand_name = d['brand_name']
  333. if 'business_time' in d:
  334. o.business_time = d['business_time']
  335. if 'category_infos' in d:
  336. o.category_infos = d['category_infos']
  337. if 'city_code' in d:
  338. o.city_code = d['city_code']
  339. if 'city_name' in d:
  340. o.city_name = d['city_name']
  341. if 'display_status' in d:
  342. o.display_status = d['display_status']
  343. if 'district_code' in d:
  344. o.district_code = d['district_code']
  345. if 'district_name' in d:
  346. o.district_name = d['district_name']
  347. if 'landline_no' in d:
  348. o.landline_no = d['landline_no']
  349. if 'latitude' in d:
  350. o.latitude = d['latitude']
  351. if 'logo' in d:
  352. o.logo = d['logo']
  353. if 'logo_url' in d:
  354. o.logo_url = d['logo_url']
  355. if 'longitude' in d:
  356. o.longitude = d['longitude']
  357. if 'main_image' in d:
  358. o.main_image = d['main_image']
  359. if 'main_image_url' in d:
  360. o.main_image_url = d['main_image_url']
  361. if 'main_shop_name' in d:
  362. o.main_shop_name = d['main_shop_name']
  363. if 'mobile_no' in d:
  364. o.mobile_no = d['mobile_no']
  365. if 'per_pay' in d:
  366. o.per_pay = d['per_pay']
  367. if 'principal_id' in d:
  368. o.principal_id = d['principal_id']
  369. if 'province_code' in d:
  370. o.province_code = d['province_code']
  371. if 'province_name' in d:
  372. o.province_name = d['province_name']
  373. if 'shop_id' in d:
  374. o.shop_id = d['shop_id']
  375. if 'status' in d:
  376. o.status = d['status']
  377. return o