v1

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package v1 contains the type definitions for TrainStationMessage v1.

All types have accessor methods to access fields which can be chained on nils. This makes it possible to easily drill down into deeply nested data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObjectType

func ObjectType() trv.ObjectType

Types

type MediaType added in v0.7.1

type MediaType string
const (
	MediaTypeMonitor         MediaType = "Monitor"
	MediaTypePlattformsskylt MediaType = "Plattformsskylt"
	MediaTypeUtrop           MediaType = "Utrop"
)

type MessageStatus2 added in v0.7.1

type MessageStatus2 string
const (
	MessageStatus2Lag       MessageStatus2 = "Lag"
	MessageStatus2Normal    MessageStatus2 = "Normal"
	MessageStatus2Hog       MessageStatus2 = "Hog"
	MessageStatus2StortLage MessageStatus2 = "StortLage"
)

type MonitorAttributes

type MonitorAttributes struct {
	// contains filtered or unexported fields
}

func (*MonitorAttributes) BigScreenMonitorActivated

func (x *MonitorAttributes) BigScreenMonitorActivated() *bool

SV: Anger om monitormeddelandet även skall visas på stortavla. EN: Specifies if the message is to be shown on a big screen monitor

func (*MonitorAttributes) CommuterMonitor

func (x *MonitorAttributes) CommuterMonitor() *bool

SV: Anger om meddelandet skall visas på pendelmonitor. EN: Specifies if the monitor is a commuter monitor or regular

func (*MonitorAttributes) UnmarshalXML

func (x *MonitorAttributes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PlatformSignAttributes

type PlatformSignAttributes struct {
	// contains filtered or unexported fields
}

func (*PlatformSignAttributes) CommuterPlatformSign

func (x *PlatformSignAttributes) CommuterPlatformSign() *bool

SV: Anger om meddelandet skall visas på pendelplattformsskylt eller en vanlig plattformsskylt. EN: Specifies if the message is to be shown on a commuter platform sign or regular platform sign

func (*PlatformSignAttributes) TrackList

func (x *PlatformSignAttributes) TrackList() *TrackList

SV: Vilka spår som meddelandet gäller EN: The tracks that are affected by the message

func (*PlatformSignAttributes) UnmarshalXML

func (x *PlatformSignAttributes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PublicAnnouncementAttributes

type PublicAnnouncementAttributes struct {
	// contains filtered or unexported fields
}

func (*PublicAnnouncementAttributes) EnglishPublicAnnouncementActivated

func (x *PublicAnnouncementAttributes) EnglishPublicAnnouncementActivated() *bool

SV: Om Utropsystem ska ropa på engelska. EN: Specifies if the message is announced in English.

func (*PublicAnnouncementAttributes) EnglishText

func (x *PublicAnnouncementAttributes) EnglishText() *string

SV: Utropstext på engelska. EN: Announcement text in English.

func (*PublicAnnouncementAttributes) PublicAnnouncementPlanList

func (x *PublicAnnouncementAttributes) PublicAnnouncementPlanList() *PublicAnnouncementPlanList

SV: En planering för vilka dagar och tidpunkter ett meddelande skall ropas. EN: Plans for when the message is to be announced

func (*PublicAnnouncementAttributes) PublicAnnouncementZoneList

func (x *PublicAnnouncementAttributes) PublicAnnouncementZoneList() *PublicAnnouncementZoneList

func (*PublicAnnouncementAttributes) UnmarshalXML

func (x *PublicAnnouncementAttributes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PublicAnnouncementOccasionList

type PublicAnnouncementOccasionList struct {
	// contains filtered or unexported fields
}

func (*PublicAnnouncementOccasionList) PublicAnnouncementOccasions

func (x *PublicAnnouncementOccasionList) PublicAnnouncementOccasions() []int

SV: Anger vilken minut på dygnet ett utrop skall utföras EN: Indicates which minute in the day the announcement is to be made

func (*PublicAnnouncementOccasionList) UnmarshalXML

func (x *PublicAnnouncementOccasionList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PublicAnnouncementPlan

type PublicAnnouncementPlan struct {
	// contains filtered or unexported fields
}

func (*PublicAnnouncementPlan) ActiveDays

func (x *PublicAnnouncementPlan) ActiveDays() *string

SV: En sträng som beskriver om en planering är aktiv (Y) eller inte (N) för varje dag från Starttid till Sluttid. EN: A string with an 'Y' or 'N' for each day between the start and the end date. 'Y' if the message is to be announced that day and 'N' otherwise.

func (*PublicAnnouncementPlan) PublicAnnouncementOccasionList

func (x *PublicAnnouncementPlan) PublicAnnouncementOccasionList() *PublicAnnouncementOccasionList

func (*PublicAnnouncementPlan) UnmarshalXML

func (x *PublicAnnouncementPlan) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*PublicAnnouncementPlan) ValidFrom

func (x *PublicAnnouncementPlan) ValidFrom() *time.Time

SV: Planeringen är giltig efter denna tidpunkt och är första aktiva dagen i planeringen. EN: The start and first valid date of the plan.

func (*PublicAnnouncementPlan) ValidTo

func (x *PublicAnnouncementPlan) ValidTo() *time.Time

SV: Planeringen är giltig fram till denna tidpunkt och är sista aktiva dagen i planeringen. EN: The end and last valid date of the plan.

type PublicAnnouncementPlanList

type PublicAnnouncementPlanList struct {
	// contains filtered or unexported fields
}

func (*PublicAnnouncementPlanList) PublicAnnouncementPlans

func (x *PublicAnnouncementPlanList) PublicAnnouncementPlans() []PublicAnnouncementPlan

func (*PublicAnnouncementPlanList) UnmarshalXML

func (x *PublicAnnouncementPlanList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PublicAnnouncementZoneList

type PublicAnnouncementZoneList struct {
	// contains filtered or unexported fields
}

func (*PublicAnnouncementZoneList) PublicAnnouncementZones

func (x *PublicAnnouncementZoneList) PublicAnnouncementZones() []string

SV: Anger en zon där meddelandet skall utropas EN: Indicates a zone for where the message is to be announced

func (*PublicAnnouncementZoneList) UnmarshalXML

func (x *PublicAnnouncementZoneList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Response

type Response struct {
	XMLName xml.Name `xml:"RESPONSE"`
	Results []struct {
		Info struct {
			LastModified trv.LastModified `xml:"LASTMODIFIED"`
			LastChangeID string           `xml:"LASTCHANGEID"`
			EvalResult   []any            `xml:"EVALRESULT"`
			SSEURL       string           `xml:"SSEURL"`
		} `xml:"INFO"`
		Error *trv.APIError         `xml:"ERROR"`
		Data  []TrainStationMessage `xml:"TrainStationMessage"`
	} `xml:"RESULT"`
}

Response can be used to decode the response from the API.

For example:

package main

import (
	 "encoding/xml"
	 api "code.dny.dev/trafikinfo/trv/trainstationmessage/v1"
)

func main() {
	var res api.Response
	err := xml.Unmarshal(data, &res)
}

func (Response) ErrorMsg

func (r Response) ErrorMsg() string

Errors returns a slice of trv.Error, if any error was included in the response.

func (Response) HasErrors

func (r Response) HasErrors() bool

HasErrors returns whether any of the results includes an error.

type TrackList

type TrackList struct {
	// contains filtered or unexported fields
}

func (*TrackList) Tracks

func (x *TrackList) Tracks() []string

func (*TrackList) UnmarshalXML

func (x *TrackList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type TrainStationMessage

type TrainStationMessage struct {
	// contains filtered or unexported fields
}

func (*TrainStationMessage) ActiveDays

func (x *TrainStationMessage) ActiveDays() *string

SV: En sträng som beskriver om ett meddelande ska vara aktivt (Y) eller inte (N) för varje dag från Starttid till Sluttid. EN: A string with an 'Y' or 'N' for each day between the start and the end date. 'Y' if the message is to be active that day and 'N' otherwise.

func (*TrainStationMessage) Deleted

func (x *TrainStationMessage) Deleted() *bool

SV: Anger att dataposten raderats EN: Specifies if the element has been deleted

func (*TrainStationMessage) EndDateTime

func (x *TrainStationMessage) EndDateTime() *time.Time

SV: När meddelandet ska sluta visas EN: When the message should not be displayed anymore

func (*TrainStationMessage) EventID

func (x *TrainStationMessage) EventID() *string

SV: Trafikhändelsenummer från Basun EN: Id in the BASUN application

func (*TrainStationMessage) FreeText

func (x *TrainStationMessage) FreeText() *string

SV: Annonseringstexten EN: Informational text

func (*TrainStationMessage) ID

func (x *TrainStationMessage) ID() *string

SV: Unikt id för varje meddelande EN: Unique identifier

func (*TrainStationMessage) LocationCode

func (x *TrainStationMessage) LocationCode() *string

SV: Stationens platssignatur EN: Location code

func (*TrainStationMessage) MediaType

func (x *TrainStationMessage) MediaType() *MediaType

SV: Anger vilket presentationsmedia meddelandet gäller.<br /> 'Monitor'<br /> 'Plattformsskylt'<br /> 'Utrop' EN: Type of media.<br /> 'Monitor' - Monitor<br /> 'Plattformsskylt'- Platform sign<br /> 'Utrop' - Announcement

func (*TrainStationMessage) ModifiedTime

func (x *TrainStationMessage) ModifiedTime() *time.Time

SV: Tidpunkt då dataposten ändrades EN: Time when the element wast last modified

func (*TrainStationMessage) MonitorAttributes

func (x *TrainStationMessage) MonitorAttributes() *MonitorAttributes

func (*TrainStationMessage) PlatformSignAttributes

func (x *TrainStationMessage) PlatformSignAttributes() *PlatformSignAttributes

func (*TrainStationMessage) PublicAnnouncementAttributes

func (x *TrainStationMessage) PublicAnnouncementAttributes() *PublicAnnouncementAttributes

func (*TrainStationMessage) SplitActivationTime

func (x *TrainStationMessage) SplitActivationTime() *bool

SV: Anger att ett meddelande bara skall gälla mellan tidpunkterna i Starttid och Sluttid, för varje dag i intervallet Starttid och Sluttid EN: For the dates specified in Start and EndDateTime, specifies if the message should be displayed around the clock or just between the time set in Start and EndDateTime each day

func (*TrainStationMessage) StartDateTime

func (x *TrainStationMessage) StartDateTime() *time.Time

SV: När meddelandet ska börja visas EN: When the message should start to be displayed

func (*TrainStationMessage) Status

func (x *TrainStationMessage) Status() *MessageStatus2

SV: Meddelandets viktighetsgrad EN: How important the message are (in relative to other messages)

func (*TrainStationMessage) UnmarshalXML

func (x *TrainStationMessage) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*TrainStationMessage) VersionNumber

func (x *TrainStationMessage) VersionNumber() *int

SV: Version på detta meddelande EN: Versioning number for this external message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL