RecItemInfo.py 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class RecItemInfo(object):
  6. def __init__(self):
  7. self._area_code = None
  8. self._biz_type = None
  9. self._description = None
  10. self._ext_info = None
  11. self._icon = None
  12. self._item_code = None
  13. self._item_id = None
  14. self._name = None
  15. self._service_code = None
  16. self._status = None
  17. self._type = None
  18. self._url = None
  19. @property
  20. def area_code(self):
  21. return self._area_code
  22. @area_code.setter
  23. def area_code(self, value):
  24. self._area_code = 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 description(self):
  33. return self._description
  34. @description.setter
  35. def description(self, value):
  36. self._description = value
  37. @property
  38. def ext_info(self):
  39. return self._ext_info
  40. @ext_info.setter
  41. def ext_info(self, value):
  42. self._ext_info = value
  43. @property
  44. def icon(self):
  45. return self._icon
  46. @icon.setter
  47. def icon(self, value):
  48. self._icon = value
  49. @property
  50. def item_code(self):
  51. return self._item_code
  52. @item_code.setter
  53. def item_code(self, value):
  54. self._item_code = value
  55. @property
  56. def item_id(self):
  57. return self._item_id
  58. @item_id.setter
  59. def item_id(self, value):
  60. self._item_id = value
  61. @property
  62. def name(self):
  63. return self._name
  64. @name.setter
  65. def name(self, value):
  66. self._name = value
  67. @property
  68. def service_code(self):
  69. return self._service_code
  70. @service_code.setter
  71. def service_code(self, value):
  72. self._service_code = value
  73. @property
  74. def status(self):
  75. return self._status
  76. @status.setter
  77. def status(self, value):
  78. self._status = value
  79. @property
  80. def type(self):
  81. return self._type
  82. @type.setter
  83. def type(self, value):
  84. self._type = value
  85. @property
  86. def url(self):
  87. return self._url
  88. @url.setter
  89. def url(self, value):
  90. self._url = value
  91. def to_alipay_dict(self):
  92. params = dict()
  93. if self.area_code:
  94. if hasattr(self.area_code, 'to_alipay_dict'):
  95. params['area_code'] = self.area_code.to_alipay_dict()
  96. else:
  97. params['area_code'] = self.area_code
  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.description:
  104. if hasattr(self.description, 'to_alipay_dict'):
  105. params['description'] = self.description.to_alipay_dict()
  106. else:
  107. params['description'] = self.description
  108. if self.ext_info:
  109. if hasattr(self.ext_info, 'to_alipay_dict'):
  110. params['ext_info'] = self.ext_info.to_alipay_dict()
  111. else:
  112. params['ext_info'] = self.ext_info
  113. if self.icon:
  114. if hasattr(self.icon, 'to_alipay_dict'):
  115. params['icon'] = self.icon.to_alipay_dict()
  116. else:
  117. params['icon'] = self.icon
  118. if self.item_code:
  119. if hasattr(self.item_code, 'to_alipay_dict'):
  120. params['item_code'] = self.item_code.to_alipay_dict()
  121. else:
  122. params['item_code'] = self.item_code
  123. if self.item_id:
  124. if hasattr(self.item_id, 'to_alipay_dict'):
  125. params['item_id'] = self.item_id.to_alipay_dict()
  126. else:
  127. params['item_id'] = self.item_id
  128. if self.name:
  129. if hasattr(self.name, 'to_alipay_dict'):
  130. params['name'] = self.name.to_alipay_dict()
  131. else:
  132. params['name'] = self.name
  133. if self.service_code:
  134. if hasattr(self.service_code, 'to_alipay_dict'):
  135. params['service_code'] = self.service_code.to_alipay_dict()
  136. else:
  137. params['service_code'] = self.service_code
  138. if self.status:
  139. if hasattr(self.status, 'to_alipay_dict'):
  140. params['status'] = self.status.to_alipay_dict()
  141. else:
  142. params['status'] = self.status
  143. if self.type:
  144. if hasattr(self.type, 'to_alipay_dict'):
  145. params['type'] = self.type.to_alipay_dict()
  146. else:
  147. params['type'] = self.type
  148. if self.url:
  149. if hasattr(self.url, 'to_alipay_dict'):
  150. params['url'] = self.url.to_alipay_dict()
  151. else:
  152. params['url'] = self.url
  153. return params
  154. @staticmethod
  155. def from_alipay_dict(d):
  156. if not d:
  157. return None
  158. o = RecItemInfo()
  159. if 'area_code' in d:
  160. o.area_code = d['area_code']
  161. if 'biz_type' in d:
  162. o.biz_type = d['biz_type']
  163. if 'description' in d:
  164. o.description = d['description']
  165. if 'ext_info' in d:
  166. o.ext_info = d['ext_info']
  167. if 'icon' in d:
  168. o.icon = d['icon']
  169. if 'item_code' in d:
  170. o.item_code = d['item_code']
  171. if 'item_id' in d:
  172. o.item_id = d['item_id']
  173. if 'name' in d:
  174. o.name = d['name']
  175. if 'service_code' in d:
  176. o.service_code = d['service_code']
  177. if 'status' in d:
  178. o.status = d['status']
  179. if 'type' in d:
  180. o.type = d['type']
  181. if 'url' in d:
  182. o.url = d['url']
  183. return o