AlipayTradeCreditApplyQueryModel.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayTradeCreditApplyQueryModel(object):
  6. def __init__(self):
  7. self._buyer_credit_source = None
  8. self._buyer_user_id = None
  9. self._credit_scene = None
  10. self._grant_operation_no = None
  11. self._out_request_no = None
  12. @property
  13. def buyer_credit_source(self):
  14. return self._buyer_credit_source
  15. @buyer_credit_source.setter
  16. def buyer_credit_source(self, value):
  17. self._buyer_credit_source = value
  18. @property
  19. def buyer_user_id(self):
  20. return self._buyer_user_id
  21. @buyer_user_id.setter
  22. def buyer_user_id(self, value):
  23. self._buyer_user_id = value
  24. @property
  25. def credit_scene(self):
  26. return self._credit_scene
  27. @credit_scene.setter
  28. def credit_scene(self, value):
  29. self._credit_scene = value
  30. @property
  31. def grant_operation_no(self):
  32. return self._grant_operation_no
  33. @grant_operation_no.setter
  34. def grant_operation_no(self, value):
  35. self._grant_operation_no = value
  36. @property
  37. def out_request_no(self):
  38. return self._out_request_no
  39. @out_request_no.setter
  40. def out_request_no(self, value):
  41. self._out_request_no = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.buyer_credit_source:
  45. if hasattr(self.buyer_credit_source, 'to_alipay_dict'):
  46. params['buyer_credit_source'] = self.buyer_credit_source.to_alipay_dict()
  47. else:
  48. params['buyer_credit_source'] = self.buyer_credit_source
  49. if self.buyer_user_id:
  50. if hasattr(self.buyer_user_id, 'to_alipay_dict'):
  51. params['buyer_user_id'] = self.buyer_user_id.to_alipay_dict()
  52. else:
  53. params['buyer_user_id'] = self.buyer_user_id
  54. if self.credit_scene:
  55. if hasattr(self.credit_scene, 'to_alipay_dict'):
  56. params['credit_scene'] = self.credit_scene.to_alipay_dict()
  57. else:
  58. params['credit_scene'] = self.credit_scene
  59. if self.grant_operation_no:
  60. if hasattr(self.grant_operation_no, 'to_alipay_dict'):
  61. params['grant_operation_no'] = self.grant_operation_no.to_alipay_dict()
  62. else:
  63. params['grant_operation_no'] = self.grant_operation_no
  64. if self.out_request_no:
  65. if hasattr(self.out_request_no, 'to_alipay_dict'):
  66. params['out_request_no'] = self.out_request_no.to_alipay_dict()
  67. else:
  68. params['out_request_no'] = self.out_request_no
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = AlipayTradeCreditApplyQueryModel()
  75. if 'buyer_credit_source' in d:
  76. o.buyer_credit_source = d['buyer_credit_source']
  77. if 'buyer_user_id' in d:
  78. o.buyer_user_id = d['buyer_user_id']
  79. if 'credit_scene' in d:
  80. o.credit_scene = d['credit_scene']
  81. if 'grant_operation_no' in d:
  82. o.grant_operation_no = d['grant_operation_no']
  83. if 'out_request_no' in d:
  84. o.out_request_no = d['out_request_no']
  85. return o