AlipayOpenPublicTopicModifyModel.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.TopicItem import TopicItem
  6. class AlipayOpenPublicTopicModifyModel(object):
  7. def __init__(self):
  8. self._img_url = None
  9. self._link_type = None
  10. self._link_url = None
  11. self._sub_title = None
  12. self._title = None
  13. self._topic_id = None
  14. self._topic_items = None
  15. @property
  16. def img_url(self):
  17. return self._img_url
  18. @img_url.setter
  19. def img_url(self, value):
  20. self._img_url = value
  21. @property
  22. def link_type(self):
  23. return self._link_type
  24. @link_type.setter
  25. def link_type(self, value):
  26. self._link_type = value
  27. @property
  28. def link_url(self):
  29. return self._link_url
  30. @link_url.setter
  31. def link_url(self, value):
  32. self._link_url = value
  33. @property
  34. def sub_title(self):
  35. return self._sub_title
  36. @sub_title.setter
  37. def sub_title(self, value):
  38. self._sub_title = value
  39. @property
  40. def title(self):
  41. return self._title
  42. @title.setter
  43. def title(self, value):
  44. self._title = value
  45. @property
  46. def topic_id(self):
  47. return self._topic_id
  48. @topic_id.setter
  49. def topic_id(self, value):
  50. self._topic_id = value
  51. @property
  52. def topic_items(self):
  53. return self._topic_items
  54. @topic_items.setter
  55. def topic_items(self, value):
  56. if isinstance(value, TopicItem):
  57. self._topic_items = value
  58. else:
  59. self._topic_items = TopicItem.from_alipay_dict(value)
  60. def to_alipay_dict(self):
  61. params = dict()
  62. if self.img_url:
  63. if hasattr(self.img_url, 'to_alipay_dict'):
  64. params['img_url'] = self.img_url.to_alipay_dict()
  65. else:
  66. params['img_url'] = self.img_url
  67. if self.link_type:
  68. if hasattr(self.link_type, 'to_alipay_dict'):
  69. params['link_type'] = self.link_type.to_alipay_dict()
  70. else:
  71. params['link_type'] = self.link_type
  72. if self.link_url:
  73. if hasattr(self.link_url, 'to_alipay_dict'):
  74. params['link_url'] = self.link_url.to_alipay_dict()
  75. else:
  76. params['link_url'] = self.link_url
  77. if self.sub_title:
  78. if hasattr(self.sub_title, 'to_alipay_dict'):
  79. params['sub_title'] = self.sub_title.to_alipay_dict()
  80. else:
  81. params['sub_title'] = self.sub_title
  82. if self.title:
  83. if hasattr(self.title, 'to_alipay_dict'):
  84. params['title'] = self.title.to_alipay_dict()
  85. else:
  86. params['title'] = self.title
  87. if self.topic_id:
  88. if hasattr(self.topic_id, 'to_alipay_dict'):
  89. params['topic_id'] = self.topic_id.to_alipay_dict()
  90. else:
  91. params['topic_id'] = self.topic_id
  92. if self.topic_items:
  93. if hasattr(self.topic_items, 'to_alipay_dict'):
  94. params['topic_items'] = self.topic_items.to_alipay_dict()
  95. else:
  96. params['topic_items'] = self.topic_items
  97. return params
  98. @staticmethod
  99. def from_alipay_dict(d):
  100. if not d:
  101. return None
  102. o = AlipayOpenPublicTopicModifyModel()
  103. if 'img_url' in d:
  104. o.img_url = d['img_url']
  105. if 'link_type' in d:
  106. o.link_type = d['link_type']
  107. if 'link_url' in d:
  108. o.link_url = d['link_url']
  109. if 'sub_title' in d:
  110. o.sub_title = d['sub_title']
  111. if 'title' in d:
  112. o.title = d['title']
  113. if 'topic_id' in d:
  114. o.topic_id = d['topic_id']
  115. if 'topic_items' in d:
  116. o.topic_items = d['topic_items']
  117. return o