ActivityQueryInfo.py 2.1 KB

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