AlipaySocialBaseMcommentNewsfeedAddModel.py 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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.NewsfeedMediaGiftInfo import NewsfeedMediaGiftInfo
  6. from alipay.aop.api.domain.NewsfeedMediaImg import NewsfeedMediaImg
  7. from alipay.aop.api.domain.NewsfeedLabelInfo import NewsfeedLabelInfo
  8. from alipay.aop.api.domain.NewsfeedMediaLinkInfo import NewsfeedMediaLinkInfo
  9. from alipay.aop.api.domain.NewsfeedLocationInfo import NewsfeedLocationInfo
  10. from alipay.aop.api.domain.NewsfeedMediaVideoInfo import NewsfeedMediaVideoInfo
  11. from alipay.aop.api.domain.NewsfeedWithMeInfo import NewsfeedWithMeInfo
  12. class AlipaySocialBaseMcommentNewsfeedAddModel(object):
  13. def __init__(self):
  14. self._activity_address = None
  15. self._activity_name = None
  16. self._aid = None
  17. self._biz_no = None
  18. self._content = None
  19. self._gift_info = None
  20. self._img_infos = None
  21. self._label_info = None
  22. self._link_info = None
  23. self._location_info = None
  24. self._location_name = None
  25. self._location_scheme = None
  26. self._scene_code = None
  27. self._score = None
  28. self._source = None
  29. self._source_icon = None
  30. self._source_name = None
  31. self._spread_range = None
  32. self._type = None
  33. self._user_id = None
  34. self._video_info = None
  35. self._visible = None
  36. self._visible_range = None
  37. self._with_me = None
  38. @property
  39. def activity_address(self):
  40. return self._activity_address
  41. @activity_address.setter
  42. def activity_address(self, value):
  43. self._activity_address = value
  44. @property
  45. def activity_name(self):
  46. return self._activity_name
  47. @activity_name.setter
  48. def activity_name(self, value):
  49. self._activity_name = value
  50. @property
  51. def aid(self):
  52. return self._aid
  53. @aid.setter
  54. def aid(self, value):
  55. self._aid = value
  56. @property
  57. def biz_no(self):
  58. return self._biz_no
  59. @biz_no.setter
  60. def biz_no(self, value):
  61. self._biz_no = value
  62. @property
  63. def content(self):
  64. return self._content
  65. @content.setter
  66. def content(self, value):
  67. self._content = value
  68. @property
  69. def gift_info(self):
  70. return self._gift_info
  71. @gift_info.setter
  72. def gift_info(self, value):
  73. if isinstance(value, NewsfeedMediaGiftInfo):
  74. self._gift_info = value
  75. else:
  76. self._gift_info = NewsfeedMediaGiftInfo.from_alipay_dict(value)
  77. @property
  78. def img_infos(self):
  79. return self._img_infos
  80. @img_infos.setter
  81. def img_infos(self, value):
  82. if isinstance(value, list):
  83. self._img_infos = list()
  84. for i in value:
  85. if isinstance(i, NewsfeedMediaImg):
  86. self._img_infos.append(i)
  87. else:
  88. self._img_infos.append(NewsfeedMediaImg.from_alipay_dict(i))
  89. @property
  90. def label_info(self):
  91. return self._label_info
  92. @label_info.setter
  93. def label_info(self, value):
  94. if isinstance(value, NewsfeedLabelInfo):
  95. self._label_info = value
  96. else:
  97. self._label_info = NewsfeedLabelInfo.from_alipay_dict(value)
  98. @property
  99. def link_info(self):
  100. return self._link_info
  101. @link_info.setter
  102. def link_info(self, value):
  103. if isinstance(value, NewsfeedMediaLinkInfo):
  104. self._link_info = value
  105. else:
  106. self._link_info = NewsfeedMediaLinkInfo.from_alipay_dict(value)
  107. @property
  108. def location_info(self):
  109. return self._location_info
  110. @location_info.setter
  111. def location_info(self, value):
  112. if isinstance(value, NewsfeedLocationInfo):
  113. self._location_info = value
  114. else:
  115. self._location_info = NewsfeedLocationInfo.from_alipay_dict(value)
  116. @property
  117. def location_name(self):
  118. return self._location_name
  119. @location_name.setter
  120. def location_name(self, value):
  121. self._location_name = value
  122. @property
  123. def location_scheme(self):
  124. return self._location_scheme
  125. @location_scheme.setter
  126. def location_scheme(self, value):
  127. self._location_scheme = value
  128. @property
  129. def scene_code(self):
  130. return self._scene_code
  131. @scene_code.setter
  132. def scene_code(self, value):
  133. self._scene_code = value
  134. @property
  135. def score(self):
  136. return self._score
  137. @score.setter
  138. def score(self, value):
  139. self._score = value
  140. @property
  141. def source(self):
  142. return self._source
  143. @source.setter
  144. def source(self, value):
  145. self._source = value
  146. @property
  147. def source_icon(self):
  148. return self._source_icon
  149. @source_icon.setter
  150. def source_icon(self, value):
  151. self._source_icon = value
  152. @property
  153. def source_name(self):
  154. return self._source_name
  155. @source_name.setter
  156. def source_name(self, value):
  157. self._source_name = value
  158. @property
  159. def spread_range(self):
  160. return self._spread_range
  161. @spread_range.setter
  162. def spread_range(self, value):
  163. self._spread_range = value
  164. @property
  165. def type(self):
  166. return self._type
  167. @type.setter
  168. def type(self, value):
  169. self._type = value
  170. @property
  171. def user_id(self):
  172. return self._user_id
  173. @user_id.setter
  174. def user_id(self, value):
  175. self._user_id = value
  176. @property
  177. def video_info(self):
  178. return self._video_info
  179. @video_info.setter
  180. def video_info(self, value):
  181. if isinstance(value, NewsfeedMediaVideoInfo):
  182. self._video_info = value
  183. else:
  184. self._video_info = NewsfeedMediaVideoInfo.from_alipay_dict(value)
  185. @property
  186. def visible(self):
  187. return self._visible
  188. @visible.setter
  189. def visible(self, value):
  190. self._visible = value
  191. @property
  192. def visible_range(self):
  193. return self._visible_range
  194. @visible_range.setter
  195. def visible_range(self, value):
  196. if isinstance(value, list):
  197. self._visible_range = list()
  198. for i in value:
  199. self._visible_range.append(i)
  200. @property
  201. def with_me(self):
  202. return self._with_me
  203. @with_me.setter
  204. def with_me(self, value):
  205. if isinstance(value, list):
  206. self._with_me = list()
  207. for i in value:
  208. if isinstance(i, NewsfeedWithMeInfo):
  209. self._with_me.append(i)
  210. else:
  211. self._with_me.append(NewsfeedWithMeInfo.from_alipay_dict(i))
  212. def to_alipay_dict(self):
  213. params = dict()
  214. if self.activity_address:
  215. if hasattr(self.activity_address, 'to_alipay_dict'):
  216. params['activity_address'] = self.activity_address.to_alipay_dict()
  217. else:
  218. params['activity_address'] = self.activity_address
  219. if self.activity_name:
  220. if hasattr(self.activity_name, 'to_alipay_dict'):
  221. params['activity_name'] = self.activity_name.to_alipay_dict()
  222. else:
  223. params['activity_name'] = self.activity_name
  224. if self.aid:
  225. if hasattr(self.aid, 'to_alipay_dict'):
  226. params['aid'] = self.aid.to_alipay_dict()
  227. else:
  228. params['aid'] = self.aid
  229. if self.biz_no:
  230. if hasattr(self.biz_no, 'to_alipay_dict'):
  231. params['biz_no'] = self.biz_no.to_alipay_dict()
  232. else:
  233. params['biz_no'] = self.biz_no
  234. if self.content:
  235. if hasattr(self.content, 'to_alipay_dict'):
  236. params['content'] = self.content.to_alipay_dict()
  237. else:
  238. params['content'] = self.content
  239. if self.gift_info:
  240. if hasattr(self.gift_info, 'to_alipay_dict'):
  241. params['gift_info'] = self.gift_info.to_alipay_dict()
  242. else:
  243. params['gift_info'] = self.gift_info
  244. if self.img_infos:
  245. if isinstance(self.img_infos, list):
  246. for i in range(0, len(self.img_infos)):
  247. element = self.img_infos[i]
  248. if hasattr(element, 'to_alipay_dict'):
  249. self.img_infos[i] = element.to_alipay_dict()
  250. if hasattr(self.img_infos, 'to_alipay_dict'):
  251. params['img_infos'] = self.img_infos.to_alipay_dict()
  252. else:
  253. params['img_infos'] = self.img_infos
  254. if self.label_info:
  255. if hasattr(self.label_info, 'to_alipay_dict'):
  256. params['label_info'] = self.label_info.to_alipay_dict()
  257. else:
  258. params['label_info'] = self.label_info
  259. if self.link_info:
  260. if hasattr(self.link_info, 'to_alipay_dict'):
  261. params['link_info'] = self.link_info.to_alipay_dict()
  262. else:
  263. params['link_info'] = self.link_info
  264. if self.location_info:
  265. if hasattr(self.location_info, 'to_alipay_dict'):
  266. params['location_info'] = self.location_info.to_alipay_dict()
  267. else:
  268. params['location_info'] = self.location_info
  269. if self.location_name:
  270. if hasattr(self.location_name, 'to_alipay_dict'):
  271. params['location_name'] = self.location_name.to_alipay_dict()
  272. else:
  273. params['location_name'] = self.location_name
  274. if self.location_scheme:
  275. if hasattr(self.location_scheme, 'to_alipay_dict'):
  276. params['location_scheme'] = self.location_scheme.to_alipay_dict()
  277. else:
  278. params['location_scheme'] = self.location_scheme
  279. if self.scene_code:
  280. if hasattr(self.scene_code, 'to_alipay_dict'):
  281. params['scene_code'] = self.scene_code.to_alipay_dict()
  282. else:
  283. params['scene_code'] = self.scene_code
  284. if self.score:
  285. if hasattr(self.score, 'to_alipay_dict'):
  286. params['score'] = self.score.to_alipay_dict()
  287. else:
  288. params['score'] = self.score
  289. if self.source:
  290. if hasattr(self.source, 'to_alipay_dict'):
  291. params['source'] = self.source.to_alipay_dict()
  292. else:
  293. params['source'] = self.source
  294. if self.source_icon:
  295. if hasattr(self.source_icon, 'to_alipay_dict'):
  296. params['source_icon'] = self.source_icon.to_alipay_dict()
  297. else:
  298. params['source_icon'] = self.source_icon
  299. if self.source_name:
  300. if hasattr(self.source_name, 'to_alipay_dict'):
  301. params['source_name'] = self.source_name.to_alipay_dict()
  302. else:
  303. params['source_name'] = self.source_name
  304. if self.spread_range:
  305. if hasattr(self.spread_range, 'to_alipay_dict'):
  306. params['spread_range'] = self.spread_range.to_alipay_dict()
  307. else:
  308. params['spread_range'] = self.spread_range
  309. if self.type:
  310. if hasattr(self.type, 'to_alipay_dict'):
  311. params['type'] = self.type.to_alipay_dict()
  312. else:
  313. params['type'] = self.type
  314. if self.user_id:
  315. if hasattr(self.user_id, 'to_alipay_dict'):
  316. params['user_id'] = self.user_id.to_alipay_dict()
  317. else:
  318. params['user_id'] = self.user_id
  319. if self.video_info:
  320. if hasattr(self.video_info, 'to_alipay_dict'):
  321. params['video_info'] = self.video_info.to_alipay_dict()
  322. else:
  323. params['video_info'] = self.video_info
  324. if self.visible:
  325. if hasattr(self.visible, 'to_alipay_dict'):
  326. params['visible'] = self.visible.to_alipay_dict()
  327. else:
  328. params['visible'] = self.visible
  329. if self.visible_range:
  330. if isinstance(self.visible_range, list):
  331. for i in range(0, len(self.visible_range)):
  332. element = self.visible_range[i]
  333. if hasattr(element, 'to_alipay_dict'):
  334. self.visible_range[i] = element.to_alipay_dict()
  335. if hasattr(self.visible_range, 'to_alipay_dict'):
  336. params['visible_range'] = self.visible_range.to_alipay_dict()
  337. else:
  338. params['visible_range'] = self.visible_range
  339. if self.with_me:
  340. if isinstance(self.with_me, list):
  341. for i in range(0, len(self.with_me)):
  342. element = self.with_me[i]
  343. if hasattr(element, 'to_alipay_dict'):
  344. self.with_me[i] = element.to_alipay_dict()
  345. if hasattr(self.with_me, 'to_alipay_dict'):
  346. params['with_me'] = self.with_me.to_alipay_dict()
  347. else:
  348. params['with_me'] = self.with_me
  349. return params
  350. @staticmethod
  351. def from_alipay_dict(d):
  352. if not d:
  353. return None
  354. o = AlipaySocialBaseMcommentNewsfeedAddModel()
  355. if 'activity_address' in d:
  356. o.activity_address = d['activity_address']
  357. if 'activity_name' in d:
  358. o.activity_name = d['activity_name']
  359. if 'aid' in d:
  360. o.aid = d['aid']
  361. if 'biz_no' in d:
  362. o.biz_no = d['biz_no']
  363. if 'content' in d:
  364. o.content = d['content']
  365. if 'gift_info' in d:
  366. o.gift_info = d['gift_info']
  367. if 'img_infos' in d:
  368. o.img_infos = d['img_infos']
  369. if 'label_info' in d:
  370. o.label_info = d['label_info']
  371. if 'link_info' in d:
  372. o.link_info = d['link_info']
  373. if 'location_info' in d:
  374. o.location_info = d['location_info']
  375. if 'location_name' in d:
  376. o.location_name = d['location_name']
  377. if 'location_scheme' in d:
  378. o.location_scheme = d['location_scheme']
  379. if 'scene_code' in d:
  380. o.scene_code = d['scene_code']
  381. if 'score' in d:
  382. o.score = d['score']
  383. if 'source' in d:
  384. o.source = d['source']
  385. if 'source_icon' in d:
  386. o.source_icon = d['source_icon']
  387. if 'source_name' in d:
  388. o.source_name = d['source_name']
  389. if 'spread_range' in d:
  390. o.spread_range = d['spread_range']
  391. if 'type' in d:
  392. o.type = d['type']
  393. if 'user_id' in d:
  394. o.user_id = d['user_id']
  395. if 'video_info' in d:
  396. o.video_info = d['video_info']
  397. if 'visible' in d:
  398. o.visible = d['visible']
  399. if 'visible_range' in d:
  400. o.visible_range = d['visible_range']
  401. if 'with_me' in d:
  402. o.with_me = d['with_me']
  403. return o