MiniActivityModuleQueryInfo.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class MiniActivityModuleQueryInfo(object):
  6. def __init__(self):
  7. self._action_text = None
  8. self._id = None
  9. self._image = None
  10. self._logo = None
  11. self._mini_app_id = None
  12. self._page = None
  13. self._sub_title = None
  14. self._title = None
  15. self._url = None
  16. @property
  17. def action_text(self):
  18. return self._action_text
  19. @action_text.setter
  20. def action_text(self, value):
  21. self._action_text = value
  22. @property
  23. def id(self):
  24. return self._id
  25. @id.setter
  26. def id(self, value):
  27. self._id = value
  28. @property
  29. def image(self):
  30. return self._image
  31. @image.setter
  32. def image(self, value):
  33. self._image = value
  34. @property
  35. def logo(self):
  36. return self._logo
  37. @logo.setter
  38. def logo(self, value):
  39. self._logo = value
  40. @property
  41. def mini_app_id(self):
  42. return self._mini_app_id
  43. @mini_app_id.setter
  44. def mini_app_id(self, value):
  45. self._mini_app_id = value
  46. @property
  47. def page(self):
  48. return self._page
  49. @page.setter
  50. def page(self, value):
  51. self._page = value
  52. @property
  53. def sub_title(self):
  54. return self._sub_title
  55. @sub_title.setter
  56. def sub_title(self, value):
  57. self._sub_title = value
  58. @property
  59. def title(self):
  60. return self._title
  61. @title.setter
  62. def title(self, value):
  63. self._title = value
  64. @property
  65. def url(self):
  66. return self._url
  67. @url.setter
  68. def url(self, value):
  69. self._url = value
  70. def to_alipay_dict(self):
  71. params = dict()
  72. if self.action_text:
  73. if hasattr(self.action_text, 'to_alipay_dict'):
  74. params['action_text'] = self.action_text.to_alipay_dict()
  75. else:
  76. params['action_text'] = self.action_text
  77. if self.id:
  78. if hasattr(self.id, 'to_alipay_dict'):
  79. params['id'] = self.id.to_alipay_dict()
  80. else:
  81. params['id'] = self.id
  82. if self.image:
  83. if hasattr(self.image, 'to_alipay_dict'):
  84. params['image'] = self.image.to_alipay_dict()
  85. else:
  86. params['image'] = self.image
  87. if self.logo:
  88. if hasattr(self.logo, 'to_alipay_dict'):
  89. params['logo'] = self.logo.to_alipay_dict()
  90. else:
  91. params['logo'] = self.logo
  92. if self.mini_app_id:
  93. if hasattr(self.mini_app_id, 'to_alipay_dict'):
  94. params['mini_app_id'] = self.mini_app_id.to_alipay_dict()
  95. else:
  96. params['mini_app_id'] = self.mini_app_id
  97. if self.page:
  98. if hasattr(self.page, 'to_alipay_dict'):
  99. params['page'] = self.page.to_alipay_dict()
  100. else:
  101. params['page'] = self.page
  102. if self.sub_title:
  103. if hasattr(self.sub_title, 'to_alipay_dict'):
  104. params['sub_title'] = self.sub_title.to_alipay_dict()
  105. else:
  106. params['sub_title'] = self.sub_title
  107. if self.title:
  108. if hasattr(self.title, 'to_alipay_dict'):
  109. params['title'] = self.title.to_alipay_dict()
  110. else:
  111. params['title'] = self.title
  112. if self.url:
  113. if hasattr(self.url, 'to_alipay_dict'):
  114. params['url'] = self.url.to_alipay_dict()
  115. else:
  116. params['url'] = self.url
  117. return params
  118. @staticmethod
  119. def from_alipay_dict(d):
  120. if not d:
  121. return None
  122. o = MiniActivityModuleQueryInfo()
  123. if 'action_text' in d:
  124. o.action_text = d['action_text']
  125. if 'id' in d:
  126. o.id = d['id']
  127. if 'image' in d:
  128. o.image = d['image']
  129. if 'logo' in d:
  130. o.logo = d['logo']
  131. if 'mini_app_id' in d:
  132. o.mini_app_id = d['mini_app_id']
  133. if 'page' in d:
  134. o.page = d['page']
  135. if 'sub_title' in d:
  136. o.sub_title = d['sub_title']
  137. if 'title' in d:
  138. o.title = d['title']
  139. if 'url' in d:
  140. o.url = d['url']
  141. return o