KoubeiTradeOrderEnterpriseSettleModel.py 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiTradeOrderEnterpriseSettleModel(object):
  6. def __init__(self):
  7. self._biz_product = None
  8. self._biz_scene = None
  9. self._buyer_amount = None
  10. self._buyer_id = None
  11. self._buyer_type = None
  12. self._enterprise_amount = None
  13. self._ext_info = None
  14. self._mdiscount_amount = None
  15. self._out_order_no = None
  16. self._partner_id = None
  17. self._platform_discount_amount = None
  18. self._real_amount = None
  19. self._shop_id = None
  20. self._total_amount = None
  21. self._trade_close_timeout = None
  22. self._trade_finish_timeout = None
  23. @property
  24. def biz_product(self):
  25. return self._biz_product
  26. @biz_product.setter
  27. def biz_product(self, value):
  28. self._biz_product = value
  29. @property
  30. def biz_scene(self):
  31. return self._biz_scene
  32. @biz_scene.setter
  33. def biz_scene(self, value):
  34. self._biz_scene = value
  35. @property
  36. def buyer_amount(self):
  37. return self._buyer_amount
  38. @buyer_amount.setter
  39. def buyer_amount(self, value):
  40. self._buyer_amount = value
  41. @property
  42. def buyer_id(self):
  43. return self._buyer_id
  44. @buyer_id.setter
  45. def buyer_id(self, value):
  46. self._buyer_id = value
  47. @property
  48. def buyer_type(self):
  49. return self._buyer_type
  50. @buyer_type.setter
  51. def buyer_type(self, value):
  52. self._buyer_type = value
  53. @property
  54. def enterprise_amount(self):
  55. return self._enterprise_amount
  56. @enterprise_amount.setter
  57. def enterprise_amount(self, value):
  58. self._enterprise_amount = value
  59. @property
  60. def ext_info(self):
  61. return self._ext_info
  62. @ext_info.setter
  63. def ext_info(self, value):
  64. self._ext_info = value
  65. @property
  66. def mdiscount_amount(self):
  67. return self._mdiscount_amount
  68. @mdiscount_amount.setter
  69. def mdiscount_amount(self, value):
  70. self._mdiscount_amount = value
  71. @property
  72. def out_order_no(self):
  73. return self._out_order_no
  74. @out_order_no.setter
  75. def out_order_no(self, value):
  76. self._out_order_no = value
  77. @property
  78. def partner_id(self):
  79. return self._partner_id
  80. @partner_id.setter
  81. def partner_id(self, value):
  82. self._partner_id = value
  83. @property
  84. def platform_discount_amount(self):
  85. return self._platform_discount_amount
  86. @platform_discount_amount.setter
  87. def platform_discount_amount(self, value):
  88. self._platform_discount_amount = value
  89. @property
  90. def real_amount(self):
  91. return self._real_amount
  92. @real_amount.setter
  93. def real_amount(self, value):
  94. self._real_amount = value
  95. @property
  96. def shop_id(self):
  97. return self._shop_id
  98. @shop_id.setter
  99. def shop_id(self, value):
  100. self._shop_id = value
  101. @property
  102. def total_amount(self):
  103. return self._total_amount
  104. @total_amount.setter
  105. def total_amount(self, value):
  106. self._total_amount = value
  107. @property
  108. def trade_close_timeout(self):
  109. return self._trade_close_timeout
  110. @trade_close_timeout.setter
  111. def trade_close_timeout(self, value):
  112. self._trade_close_timeout = value
  113. @property
  114. def trade_finish_timeout(self):
  115. return self._trade_finish_timeout
  116. @trade_finish_timeout.setter
  117. def trade_finish_timeout(self, value):
  118. self._trade_finish_timeout = value
  119. def to_alipay_dict(self):
  120. params = dict()
  121. if self.biz_product:
  122. if hasattr(self.biz_product, 'to_alipay_dict'):
  123. params['biz_product'] = self.biz_product.to_alipay_dict()
  124. else:
  125. params['biz_product'] = self.biz_product
  126. if self.biz_scene:
  127. if hasattr(self.biz_scene, 'to_alipay_dict'):
  128. params['biz_scene'] = self.biz_scene.to_alipay_dict()
  129. else:
  130. params['biz_scene'] = self.biz_scene
  131. if self.buyer_amount:
  132. if hasattr(self.buyer_amount, 'to_alipay_dict'):
  133. params['buyer_amount'] = self.buyer_amount.to_alipay_dict()
  134. else:
  135. params['buyer_amount'] = self.buyer_amount
  136. if self.buyer_id:
  137. if hasattr(self.buyer_id, 'to_alipay_dict'):
  138. params['buyer_id'] = self.buyer_id.to_alipay_dict()
  139. else:
  140. params['buyer_id'] = self.buyer_id
  141. if self.buyer_type:
  142. if hasattr(self.buyer_type, 'to_alipay_dict'):
  143. params['buyer_type'] = self.buyer_type.to_alipay_dict()
  144. else:
  145. params['buyer_type'] = self.buyer_type
  146. if self.enterprise_amount:
  147. if hasattr(self.enterprise_amount, 'to_alipay_dict'):
  148. params['enterprise_amount'] = self.enterprise_amount.to_alipay_dict()
  149. else:
  150. params['enterprise_amount'] = self.enterprise_amount
  151. if self.ext_info:
  152. if hasattr(self.ext_info, 'to_alipay_dict'):
  153. params['ext_info'] = self.ext_info.to_alipay_dict()
  154. else:
  155. params['ext_info'] = self.ext_info
  156. if self.mdiscount_amount:
  157. if hasattr(self.mdiscount_amount, 'to_alipay_dict'):
  158. params['mdiscount_amount'] = self.mdiscount_amount.to_alipay_dict()
  159. else:
  160. params['mdiscount_amount'] = self.mdiscount_amount
  161. if self.out_order_no:
  162. if hasattr(self.out_order_no, 'to_alipay_dict'):
  163. params['out_order_no'] = self.out_order_no.to_alipay_dict()
  164. else:
  165. params['out_order_no'] = self.out_order_no
  166. if self.partner_id:
  167. if hasattr(self.partner_id, 'to_alipay_dict'):
  168. params['partner_id'] = self.partner_id.to_alipay_dict()
  169. else:
  170. params['partner_id'] = self.partner_id
  171. if self.platform_discount_amount:
  172. if hasattr(self.platform_discount_amount, 'to_alipay_dict'):
  173. params['platform_discount_amount'] = self.platform_discount_amount.to_alipay_dict()
  174. else:
  175. params['platform_discount_amount'] = self.platform_discount_amount
  176. if self.real_amount:
  177. if hasattr(self.real_amount, 'to_alipay_dict'):
  178. params['real_amount'] = self.real_amount.to_alipay_dict()
  179. else:
  180. params['real_amount'] = self.real_amount
  181. if self.shop_id:
  182. if hasattr(self.shop_id, 'to_alipay_dict'):
  183. params['shop_id'] = self.shop_id.to_alipay_dict()
  184. else:
  185. params['shop_id'] = self.shop_id
  186. if self.total_amount:
  187. if hasattr(self.total_amount, 'to_alipay_dict'):
  188. params['total_amount'] = self.total_amount.to_alipay_dict()
  189. else:
  190. params['total_amount'] = self.total_amount
  191. if self.trade_close_timeout:
  192. if hasattr(self.trade_close_timeout, 'to_alipay_dict'):
  193. params['trade_close_timeout'] = self.trade_close_timeout.to_alipay_dict()
  194. else:
  195. params['trade_close_timeout'] = self.trade_close_timeout
  196. if self.trade_finish_timeout:
  197. if hasattr(self.trade_finish_timeout, 'to_alipay_dict'):
  198. params['trade_finish_timeout'] = self.trade_finish_timeout.to_alipay_dict()
  199. else:
  200. params['trade_finish_timeout'] = self.trade_finish_timeout
  201. return params
  202. @staticmethod
  203. def from_alipay_dict(d):
  204. if not d:
  205. return None
  206. o = KoubeiTradeOrderEnterpriseSettleModel()
  207. if 'biz_product' in d:
  208. o.biz_product = d['biz_product']
  209. if 'biz_scene' in d:
  210. o.biz_scene = d['biz_scene']
  211. if 'buyer_amount' in d:
  212. o.buyer_amount = d['buyer_amount']
  213. if 'buyer_id' in d:
  214. o.buyer_id = d['buyer_id']
  215. if 'buyer_type' in d:
  216. o.buyer_type = d['buyer_type']
  217. if 'enterprise_amount' in d:
  218. o.enterprise_amount = d['enterprise_amount']
  219. if 'ext_info' in d:
  220. o.ext_info = d['ext_info']
  221. if 'mdiscount_amount' in d:
  222. o.mdiscount_amount = d['mdiscount_amount']
  223. if 'out_order_no' in d:
  224. o.out_order_no = d['out_order_no']
  225. if 'partner_id' in d:
  226. o.partner_id = d['partner_id']
  227. if 'platform_discount_amount' in d:
  228. o.platform_discount_amount = d['platform_discount_amount']
  229. if 'real_amount' in d:
  230. o.real_amount = d['real_amount']
  231. if 'shop_id' in d:
  232. o.shop_id = d['shop_id']
  233. if 'total_amount' in d:
  234. o.total_amount = d['total_amount']
  235. if 'trade_close_timeout' in d:
  236. o.trade_close_timeout = d['trade_close_timeout']
  237. if 'trade_finish_timeout' in d:
  238. o.trade_finish_timeout = d['trade_finish_timeout']
  239. return o