DeviceBehaviorLogResponse.py 1.9 KB

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