CreditPayBillAssetVO.py 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.CreditPayAssetBaseVO import CreditPayAssetBaseVO
  6. from alipay.aop.api.domain.CreditPayChargePricingVO import CreditPayChargePricingVO
  7. from alipay.aop.api.domain.CreditPayClauseVO import CreditPayClauseVO
  8. from alipay.aop.api.domain.CreditPayDiscountVO import CreditPayDiscountVO
  9. from alipay.aop.api.domain.CreditPayIntPricingVO import CreditPayIntPricingVO
  10. from alipay.aop.api.domain.CreditPayRepayVO import CreditPayRepayVO
  11. from alipay.aop.api.domain.CreditPayTermVO import CreditPayTermVO
  12. class CreditPayBillAssetVO(object):
  13. def __init__(self):
  14. self._allow_part_prepayment = None
  15. self._allow_prepayment = None
  16. self._base_info = None
  17. self._bill_account_day = None
  18. self._bill_account_day_unit = None
  19. self._bill_pd_code = None
  20. self._charge_pricing_list = None
  21. self._clauses = None
  22. self._discount_info = None
  23. self._int_pricing = None
  24. self._repay_info = None
  25. self._term_info = None
  26. @property
  27. def allow_part_prepayment(self):
  28. return self._allow_part_prepayment
  29. @allow_part_prepayment.setter
  30. def allow_part_prepayment(self, value):
  31. self._allow_part_prepayment = value
  32. @property
  33. def allow_prepayment(self):
  34. return self._allow_prepayment
  35. @allow_prepayment.setter
  36. def allow_prepayment(self, value):
  37. self._allow_prepayment = value
  38. @property
  39. def base_info(self):
  40. return self._base_info
  41. @base_info.setter
  42. def base_info(self, value):
  43. if isinstance(value, CreditPayAssetBaseVO):
  44. self._base_info = value
  45. else:
  46. self._base_info = CreditPayAssetBaseVO.from_alipay_dict(value)
  47. @property
  48. def bill_account_day(self):
  49. return self._bill_account_day
  50. @bill_account_day.setter
  51. def bill_account_day(self, value):
  52. self._bill_account_day = value
  53. @property
  54. def bill_account_day_unit(self):
  55. return self._bill_account_day_unit
  56. @bill_account_day_unit.setter
  57. def bill_account_day_unit(self, value):
  58. self._bill_account_day_unit = value
  59. @property
  60. def bill_pd_code(self):
  61. return self._bill_pd_code
  62. @bill_pd_code.setter
  63. def bill_pd_code(self, value):
  64. self._bill_pd_code = value
  65. @property
  66. def charge_pricing_list(self):
  67. return self._charge_pricing_list
  68. @charge_pricing_list.setter
  69. def charge_pricing_list(self, value):
  70. if isinstance(value, list):
  71. self._charge_pricing_list = list()
  72. for i in value:
  73. if isinstance(i, CreditPayChargePricingVO):
  74. self._charge_pricing_list.append(i)
  75. else:
  76. self._charge_pricing_list.append(CreditPayChargePricingVO.from_alipay_dict(i))
  77. @property
  78. def clauses(self):
  79. return self._clauses
  80. @clauses.setter
  81. def clauses(self, value):
  82. if isinstance(value, list):
  83. self._clauses = list()
  84. for i in value:
  85. if isinstance(i, CreditPayClauseVO):
  86. self._clauses.append(i)
  87. else:
  88. self._clauses.append(CreditPayClauseVO.from_alipay_dict(i))
  89. @property
  90. def discount_info(self):
  91. return self._discount_info
  92. @discount_info.setter
  93. def discount_info(self, value):
  94. if isinstance(value, CreditPayDiscountVO):
  95. self._discount_info = value
  96. else:
  97. self._discount_info = CreditPayDiscountVO.from_alipay_dict(value)
  98. @property
  99. def int_pricing(self):
  100. return self._int_pricing
  101. @int_pricing.setter
  102. def int_pricing(self, value):
  103. if isinstance(value, CreditPayIntPricingVO):
  104. self._int_pricing = value
  105. else:
  106. self._int_pricing = CreditPayIntPricingVO.from_alipay_dict(value)
  107. @property
  108. def repay_info(self):
  109. return self._repay_info
  110. @repay_info.setter
  111. def repay_info(self, value):
  112. if isinstance(value, CreditPayRepayVO):
  113. self._repay_info = value
  114. else:
  115. self._repay_info = CreditPayRepayVO.from_alipay_dict(value)
  116. @property
  117. def term_info(self):
  118. return self._term_info
  119. @term_info.setter
  120. def term_info(self, value):
  121. if isinstance(value, CreditPayTermVO):
  122. self._term_info = value
  123. else:
  124. self._term_info = CreditPayTermVO.from_alipay_dict(value)
  125. def to_alipay_dict(self):
  126. params = dict()
  127. if self.allow_part_prepayment:
  128. if hasattr(self.allow_part_prepayment, 'to_alipay_dict'):
  129. params['allow_part_prepayment'] = self.allow_part_prepayment.to_alipay_dict()
  130. else:
  131. params['allow_part_prepayment'] = self.allow_part_prepayment
  132. if self.allow_prepayment:
  133. if hasattr(self.allow_prepayment, 'to_alipay_dict'):
  134. params['allow_prepayment'] = self.allow_prepayment.to_alipay_dict()
  135. else:
  136. params['allow_prepayment'] = self.allow_prepayment
  137. if self.base_info:
  138. if hasattr(self.base_info, 'to_alipay_dict'):
  139. params['base_info'] = self.base_info.to_alipay_dict()
  140. else:
  141. params['base_info'] = self.base_info
  142. if self.bill_account_day:
  143. if hasattr(self.bill_account_day, 'to_alipay_dict'):
  144. params['bill_account_day'] = self.bill_account_day.to_alipay_dict()
  145. else:
  146. params['bill_account_day'] = self.bill_account_day
  147. if self.bill_account_day_unit:
  148. if hasattr(self.bill_account_day_unit, 'to_alipay_dict'):
  149. params['bill_account_day_unit'] = self.bill_account_day_unit.to_alipay_dict()
  150. else:
  151. params['bill_account_day_unit'] = self.bill_account_day_unit
  152. if self.bill_pd_code:
  153. if hasattr(self.bill_pd_code, 'to_alipay_dict'):
  154. params['bill_pd_code'] = self.bill_pd_code.to_alipay_dict()
  155. else:
  156. params['bill_pd_code'] = self.bill_pd_code
  157. if self.charge_pricing_list:
  158. if isinstance(self.charge_pricing_list, list):
  159. for i in range(0, len(self.charge_pricing_list)):
  160. element = self.charge_pricing_list[i]
  161. if hasattr(element, 'to_alipay_dict'):
  162. self.charge_pricing_list[i] = element.to_alipay_dict()
  163. if hasattr(self.charge_pricing_list, 'to_alipay_dict'):
  164. params['charge_pricing_list'] = self.charge_pricing_list.to_alipay_dict()
  165. else:
  166. params['charge_pricing_list'] = self.charge_pricing_list
  167. if self.clauses:
  168. if isinstance(self.clauses, list):
  169. for i in range(0, len(self.clauses)):
  170. element = self.clauses[i]
  171. if hasattr(element, 'to_alipay_dict'):
  172. self.clauses[i] = element.to_alipay_dict()
  173. if hasattr(self.clauses, 'to_alipay_dict'):
  174. params['clauses'] = self.clauses.to_alipay_dict()
  175. else:
  176. params['clauses'] = self.clauses
  177. if self.discount_info:
  178. if hasattr(self.discount_info, 'to_alipay_dict'):
  179. params['discount_info'] = self.discount_info.to_alipay_dict()
  180. else:
  181. params['discount_info'] = self.discount_info
  182. if self.int_pricing:
  183. if hasattr(self.int_pricing, 'to_alipay_dict'):
  184. params['int_pricing'] = self.int_pricing.to_alipay_dict()
  185. else:
  186. params['int_pricing'] = self.int_pricing
  187. if self.repay_info:
  188. if hasattr(self.repay_info, 'to_alipay_dict'):
  189. params['repay_info'] = self.repay_info.to_alipay_dict()
  190. else:
  191. params['repay_info'] = self.repay_info
  192. if self.term_info:
  193. if hasattr(self.term_info, 'to_alipay_dict'):
  194. params['term_info'] = self.term_info.to_alipay_dict()
  195. else:
  196. params['term_info'] = self.term_info
  197. return params
  198. @staticmethod
  199. def from_alipay_dict(d):
  200. if not d:
  201. return None
  202. o = CreditPayBillAssetVO()
  203. if 'allow_part_prepayment' in d:
  204. o.allow_part_prepayment = d['allow_part_prepayment']
  205. if 'allow_prepayment' in d:
  206. o.allow_prepayment = d['allow_prepayment']
  207. if 'base_info' in d:
  208. o.base_info = d['base_info']
  209. if 'bill_account_day' in d:
  210. o.bill_account_day = d['bill_account_day']
  211. if 'bill_account_day_unit' in d:
  212. o.bill_account_day_unit = d['bill_account_day_unit']
  213. if 'bill_pd_code' in d:
  214. o.bill_pd_code = d['bill_pd_code']
  215. if 'charge_pricing_list' in d:
  216. o.charge_pricing_list = d['charge_pricing_list']
  217. if 'clauses' in d:
  218. o.clauses = d['clauses']
  219. if 'discount_info' in d:
  220. o.discount_info = d['discount_info']
  221. if 'int_pricing' in d:
  222. o.int_pricing = d['int_pricing']
  223. if 'repay_info' in d:
  224. o.repay_info = d['repay_info']
  225. if 'term_info' in d:
  226. o.term_info = d['term_info']
  227. return o