AlipayOpenMiniMorphoAppRollbackModel.py 1.4 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.MorphoIdentity import MorphoIdentity
  6. class AlipayOpenMiniMorphoAppRollbackModel(object):
  7. def __init__(self):
  8. self._id = None
  9. self._identity = None
  10. @property
  11. def id(self):
  12. return self._id
  13. @id.setter
  14. def id(self, value):
  15. self._id = value
  16. @property
  17. def identity(self):
  18. return self._identity
  19. @identity.setter
  20. def identity(self, value):
  21. if isinstance(value, MorphoIdentity):
  22. self._identity = value
  23. else:
  24. self._identity = MorphoIdentity.from_alipay_dict(value)
  25. def to_alipay_dict(self):
  26. params = dict()
  27. if self.id:
  28. if hasattr(self.id, 'to_alipay_dict'):
  29. params['id'] = self.id.to_alipay_dict()
  30. else:
  31. params['id'] = self.id
  32. if self.identity:
  33. if hasattr(self.identity, 'to_alipay_dict'):
  34. params['identity'] = self.identity.to_alipay_dict()
  35. else:
  36. params['identity'] = self.identity
  37. return params
  38. @staticmethod
  39. def from_alipay_dict(d):
  40. if not d:
  41. return None
  42. o = AlipayOpenMiniMorphoAppRollbackModel()
  43. if 'id' in d:
  44. o.id = d['id']
  45. if 'identity' in d:
  46. o.identity = d['identity']
  47. return o