MybankFinanceYulibaoCapitalPurchaseModel.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class MybankFinanceYulibaoCapitalPurchaseModel(object):
  6. def __init__(self):
  7. self._amount = None
  8. self._currency = None
  9. self._fund_code = None
  10. self._out_biz_no = None
  11. @property
  12. def amount(self):
  13. return self._amount
  14. @amount.setter
  15. def amount(self, value):
  16. self._amount = value
  17. @property
  18. def currency(self):
  19. return self._currency
  20. @currency.setter
  21. def currency(self, value):
  22. self._currency = value
  23. @property
  24. def fund_code(self):
  25. return self._fund_code
  26. @fund_code.setter
  27. def fund_code(self, value):
  28. self._fund_code = value
  29. @property
  30. def out_biz_no(self):
  31. return self._out_biz_no
  32. @out_biz_no.setter
  33. def out_biz_no(self, value):
  34. self._out_biz_no = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.amount:
  38. if hasattr(self.amount, 'to_alipay_dict'):
  39. params['amount'] = self.amount.to_alipay_dict()
  40. else:
  41. params['amount'] = self.amount
  42. if self.currency:
  43. if hasattr(self.currency, 'to_alipay_dict'):
  44. params['currency'] = self.currency.to_alipay_dict()
  45. else:
  46. params['currency'] = self.currency
  47. if self.fund_code:
  48. if hasattr(self.fund_code, 'to_alipay_dict'):
  49. params['fund_code'] = self.fund_code.to_alipay_dict()
  50. else:
  51. params['fund_code'] = self.fund_code
  52. if self.out_biz_no:
  53. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  54. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  55. else:
  56. params['out_biz_no'] = self.out_biz_no
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = MybankFinanceYulibaoCapitalPurchaseModel()
  63. if 'amount' in d:
  64. o.amount = d['amount']
  65. if 'currency' in d:
  66. o.currency = d['currency']
  67. if 'fund_code' in d:
  68. o.fund_code = d['fund_code']
  69. if 'out_biz_no' in d:
  70. o.out_biz_no = d['out_biz_no']
  71. return o