AlipayUserStepcounterSyncModel.py 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayUserStepcounterSyncModel(object):
  6. def __init__(self):
  7. self._age = None
  8. self._calorie = None
  9. self._count = None
  10. self._data_provider = None
  11. self._distance = None
  12. self._height = None
  13. self._latitude = None
  14. self._longitude = None
  15. self._out_user_id = None
  16. self._time = None
  17. self._time_zone = None
  18. self._user_id = None
  19. self._weight = None
  20. @property
  21. def age(self):
  22. return self._age
  23. @age.setter
  24. def age(self, value):
  25. self._age = value
  26. @property
  27. def calorie(self):
  28. return self._calorie
  29. @calorie.setter
  30. def calorie(self, value):
  31. self._calorie = value
  32. @property
  33. def count(self):
  34. return self._count
  35. @count.setter
  36. def count(self, value):
  37. self._count = value
  38. @property
  39. def data_provider(self):
  40. return self._data_provider
  41. @data_provider.setter
  42. def data_provider(self, value):
  43. self._data_provider = value
  44. @property
  45. def distance(self):
  46. return self._distance
  47. @distance.setter
  48. def distance(self, value):
  49. self._distance = value
  50. @property
  51. def height(self):
  52. return self._height
  53. @height.setter
  54. def height(self, value):
  55. self._height = value
  56. @property
  57. def latitude(self):
  58. return self._latitude
  59. @latitude.setter
  60. def latitude(self, value):
  61. self._latitude = value
  62. @property
  63. def longitude(self):
  64. return self._longitude
  65. @longitude.setter
  66. def longitude(self, value):
  67. self._longitude = value
  68. @property
  69. def out_user_id(self):
  70. return self._out_user_id
  71. @out_user_id.setter
  72. def out_user_id(self, value):
  73. self._out_user_id = value
  74. @property
  75. def time(self):
  76. return self._time
  77. @time.setter
  78. def time(self, value):
  79. self._time = value
  80. @property
  81. def time_zone(self):
  82. return self._time_zone
  83. @time_zone.setter
  84. def time_zone(self, value):
  85. self._time_zone = value
  86. @property
  87. def user_id(self):
  88. return self._user_id
  89. @user_id.setter
  90. def user_id(self, value):
  91. self._user_id = value
  92. @property
  93. def weight(self):
  94. return self._weight
  95. @weight.setter
  96. def weight(self, value):
  97. self._weight = value
  98. def to_alipay_dict(self):
  99. params = dict()
  100. if self.age:
  101. if hasattr(self.age, 'to_alipay_dict'):
  102. params['age'] = self.age.to_alipay_dict()
  103. else:
  104. params['age'] = self.age
  105. if self.calorie:
  106. if hasattr(self.calorie, 'to_alipay_dict'):
  107. params['calorie'] = self.calorie.to_alipay_dict()
  108. else:
  109. params['calorie'] = self.calorie
  110. if self.count:
  111. if hasattr(self.count, 'to_alipay_dict'):
  112. params['count'] = self.count.to_alipay_dict()
  113. else:
  114. params['count'] = self.count
  115. if self.data_provider:
  116. if hasattr(self.data_provider, 'to_alipay_dict'):
  117. params['data_provider'] = self.data_provider.to_alipay_dict()
  118. else:
  119. params['data_provider'] = self.data_provider
  120. if self.distance:
  121. if hasattr(self.distance, 'to_alipay_dict'):
  122. params['distance'] = self.distance.to_alipay_dict()
  123. else:
  124. params['distance'] = self.distance
  125. if self.height:
  126. if hasattr(self.height, 'to_alipay_dict'):
  127. params['height'] = self.height.to_alipay_dict()
  128. else:
  129. params['height'] = self.height
  130. if self.latitude:
  131. if hasattr(self.latitude, 'to_alipay_dict'):
  132. params['latitude'] = self.latitude.to_alipay_dict()
  133. else:
  134. params['latitude'] = self.latitude
  135. if self.longitude:
  136. if hasattr(self.longitude, 'to_alipay_dict'):
  137. params['longitude'] = self.longitude.to_alipay_dict()
  138. else:
  139. params['longitude'] = self.longitude
  140. if self.out_user_id:
  141. if hasattr(self.out_user_id, 'to_alipay_dict'):
  142. params['out_user_id'] = self.out_user_id.to_alipay_dict()
  143. else:
  144. params['out_user_id'] = self.out_user_id
  145. if self.time:
  146. if hasattr(self.time, 'to_alipay_dict'):
  147. params['time'] = self.time.to_alipay_dict()
  148. else:
  149. params['time'] = self.time
  150. if self.time_zone:
  151. if hasattr(self.time_zone, 'to_alipay_dict'):
  152. params['time_zone'] = self.time_zone.to_alipay_dict()
  153. else:
  154. params['time_zone'] = self.time_zone
  155. if self.user_id:
  156. if hasattr(self.user_id, 'to_alipay_dict'):
  157. params['user_id'] = self.user_id.to_alipay_dict()
  158. else:
  159. params['user_id'] = self.user_id
  160. if self.weight:
  161. if hasattr(self.weight, 'to_alipay_dict'):
  162. params['weight'] = self.weight.to_alipay_dict()
  163. else:
  164. params['weight'] = self.weight
  165. return params
  166. @staticmethod
  167. def from_alipay_dict(d):
  168. if not d:
  169. return None
  170. o = AlipayUserStepcounterSyncModel()
  171. if 'age' in d:
  172. o.age = d['age']
  173. if 'calorie' in d:
  174. o.calorie = d['calorie']
  175. if 'count' in d:
  176. o.count = d['count']
  177. if 'data_provider' in d:
  178. o.data_provider = d['data_provider']
  179. if 'distance' in d:
  180. o.distance = d['distance']
  181. if 'height' in d:
  182. o.height = d['height']
  183. if 'latitude' in d:
  184. o.latitude = d['latitude']
  185. if 'longitude' in d:
  186. o.longitude = d['longitude']
  187. if 'out_user_id' in d:
  188. o.out_user_id = d['out_user_id']
  189. if 'time' in d:
  190. o.time = d['time']
  191. if 'time_zone' in d:
  192. o.time_zone = d['time_zone']
  193. if 'user_id' in d:
  194. o.user_id = d['user_id']
  195. if 'weight' in d:
  196. o.weight = d['weight']
  197. return o