HighwaySceneData.py 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class HighwaySceneData(object):
  6. def __init__(self):
  7. self._car_type = None
  8. self._end_province_code = None
  9. self._end_station_code = None
  10. self._end_station_id = None
  11. self._end_station_latitude = None
  12. self._end_station_longitude = None
  13. self._end_station_name = None
  14. self._end_station_province = None
  15. self._end_time = None
  16. self._lane_no = None
  17. self._start_province_code = None
  18. self._start_station_code = None
  19. self._start_station_id = None
  20. self._start_station_latitude = None
  21. self._start_station_longitude = None
  22. self._start_station_name = None
  23. self._start_station_province = None
  24. self._start_time = None
  25. @property
  26. def car_type(self):
  27. return self._car_type
  28. @car_type.setter
  29. def car_type(self, value):
  30. self._car_type = value
  31. @property
  32. def end_province_code(self):
  33. return self._end_province_code
  34. @end_province_code.setter
  35. def end_province_code(self, value):
  36. self._end_province_code = value
  37. @property
  38. def end_station_code(self):
  39. return self._end_station_code
  40. @end_station_code.setter
  41. def end_station_code(self, value):
  42. self._end_station_code = value
  43. @property
  44. def end_station_id(self):
  45. return self._end_station_id
  46. @end_station_id.setter
  47. def end_station_id(self, value):
  48. self._end_station_id = value
  49. @property
  50. def end_station_latitude(self):
  51. return self._end_station_latitude
  52. @end_station_latitude.setter
  53. def end_station_latitude(self, value):
  54. self._end_station_latitude = value
  55. @property
  56. def end_station_longitude(self):
  57. return self._end_station_longitude
  58. @end_station_longitude.setter
  59. def end_station_longitude(self, value):
  60. self._end_station_longitude = value
  61. @property
  62. def end_station_name(self):
  63. return self._end_station_name
  64. @end_station_name.setter
  65. def end_station_name(self, value):
  66. self._end_station_name = value
  67. @property
  68. def end_station_province(self):
  69. return self._end_station_province
  70. @end_station_province.setter
  71. def end_station_province(self, value):
  72. self._end_station_province = value
  73. @property
  74. def end_time(self):
  75. return self._end_time
  76. @end_time.setter
  77. def end_time(self, value):
  78. self._end_time = value
  79. @property
  80. def lane_no(self):
  81. return self._lane_no
  82. @lane_no.setter
  83. def lane_no(self, value):
  84. self._lane_no = value
  85. @property
  86. def start_province_code(self):
  87. return self._start_province_code
  88. @start_province_code.setter
  89. def start_province_code(self, value):
  90. self._start_province_code = value
  91. @property
  92. def start_station_code(self):
  93. return self._start_station_code
  94. @start_station_code.setter
  95. def start_station_code(self, value):
  96. self._start_station_code = value
  97. @property
  98. def start_station_id(self):
  99. return self._start_station_id
  100. @start_station_id.setter
  101. def start_station_id(self, value):
  102. self._start_station_id = value
  103. @property
  104. def start_station_latitude(self):
  105. return self._start_station_latitude
  106. @start_station_latitude.setter
  107. def start_station_latitude(self, value):
  108. self._start_station_latitude = value
  109. @property
  110. def start_station_longitude(self):
  111. return self._start_station_longitude
  112. @start_station_longitude.setter
  113. def start_station_longitude(self, value):
  114. self._start_station_longitude = value
  115. @property
  116. def start_station_name(self):
  117. return self._start_station_name
  118. @start_station_name.setter
  119. def start_station_name(self, value):
  120. self._start_station_name = value
  121. @property
  122. def start_station_province(self):
  123. return self._start_station_province
  124. @start_station_province.setter
  125. def start_station_province(self, value):
  126. self._start_station_province = value
  127. @property
  128. def start_time(self):
  129. return self._start_time
  130. @start_time.setter
  131. def start_time(self, value):
  132. self._start_time = value
  133. def to_alipay_dict(self):
  134. params = dict()
  135. if self.car_type:
  136. if hasattr(self.car_type, 'to_alipay_dict'):
  137. params['car_type'] = self.car_type.to_alipay_dict()
  138. else:
  139. params['car_type'] = self.car_type
  140. if self.end_province_code:
  141. if hasattr(self.end_province_code, 'to_alipay_dict'):
  142. params['end_province_code'] = self.end_province_code.to_alipay_dict()
  143. else:
  144. params['end_province_code'] = self.end_province_code
  145. if self.end_station_code:
  146. if hasattr(self.end_station_code, 'to_alipay_dict'):
  147. params['end_station_code'] = self.end_station_code.to_alipay_dict()
  148. else:
  149. params['end_station_code'] = self.end_station_code
  150. if self.end_station_id:
  151. if hasattr(self.end_station_id, 'to_alipay_dict'):
  152. params['end_station_id'] = self.end_station_id.to_alipay_dict()
  153. else:
  154. params['end_station_id'] = self.end_station_id
  155. if self.end_station_latitude:
  156. if hasattr(self.end_station_latitude, 'to_alipay_dict'):
  157. params['end_station_latitude'] = self.end_station_latitude.to_alipay_dict()
  158. else:
  159. params['end_station_latitude'] = self.end_station_latitude
  160. if self.end_station_longitude:
  161. if hasattr(self.end_station_longitude, 'to_alipay_dict'):
  162. params['end_station_longitude'] = self.end_station_longitude.to_alipay_dict()
  163. else:
  164. params['end_station_longitude'] = self.end_station_longitude
  165. if self.end_station_name:
  166. if hasattr(self.end_station_name, 'to_alipay_dict'):
  167. params['end_station_name'] = self.end_station_name.to_alipay_dict()
  168. else:
  169. params['end_station_name'] = self.end_station_name
  170. if self.end_station_province:
  171. if hasattr(self.end_station_province, 'to_alipay_dict'):
  172. params['end_station_province'] = self.end_station_province.to_alipay_dict()
  173. else:
  174. params['end_station_province'] = self.end_station_province
  175. if self.end_time:
  176. if hasattr(self.end_time, 'to_alipay_dict'):
  177. params['end_time'] = self.end_time.to_alipay_dict()
  178. else:
  179. params['end_time'] = self.end_time
  180. if self.lane_no:
  181. if hasattr(self.lane_no, 'to_alipay_dict'):
  182. params['lane_no'] = self.lane_no.to_alipay_dict()
  183. else:
  184. params['lane_no'] = self.lane_no
  185. if self.start_province_code:
  186. if hasattr(self.start_province_code, 'to_alipay_dict'):
  187. params['start_province_code'] = self.start_province_code.to_alipay_dict()
  188. else:
  189. params['start_province_code'] = self.start_province_code
  190. if self.start_station_code:
  191. if hasattr(self.start_station_code, 'to_alipay_dict'):
  192. params['start_station_code'] = self.start_station_code.to_alipay_dict()
  193. else:
  194. params['start_station_code'] = self.start_station_code
  195. if self.start_station_id:
  196. if hasattr(self.start_station_id, 'to_alipay_dict'):
  197. params['start_station_id'] = self.start_station_id.to_alipay_dict()
  198. else:
  199. params['start_station_id'] = self.start_station_id
  200. if self.start_station_latitude:
  201. if hasattr(self.start_station_latitude, 'to_alipay_dict'):
  202. params['start_station_latitude'] = self.start_station_latitude.to_alipay_dict()
  203. else:
  204. params['start_station_latitude'] = self.start_station_latitude
  205. if self.start_station_longitude:
  206. if hasattr(self.start_station_longitude, 'to_alipay_dict'):
  207. params['start_station_longitude'] = self.start_station_longitude.to_alipay_dict()
  208. else:
  209. params['start_station_longitude'] = self.start_station_longitude
  210. if self.start_station_name:
  211. if hasattr(self.start_station_name, 'to_alipay_dict'):
  212. params['start_station_name'] = self.start_station_name.to_alipay_dict()
  213. else:
  214. params['start_station_name'] = self.start_station_name
  215. if self.start_station_province:
  216. if hasattr(self.start_station_province, 'to_alipay_dict'):
  217. params['start_station_province'] = self.start_station_province.to_alipay_dict()
  218. else:
  219. params['start_station_province'] = self.start_station_province
  220. if self.start_time:
  221. if hasattr(self.start_time, 'to_alipay_dict'):
  222. params['start_time'] = self.start_time.to_alipay_dict()
  223. else:
  224. params['start_time'] = self.start_time
  225. return params
  226. @staticmethod
  227. def from_alipay_dict(d):
  228. if not d:
  229. return None
  230. o = HighwaySceneData()
  231. if 'car_type' in d:
  232. o.car_type = d['car_type']
  233. if 'end_province_code' in d:
  234. o.end_province_code = d['end_province_code']
  235. if 'end_station_code' in d:
  236. o.end_station_code = d['end_station_code']
  237. if 'end_station_id' in d:
  238. o.end_station_id = d['end_station_id']
  239. if 'end_station_latitude' in d:
  240. o.end_station_latitude = d['end_station_latitude']
  241. if 'end_station_longitude' in d:
  242. o.end_station_longitude = d['end_station_longitude']
  243. if 'end_station_name' in d:
  244. o.end_station_name = d['end_station_name']
  245. if 'end_station_province' in d:
  246. o.end_station_province = d['end_station_province']
  247. if 'end_time' in d:
  248. o.end_time = d['end_time']
  249. if 'lane_no' in d:
  250. o.lane_no = d['lane_no']
  251. if 'start_province_code' in d:
  252. o.start_province_code = d['start_province_code']
  253. if 'start_station_code' in d:
  254. o.start_station_code = d['start_station_code']
  255. if 'start_station_id' in d:
  256. o.start_station_id = d['start_station_id']
  257. if 'start_station_latitude' in d:
  258. o.start_station_latitude = d['start_station_latitude']
  259. if 'start_station_longitude' in d:
  260. o.start_station_longitude = d['start_station_longitude']
  261. if 'start_station_name' in d:
  262. o.start_station_name = d['start_station_name']
  263. if 'start_station_province' in d:
  264. o.start_station_province = d['start_station_province']
  265. if 'start_time' in d:
  266. o.start_time = d['start_time']
  267. return o