123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674 |
- package traffic
- // Code generated by go-bare/cmd/gen, DO NOT EDIT.
- import (
- "errors"
- "git.sr.ht/~sircmpwn/go-bare"
- )
- type Translation struct {
- Language string `bare:"language"`
- Value string `bare:"value"`
- }
- func (t *Translation) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Translation) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Trip struct {
- Id string `bare:"id"`
- Headsign string `bare:"headsign"`
- TranslatedHeadsigns []Translation `bare:"translatedHeadsigns"`
- Direction Direction `bare:"direction"`
- LineID string `bare:"lineID"`
- ScheduleID string `bare:"scheduleID"`
- ShapeID string `bare:"shapeID"`
- Departures []Departure `bare:"departures"`
- }
- func (t *Trip) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Trip) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Vehicle struct {
- Id string `bare:"id"`
- Capabilities uint16 `bare:"capabilities"`
- }
- func (t *Vehicle) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Vehicle) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Departure struct {
- StopSequence int `bare:"stopSequence"`
- Time uint `bare:"time"`
- Pickup Boarding `bare:"pickup"`
- Dropoff Boarding `bare:"dropoff"`
- StopOffset uint `bare:"stopOffset"`
- }
- func (t *Departure) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Departure) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Stop struct {
- Id string `bare:"id"`
- Code string `bare:"code"`
- Name string `bare:"name"`
- TranslatedNames []Translation `bare:"translatedNames"`
- NodeName string `bare:"nodeName"`
- TranslatedNodeNames []Translation `bare:"translatedNodeNames"`
- ChangeOptions []ChangeOption `bare:"changeOptions"`
- Zone string `bare:"zone"`
- Position Position `bare:"position"`
- Order map[string]StopOrder `bare:"order"`
- Timezone string `bare:"timezone"`
- }
- func (t *Stop) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Stop) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type ChangeOption struct {
- LineName string `bare:"lineName"`
- Headsign string `bare:"headsign"`
- TranslatedHeadsigns []Translation `bare:"translatedHeadsigns"`
- }
- func (t *ChangeOption) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *ChangeOption) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Position struct {
- Lat float64 `bare:"lat"`
- Lon float64 `bare:"lon"`
- }
- func (t *Position) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Position) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type LineGraph struct {
- StopCodes []string `bare:"stopCodes"`
- NextNodes map[int][]int `bare:"nextNodes"`
- }
- func (t *LineGraph) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *LineGraph) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type StopOrder struct {
- TripOffset uint `bare:"tripOffset"`
- Sequence int `bare:"sequence"`
- }
- func (t *StopOrder) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *StopOrder) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Colour struct {
- R uint8 `bare:"r"`
- G uint8 `bare:"g"`
- B uint8 `bare:"b"`
- A uint8 `bare:"a"`
- }
- func (t *Colour) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Colour) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Line struct {
- Id string `bare:"id"`
- Name string `bare:"name"`
- Colour Colour `bare:"colour"`
- Kind LineType `bare:"kind"`
- AgencyID string `bare:"agencyID"`
- Headsigns [][]string `bare:"headsigns"`
- TranslatedHeadsigns [][][]Translation `bare:"translatedHeadsigns"`
- Graphs []LineGraph `bare:"graphs"`
- }
- func (t *Line) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Line) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type FeedInfo struct {
- Name string `bare:"name"`
- Website string `bare:"website"`
- Language string `bare:"language"`
- ValidSince string `bare:"validSince"`
- ValidTill string `bare:"validTill"`
- QrHost string `bare:"qrHost"`
- QrLocation QRLocation `bare:"qrLocation"`
- QrSelector string `bare:"qrSelector"`
- Attributions map[string]string `bare:"attributions"`
- Descriptions map[string]string `bare:"descriptions"`
- RealtimeFeeds map[RealtimeFeedType]string `bare:"realtimeFeeds"`
- Timezone string `bare:"timezone"`
- }
- func (t *FeedInfo) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *FeedInfo) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Agency struct {
- Id string `bare:"id"`
- Name string `bare:"name"`
- TranslatedNames []Translation `bare:"translatedNames"`
- Website string `bare:"website"`
- TranslatedWebsites []Translation `bare:"translatedWebsites"`
- Timezone string `bare:"timezone"`
- PhoneNumber string `bare:"phoneNumber"`
- TranslatedPhoneNumbers []Translation `bare:"translatedPhoneNumbers"`
- Language string `bare:"language"`
- Email string `bare:"email"`
- TranslatedEmails []Translation `bare:"translatedEmails"`
- FareWebsite string `bare:"fareWebsite"`
- TranslatedFareWebsites []Translation `bare:"translatedFareWebsites"`
- }
- func (t *Agency) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Agency) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type NameOffset struct {
- Name string `bare:"name"`
- Offsets []uint `bare:"offsets"`
- }
- func (t *NameOffset) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *NameOffset) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type CodeIndex map[string]uint
- func (t *CodeIndex) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *CodeIndex) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Schedule struct {
- Id string `bare:"id"`
- DateRanges []DateRange `bare:"dateRanges"`
- }
- func (t *Schedule) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Schedule) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type DateRange struct {
- Start string `bare:"start"`
- End string `bare:"end"`
- Weekdays uint8 `bare:"weekdays"`
- }
- func (t *DateRange) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *DateRange) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type TimeRange struct {
- StartDate string `bare:"startDate"`
- EndDate string `bare:"endDate"`
- }
- func (t *TimeRange) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *TimeRange) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type AlertLua struct {
- TimeRanges []TimeRange `bare:"timeRanges"`
- Headers map[string]string `bare:"headers"`
- Descriptions map[string]string `bare:"descriptions"`
- Urls map[string]string `bare:"urls"`
- Cause int `bare:"cause"`
- Effect int `bare:"effect"`
- }
- func (t *AlertLua) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *AlertLua) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type LuaUpdates struct {
- AreTripsInTimetable bool `bare:"areTripsInTimetable"`
- Updates map[string]Update `bare:"updates"`
- Alerts map[string][]AlertLua `bare:"alerts"`
- }
- func (t *LuaUpdates) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *LuaUpdates) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type LuaError struct {
- HttpResponseCode int `bare:"httpResponseCode"`
- Message string `bare:"message"`
- WillNextRequestFail bool `bare:"willNextRequestFail"`
- }
- func (t *LuaError) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *LuaError) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Update struct {
- Time string `bare:"time"`
- TimeUTC string `bare:"timeUTC"`
- StopSequence uint32 `bare:"stopSequence"`
- StopID string `bare:"stopID"`
- Delay int32 `bare:"delay"`
- TimetableRelationship TimetableRelationship `bare:"timetableRelationship"`
- VehicleStatus VehicleStatus `bare:"vehicleStatus"`
- }
- func (t *Update) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *Update) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type VehicleStatus struct {
- Status DepartureStatus `bare:"status"`
- CongestionLevel CongestionLevel `bare:"congestionLevel"`
- OccupancyStatus OccupancyStatus `bare:"occupancyStatus"`
- VehicleID string `bare:"vehicleID"`
- Latitude float64 `bare:"latitude"`
- Longitude float64 `bare:"longitude"`
- Speed float32 `bare:"speed"`
- Bearing float64 `bare:"bearing"`
- LineID string `bare:"lineID"`
- LineName string `bare:"lineName"`
- Headsign string `bare:"headsign"`
- TripID string `bare:"tripID"`
- WheelchairAccessibility WheelchairAccessibility `bare:"wheelchairAccessibility"`
- }
- func (t *VehicleStatus) Decode(data []byte) error {
- return bare.Unmarshal(data, t)
- }
- func (t *VehicleStatus) Encode() ([]byte, error) {
- return bare.Marshal(t)
- }
- type Direction uint
- const (
- THERE Direction = 0
- BACK Direction = 1
- )
- func (t Direction) String() string {
- switch t {
- case THERE:
- return "THERE"
- case BACK:
- return "BACK"
- }
- panic(errors.New("Invalid Direction value"))
- }
- type VehicleCapabilities uint
- const (
- RAMP VehicleCapabilities = 1
- LOW_FLOOR VehicleCapabilities = 2
- AIR_CONDITIONING VehicleCapabilities = 4
- BICYCLE VehicleCapabilities = 8
- VOICE_ANNOUNCEMENTS VehicleCapabilities = 16
- TICKET_MACHINE VehicleCapabilities = 32
- TICKET_SOLD_DRIVER VehicleCapabilities = 64
- USB_CHARGING VehicleCapabilities = 128
- LOW_FLOOR_PARTIAL VehicleCapabilities = 256
- )
- func (t VehicleCapabilities) String() string {
- switch t {
- case RAMP:
- return "RAMP"
- case LOW_FLOOR:
- return "LOW_FLOOR"
- case AIR_CONDITIONING:
- return "AIR_CONDITIONING"
- case BICYCLE:
- return "BICYCLE"
- case VOICE_ANNOUNCEMENTS:
- return "VOICE_ANNOUNCEMENTS"
- case TICKET_MACHINE:
- return "TICKET_MACHINE"
- case TICKET_SOLD_DRIVER:
- return "TICKET_SOLD_DRIVER"
- case USB_CHARGING:
- return "USB_CHARGING"
- case LOW_FLOOR_PARTIAL:
- return "LOW_FLOOR_PARTIAL"
- }
- panic(errors.New("Invalid VehicleCapabilities value"))
- }
- type Boarding uint
- const (
- REGULAR Boarding = 0
- NONE Boarding = 1
- BY_PHONE Boarding = 2
- BY_DRIVER Boarding = 3
- )
- func (t Boarding) String() string {
- switch t {
- case REGULAR:
- return "REGULAR"
- case NONE:
- return "NONE"
- case BY_PHONE:
- return "BY_PHONE"
- case BY_DRIVER:
- return "BY_DRIVER"
- }
- panic(errors.New("Invalid Boarding value"))
- }
- type LineType uint
- const (
- TRAM LineType = 0
- METRO LineType = 1
- RAIL LineType = 2
- BUS LineType = 3
- FERRY LineType = 4
- CABLE_TRAM LineType = 5
- CABLE_CAR LineType = 6
- FUNICULAR LineType = 7
- TROLLEYBUS LineType = 11
- MONORAIL LineType = 12
- )
- func (t LineType) String() string {
- switch t {
- case TRAM:
- return "TRAM"
- case METRO:
- return "METRO"
- case RAIL:
- return "RAIL"
- case BUS:
- return "BUS"
- case FERRY:
- return "FERRY"
- case CABLE_TRAM:
- return "CABLE_TRAM"
- case CABLE_CAR:
- return "CABLE_CAR"
- case FUNICULAR:
- return "FUNICULAR"
- case TROLLEYBUS:
- return "TROLLEYBUS"
- case MONORAIL:
- return "MONORAIL"
- }
- panic(errors.New("Invalid LineType value"))
- }
- type RealtimeFeedType uint
- const (
- TRIP_UPDATES RealtimeFeedType = 0
- VEHICLE_POSITIONS RealtimeFeedType = 1
- ALERTS RealtimeFeedType = 2
- )
- func (t RealtimeFeedType) String() string {
- switch t {
- case TRIP_UPDATES:
- return "TRIP_UPDATES"
- case VEHICLE_POSITIONS:
- return "VEHICLE_POSITIONS"
- case ALERTS:
- return "ALERTS"
- }
- panic(errors.New("Invalid RealtimeFeedType value"))
- }
- type QRLocation uint
- const (
- QRLocationUnknown QRLocation = 0
- QRLocationNone QRLocation = 1
- QRLocationPath QRLocation = 2
- QRLocationQuery QRLocation = 3
- )
- func (t QRLocation) String() string {
- switch t {
- case QRLocationUnknown:
- return "QRLocationUnknown"
- case QRLocationNone:
- return "QRLocationNone"
- case QRLocationPath:
- return "QRLocationPath"
- case QRLocationQuery:
- return "QRLocationQuery"
- }
- panic(errors.New("Invalid QRLocation value"))
- }
- type TimetableRelationship uint
- const (
- NOT_REALTIME TimetableRelationship = 0
- TRIP_SCHEDULED TimetableRelationship = 1
- TRIP_CANCELED TimetableRelationship = 2
- TRIP_DELETED TimetableRelationship = 3
- TRIP_ADDED TimetableRelationship = 4
- STOP_SKIPPED TimetableRelationship = 5
- NO_TRIP_DATA TimetableRelationship = 6
- )
- func (t TimetableRelationship) String() string {
- switch t {
- case NOT_REALTIME:
- return "NOT_REALTIME"
- case TRIP_SCHEDULED:
- return "TRIP_SCHEDULED"
- case TRIP_CANCELED:
- return "TRIP_CANCELED"
- case TRIP_DELETED:
- return "TRIP_DELETED"
- case TRIP_ADDED:
- return "TRIP_ADDED"
- case STOP_SKIPPED:
- return "STOP_SKIPPED"
- case NO_TRIP_DATA:
- return "NO_TRIP_DATA"
- }
- panic(errors.New("Invalid TimetableRelationship value"))
- }
- type CongestionLevel uint
- const (
- CONGESTION_UNKNOWN CongestionLevel = 0
- CONGESTION_SMOOTH CongestionLevel = 1
- CONGESTION_STOP_AND_GO CongestionLevel = 2
- CONGESTION_SIGNIFICANT CongestionLevel = 3
- CONGESTION_SEVERE CongestionLevel = 4
- )
- func (t CongestionLevel) String() string {
- switch t {
- case CONGESTION_UNKNOWN:
- return "CONGESTION_UNKNOWN"
- case CONGESTION_SMOOTH:
- return "CONGESTION_SMOOTH"
- case CONGESTION_STOP_AND_GO:
- return "CONGESTION_STOP_AND_GO"
- case CONGESTION_SIGNIFICANT:
- return "CONGESTION_SIGNIFICANT"
- case CONGESTION_SEVERE:
- return "CONGESTION_SEVERE"
- }
- panic(errors.New("Invalid CongestionLevel value"))
- }
- type OccupancyStatus uint
- const (
- OCCUPANCY_UNKNOWN OccupancyStatus = 0
- OCCUPANCY_EMPTY OccupancyStatus = 1
- OCCUPANCY_MANY_AVAILABLE OccupancyStatus = 2
- OCCUPANCY_FEW_AVAILABLE OccupancyStatus = 3
- OCCUPANCY_STANDING_ONLY OccupancyStatus = 4
- OCCUPANCY_CRUSHED OccupancyStatus = 5
- OCCUPANCY_FULL OccupancyStatus = 6
- OCCUPANCY_NOT_ACCEPTING OccupancyStatus = 7
- )
- func (t OccupancyStatus) String() string {
- switch t {
- case OCCUPANCY_UNKNOWN:
- return "OCCUPANCY_UNKNOWN"
- case OCCUPANCY_EMPTY:
- return "OCCUPANCY_EMPTY"
- case OCCUPANCY_MANY_AVAILABLE:
- return "OCCUPANCY_MANY_AVAILABLE"
- case OCCUPANCY_FEW_AVAILABLE:
- return "OCCUPANCY_FEW_AVAILABLE"
- case OCCUPANCY_STANDING_ONLY:
- return "OCCUPANCY_STANDING_ONLY"
- case OCCUPANCY_CRUSHED:
- return "OCCUPANCY_CRUSHED"
- case OCCUPANCY_FULL:
- return "OCCUPANCY_FULL"
- case OCCUPANCY_NOT_ACCEPTING:
- return "OCCUPANCY_NOT_ACCEPTING"
- }
- panic(errors.New("Invalid OccupancyStatus value"))
- }
- type WheelchairAccessibility uint
- const (
- WHEELCHAIR_NO_DATA WheelchairAccessibility = 0
- WHEELCHAIR_UNKNOWN WheelchairAccessibility = 1
- WHHELCHAIR_ACCESSIBLE WheelchairAccessibility = 2
- WHEELCHAIR_INACCESSIBLE WheelchairAccessibility = 3
- )
- func (t WheelchairAccessibility) String() string {
- switch t {
- case WHEELCHAIR_NO_DATA:
- return "WHEELCHAIR_NO_DATA"
- case WHEELCHAIR_UNKNOWN:
- return "WHEELCHAIR_UNKNOWN"
- case WHHELCHAIR_ACCESSIBLE:
- return "WHHELCHAIR_ACCESSIBLE"
- case WHEELCHAIR_INACCESSIBLE:
- return "WHEELCHAIR_INACCESSIBLE"
- }
- panic(errors.New("Invalid WheelchairAccessibility value"))
- }
- type DepartureStatus uint
- const (
- IN_TRANSIT DepartureStatus = 0
- AT_STOP DepartureStatus = 1
- INCOMING DepartureStatus = 2
- )
- func (t DepartureStatus) String() string {
- switch t {
- case IN_TRANSIT:
- return "IN_TRANSIT"
- case AT_STOP:
- return "AT_STOP"
- case INCOMING:
- return "INCOMING"
- }
- panic(errors.New("Invalid DepartureStatus value"))
- }
|