SquareDanceTaskInfo.py 6.0 KB

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