AlipayOpenPublicContentPublishModel.py 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayOpenPublicContentPublishModel(object):
  6. def __init__(self):
  7. self._action_url = None
  8. self._article_id = None
  9. self._content = None
  10. self._cover_img = None
  11. self._desc = None
  12. self._end_time = None
  13. self._source = None
  14. self._title = None
  15. @property
  16. def action_url(self):
  17. return self._action_url
  18. @action_url.setter
  19. def action_url(self, value):
  20. self._action_url = value
  21. @property
  22. def article_id(self):
  23. return self._article_id
  24. @article_id.setter
  25. def article_id(self, value):
  26. self._article_id = value
  27. @property
  28. def content(self):
  29. return self._content
  30. @content.setter
  31. def content(self, value):
  32. self._content = value
  33. @property
  34. def cover_img(self):
  35. return self._cover_img
  36. @cover_img.setter
  37. def cover_img(self, value):
  38. self._cover_img = value
  39. @property
  40. def desc(self):
  41. return self._desc
  42. @desc.setter
  43. def desc(self, value):
  44. self._desc = value
  45. @property
  46. def end_time(self):
  47. return self._end_time
  48. @end_time.setter
  49. def end_time(self, value):
  50. self._end_time = value
  51. @property
  52. def source(self):
  53. return self._source
  54. @source.setter
  55. def source(self, value):
  56. self._source = value
  57. @property
  58. def title(self):
  59. return self._title
  60. @title.setter
  61. def title(self, value):
  62. self._title = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.action_url:
  66. if hasattr(self.action_url, 'to_alipay_dict'):
  67. params['action_url'] = self.action_url.to_alipay_dict()
  68. else:
  69. params['action_url'] = self.action_url
  70. if self.article_id:
  71. if hasattr(self.article_id, 'to_alipay_dict'):
  72. params['article_id'] = self.article_id.to_alipay_dict()
  73. else:
  74. params['article_id'] = self.article_id
  75. if self.content:
  76. if hasattr(self.content, 'to_alipay_dict'):
  77. params['content'] = self.content.to_alipay_dict()
  78. else:
  79. params['content'] = self.content
  80. if self.cover_img:
  81. if hasattr(self.cover_img, 'to_alipay_dict'):
  82. params['cover_img'] = self.cover_img.to_alipay_dict()
  83. else:
  84. params['cover_img'] = self.cover_img
  85. if self.desc:
  86. if hasattr(self.desc, 'to_alipay_dict'):
  87. params['desc'] = self.desc.to_alipay_dict()
  88. else:
  89. params['desc'] = self.desc
  90. if self.end_time:
  91. if hasattr(self.end_time, 'to_alipay_dict'):
  92. params['end_time'] = self.end_time.to_alipay_dict()
  93. else:
  94. params['end_time'] = self.end_time
  95. if self.source:
  96. if hasattr(self.source, 'to_alipay_dict'):
  97. params['source'] = self.source.to_alipay_dict()
  98. else:
  99. params['source'] = self.source
  100. if self.title:
  101. if hasattr(self.title, 'to_alipay_dict'):
  102. params['title'] = self.title.to_alipay_dict()
  103. else:
  104. params['title'] = self.title
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = AlipayOpenPublicContentPublishModel()
  111. if 'action_url' in d:
  112. o.action_url = d['action_url']
  113. if 'article_id' in d:
  114. o.article_id = d['article_id']
  115. if 'content' in d:
  116. o.content = d['content']
  117. if 'cover_img' in d:
  118. o.cover_img = d['cover_img']
  119. if 'desc' in d:
  120. o.desc = d['desc']
  121. if 'end_time' in d:
  122. o.end_time = d['end_time']
  123. if 'source' in d:
  124. o.source = d['source']
  125. if 'title' in d:
  126. o.title = d['title']
  127. return o