CreditPayInstallmentDetailVO.py 8.7 KB

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