AlipayMerchantOrderPointQueryModel.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.UserIdentity import UserIdentity
  6. class AlipayMerchantOrderPointQueryModel(object):
  7. def __init__(self):
  8. self._point_type = None
  9. self._user = None
  10. @property
  11. def point_type(self):
  12. return self._point_type
  13. @point_type.setter
  14. def point_type(self, value):
  15. self._point_type = value
  16. @property
  17. def user(self):
  18. return self._user
  19. @user.setter
  20. def user(self, value):
  21. if isinstance(value, UserIdentity):
  22. self._user = value
  23. else:
  24. self._user = UserIdentity.from_alipay_dict(value)
  25. def to_alipay_dict(self):
  26. params = dict()
  27. if self.point_type:
  28. if hasattr(self.point_type, 'to_alipay_dict'):
  29. params['point_type'] = self.point_type.to_alipay_dict()
  30. else:
  31. params['point_type'] = self.point_type
  32. if self.user:
  33. if hasattr(self.user, 'to_alipay_dict'):
  34. params['user'] = self.user.to_alipay_dict()
  35. else:
  36. params['user'] = self.user
  37. return params
  38. @staticmethod
  39. def from_alipay_dict(d):
  40. if not d:
  41. return None
  42. o = AlipayMerchantOrderPointQueryModel()
  43. if 'point_type' in d:
  44. o.point_type = d['point_type']
  45. if 'user' in d:
  46. o.user = d['user']
  47. return o