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 ReasonCode 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 ReasonCode

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

func (*ReasonCode) Code

func (x *ReasonCode) Code() *string

SV: Full orsakskod, detta fält motsvarar det som finns från och med TrainAnnouncement version 1.5 under t.ex. Deviation.Code<br /> eller i objekttypen TrainMessage från och med schemaversion 1.5 under ReasonCode.Code

func (*ReasonCode) Deleted

func (x *ReasonCode) Deleted() *bool

SV: Anger att dataposten raderats

func (*ReasonCode) GroupDescription

func (x *ReasonCode) GroupDescription() *string

SV: Beskrivning för vilken grupp orsakskoden tillhör, t.ex Annonseringstexter och Orsaker nya principer

func (*ReasonCode) Level1Description

func (x *ReasonCode) Level1Description() *string

SV: Nivå 1 beskrivning, beskriver vilken typ av orsakskod.

func (*ReasonCode) Level2Description

func (x *ReasonCode) Level2Description() *string

SV: Nivå 2 beskrivning, beskriver vilken betydelse orsakskoden har, t.ex. Nationell

func (*ReasonCode) Level3Description

func (x *ReasonCode) Level3Description() *string

SV: Nivå 3 beskrivning, beskrivande text för orsakskoden, detta fält motsvarar det som finns i objekttypen TrainAnnouncement från och med schemaversion 1.5 under t.ex. Deviation.Description<br /> eller i objekttypen TrainMessage från och med schemaversion 1.5 under ReasonCode.Description

func (*ReasonCode) ModifiedTime

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

SV: Tidpunkt då dataposten ändrades

func (*ReasonCode) UnmarshalXML

func (x *ReasonCode) 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  []ReasonCode  `xml:"ReasonCode"`
	} `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/reasoncode/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.

Jump to

Keyboard shortcuts

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