KbadvertCommissionLimit.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KbadvertCommissionLimit(object):
  6. def __init__(self):
  7. self._commission_user_type = None
  8. self._level = None
  9. self._max_max_amount = None
  10. self._max_quota_amount = None
  11. self._min_commission_percentage = None
  12. self._min_quota_amount = None
  13. @property
  14. def commission_user_type(self):
  15. return self._commission_user_type
  16. @commission_user_type.setter
  17. def commission_user_type(self, value):
  18. self._commission_user_type = value
  19. @property
  20. def level(self):
  21. return self._level
  22. @level.setter
  23. def level(self, value):
  24. self._level = value
  25. @property
  26. def max_max_amount(self):
  27. return self._max_max_amount
  28. @max_max_amount.setter
  29. def max_max_amount(self, value):
  30. self._max_max_amount = value
  31. @property
  32. def max_quota_amount(self):
  33. return self._max_quota_amount
  34. @max_quota_amount.setter
  35. def max_quota_amount(self, value):
  36. self._max_quota_amount = value
  37. @property
  38. def min_commission_percentage(self):
  39. return self._min_commission_percentage
  40. @min_commission_percentage.setter
  41. def min_commission_percentage(self, value):
  42. self._min_commission_percentage = value
  43. @property
  44. def min_quota_amount(self):
  45. return self._min_quota_amount
  46. @min_quota_amount.setter
  47. def min_quota_amount(self, value):
  48. self._min_quota_amount = value
  49. def to_alipay_dict(self):
  50. params = dict()
  51. if self.commission_user_type:
  52. if hasattr(self.commission_user_type, 'to_alipay_dict'):
  53. params['commission_user_type'] = self.commission_user_type.to_alipay_dict()
  54. else:
  55. params['commission_user_type'] = self.commission_user_type
  56. if self.level:
  57. if hasattr(self.level, 'to_alipay_dict'):
  58. params['level'] = self.level.to_alipay_dict()
  59. else:
  60. params['level'] = self.level
  61. if self.max_max_amount:
  62. if hasattr(self.max_max_amount, 'to_alipay_dict'):
  63. params['max_max_amount'] = self.max_max_amount.to_alipay_dict()
  64. else:
  65. params['max_max_amount'] = self.max_max_amount
  66. if self.max_quota_amount:
  67. if hasattr(self.max_quota_amount, 'to_alipay_dict'):
  68. params['max_quota_amount'] = self.max_quota_amount.to_alipay_dict()
  69. else:
  70. params['max_quota_amount'] = self.max_quota_amount
  71. if self.min_commission_percentage:
  72. if hasattr(self.min_commission_percentage, 'to_alipay_dict'):
  73. params['min_commission_percentage'] = self.min_commission_percentage.to_alipay_dict()
  74. else:
  75. params['min_commission_percentage'] = self.min_commission_percentage
  76. if self.min_quota_amount:
  77. if hasattr(self.min_quota_amount, 'to_alipay_dict'):
  78. params['min_quota_amount'] = self.min_quota_amount.to_alipay_dict()
  79. else:
  80. params['min_quota_amount'] = self.min_quota_amount
  81. return params
  82. @staticmethod
  83. def from_alipay_dict(d):
  84. if not d:
  85. return None
  86. o = KbadvertCommissionLimit()
  87. if 'commission_user_type' in d:
  88. o.commission_user_type = d['commission_user_type']
  89. if 'level' in d:
  90. o.level = d['level']
  91. if 'max_max_amount' in d:
  92. o.max_max_amount = d['max_max_amount']
  93. if 'max_quota_amount' in d:
  94. o.max_quota_amount = d['max_quota_amount']
  95. if 'min_commission_percentage' in d:
  96. o.min_commission_percentage = d['min_commission_percentage']
  97. if 'min_quota_amount' in d:
  98. o.min_quota_amount = d['min_quota_amount']
  99. return o