AlipayMarketingCouponTemplateCreateModel.py 8.5 KB

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