AlipayTradeBuyerCreditApplyModel.py 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayTradeBuyerCreditApplyModel(object):
  6. def __init__(self):
  7. self._buyer_credit_source = None
  8. self._buyer_user_id = None
  9. self._credit_period = None
  10. self._credit_scene = None
  11. self._grant_credit_quota = None
  12. self._merchant_credit_source = None
  13. self._merchant_user_id = None
  14. self._operation_type = None
  15. self._out_request_no = None
  16. self._previous_credit_quota = None
  17. @property
  18. def buyer_credit_source(self):
  19. return self._buyer_credit_source
  20. @buyer_credit_source.setter
  21. def buyer_credit_source(self, value):
  22. self._buyer_credit_source = value
  23. @property
  24. def buyer_user_id(self):
  25. return self._buyer_user_id
  26. @buyer_user_id.setter
  27. def buyer_user_id(self, value):
  28. self._buyer_user_id = value
  29. @property
  30. def credit_period(self):
  31. return self._credit_period
  32. @credit_period.setter
  33. def credit_period(self, value):
  34. self._credit_period = value
  35. @property
  36. def credit_scene(self):
  37. return self._credit_scene
  38. @credit_scene.setter
  39. def credit_scene(self, value):
  40. self._credit_scene = value
  41. @property
  42. def grant_credit_quota(self):
  43. return self._grant_credit_quota
  44. @grant_credit_quota.setter
  45. def grant_credit_quota(self, value):
  46. self._grant_credit_quota = value
  47. @property
  48. def merchant_credit_source(self):
  49. return self._merchant_credit_source
  50. @merchant_credit_source.setter
  51. def merchant_credit_source(self, value):
  52. self._merchant_credit_source = value
  53. @property
  54. def merchant_user_id(self):
  55. return self._merchant_user_id
  56. @merchant_user_id.setter
  57. def merchant_user_id(self, value):
  58. self._merchant_user_id = value
  59. @property
  60. def operation_type(self):
  61. return self._operation_type
  62. @operation_type.setter
  63. def operation_type(self, value):
  64. self._operation_type = value
  65. @property
  66. def out_request_no(self):
  67. return self._out_request_no
  68. @out_request_no.setter
  69. def out_request_no(self, value):
  70. self._out_request_no = value
  71. @property
  72. def previous_credit_quota(self):
  73. return self._previous_credit_quota
  74. @previous_credit_quota.setter
  75. def previous_credit_quota(self, value):
  76. self._previous_credit_quota = value
  77. def to_alipay_dict(self):
  78. params = dict()
  79. if self.buyer_credit_source:
  80. if hasattr(self.buyer_credit_source, 'to_alipay_dict'):
  81. params['buyer_credit_source'] = self.buyer_credit_source.to_alipay_dict()
  82. else:
  83. params['buyer_credit_source'] = self.buyer_credit_source
  84. if self.buyer_user_id:
  85. if hasattr(self.buyer_user_id, 'to_alipay_dict'):
  86. params['buyer_user_id'] = self.buyer_user_id.to_alipay_dict()
  87. else:
  88. params['buyer_user_id'] = self.buyer_user_id
  89. if self.credit_period:
  90. if hasattr(self.credit_period, 'to_alipay_dict'):
  91. params['credit_period'] = self.credit_period.to_alipay_dict()
  92. else:
  93. params['credit_period'] = self.credit_period
  94. if self.credit_scene:
  95. if hasattr(self.credit_scene, 'to_alipay_dict'):
  96. params['credit_scene'] = self.credit_scene.to_alipay_dict()
  97. else:
  98. params['credit_scene'] = self.credit_scene
  99. if self.grant_credit_quota:
  100. if hasattr(self.grant_credit_quota, 'to_alipay_dict'):
  101. params['grant_credit_quota'] = self.grant_credit_quota.to_alipay_dict()
  102. else:
  103. params['grant_credit_quota'] = self.grant_credit_quota
  104. if self.merchant_credit_source:
  105. if hasattr(self.merchant_credit_source, 'to_alipay_dict'):
  106. params['merchant_credit_source'] = self.merchant_credit_source.to_alipay_dict()
  107. else:
  108. params['merchant_credit_source'] = self.merchant_credit_source
  109. if self.merchant_user_id:
  110. if hasattr(self.merchant_user_id, 'to_alipay_dict'):
  111. params['merchant_user_id'] = self.merchant_user_id.to_alipay_dict()
  112. else:
  113. params['merchant_user_id'] = self.merchant_user_id
  114. if self.operation_type:
  115. if hasattr(self.operation_type, 'to_alipay_dict'):
  116. params['operation_type'] = self.operation_type.to_alipay_dict()
  117. else:
  118. params['operation_type'] = self.operation_type
  119. if self.out_request_no:
  120. if hasattr(self.out_request_no, 'to_alipay_dict'):
  121. params['out_request_no'] = self.out_request_no.to_alipay_dict()
  122. else:
  123. params['out_request_no'] = self.out_request_no
  124. if self.previous_credit_quota:
  125. if hasattr(self.previous_credit_quota, 'to_alipay_dict'):
  126. params['previous_credit_quota'] = self.previous_credit_quota.to_alipay_dict()
  127. else:
  128. params['previous_credit_quota'] = self.previous_credit_quota
  129. return params
  130. @staticmethod
  131. def from_alipay_dict(d):
  132. if not d:
  133. return None
  134. o = AlipayTradeBuyerCreditApplyModel()
  135. if 'buyer_credit_source' in d:
  136. o.buyer_credit_source = d['buyer_credit_source']
  137. if 'buyer_user_id' in d:
  138. o.buyer_user_id = d['buyer_user_id']
  139. if 'credit_period' in d:
  140. o.credit_period = d['credit_period']
  141. if 'credit_scene' in d:
  142. o.credit_scene = d['credit_scene']
  143. if 'grant_credit_quota' in d:
  144. o.grant_credit_quota = d['grant_credit_quota']
  145. if 'merchant_credit_source' in d:
  146. o.merchant_credit_source = d['merchant_credit_source']
  147. if 'merchant_user_id' in d:
  148. o.merchant_user_id = d['merchant_user_id']
  149. if 'operation_type' in d:
  150. o.operation_type = d['operation_type']
  151. if 'out_request_no' in d:
  152. o.out_request_no = d['out_request_no']
  153. if 'previous_credit_quota' in d:
  154. o.previous_credit_quota = d['previous_credit_quota']
  155. return o