OfferObject.py 6.6 KB

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