AlipayMarketingCashvoucherTemplateCreateModel.py 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayMarketingCashvoucherTemplateCreateModel(object):
  6. def __init__(self):
  7. self._amount = None
  8. self._brand_name = None
  9. self._extension_info = None
  10. self._floor_amount = None
  11. self._fund_account = None
  12. self._notify_uri = None
  13. self._out_biz_no = None
  14. self._publish_end_time = None
  15. self._publish_start_time = None
  16. self._redirect_uri = None
  17. self._rule_conf = None
  18. self._slogan = None
  19. self._voucher_description = None
  20. self._voucher_quantity = None
  21. self._voucher_type = None
  22. self._voucher_use_scene = None
  23. self._voucher_valid_period = None
  24. @property
  25. def amount(self):
  26. return self._amount
  27. @amount.setter
  28. def amount(self, value):
  29. self._amount = value
  30. @property
  31. def brand_name(self):
  32. return self._brand_name
  33. @brand_name.setter
  34. def brand_name(self, value):
  35. self._brand_name = value
  36. @property
  37. def extension_info(self):
  38. return self._extension_info
  39. @extension_info.setter
  40. def extension_info(self, value):
  41. self._extension_info = value
  42. @property
  43. def floor_amount(self):
  44. return self._floor_amount
  45. @floor_amount.setter
  46. def floor_amount(self, value):
  47. self._floor_amount = value
  48. @property
  49. def fund_account(self):
  50. return self._fund_account
  51. @fund_account.setter
  52. def fund_account(self, value):
  53. self._fund_account = value
  54. @property
  55. def notify_uri(self):
  56. return self._notify_uri
  57. @notify_uri.setter
  58. def notify_uri(self, value):
  59. self._notify_uri = value
  60. @property
  61. def out_biz_no(self):
  62. return self._out_biz_no
  63. @out_biz_no.setter
  64. def out_biz_no(self, value):
  65. self._out_biz_no = value
  66. @property
  67. def publish_end_time(self):
  68. return self._publish_end_time
  69. @publish_end_time.setter
  70. def publish_end_time(self, value):
  71. self._publish_end_time = value
  72. @property
  73. def publish_start_time(self):
  74. return self._publish_start_time
  75. @publish_start_time.setter
  76. def publish_start_time(self, value):
  77. self._publish_start_time = value
  78. @property
  79. def redirect_uri(self):
  80. return self._redirect_uri
  81. @redirect_uri.setter
  82. def redirect_uri(self, value):
  83. self._redirect_uri = value
  84. @property
  85. def rule_conf(self):
  86. return self._rule_conf
  87. @rule_conf.setter
  88. def rule_conf(self, value):
  89. self._rule_conf = value
  90. @property
  91. def slogan(self):
  92. return self._slogan
  93. @slogan.setter
  94. def slogan(self, value):
  95. self._slogan = value
  96. @property
  97. def voucher_description(self):
  98. return self._voucher_description
  99. @voucher_description.setter
  100. def voucher_description(self, value):
  101. self._voucher_description = value
  102. @property
  103. def voucher_quantity(self):
  104. return self._voucher_quantity
  105. @voucher_quantity.setter
  106. def voucher_quantity(self, value):
  107. self._voucher_quantity = value
  108. @property
  109. def voucher_type(self):
  110. return self._voucher_type
  111. @voucher_type.setter
  112. def voucher_type(self, value):
  113. self._voucher_type = value
  114. @property
  115. def voucher_use_scene(self):
  116. return self._voucher_use_scene
  117. @voucher_use_scene.setter
  118. def voucher_use_scene(self, value):
  119. self._voucher_use_scene = value
  120. @property
  121. def voucher_valid_period(self):
  122. return self._voucher_valid_period
  123. @voucher_valid_period.setter
  124. def voucher_valid_period(self, value):
  125. self._voucher_valid_period = value
  126. def to_alipay_dict(self):
  127. params = dict()
  128. if self.amount:
  129. if hasattr(self.amount, 'to_alipay_dict'):
  130. params['amount'] = self.amount.to_alipay_dict()
  131. else:
  132. params['amount'] = self.amount
  133. if self.brand_name:
  134. if hasattr(self.brand_name, 'to_alipay_dict'):
  135. params['brand_name'] = self.brand_name.to_alipay_dict()
  136. else:
  137. params['brand_name'] = self.brand_name
  138. if self.extension_info:
  139. if hasattr(self.extension_info, 'to_alipay_dict'):
  140. params['extension_info'] = self.extension_info.to_alipay_dict()
  141. else:
  142. params['extension_info'] = self.extension_info
  143. if self.floor_amount:
  144. if hasattr(self.floor_amount, 'to_alipay_dict'):
  145. params['floor_amount'] = self.floor_amount.to_alipay_dict()
  146. else:
  147. params['floor_amount'] = self.floor_amount
  148. if self.fund_account:
  149. if hasattr(self.fund_account, 'to_alipay_dict'):
  150. params['fund_account'] = self.fund_account.to_alipay_dict()
  151. else:
  152. params['fund_account'] = self.fund_account
  153. if self.notify_uri:
  154. if hasattr(self.notify_uri, 'to_alipay_dict'):
  155. params['notify_uri'] = self.notify_uri.to_alipay_dict()
  156. else:
  157. params['notify_uri'] = self.notify_uri
  158. if self.out_biz_no:
  159. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  160. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  161. else:
  162. params['out_biz_no'] = self.out_biz_no
  163. if self.publish_end_time:
  164. if hasattr(self.publish_end_time, 'to_alipay_dict'):
  165. params['publish_end_time'] = self.publish_end_time.to_alipay_dict()
  166. else:
  167. params['publish_end_time'] = self.publish_end_time
  168. if self.publish_start_time:
  169. if hasattr(self.publish_start_time, 'to_alipay_dict'):
  170. params['publish_start_time'] = self.publish_start_time.to_alipay_dict()
  171. else:
  172. params['publish_start_time'] = self.publish_start_time
  173. if self.redirect_uri:
  174. if hasattr(self.redirect_uri, 'to_alipay_dict'):
  175. params['redirect_uri'] = self.redirect_uri.to_alipay_dict()
  176. else:
  177. params['redirect_uri'] = self.redirect_uri
  178. if self.rule_conf:
  179. if hasattr(self.rule_conf, 'to_alipay_dict'):
  180. params['rule_conf'] = self.rule_conf.to_alipay_dict()
  181. else:
  182. params['rule_conf'] = self.rule_conf
  183. if self.slogan:
  184. if hasattr(self.slogan, 'to_alipay_dict'):
  185. params['slogan'] = self.slogan.to_alipay_dict()
  186. else:
  187. params['slogan'] = self.slogan
  188. if self.voucher_description:
  189. if hasattr(self.voucher_description, 'to_alipay_dict'):
  190. params['voucher_description'] = self.voucher_description.to_alipay_dict()
  191. else:
  192. params['voucher_description'] = self.voucher_description
  193. if self.voucher_quantity:
  194. if hasattr(self.voucher_quantity, 'to_alipay_dict'):
  195. params['voucher_quantity'] = self.voucher_quantity.to_alipay_dict()
  196. else:
  197. params['voucher_quantity'] = self.voucher_quantity
  198. if self.voucher_type:
  199. if hasattr(self.voucher_type, 'to_alipay_dict'):
  200. params['voucher_type'] = self.voucher_type.to_alipay_dict()
  201. else:
  202. params['voucher_type'] = self.voucher_type
  203. if self.voucher_use_scene:
  204. if hasattr(self.voucher_use_scene, 'to_alipay_dict'):
  205. params['voucher_use_scene'] = self.voucher_use_scene.to_alipay_dict()
  206. else:
  207. params['voucher_use_scene'] = self.voucher_use_scene
  208. if self.voucher_valid_period:
  209. if hasattr(self.voucher_valid_period, 'to_alipay_dict'):
  210. params['voucher_valid_period'] = self.voucher_valid_period.to_alipay_dict()
  211. else:
  212. params['voucher_valid_period'] = self.voucher_valid_period
  213. return params
  214. @staticmethod
  215. def from_alipay_dict(d):
  216. if not d:
  217. return None
  218. o = AlipayMarketingCashvoucherTemplateCreateModel()
  219. if 'amount' in d:
  220. o.amount = d['amount']
  221. if 'brand_name' in d:
  222. o.brand_name = d['brand_name']
  223. if 'extension_info' in d:
  224. o.extension_info = d['extension_info']
  225. if 'floor_amount' in d:
  226. o.floor_amount = d['floor_amount']
  227. if 'fund_account' in d:
  228. o.fund_account = d['fund_account']
  229. if 'notify_uri' in d:
  230. o.notify_uri = d['notify_uri']
  231. if 'out_biz_no' in d:
  232. o.out_biz_no = d['out_biz_no']
  233. if 'publish_end_time' in d:
  234. o.publish_end_time = d['publish_end_time']
  235. if 'publish_start_time' in d:
  236. o.publish_start_time = d['publish_start_time']
  237. if 'redirect_uri' in d:
  238. o.redirect_uri = d['redirect_uri']
  239. if 'rule_conf' in d:
  240. o.rule_conf = d['rule_conf']
  241. if 'slogan' in d:
  242. o.slogan = d['slogan']
  243. if 'voucher_description' in d:
  244. o.voucher_description = d['voucher_description']
  245. if 'voucher_quantity' in d:
  246. o.voucher_quantity = d['voucher_quantity']
  247. if 'voucher_type' in d:
  248. o.voucher_type = d['voucher_type']
  249. if 'voucher_use_scene' in d:
  250. o.voucher_use_scene = d['voucher_use_scene']
  251. if 'voucher_valid_period' in d:
  252. o.voucher_valid_period = d['voucher_valid_period']
  253. return o