AlipayTradeMerchantCreditInitializeModel.py 2.7 KB

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