AlipaySocialBaseContentlibNewsflashSendModel.py 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipaySocialBaseContentlibNewsflashSendModel(object):
  6. def __init__(self):
  7. self._author = None
  8. self._content = None
  9. self._ext_info = None
  10. self._images = None
  11. self._opr_tags = None
  12. self._publish_date = None
  13. self._recommend = None
  14. self._source_channel_key = None
  15. self._source_id = None
  16. self._summary = None
  17. self._title = None
  18. @property
  19. def author(self):
  20. return self._author
  21. @author.setter
  22. def author(self, value):
  23. self._author = value
  24. @property
  25. def content(self):
  26. return self._content
  27. @content.setter
  28. def content(self, value):
  29. self._content = value
  30. @property
  31. def ext_info(self):
  32. return self._ext_info
  33. @ext_info.setter
  34. def ext_info(self, value):
  35. self._ext_info = value
  36. @property
  37. def images(self):
  38. return self._images
  39. @images.setter
  40. def images(self, value):
  41. self._images = value
  42. @property
  43. def opr_tags(self):
  44. return self._opr_tags
  45. @opr_tags.setter
  46. def opr_tags(self, value):
  47. self._opr_tags = value
  48. @property
  49. def publish_date(self):
  50. return self._publish_date
  51. @publish_date.setter
  52. def publish_date(self, value):
  53. self._publish_date = value
  54. @property
  55. def recommend(self):
  56. return self._recommend
  57. @recommend.setter
  58. def recommend(self, value):
  59. self._recommend = value
  60. @property
  61. def source_channel_key(self):
  62. return self._source_channel_key
  63. @source_channel_key.setter
  64. def source_channel_key(self, value):
  65. self._source_channel_key = value
  66. @property
  67. def source_id(self):
  68. return self._source_id
  69. @source_id.setter
  70. def source_id(self, value):
  71. self._source_id = value
  72. @property
  73. def summary(self):
  74. return self._summary
  75. @summary.setter
  76. def summary(self, value):
  77. self._summary = value
  78. @property
  79. def title(self):
  80. return self._title
  81. @title.setter
  82. def title(self, value):
  83. self._title = value
  84. def to_alipay_dict(self):
  85. params = dict()
  86. if self.author:
  87. if hasattr(self.author, 'to_alipay_dict'):
  88. params['author'] = self.author.to_alipay_dict()
  89. else:
  90. params['author'] = self.author
  91. if self.content:
  92. if hasattr(self.content, 'to_alipay_dict'):
  93. params['content'] = self.content.to_alipay_dict()
  94. else:
  95. params['content'] = self.content
  96. if self.ext_info:
  97. if hasattr(self.ext_info, 'to_alipay_dict'):
  98. params['ext_info'] = self.ext_info.to_alipay_dict()
  99. else:
  100. params['ext_info'] = self.ext_info
  101. if self.images:
  102. if hasattr(self.images, 'to_alipay_dict'):
  103. params['images'] = self.images.to_alipay_dict()
  104. else:
  105. params['images'] = self.images
  106. if self.opr_tags:
  107. if hasattr(self.opr_tags, 'to_alipay_dict'):
  108. params['opr_tags'] = self.opr_tags.to_alipay_dict()
  109. else:
  110. params['opr_tags'] = self.opr_tags
  111. if self.publish_date:
  112. if hasattr(self.publish_date, 'to_alipay_dict'):
  113. params['publish_date'] = self.publish_date.to_alipay_dict()
  114. else:
  115. params['publish_date'] = self.publish_date
  116. if self.recommend:
  117. if hasattr(self.recommend, 'to_alipay_dict'):
  118. params['recommend'] = self.recommend.to_alipay_dict()
  119. else:
  120. params['recommend'] = self.recommend
  121. if self.source_channel_key:
  122. if hasattr(self.source_channel_key, 'to_alipay_dict'):
  123. params['source_channel_key'] = self.source_channel_key.to_alipay_dict()
  124. else:
  125. params['source_channel_key'] = self.source_channel_key
  126. if self.source_id:
  127. if hasattr(self.source_id, 'to_alipay_dict'):
  128. params['source_id'] = self.source_id.to_alipay_dict()
  129. else:
  130. params['source_id'] = self.source_id
  131. if self.summary:
  132. if hasattr(self.summary, 'to_alipay_dict'):
  133. params['summary'] = self.summary.to_alipay_dict()
  134. else:
  135. params['summary'] = self.summary
  136. if self.title:
  137. if hasattr(self.title, 'to_alipay_dict'):
  138. params['title'] = self.title.to_alipay_dict()
  139. else:
  140. params['title'] = self.title
  141. return params
  142. @staticmethod
  143. def from_alipay_dict(d):
  144. if not d:
  145. return None
  146. o = AlipaySocialBaseContentlibNewsflashSendModel()
  147. if 'author' in d:
  148. o.author = d['author']
  149. if 'content' in d:
  150. o.content = d['content']
  151. if 'ext_info' in d:
  152. o.ext_info = d['ext_info']
  153. if 'images' in d:
  154. o.images = d['images']
  155. if 'opr_tags' in d:
  156. o.opr_tags = d['opr_tags']
  157. if 'publish_date' in d:
  158. o.publish_date = d['publish_date']
  159. if 'recommend' in d:
  160. o.recommend = d['recommend']
  161. if 'source_channel_key' in d:
  162. o.source_channel_key = d['source_channel_key']
  163. if 'source_id' in d:
  164. o.source_id = d['source_id']
  165. if 'summary' in d:
  166. o.summary = d['summary']
  167. if 'title' in d:
  168. o.title = d['title']
  169. return o