BigCardData.py 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class BigCardData(object):
  6. def __init__(self):
  7. self._action_text = None
  8. self._biz_code = None
  9. self._biz_data = None
  10. self._biz_title = None
  11. self._color = None
  12. self._image_url = None
  13. self._left_image_url = None
  14. self._left_target_url = None
  15. self._left_title = None
  16. self._right_image_url = None
  17. self._right_target_url = None
  18. self._right_title = None
  19. self._sub_title = None
  20. self._target_url = None
  21. self._tool_type = None
  22. @property
  23. def action_text(self):
  24. return self._action_text
  25. @action_text.setter
  26. def action_text(self, value):
  27. self._action_text = value
  28. @property
  29. def biz_code(self):
  30. return self._biz_code
  31. @biz_code.setter
  32. def biz_code(self, value):
  33. self._biz_code = value
  34. @property
  35. def biz_data(self):
  36. return self._biz_data
  37. @biz_data.setter
  38. def biz_data(self, value):
  39. self._biz_data = value
  40. @property
  41. def biz_title(self):
  42. return self._biz_title
  43. @biz_title.setter
  44. def biz_title(self, value):
  45. self._biz_title = value
  46. @property
  47. def color(self):
  48. return self._color
  49. @color.setter
  50. def color(self, value):
  51. self._color = value
  52. @property
  53. def image_url(self):
  54. return self._image_url
  55. @image_url.setter
  56. def image_url(self, value):
  57. self._image_url = value
  58. @property
  59. def left_image_url(self):
  60. return self._left_image_url
  61. @left_image_url.setter
  62. def left_image_url(self, value):
  63. self._left_image_url = value
  64. @property
  65. def left_target_url(self):
  66. return self._left_target_url
  67. @left_target_url.setter
  68. def left_target_url(self, value):
  69. self._left_target_url = value
  70. @property
  71. def left_title(self):
  72. return self._left_title
  73. @left_title.setter
  74. def left_title(self, value):
  75. self._left_title = value
  76. @property
  77. def right_image_url(self):
  78. return self._right_image_url
  79. @right_image_url.setter
  80. def right_image_url(self, value):
  81. self._right_image_url = value
  82. @property
  83. def right_target_url(self):
  84. return self._right_target_url
  85. @right_target_url.setter
  86. def right_target_url(self, value):
  87. self._right_target_url = value
  88. @property
  89. def right_title(self):
  90. return self._right_title
  91. @right_title.setter
  92. def right_title(self, value):
  93. self._right_title = value
  94. @property
  95. def sub_title(self):
  96. return self._sub_title
  97. @sub_title.setter
  98. def sub_title(self, value):
  99. self._sub_title = value
  100. @property
  101. def target_url(self):
  102. return self._target_url
  103. @target_url.setter
  104. def target_url(self, value):
  105. self._target_url = value
  106. @property
  107. def tool_type(self):
  108. return self._tool_type
  109. @tool_type.setter
  110. def tool_type(self, value):
  111. self._tool_type = value
  112. def to_alipay_dict(self):
  113. params = dict()
  114. if self.action_text:
  115. if hasattr(self.action_text, 'to_alipay_dict'):
  116. params['action_text'] = self.action_text.to_alipay_dict()
  117. else:
  118. params['action_text'] = self.action_text
  119. if self.biz_code:
  120. if hasattr(self.biz_code, 'to_alipay_dict'):
  121. params['biz_code'] = self.biz_code.to_alipay_dict()
  122. else:
  123. params['biz_code'] = self.biz_code
  124. if self.biz_data:
  125. if hasattr(self.biz_data, 'to_alipay_dict'):
  126. params['biz_data'] = self.biz_data.to_alipay_dict()
  127. else:
  128. params['biz_data'] = self.biz_data
  129. if self.biz_title:
  130. if hasattr(self.biz_title, 'to_alipay_dict'):
  131. params['biz_title'] = self.biz_title.to_alipay_dict()
  132. else:
  133. params['biz_title'] = self.biz_title
  134. if self.color:
  135. if hasattr(self.color, 'to_alipay_dict'):
  136. params['color'] = self.color.to_alipay_dict()
  137. else:
  138. params['color'] = self.color
  139. if self.image_url:
  140. if hasattr(self.image_url, 'to_alipay_dict'):
  141. params['image_url'] = self.image_url.to_alipay_dict()
  142. else:
  143. params['image_url'] = self.image_url
  144. if self.left_image_url:
  145. if hasattr(self.left_image_url, 'to_alipay_dict'):
  146. params['left_image_url'] = self.left_image_url.to_alipay_dict()
  147. else:
  148. params['left_image_url'] = self.left_image_url
  149. if self.left_target_url:
  150. if hasattr(self.left_target_url, 'to_alipay_dict'):
  151. params['left_target_url'] = self.left_target_url.to_alipay_dict()
  152. else:
  153. params['left_target_url'] = self.left_target_url
  154. if self.left_title:
  155. if hasattr(self.left_title, 'to_alipay_dict'):
  156. params['left_title'] = self.left_title.to_alipay_dict()
  157. else:
  158. params['left_title'] = self.left_title
  159. if self.right_image_url:
  160. if hasattr(self.right_image_url, 'to_alipay_dict'):
  161. params['right_image_url'] = self.right_image_url.to_alipay_dict()
  162. else:
  163. params['right_image_url'] = self.right_image_url
  164. if self.right_target_url:
  165. if hasattr(self.right_target_url, 'to_alipay_dict'):
  166. params['right_target_url'] = self.right_target_url.to_alipay_dict()
  167. else:
  168. params['right_target_url'] = self.right_target_url
  169. if self.right_title:
  170. if hasattr(self.right_title, 'to_alipay_dict'):
  171. params['right_title'] = self.right_title.to_alipay_dict()
  172. else:
  173. params['right_title'] = self.right_title
  174. if self.sub_title:
  175. if hasattr(self.sub_title, 'to_alipay_dict'):
  176. params['sub_title'] = self.sub_title.to_alipay_dict()
  177. else:
  178. params['sub_title'] = self.sub_title
  179. if self.target_url:
  180. if hasattr(self.target_url, 'to_alipay_dict'):
  181. params['target_url'] = self.target_url.to_alipay_dict()
  182. else:
  183. params['target_url'] = self.target_url
  184. if self.tool_type:
  185. if hasattr(self.tool_type, 'to_alipay_dict'):
  186. params['tool_type'] = self.tool_type.to_alipay_dict()
  187. else:
  188. params['tool_type'] = self.tool_type
  189. return params
  190. @staticmethod
  191. def from_alipay_dict(d):
  192. if not d:
  193. return None
  194. o = BigCardData()
  195. if 'action_text' in d:
  196. o.action_text = d['action_text']
  197. if 'biz_code' in d:
  198. o.biz_code = d['biz_code']
  199. if 'biz_data' in d:
  200. o.biz_data = d['biz_data']
  201. if 'biz_title' in d:
  202. o.biz_title = d['biz_title']
  203. if 'color' in d:
  204. o.color = d['color']
  205. if 'image_url' in d:
  206. o.image_url = d['image_url']
  207. if 'left_image_url' in d:
  208. o.left_image_url = d['left_image_url']
  209. if 'left_target_url' in d:
  210. o.left_target_url = d['left_target_url']
  211. if 'left_title' in d:
  212. o.left_title = d['left_title']
  213. if 'right_image_url' in d:
  214. o.right_image_url = d['right_image_url']
  215. if 'right_target_url' in d:
  216. o.right_target_url = d['right_target_url']
  217. if 'right_title' in d:
  218. o.right_title = d['right_title']
  219. if 'sub_title' in d:
  220. o.sub_title = d['sub_title']
  221. if 'target_url' in d:
  222. o.target_url = d['target_url']
  223. if 'tool_type' in d:
  224. o.tool_type = d['tool_type']
  225. return o