StepcounterDataInfo.py 1.8 KB

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