AlipaySecurityRiskContentAnalyzeModel.py 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipaySecurityRiskContentAnalyzeModel(object):
  6. def __init__(self):
  7. self._account_id = None
  8. self._account_type = None
  9. self._app_main_scene = None
  10. self._app_main_scene_id = None
  11. self._app_name = None
  12. self._app_scene = None
  13. self._app_scene_data_id = None
  14. self._audio_urls = None
  15. self._link_urls = None
  16. self._picture_urls = None
  17. self._publish_date = None
  18. self._text = None
  19. self._video_urls = None
  20. @property
  21. def account_id(self):
  22. return self._account_id
  23. @account_id.setter
  24. def account_id(self, value):
  25. self._account_id = value
  26. @property
  27. def account_type(self):
  28. return self._account_type
  29. @account_type.setter
  30. def account_type(self, value):
  31. self._account_type = value
  32. @property
  33. def app_main_scene(self):
  34. return self._app_main_scene
  35. @app_main_scene.setter
  36. def app_main_scene(self, value):
  37. self._app_main_scene = value
  38. @property
  39. def app_main_scene_id(self):
  40. return self._app_main_scene_id
  41. @app_main_scene_id.setter
  42. def app_main_scene_id(self, value):
  43. self._app_main_scene_id = value
  44. @property
  45. def app_name(self):
  46. return self._app_name
  47. @app_name.setter
  48. def app_name(self, value):
  49. self._app_name = value
  50. @property
  51. def app_scene(self):
  52. return self._app_scene
  53. @app_scene.setter
  54. def app_scene(self, value):
  55. self._app_scene = value
  56. @property
  57. def app_scene_data_id(self):
  58. return self._app_scene_data_id
  59. @app_scene_data_id.setter
  60. def app_scene_data_id(self, value):
  61. self._app_scene_data_id = value
  62. @property
  63. def audio_urls(self):
  64. return self._audio_urls
  65. @audio_urls.setter
  66. def audio_urls(self, value):
  67. if isinstance(value, list):
  68. self._audio_urls = list()
  69. for i in value:
  70. self._audio_urls.append(i)
  71. @property
  72. def link_urls(self):
  73. return self._link_urls
  74. @link_urls.setter
  75. def link_urls(self, value):
  76. if isinstance(value, list):
  77. self._link_urls = list()
  78. for i in value:
  79. self._link_urls.append(i)
  80. @property
  81. def picture_urls(self):
  82. return self._picture_urls
  83. @picture_urls.setter
  84. def picture_urls(self, value):
  85. if isinstance(value, list):
  86. self._picture_urls = list()
  87. for i in value:
  88. self._picture_urls.append(i)
  89. @property
  90. def publish_date(self):
  91. return self._publish_date
  92. @publish_date.setter
  93. def publish_date(self, value):
  94. self._publish_date = value
  95. @property
  96. def text(self):
  97. return self._text
  98. @text.setter
  99. def text(self, value):
  100. self._text = value
  101. @property
  102. def video_urls(self):
  103. return self._video_urls
  104. @video_urls.setter
  105. def video_urls(self, value):
  106. if isinstance(value, list):
  107. self._video_urls = list()
  108. for i in value:
  109. self._video_urls.append(i)
  110. def to_alipay_dict(self):
  111. params = dict()
  112. if self.account_id:
  113. if hasattr(self.account_id, 'to_alipay_dict'):
  114. params['account_id'] = self.account_id.to_alipay_dict()
  115. else:
  116. params['account_id'] = self.account_id
  117. if self.account_type:
  118. if hasattr(self.account_type, 'to_alipay_dict'):
  119. params['account_type'] = self.account_type.to_alipay_dict()
  120. else:
  121. params['account_type'] = self.account_type
  122. if self.app_main_scene:
  123. if hasattr(self.app_main_scene, 'to_alipay_dict'):
  124. params['app_main_scene'] = self.app_main_scene.to_alipay_dict()
  125. else:
  126. params['app_main_scene'] = self.app_main_scene
  127. if self.app_main_scene_id:
  128. if hasattr(self.app_main_scene_id, 'to_alipay_dict'):
  129. params['app_main_scene_id'] = self.app_main_scene_id.to_alipay_dict()
  130. else:
  131. params['app_main_scene_id'] = self.app_main_scene_id
  132. if self.app_name:
  133. if hasattr(self.app_name, 'to_alipay_dict'):
  134. params['app_name'] = self.app_name.to_alipay_dict()
  135. else:
  136. params['app_name'] = self.app_name
  137. if self.app_scene:
  138. if hasattr(self.app_scene, 'to_alipay_dict'):
  139. params['app_scene'] = self.app_scene.to_alipay_dict()
  140. else:
  141. params['app_scene'] = self.app_scene
  142. if self.app_scene_data_id:
  143. if hasattr(self.app_scene_data_id, 'to_alipay_dict'):
  144. params['app_scene_data_id'] = self.app_scene_data_id.to_alipay_dict()
  145. else:
  146. params['app_scene_data_id'] = self.app_scene_data_id
  147. if self.audio_urls:
  148. if isinstance(self.audio_urls, list):
  149. for i in range(0, len(self.audio_urls)):
  150. element = self.audio_urls[i]
  151. if hasattr(element, 'to_alipay_dict'):
  152. self.audio_urls[i] = element.to_alipay_dict()
  153. if hasattr(self.audio_urls, 'to_alipay_dict'):
  154. params['audio_urls'] = self.audio_urls.to_alipay_dict()
  155. else:
  156. params['audio_urls'] = self.audio_urls
  157. if self.link_urls:
  158. if isinstance(self.link_urls, list):
  159. for i in range(0, len(self.link_urls)):
  160. element = self.link_urls[i]
  161. if hasattr(element, 'to_alipay_dict'):
  162. self.link_urls[i] = element.to_alipay_dict()
  163. if hasattr(self.link_urls, 'to_alipay_dict'):
  164. params['link_urls'] = self.link_urls.to_alipay_dict()
  165. else:
  166. params['link_urls'] = self.link_urls
  167. if self.picture_urls:
  168. if isinstance(self.picture_urls, list):
  169. for i in range(0, len(self.picture_urls)):
  170. element = self.picture_urls[i]
  171. if hasattr(element, 'to_alipay_dict'):
  172. self.picture_urls[i] = element.to_alipay_dict()
  173. if hasattr(self.picture_urls, 'to_alipay_dict'):
  174. params['picture_urls'] = self.picture_urls.to_alipay_dict()
  175. else:
  176. params['picture_urls'] = self.picture_urls
  177. if self.publish_date:
  178. if hasattr(self.publish_date, 'to_alipay_dict'):
  179. params['publish_date'] = self.publish_date.to_alipay_dict()
  180. else:
  181. params['publish_date'] = self.publish_date
  182. if self.text:
  183. if hasattr(self.text, 'to_alipay_dict'):
  184. params['text'] = self.text.to_alipay_dict()
  185. else:
  186. params['text'] = self.text
  187. if self.video_urls:
  188. if isinstance(self.video_urls, list):
  189. for i in range(0, len(self.video_urls)):
  190. element = self.video_urls[i]
  191. if hasattr(element, 'to_alipay_dict'):
  192. self.video_urls[i] = element.to_alipay_dict()
  193. if hasattr(self.video_urls, 'to_alipay_dict'):
  194. params['video_urls'] = self.video_urls.to_alipay_dict()
  195. else:
  196. params['video_urls'] = self.video_urls
  197. return params
  198. @staticmethod
  199. def from_alipay_dict(d):
  200. if not d:
  201. return None
  202. o = AlipaySecurityRiskContentAnalyzeModel()
  203. if 'account_id' in d:
  204. o.account_id = d['account_id']
  205. if 'account_type' in d:
  206. o.account_type = d['account_type']
  207. if 'app_main_scene' in d:
  208. o.app_main_scene = d['app_main_scene']
  209. if 'app_main_scene_id' in d:
  210. o.app_main_scene_id = d['app_main_scene_id']
  211. if 'app_name' in d:
  212. o.app_name = d['app_name']
  213. if 'app_scene' in d:
  214. o.app_scene = d['app_scene']
  215. if 'app_scene_data_id' in d:
  216. o.app_scene_data_id = d['app_scene_data_id']
  217. if 'audio_urls' in d:
  218. o.audio_urls = d['audio_urls']
  219. if 'link_urls' in d:
  220. o.link_urls = d['link_urls']
  221. if 'picture_urls' in d:
  222. o.picture_urls = d['picture_urls']
  223. if 'publish_date' in d:
  224. o.publish_date = d['publish_date']
  225. if 'text' in d:
  226. o.text = d['text']
  227. if 'video_urls' in d:
  228. o.video_urls = d['video_urls']
  229. return o