AlipayDataDataserviceCodeRecoModel.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayDataDataserviceCodeRecoModel(object):
  6. def __init__(self):
  7. self._config = None
  8. self._content = None
  9. self._strategy = None
  10. @property
  11. def config(self):
  12. return self._config
  13. @config.setter
  14. def config(self, value):
  15. self._config = value
  16. @property
  17. def content(self):
  18. return self._content
  19. @content.setter
  20. def content(self, value):
  21. self._content = value
  22. @property
  23. def strategy(self):
  24. return self._strategy
  25. @strategy.setter
  26. def strategy(self, value):
  27. self._strategy = value
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.config:
  31. if hasattr(self.config, 'to_alipay_dict'):
  32. params['config'] = self.config.to_alipay_dict()
  33. else:
  34. params['config'] = self.config
  35. if self.content:
  36. if hasattr(self.content, 'to_alipay_dict'):
  37. params['content'] = self.content.to_alipay_dict()
  38. else:
  39. params['content'] = self.content
  40. if self.strategy:
  41. if hasattr(self.strategy, 'to_alipay_dict'):
  42. params['strategy'] = self.strategy.to_alipay_dict()
  43. else:
  44. params['strategy'] = self.strategy
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = AlipayDataDataserviceCodeRecoModel()
  51. if 'config' in d:
  52. o.config = d['config']
  53. if 'content' in d:
  54. o.content = d['content']
  55. if 'strategy' in d:
  56. o.strategy = d['strategy']
  57. return o