structs_gen.go 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. package api
  2. // Code generated by go-bare/cmd/gen, DO NOT EDIT.
  3. import (
  4. "errors"
  5. "git.sr.ht/~sircmpwn/go-bare"
  6. )
  7. type LineResponseDev struct {
  8. Line LineV3 `bare:"line"`
  9. }
  10. func (t *LineResponseDev) Decode(data []byte) error {
  11. return bare.Unmarshal(data, t)
  12. }
  13. func (t *LineResponseDev) Encode() ([]byte, error) {
  14. return bare.Marshal(t)
  15. }
  16. type LineResponseV3 struct {
  17. Line LineV3 `bare:"line"`
  18. }
  19. func (t *LineResponseV3) Decode(data []byte) error {
  20. return bare.Unmarshal(data, t)
  21. }
  22. func (t *LineResponseV3) Encode() ([]byte, error) {
  23. return bare.Marshal(t)
  24. }
  25. type LineResponseV2 struct {
  26. Line LineV2 `bare:"line"`
  27. }
  28. func (t *LineResponseV2) Decode(data []byte) error {
  29. return bare.Unmarshal(data, t)
  30. }
  31. func (t *LineResponseV2) Encode() ([]byte, error) {
  32. return bare.Marshal(t)
  33. }
  34. type LineResponseV1 struct {
  35. Line LineV1 `bare:"line"`
  36. }
  37. func (t *LineResponseV1) Decode(data []byte) error {
  38. return bare.Unmarshal(data, t)
  39. }
  40. func (t *LineResponseV1) Encode() ([]byte, error) {
  41. return bare.Marshal(t)
  42. }
  43. type FeedsResponseDev struct {
  44. Feeds []FeedInfoV2 `bare:"feeds"`
  45. }
  46. func (t *FeedsResponseDev) Decode(data []byte) error {
  47. return bare.Unmarshal(data, t)
  48. }
  49. func (t *FeedsResponseDev) Encode() ([]byte, error) {
  50. return bare.Marshal(t)
  51. }
  52. type FeedsResponseV2 struct {
  53. Feeds []FeedInfoV2 `bare:"feeds"`
  54. }
  55. func (t *FeedsResponseV2) Decode(data []byte) error {
  56. return bare.Unmarshal(data, t)
  57. }
  58. func (t *FeedsResponseV2) Encode() ([]byte, error) {
  59. return bare.Marshal(t)
  60. }
  61. type FeedsResponseV1 struct {
  62. Feeds []FeedInfoV1 `bare:"feeds"`
  63. }
  64. func (t *FeedsResponseV1) Decode(data []byte) error {
  65. return bare.Unmarshal(data, t)
  66. }
  67. func (t *FeedsResponseV1) Encode() ([]byte, error) {
  68. return bare.Marshal(t)
  69. }
  70. type FeedInfoV1 struct {
  71. Name string `bare:"name"`
  72. Id string `bare:"id"`
  73. Attribution string `bare:"attribution"`
  74. Description string `bare:"description"`
  75. LastUpdate string `bare:"lastUpdate"`
  76. }
  77. func (t *FeedInfoV1) Decode(data []byte) error {
  78. return bare.Unmarshal(data, t)
  79. }
  80. func (t *FeedInfoV1) Encode() ([]byte, error) {
  81. return bare.Marshal(t)
  82. }
  83. type FeedInfoV2 struct {
  84. Name string `bare:"name"`
  85. Id string `bare:"id"`
  86. Attribution string `bare:"attribution"`
  87. Description string `bare:"description"`
  88. LastUpdate string `bare:"lastUpdate"`
  89. QrHost string `bare:"qrHost"`
  90. QrIn QRLocationV1 `bare:"qrIn"`
  91. QrSelector string `bare:"qrSelector"`
  92. ValidSince string `bare:"validSince"`
  93. ValidTill string `bare:"validTill"`
  94. }
  95. func (t *FeedInfoV2) Decode(data []byte) error {
  96. return bare.Unmarshal(data, t)
  97. }
  98. func (t *FeedInfoV2) Encode() ([]byte, error) {
  99. return bare.Marshal(t)
  100. }
  101. type QueryablesResponseDev struct {
  102. Queryables []QueryableV4 `bare:"queryables"`
  103. }
  104. func (t *QueryablesResponseDev) Decode(data []byte) error {
  105. return bare.Unmarshal(data, t)
  106. }
  107. func (t *QueryablesResponseDev) Encode() ([]byte, error) {
  108. return bare.Marshal(t)
  109. }
  110. type QueryablesResponseV4 struct {
  111. Queryables []QueryableV4 `bare:"queryables"`
  112. }
  113. func (t *QueryablesResponseV4) Decode(data []byte) error {
  114. return bare.Unmarshal(data, t)
  115. }
  116. func (t *QueryablesResponseV4) Encode() ([]byte, error) {
  117. return bare.Marshal(t)
  118. }
  119. type QueryablesResponseV3 struct {
  120. Queryables []QueryableV3 `bare:"queryables"`
  121. }
  122. func (t *QueryablesResponseV3) Decode(data []byte) error {
  123. return bare.Unmarshal(data, t)
  124. }
  125. func (t *QueryablesResponseV3) Encode() ([]byte, error) {
  126. return bare.Marshal(t)
  127. }
  128. type QueryablesResponseV2 struct {
  129. Queryables []QueryableV2 `bare:"queryables"`
  130. }
  131. func (t *QueryablesResponseV2) Decode(data []byte) error {
  132. return bare.Unmarshal(data, t)
  133. }
  134. func (t *QueryablesResponseV2) Encode() ([]byte, error) {
  135. return bare.Marshal(t)
  136. }
  137. type QueryablesResponseV1 struct {
  138. Queryables []QueryableV1 `bare:"queryables"`
  139. }
  140. func (t *QueryablesResponseV1) Decode(data []byte) error {
  141. return bare.Unmarshal(data, t)
  142. }
  143. func (t *QueryablesResponseV1) Encode() ([]byte, error) {
  144. return bare.Marshal(t)
  145. }
  146. type StopV1 struct {
  147. Code string `bare:"code"`
  148. Name string `bare:"name"`
  149. Zone string `bare:"zone"`
  150. Position PositionV1 `bare:"position"`
  151. ChangeOptions []ChangeOptionV1 `bare:"changeOptions"`
  152. }
  153. func (t *StopV1) Decode(data []byte) error {
  154. return bare.Unmarshal(data, t)
  155. }
  156. func (t *StopV1) Encode() ([]byte, error) {
  157. return bare.Marshal(t)
  158. }
  159. type StopV2 struct {
  160. Code string `bare:"code"`
  161. Name string `bare:"name"`
  162. NodeName string `bare:"nodeName"`
  163. Zone string `bare:"zone"`
  164. FeedID string `bare:"feedID"`
  165. Position PositionV1 `bare:"position"`
  166. ChangeOptions []ChangeOptionV1 `bare:"changeOptions"`
  167. }
  168. func (t *StopV2) Decode(data []byte) error {
  169. return bare.Unmarshal(data, t)
  170. }
  171. func (t *StopV2) Encode() ([]byte, error) {
  172. return bare.Marshal(t)
  173. }
  174. type LineV1 struct {
  175. Name string `bare:"name"`
  176. Colour ColourV1 `bare:"colour"`
  177. Kind LineTypeV2 `bare:"kind"`
  178. FeedID string `bare:"feedID"`
  179. Headsigns [][]string `bare:"headsigns"`
  180. Graphs []LineGraphV1 `bare:"graphs"`
  181. }
  182. func (t *LineV1) Decode(data []byte) error {
  183. return bare.Unmarshal(data, t)
  184. }
  185. func (t *LineV1) Encode() ([]byte, error) {
  186. return bare.Marshal(t)
  187. }
  188. type LineV2 struct {
  189. Name string `bare:"name"`
  190. Colour ColourV1 `bare:"colour"`
  191. Kind LineTypeV3 `bare:"kind"`
  192. FeedID string `bare:"feedID"`
  193. Headsigns [][]string `bare:"headsigns"`
  194. Graphs []LineGraphV1 `bare:"graphs"`
  195. }
  196. func (t *LineV2) Decode(data []byte) error {
  197. return bare.Unmarshal(data, t)
  198. }
  199. func (t *LineV2) Encode() ([]byte, error) {
  200. return bare.Marshal(t)
  201. }
  202. type LineV3 struct {
  203. Id string `bare:"id"`
  204. Name string `bare:"name"`
  205. Colour ColourV1 `bare:"colour"`
  206. Kind LineTypeV3 `bare:"kind"`
  207. FeedID string `bare:"feedID"`
  208. Headsigns [][]string `bare:"headsigns"`
  209. Graphs []LineGraphV1 `bare:"graphs"`
  210. }
  211. func (t *LineV3) Decode(data []byte) error {
  212. return bare.Unmarshal(data, t)
  213. }
  214. func (t *LineV3) Encode() ([]byte, error) {
  215. return bare.Marshal(t)
  216. }
  217. type LineGraphV1 struct {
  218. Stops []StopStubV1 `bare:"stops"`
  219. NextNodes map[int][]int `bare:"nextNodes"`
  220. }
  221. func (t *LineGraphV1) Decode(data []byte) error {
  222. return bare.Unmarshal(data, t)
  223. }
  224. func (t *LineGraphV1) Encode() ([]byte, error) {
  225. return bare.Marshal(t)
  226. }
  227. type StopStubV1 struct {
  228. Code string `bare:"code"`
  229. Name string `bare:"name"`
  230. NodeName string `bare:"nodeName"`
  231. Zone string `bare:"zone"`
  232. OnDemand bool `bare:"onDemand"`
  233. }
  234. func (t *StopStubV1) Decode(data []byte) error {
  235. return bare.Unmarshal(data, t)
  236. }
  237. func (t *StopStubV1) Encode() ([]byte, error) {
  238. return bare.Marshal(t)
  239. }
  240. type PositionV1 struct {
  241. Lat float64 `bare:"lat"`
  242. Lon float64 `bare:"lon"`
  243. }
  244. func (t *PositionV1) Decode(data []byte) error {
  245. return bare.Unmarshal(data, t)
  246. }
  247. func (t *PositionV1) Encode() ([]byte, error) {
  248. return bare.Marshal(t)
  249. }
  250. type ChangeOptionV1 struct {
  251. LineName string `bare:"lineName"`
  252. Headsign string `bare:"headsign"`
  253. }
  254. func (t *ChangeOptionV1) Decode(data []byte) error {
  255. return bare.Unmarshal(data, t)
  256. }
  257. func (t *ChangeOptionV1) Encode() ([]byte, error) {
  258. return bare.Marshal(t)
  259. }
  260. type LocatablesResponseDev struct {
  261. Locatables []LocatableV3 `bare:"locatables"`
  262. }
  263. func (t *LocatablesResponseDev) Decode(data []byte) error {
  264. return bare.Unmarshal(data, t)
  265. }
  266. func (t *LocatablesResponseDev) Encode() ([]byte, error) {
  267. return bare.Marshal(t)
  268. }
  269. type LocatablesResponseV3 struct {
  270. Locatables []LocatableV3 `bare:"locatables"`
  271. }
  272. func (t *LocatablesResponseV3) Decode(data []byte) error {
  273. return bare.Unmarshal(data, t)
  274. }
  275. func (t *LocatablesResponseV3) Encode() ([]byte, error) {
  276. return bare.Marshal(t)
  277. }
  278. type LocatablesResponseV2 struct {
  279. Locatables []LocatableV2 `bare:"locatables"`
  280. }
  281. func (t *LocatablesResponseV2) Decode(data []byte) error {
  282. return bare.Unmarshal(data, t)
  283. }
  284. func (t *LocatablesResponseV2) Encode() ([]byte, error) {
  285. return bare.Marshal(t)
  286. }
  287. type LocatablesResponseV1 struct {
  288. Locatables []LocatableV1 `bare:"locatables"`
  289. }
  290. func (t *LocatablesResponseV1) Decode(data []byte) error {
  291. return bare.Unmarshal(data, t)
  292. }
  293. func (t *LocatablesResponseV1) Encode() ([]byte, error) {
  294. return bare.Marshal(t)
  295. }
  296. type VehicleV1 struct {
  297. Id string `bare:"id"`
  298. Position PositionV1 `bare:"position"`
  299. Capabilities uint16 `bare:"capabilities"`
  300. Speed float32 `bare:"speed"`
  301. Line LineStubV1 `bare:"line"`
  302. Headsign string `bare:"headsign"`
  303. CongestionLevel CongestionLevelV1 `bare:"congestionLevel"`
  304. OccupancyStatus OccupancyStatusV1 `bare:"occupancyStatus"`
  305. }
  306. func (t *VehicleV1) Decode(data []byte) error {
  307. return bare.Unmarshal(data, t)
  308. }
  309. func (t *VehicleV1) Encode() ([]byte, error) {
  310. return bare.Marshal(t)
  311. }
  312. type VehicleV2 struct {
  313. Id string `bare:"id"`
  314. Position PositionV1 `bare:"position"`
  315. Capabilities uint16 `bare:"capabilities"`
  316. Speed float32 `bare:"speed"`
  317. Line LineStubV2 `bare:"line"`
  318. Headsign string `bare:"headsign"`
  319. CongestionLevel CongestionLevelV1 `bare:"congestionLevel"`
  320. OccupancyStatus OccupancyStatusV1 `bare:"occupancyStatus"`
  321. }
  322. func (t *VehicleV2) Decode(data []byte) error {
  323. return bare.Unmarshal(data, t)
  324. }
  325. func (t *VehicleV2) Encode() ([]byte, error) {
  326. return bare.Marshal(t)
  327. }
  328. type VehicleV3 struct {
  329. Id string `bare:"id"`
  330. Position PositionV1 `bare:"position"`
  331. Capabilities uint16 `bare:"capabilities"`
  332. Speed float32 `bare:"speed"`
  333. Line LineStubV3 `bare:"line"`
  334. Headsign string `bare:"headsign"`
  335. CongestionLevel CongestionLevelV1 `bare:"congestionLevel"`
  336. OccupancyStatus OccupancyStatusV1 `bare:"occupancyStatus"`
  337. }
  338. func (t *VehicleV3) Decode(data []byte) error {
  339. return bare.Unmarshal(data, t)
  340. }
  341. func (t *VehicleV3) Encode() ([]byte, error) {
  342. return bare.Marshal(t)
  343. }
  344. type LineStubV1 struct {
  345. Name string `bare:"name"`
  346. Kind LineTypeV1 `bare:"kind"`
  347. Colour ColourV1 `bare:"colour"`
  348. }
  349. func (t *LineStubV1) Decode(data []byte) error {
  350. return bare.Unmarshal(data, t)
  351. }
  352. func (t *LineStubV1) Encode() ([]byte, error) {
  353. return bare.Marshal(t)
  354. }
  355. type LineStubV2 struct {
  356. Name string `bare:"name"`
  357. Kind LineTypeV2 `bare:"kind"`
  358. Colour ColourV1 `bare:"colour"`
  359. }
  360. func (t *LineStubV2) Decode(data []byte) error {
  361. return bare.Unmarshal(data, t)
  362. }
  363. func (t *LineStubV2) Encode() ([]byte, error) {
  364. return bare.Marshal(t)
  365. }
  366. type LineStubV3 struct {
  367. Name string `bare:"name"`
  368. Kind LineTypeV3 `bare:"kind"`
  369. Colour ColourV1 `bare:"colour"`
  370. }
  371. func (t *LineStubV3) Decode(data []byte) error {
  372. return bare.Unmarshal(data, t)
  373. }
  374. func (t *LineStubV3) Encode() ([]byte, error) {
  375. return bare.Marshal(t)
  376. }
  377. type ColourV1 struct {
  378. R uint8 `bare:"r"`
  379. G uint8 `bare:"g"`
  380. B uint8 `bare:"b"`
  381. }
  382. func (t *ColourV1) Decode(data []byte) error {
  383. return bare.Unmarshal(data, t)
  384. }
  385. func (t *ColourV1) Encode() ([]byte, error) {
  386. return bare.Marshal(t)
  387. }
  388. type DeparturesResponseDev struct {
  389. Alerts []AlertV1 `bare:"alerts"`
  390. Departures []DepartureV4 `bare:"departures"`
  391. Stop StopV2 `bare:"stop"`
  392. }
  393. func (t *DeparturesResponseDev) Decode(data []byte) error {
  394. return bare.Unmarshal(data, t)
  395. }
  396. func (t *DeparturesResponseDev) Encode() ([]byte, error) {
  397. return bare.Marshal(t)
  398. }
  399. type DeparturesResponseV4 struct {
  400. Alerts []AlertV1 `bare:"alerts"`
  401. Departures []DepartureV4 `bare:"departures"`
  402. Stop StopV2 `bare:"stop"`
  403. }
  404. func (t *DeparturesResponseV4) Decode(data []byte) error {
  405. return bare.Unmarshal(data, t)
  406. }
  407. func (t *DeparturesResponseV4) Encode() ([]byte, error) {
  408. return bare.Marshal(t)
  409. }
  410. type DeparturesResponseV3 struct {
  411. Alerts []AlertV1 `bare:"alerts"`
  412. Departures []DepartureV3 `bare:"departures"`
  413. Stop StopV2 `bare:"stop"`
  414. }
  415. func (t *DeparturesResponseV3) Decode(data []byte) error {
  416. return bare.Unmarshal(data, t)
  417. }
  418. func (t *DeparturesResponseV3) Encode() ([]byte, error) {
  419. return bare.Marshal(t)
  420. }
  421. type DeparturesResponseV2 struct {
  422. Alerts []AlertV1 `bare:"alerts"`
  423. Departures []DepartureV2 `bare:"departures"`
  424. Stop StopV2 `bare:"stop"`
  425. }
  426. func (t *DeparturesResponseV2) Decode(data []byte) error {
  427. return bare.Unmarshal(data, t)
  428. }
  429. func (t *DeparturesResponseV2) Encode() ([]byte, error) {
  430. return bare.Marshal(t)
  431. }
  432. type DeparturesResponseV1 struct {
  433. Alerts []AlertV1 `bare:"alerts"`
  434. Departures []DepartureV1 `bare:"departures"`
  435. Stop StopV1 `bare:"stop"`
  436. }
  437. func (t *DeparturesResponseV1) Decode(data []byte) error {
  438. return bare.Unmarshal(data, t)
  439. }
  440. func (t *DeparturesResponseV1) Encode() ([]byte, error) {
  441. return bare.Marshal(t)
  442. }
  443. type AlertV1 struct {
  444. Header string `bare:"header"`
  445. Description string `bare:"description"`
  446. Url string `bare:"url"`
  447. Cause AlertCauseV1 `bare:"cause"`
  448. Effect AlertEffectV1 `bare:"effect"`
  449. }
  450. func (t *AlertV1) Decode(data []byte) error {
  451. return bare.Unmarshal(data, t)
  452. }
  453. func (t *AlertV1) Encode() ([]byte, error) {
  454. return bare.Marshal(t)
  455. }
  456. type DepartureV1 struct {
  457. Id string `bare:"id"`
  458. Time TimeV1 `bare:"time"`
  459. Status VehicleStatusV1 `bare:"status"`
  460. IsRealtime bool `bare:"isRealtime"`
  461. Vehicle VehicleV1 `bare:"vehicle"`
  462. Boarding uint8 `bare:"boarding"`
  463. }
  464. func (t *DepartureV1) Decode(data []byte) error {
  465. return bare.Unmarshal(data, t)
  466. }
  467. func (t *DepartureV1) Encode() ([]byte, error) {
  468. return bare.Marshal(t)
  469. }
  470. type DepartureV2 struct {
  471. Id string `bare:"id"`
  472. Time TimeV1 `bare:"time"`
  473. Status VehicleStatusV1 `bare:"status"`
  474. IsRealtime bool `bare:"isRealtime"`
  475. Vehicle VehicleV2 `bare:"vehicle"`
  476. Boarding uint8 `bare:"boarding"`
  477. }
  478. func (t *DepartureV2) Decode(data []byte) error {
  479. return bare.Unmarshal(data, t)
  480. }
  481. func (t *DepartureV2) Encode() ([]byte, error) {
  482. return bare.Marshal(t)
  483. }
  484. type DepartureV3 struct {
  485. Id string `bare:"id"`
  486. Time TimeV1 `bare:"time"`
  487. Status VehicleStatusV1 `bare:"status"`
  488. IsRealtime bool `bare:"isRealtime"`
  489. Vehicle VehicleV3 `bare:"vehicle"`
  490. Boarding uint8 `bare:"boarding"`
  491. }
  492. func (t *DepartureV3) Decode(data []byte) error {
  493. return bare.Unmarshal(data, t)
  494. }
  495. func (t *DepartureV3) Encode() ([]byte, error) {
  496. return bare.Marshal(t)
  497. }
  498. type DepartureV4 struct {
  499. Id string `bare:"id"`
  500. Time TimeV1 `bare:"time"`
  501. Status VehicleStatusV1 `bare:"status"`
  502. IsRealtime bool `bare:"isRealtime"`
  503. Vehicle VehicleV3 `bare:"vehicle"`
  504. Boarding uint8 `bare:"boarding"`
  505. Alerts []AlertV1 `bare:"alerts"`
  506. }
  507. func (t *DepartureV4) Decode(data []byte) error {
  508. return bare.Unmarshal(data, t)
  509. }
  510. func (t *DepartureV4) Encode() ([]byte, error) {
  511. return bare.Marshal(t)
  512. }
  513. type TimeV1 struct {
  514. Hour uint8 `bare:"hour"`
  515. Minute uint8 `bare:"minute"`
  516. Second uint8 `bare:"second"`
  517. DayOffset int8 `bare:"dayOffset"`
  518. Zone string `bare:"zone"`
  519. }
  520. func (t *TimeV1) Decode(data []byte) error {
  521. return bare.Unmarshal(data, t)
  522. }
  523. func (t *TimeV1) Encode() ([]byte, error) {
  524. return bare.Marshal(t)
  525. }
  526. type ErrorResponse struct {
  527. Field string `bare:"field"`
  528. Message string `bare:"message"`
  529. }
  530. func (t *ErrorResponse) Decode(data []byte) error {
  531. return bare.Unmarshal(data, t)
  532. }
  533. func (t *ErrorResponse) Encode() ([]byte, error) {
  534. return bare.Marshal(t)
  535. }
  536. type QRLocationV1 uint
  537. const (
  538. UNKNOWN QRLocationV1 = 0
  539. NONE QRLocationV1 = 1
  540. PATH QRLocationV1 = 2
  541. QUERY QRLocationV1 = 3
  542. )
  543. func (t QRLocationV1) String() string {
  544. switch t {
  545. case UNKNOWN:
  546. return "UNKNOWN"
  547. case NONE:
  548. return "NONE"
  549. case PATH:
  550. return "PATH"
  551. case QUERY:
  552. return "QUERY"
  553. }
  554. panic(errors.New("Invalid QRLocationV1 value"))
  555. }
  556. type CongestionLevelV1 uint
  557. const (
  558. CONGESTION_UNKNOWN CongestionLevelV1 = 0
  559. CONGESTION_SMOOTH CongestionLevelV1 = 1
  560. CONGESTION_STOP_AND_GO CongestionLevelV1 = 2
  561. CONGESTION_SIGNIFICANT CongestionLevelV1 = 3
  562. CONGESTION_SEVERE CongestionLevelV1 = 4
  563. )
  564. func (t CongestionLevelV1) String() string {
  565. switch t {
  566. case CONGESTION_UNKNOWN:
  567. return "CONGESTION_UNKNOWN"
  568. case CONGESTION_SMOOTH:
  569. return "CONGESTION_SMOOTH"
  570. case CONGESTION_STOP_AND_GO:
  571. return "CONGESTION_STOP_AND_GO"
  572. case CONGESTION_SIGNIFICANT:
  573. return "CONGESTION_SIGNIFICANT"
  574. case CONGESTION_SEVERE:
  575. return "CONGESTION_SEVERE"
  576. }
  577. panic(errors.New("Invalid CongestionLevelV1 value"))
  578. }
  579. type OccupancyStatusV1 uint
  580. const (
  581. OCCUPANCY_UNKNOWN OccupancyStatusV1 = 0
  582. OCCUPANCY_EMPTY OccupancyStatusV1 = 1
  583. OCCUPANCY_MANY_AVAILABLE OccupancyStatusV1 = 2
  584. OCCUPANCY_FEW_AVAILABLE OccupancyStatusV1 = 3
  585. OCCUPANCY_STANDING_ONLY OccupancyStatusV1 = 4
  586. OCCUPANCY_CRUSHED OccupancyStatusV1 = 5
  587. OCCUPANCY_FULL OccupancyStatusV1 = 6
  588. OCCUPANCY_NOT_ACCEPTING OccupancyStatusV1 = 7
  589. )
  590. func (t OccupancyStatusV1) String() string {
  591. switch t {
  592. case OCCUPANCY_UNKNOWN:
  593. return "OCCUPANCY_UNKNOWN"
  594. case OCCUPANCY_EMPTY:
  595. return "OCCUPANCY_EMPTY"
  596. case OCCUPANCY_MANY_AVAILABLE:
  597. return "OCCUPANCY_MANY_AVAILABLE"
  598. case OCCUPANCY_FEW_AVAILABLE:
  599. return "OCCUPANCY_FEW_AVAILABLE"
  600. case OCCUPANCY_STANDING_ONLY:
  601. return "OCCUPANCY_STANDING_ONLY"
  602. case OCCUPANCY_CRUSHED:
  603. return "OCCUPANCY_CRUSHED"
  604. case OCCUPANCY_FULL:
  605. return "OCCUPANCY_FULL"
  606. case OCCUPANCY_NOT_ACCEPTING:
  607. return "OCCUPANCY_NOT_ACCEPTING"
  608. }
  609. panic(errors.New("Invalid OccupancyStatusV1 value"))
  610. }
  611. type LineTypeV1 uint
  612. const (
  613. LINE_UNKNOWN LineTypeV1 = 0
  614. TRAM LineTypeV1 = 1
  615. BUS LineTypeV1 = 2
  616. )
  617. func (t LineTypeV1) String() string {
  618. switch t {
  619. case LINE_UNKNOWN:
  620. return "LINE_UNKNOWN"
  621. case TRAM:
  622. return "TRAM"
  623. case BUS:
  624. return "BUS"
  625. }
  626. panic(errors.New("Invalid LineTypeV1 value"))
  627. }
  628. type LineTypeV2 uint
  629. const (
  630. LINE_V2_UNKNOWN LineTypeV2 = 0
  631. LINE_V2_TRAM LineTypeV2 = 1
  632. LINE_V2_BUS LineTypeV2 = 2
  633. LINE_V2_TROLLEYBUS LineTypeV2 = 3
  634. )
  635. func (t LineTypeV2) String() string {
  636. switch t {
  637. case LINE_V2_UNKNOWN:
  638. return "LINE_V2_UNKNOWN"
  639. case LINE_V2_TRAM:
  640. return "LINE_V2_TRAM"
  641. case LINE_V2_BUS:
  642. return "LINE_V2_BUS"
  643. case LINE_V2_TROLLEYBUS:
  644. return "LINE_V2_TROLLEYBUS"
  645. }
  646. panic(errors.New("Invalid LineTypeV2 value"))
  647. }
  648. type LineTypeV3 uint
  649. const (
  650. LINE_V3_UNKNOWN LineTypeV3 = 0
  651. LINE_V3_TRAM LineTypeV3 = 1
  652. LINE_V3_BUS LineTypeV3 = 2
  653. LINE_V3_TROLLEYBUS LineTypeV3 = 3
  654. LINE_V3_METRO LineTypeV3 = 4
  655. LINE_V3_RAIL LineTypeV3 = 5
  656. LINE_V3_FERRY LineTypeV3 = 6
  657. LINE_V3_CABLE_TRAM LineTypeV3 = 7
  658. LINE_V3_CABLE_CAR LineTypeV3 = 8
  659. LINE_V3_FUNICULAR LineTypeV3 = 9
  660. LINE_V3_MONORAIL LineTypeV3 = 10
  661. )
  662. func (t LineTypeV3) String() string {
  663. switch t {
  664. case LINE_V3_UNKNOWN:
  665. return "LINE_V3_UNKNOWN"
  666. case LINE_V3_TRAM:
  667. return "LINE_V3_TRAM"
  668. case LINE_V3_BUS:
  669. return "LINE_V3_BUS"
  670. case LINE_V3_TROLLEYBUS:
  671. return "LINE_V3_TROLLEYBUS"
  672. case LINE_V3_METRO:
  673. return "LINE_V3_METRO"
  674. case LINE_V3_RAIL:
  675. return "LINE_V3_RAIL"
  676. case LINE_V3_FERRY:
  677. return "LINE_V3_FERRY"
  678. case LINE_V3_CABLE_TRAM:
  679. return "LINE_V3_CABLE_TRAM"
  680. case LINE_V3_CABLE_CAR:
  681. return "LINE_V3_CABLE_CAR"
  682. case LINE_V3_FUNICULAR:
  683. return "LINE_V3_FUNICULAR"
  684. case LINE_V3_MONORAIL:
  685. return "LINE_V3_MONORAIL"
  686. }
  687. panic(errors.New("Invalid LineTypeV3 value"))
  688. }
  689. type AlertCauseV1 uint
  690. const (
  691. CAUSE_UNKNOWN AlertCauseV1 = 0
  692. CAUSE_OTHER AlertCauseV1 = 1
  693. CAUSE_TECHNICAL_PROBLEM AlertCauseV1 = 2
  694. CAUSE_STRIKE AlertCauseV1 = 3
  695. CAUSE_DEMONSTRATION AlertCauseV1 = 4
  696. CAUSE_ACCIDENT AlertCauseV1 = 5
  697. CAUSE_HOLIDAY AlertCauseV1 = 6
  698. CAUSE_WEATHER AlertCauseV1 = 7
  699. CAUSE_MAINTENANCE AlertCauseV1 = 8
  700. CAUSE_CONSTRUCTION AlertCauseV1 = 9
  701. CAUSE_POLICE_ACTIVITY AlertCauseV1 = 10
  702. CAUSE_MEDICAL_EMERGENCY AlertCauseV1 = 11
  703. )
  704. func (t AlertCauseV1) String() string {
  705. switch t {
  706. case CAUSE_UNKNOWN:
  707. return "CAUSE_UNKNOWN"
  708. case CAUSE_OTHER:
  709. return "CAUSE_OTHER"
  710. case CAUSE_TECHNICAL_PROBLEM:
  711. return "CAUSE_TECHNICAL_PROBLEM"
  712. case CAUSE_STRIKE:
  713. return "CAUSE_STRIKE"
  714. case CAUSE_DEMONSTRATION:
  715. return "CAUSE_DEMONSTRATION"
  716. case CAUSE_ACCIDENT:
  717. return "CAUSE_ACCIDENT"
  718. case CAUSE_HOLIDAY:
  719. return "CAUSE_HOLIDAY"
  720. case CAUSE_WEATHER:
  721. return "CAUSE_WEATHER"
  722. case CAUSE_MAINTENANCE:
  723. return "CAUSE_MAINTENANCE"
  724. case CAUSE_CONSTRUCTION:
  725. return "CAUSE_CONSTRUCTION"
  726. case CAUSE_POLICE_ACTIVITY:
  727. return "CAUSE_POLICE_ACTIVITY"
  728. case CAUSE_MEDICAL_EMERGENCY:
  729. return "CAUSE_MEDICAL_EMERGENCY"
  730. }
  731. panic(errors.New("Invalid AlertCauseV1 value"))
  732. }
  733. type AlertEffectV1 uint
  734. const (
  735. EFFECT_UNKNOWN AlertEffectV1 = 0
  736. EFFECT_OTHER AlertEffectV1 = 1
  737. EFFECT_NO_SERVICE AlertEffectV1 = 2
  738. EFFECT_REDUCED_SERVICE AlertEffectV1 = 3
  739. EFFECT_SIGNIFICANT_DELAYS AlertEffectV1 = 4
  740. EFFECT_DETOUR AlertEffectV1 = 5
  741. EFFECT_ADDITIONAL_SERVICE AlertEffectV1 = 6
  742. EFFECT_MODIFIED_SERVICE AlertEffectV1 = 7
  743. EFFECT_STOP_MOVED AlertEffectV1 = 8
  744. EFFECT_NONE AlertEffectV1 = 9
  745. EFFECT_ACCESSIBILITY_ISSUE AlertEffectV1 = 10
  746. )
  747. func (t AlertEffectV1) String() string {
  748. switch t {
  749. case EFFECT_UNKNOWN:
  750. return "EFFECT_UNKNOWN"
  751. case EFFECT_OTHER:
  752. return "EFFECT_OTHER"
  753. case EFFECT_NO_SERVICE:
  754. return "EFFECT_NO_SERVICE"
  755. case EFFECT_REDUCED_SERVICE:
  756. return "EFFECT_REDUCED_SERVICE"
  757. case EFFECT_SIGNIFICANT_DELAYS:
  758. return "EFFECT_SIGNIFICANT_DELAYS"
  759. case EFFECT_DETOUR:
  760. return "EFFECT_DETOUR"
  761. case EFFECT_ADDITIONAL_SERVICE:
  762. return "EFFECT_ADDITIONAL_SERVICE"
  763. case EFFECT_MODIFIED_SERVICE:
  764. return "EFFECT_MODIFIED_SERVICE"
  765. case EFFECT_STOP_MOVED:
  766. return "EFFECT_STOP_MOVED"
  767. case EFFECT_NONE:
  768. return "EFFECT_NONE"
  769. case EFFECT_ACCESSIBILITY_ISSUE:
  770. return "EFFECT_ACCESSIBILITY_ISSUE"
  771. }
  772. panic(errors.New("Invalid AlertEffectV1 value"))
  773. }
  774. type VehicleStatusV1 uint
  775. const (
  776. STATUS_IN_TRANSIT VehicleStatusV1 = 0
  777. STATUS_INCOMING VehicleStatusV1 = 1
  778. STATUS_AT_STOP VehicleStatusV1 = 2
  779. STATUS_DEPARTED VehicleStatusV1 = 3
  780. )
  781. func (t VehicleStatusV1) String() string {
  782. switch t {
  783. case STATUS_IN_TRANSIT:
  784. return "STATUS_IN_TRANSIT"
  785. case STATUS_INCOMING:
  786. return "STATUS_INCOMING"
  787. case STATUS_AT_STOP:
  788. return "STATUS_AT_STOP"
  789. case STATUS_DEPARTED:
  790. return "STATUS_DEPARTED"
  791. }
  792. panic(errors.New("Invalid VehicleStatusV1 value"))
  793. }
  794. type BoardingV1 uint
  795. const (
  796. BOARDING_NONE BoardingV1 = 0
  797. ONBOARDING_REGULAR BoardingV1 = 1
  798. ONBOARDING_PHONE BoardingV1 = 2
  799. ONBOARDING_DRIVER BoardingV1 = 3
  800. OFFBOARDING_REGULAR BoardingV1 = 16
  801. OFFBOARDING_PHONE BoardingV1 = 32
  802. OFFBOARDING_DRIVER BoardingV1 = 48
  803. )
  804. func (t BoardingV1) String() string {
  805. switch t {
  806. case BOARDING_NONE:
  807. return "BOARDING_NONE"
  808. case ONBOARDING_REGULAR:
  809. return "ONBOARDING_REGULAR"
  810. case ONBOARDING_PHONE:
  811. return "ONBOARDING_PHONE"
  812. case ONBOARDING_DRIVER:
  813. return "ONBOARDING_DRIVER"
  814. case OFFBOARDING_REGULAR:
  815. return "OFFBOARDING_REGULAR"
  816. case OFFBOARDING_PHONE:
  817. return "OFFBOARDING_PHONE"
  818. case OFFBOARDING_DRIVER:
  819. return "OFFBOARDING_DRIVER"
  820. }
  821. panic(errors.New("Invalid BoardingV1 value"))
  822. }
  823. type LineResponse interface {
  824. bare.Union
  825. }
  826. func (_ LineResponseDev) IsUnion() {}
  827. func (_ LineResponseV1) IsUnion() {}
  828. func (_ LineResponseV2) IsUnion() {}
  829. func (_ LineResponseV3) IsUnion() {}
  830. type FeedsResponse interface {
  831. bare.Union
  832. }
  833. func (_ FeedsResponseDev) IsUnion() {}
  834. func (_ FeedsResponseV1) IsUnion() {}
  835. func (_ FeedsResponseV2) IsUnion() {}
  836. type QueryablesResponse interface {
  837. bare.Union
  838. }
  839. func (_ QueryablesResponseDev) IsUnion() {}
  840. func (_ QueryablesResponseV1) IsUnion() {}
  841. func (_ QueryablesResponseV2) IsUnion() {}
  842. func (_ QueryablesResponseV3) IsUnion() {}
  843. func (_ QueryablesResponseV4) IsUnion() {}
  844. type QueryableV1 interface {
  845. bare.Union
  846. }
  847. func (_ StopV1) IsUnion() {}
  848. type QueryableV2 interface {
  849. bare.Union
  850. }
  851. func (_ StopV2) IsUnion() {}
  852. func (_ LineV1) IsUnion() {}
  853. type QueryableV3 interface {
  854. bare.Union
  855. }
  856. func (_ LineV2) IsUnion() {}
  857. type QueryableV4 interface {
  858. bare.Union
  859. }
  860. func (_ LineV3) IsUnion() {}
  861. type LocatablesResponse interface {
  862. bare.Union
  863. }
  864. func (_ LocatablesResponseDev) IsUnion() {}
  865. func (_ LocatablesResponseV1) IsUnion() {}
  866. func (_ LocatablesResponseV2) IsUnion() {}
  867. func (_ LocatablesResponseV3) IsUnion() {}
  868. type LocatableV1 interface {
  869. bare.Union
  870. }
  871. func (_ VehicleV1) IsUnion() {}
  872. type LocatableV2 interface {
  873. bare.Union
  874. }
  875. func (_ VehicleV2) IsUnion() {}
  876. type LocatableV3 interface {
  877. bare.Union
  878. }
  879. func (_ VehicleV3) IsUnion() {}
  880. type DeparturesResponse interface {
  881. bare.Union
  882. }
  883. func (_ DeparturesResponseDev) IsUnion() {}
  884. func (_ DeparturesResponseV1) IsUnion() {}
  885. func (_ DeparturesResponseV2) IsUnion() {}
  886. func (_ DeparturesResponseV3) IsUnion() {}
  887. func (_ DeparturesResponseV4) IsUnion() {}
  888. func init() {
  889. bare.RegisterUnion((*LineResponse)(nil)).
  890. Member(*new(LineResponseDev), 0).
  891. Member(*new(LineResponseV1), 1).
  892. Member(*new(LineResponseV2), 2).
  893. Member(*new(LineResponseV3), 3)
  894. bare.RegisterUnion((*FeedsResponse)(nil)).
  895. Member(*new(FeedsResponseDev), 0).
  896. Member(*new(FeedsResponseV1), 1).
  897. Member(*new(FeedsResponseV2), 2)
  898. bare.RegisterUnion((*QueryablesResponse)(nil)).
  899. Member(*new(QueryablesResponseDev), 0).
  900. Member(*new(QueryablesResponseV1), 1).
  901. Member(*new(QueryablesResponseV2), 2).
  902. Member(*new(QueryablesResponseV3), 3).
  903. Member(*new(QueryablesResponseV4), 4)
  904. bare.RegisterUnion((*QueryableV1)(nil)).
  905. Member(*new(StopV1), 0)
  906. bare.RegisterUnion((*QueryableV2)(nil)).
  907. Member(*new(StopV2), 0).
  908. Member(*new(LineV1), 1)
  909. bare.RegisterUnion((*QueryableV3)(nil)).
  910. Member(*new(StopV2), 0).
  911. Member(*new(LineV2), 1)
  912. bare.RegisterUnion((*QueryableV4)(nil)).
  913. Member(*new(StopV2), 0).
  914. Member(*new(LineV3), 1)
  915. bare.RegisterUnion((*LocatablesResponse)(nil)).
  916. Member(*new(LocatablesResponseDev), 0).
  917. Member(*new(LocatablesResponseV1), 1).
  918. Member(*new(LocatablesResponseV2), 2).
  919. Member(*new(LocatablesResponseV3), 3)
  920. bare.RegisterUnion((*LocatableV1)(nil)).
  921. Member(*new(StopV1), 0).
  922. Member(*new(VehicleV1), 1)
  923. bare.RegisterUnion((*LocatableV2)(nil)).
  924. Member(*new(StopV2), 0).
  925. Member(*new(VehicleV2), 1)
  926. bare.RegisterUnion((*LocatableV3)(nil)).
  927. Member(*new(StopV2), 0).
  928. Member(*new(VehicleV3), 1)
  929. bare.RegisterUnion((*DeparturesResponse)(nil)).
  930. Member(*new(DeparturesResponseDev), 0).
  931. Member(*new(DeparturesResponseV1), 1).
  932. Member(*new(DeparturesResponseV2), 2).
  933. Member(*new(DeparturesResponseV3), 3).
  934. Member(*new(DeparturesResponseV4), 4)
  935. }