onebusaway

package module
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

Onebusaway SDK Go API Library

Go Reference

The Onebusaway SDK Go library provides convenient access to the Onebusaway SDK REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/OneBusAway/go-sdk" // imported as onebusaway
)

Or to pin the version:

go get -u 'github.com/OneBusAway/go-sdk@v1.3.4'

Requirements

This library requires Go 1.18+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/OneBusAway/go-sdk"
	"github.com/OneBusAway/go-sdk/option"
)

func main() {
	client := onebusaway.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("ONEBUSAWAY_API_KEY")
	)
	currentTime, err := client.CurrentTime.Get(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", currentTime)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: onebusaway.F("hello"),

	// Explicitly send `"description": null`
	Description: onebusaway.Null[string](),

	Point: onebusaway.F(onebusaway.Point{
		X: onebusaway.Int(0),
		Y: onebusaway.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: onebusaway.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the response JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := onebusaway.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.CurrentTime.Get(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *onebusaway.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.CurrentTime.Get(context.TODO())
if err != nil {
	var apierr *onebusaway.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/api/where/current-time.json": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.CurrentTime.Get(
	ctx,
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as param.Field[io.Reader]. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper onebusaway.FileParam(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := onebusaway.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.CurrentTime.Get(context.TODO(), option.WithMaxRetries(5))
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
currentTime, err := client.CurrentTime.Get(context.TODO(), option.WithResponseInto(&response))
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", currentTime)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]interface{}

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   onebusaway.F("id_xxxx"),
    Data: onebusaway.F(FooNewParamsData{
        FirstName: onebusaway.F("John"),
    }),
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := onebusaway.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

View Source
const ReferencesSituationsReasonEnvironmentReason = shared.ReferencesSituationsReasonEnvironmentReason

This is an alias to an internal value.

View Source
const ReferencesSituationsReasonEquipmentReason = shared.ReferencesSituationsReasonEquipmentReason

This is an alias to an internal value.

View Source
const ReferencesSituationsReasonMiscellaneousReason = shared.ReferencesSituationsReasonMiscellaneousReason

This is an alias to an internal value.

View Source
const ReferencesSituationsReasonPersonnelReason = shared.ReferencesSituationsReasonPersonnelReason

This is an alias to an internal value.

View Source
const ReferencesSituationsReasonSecurityAlert = shared.ReferencesSituationsReasonSecurityAlert

This is an alias to an internal value.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (ONEBUSAWAY_API_KEY, ONEBUSAWAY_SDK_BASE_URL). This should be used to initialize new clients.

func F

func F[T any](value T) param.Field[T]

F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.

func FileParam

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explicitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type AgenciesWithCoverageListResponse

type AgenciesWithCoverageListResponse struct {
	Data AgenciesWithCoverageListResponseData `json:"data,required"`
	JSON agenciesWithCoverageListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*AgenciesWithCoverageListResponse) UnmarshalJSON

func (r *AgenciesWithCoverageListResponse) UnmarshalJSON(data []byte) (err error)

type AgenciesWithCoverageListResponseData

type AgenciesWithCoverageListResponseData struct {
	LimitExceeded bool                                       `json:"limitExceeded,required"`
	List          []AgenciesWithCoverageListResponseDataList `json:"list,required"`
	References    shared.References                          `json:"references,required"`
	JSON          agenciesWithCoverageListResponseDataJSON   `json:"-"`
}

func (*AgenciesWithCoverageListResponseData) UnmarshalJSON

func (r *AgenciesWithCoverageListResponseData) UnmarshalJSON(data []byte) (err error)

type AgenciesWithCoverageListResponseDataList

type AgenciesWithCoverageListResponseDataList struct {
	AgencyID string                                       `json:"agencyId,required"`
	Lat      float64                                      `json:"lat,required"`
	LatSpan  float64                                      `json:"latSpan,required"`
	Lon      float64                                      `json:"lon,required"`
	LonSpan  float64                                      `json:"lonSpan,required"`
	JSON     agenciesWithCoverageListResponseDataListJSON `json:"-"`
}

func (*AgenciesWithCoverageListResponseDataList) UnmarshalJSON

func (r *AgenciesWithCoverageListResponseDataList) UnmarshalJSON(data []byte) (err error)

type AgenciesWithCoverageService

type AgenciesWithCoverageService struct {
	Options []option.RequestOption
}

AgenciesWithCoverageService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgenciesWithCoverageService method instead.

func NewAgenciesWithCoverageService

func NewAgenciesWithCoverageService(opts ...option.RequestOption) (r *AgenciesWithCoverageService)

NewAgenciesWithCoverageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AgenciesWithCoverageService) List

Returns a list of all transit agencies currently supported by OneBusAway along with the center of their coverage area.

type AgencyGetResponse

type AgencyGetResponse struct {
	Data AgencyGetResponseData `json:"data,required"`
	JSON agencyGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*AgencyGetResponse) UnmarshalJSON

func (r *AgencyGetResponse) UnmarshalJSON(data []byte) (err error)

type AgencyGetResponseData

type AgencyGetResponseData struct {
	Entry         AgencyGetResponseDataEntry `json:"entry,required"`
	LimitExceeded bool                       `json:"limitExceeded,required"`
	References    shared.References          `json:"references,required"`
	JSON          agencyGetResponseDataJSON  `json:"-"`
}

func (*AgencyGetResponseData) UnmarshalJSON

func (r *AgencyGetResponseData) UnmarshalJSON(data []byte) (err error)

type AgencyGetResponseDataEntry

type AgencyGetResponseDataEntry struct {
	ID             string                         `json:"id,required"`
	Name           string                         `json:"name,required"`
	Timezone       string                         `json:"timezone,required"`
	URL            string                         `json:"url,required"`
	Disclaimer     string                         `json:"disclaimer"`
	Email          string                         `json:"email"`
	FareURL        string                         `json:"fareUrl"`
	Lang           string                         `json:"lang"`
	Phone          string                         `json:"phone"`
	PrivateService bool                           `json:"privateService"`
	JSON           agencyGetResponseDataEntryJSON `json:"-"`
}

func (*AgencyGetResponseDataEntry) UnmarshalJSON

func (r *AgencyGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type AgencyService

type AgencyService struct {
	Options []option.RequestOption
}

AgencyService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgencyService method instead.

func NewAgencyService

func NewAgencyService(opts ...option.RequestOption) (r *AgencyService)

NewAgencyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AgencyService) Get

func (r *AgencyService) Get(ctx context.Context, agencyID string, opts ...option.RequestOption) (res *AgencyGetResponse, err error)

Retrieve information for a specific transit agency identified by its unique ID.

type ArrivalAndDepartureGetParams

type ArrivalAndDepartureGetParams struct {
	ServiceDate  param.Field[int64]  `query:"serviceDate,required"`
	TripID       param.Field[string] `query:"tripId,required"`
	StopSequence param.Field[int64]  `query:"stopSequence"`
	Time         param.Field[int64]  `query:"time"`
	VehicleID    param.Field[string] `query:"vehicleId"`
}

func (ArrivalAndDepartureGetParams) URLQuery

func (r ArrivalAndDepartureGetParams) URLQuery() (v url.Values)

URLQuery serializes ArrivalAndDepartureGetParams's query parameters as `url.Values`.

type ArrivalAndDepartureGetResponse

type ArrivalAndDepartureGetResponse struct {
	Data ArrivalAndDepartureGetResponseData `json:"data,required"`
	JSON arrivalAndDepartureGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*ArrivalAndDepartureGetResponse) UnmarshalJSON

func (r *ArrivalAndDepartureGetResponse) UnmarshalJSON(data []byte) (err error)

type ArrivalAndDepartureGetResponseData

type ArrivalAndDepartureGetResponseData struct {
	Entry      ArrivalAndDepartureGetResponseDataEntry `json:"entry,required"`
	References shared.References                       `json:"references,required"`
	JSON       arrivalAndDepartureGetResponseDataJSON  `json:"-"`
}

func (*ArrivalAndDepartureGetResponseData) UnmarshalJSON

func (r *ArrivalAndDepartureGetResponseData) UnmarshalJSON(data []byte) (err error)

type ArrivalAndDepartureGetResponseDataEntry

type ArrivalAndDepartureGetResponseDataEntry struct {
	// Indicates if riders can arrive on this transit vehicle.
	ArrivalEnabled bool `json:"arrivalEnabled,required"`
	// Index of this arrival’s trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// Indicates if riders can depart from this transit vehicle.
	DepartureEnabled bool `json:"departureEnabled,required"`
	// Number of stops between the arriving transit vehicle and the current stop
	// (excluding the current stop).
	NumberOfStopsAway int64 `json:"numberOfStopsAway,required"`
	// Predicted arrival time, in milliseconds since Unix epoch (zero if no real-time
	// available).
	PredictedArrivalTime int64 `json:"predictedArrivalTime,required"`
	// Predicted departure time, in milliseconds since Unix epoch (zero if no real-time
	// available).
	PredictedDepartureTime int64 `json:"predictedDepartureTime,required"`
	// The ID of the route for the arriving vehicle.
	RouteID string `json:"routeId,required"`
	// Scheduled arrival time, in milliseconds since Unix epoch.
	ScheduledArrivalTime int64 `json:"scheduledArrivalTime,required"`
	// Scheduled departure time, in milliseconds since Unix epoch.
	ScheduledDepartureTime int64 `json:"scheduledDepartureTime,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// The ID of the stop the vehicle is arriving at.
	StopID string `json:"stopId,required"`
	// Index of the stop into the sequence of stops that make up the trip for this
	// arrival.
	StopSequence int64 `json:"stopSequence,required"`
	// Total number of stops visited on the trip for this arrival.
	TotalStopsInTrip int64 `json:"totalStopsInTrip,required"`
	// Optional trip headsign that potentially overrides the trip headsign in the
	// referenced trip element.
	TripHeadsign string `json:"tripHeadsign,required"`
	// The ID of the trip for the arriving vehicle.
	TripID string `json:"tripId,required"`
	// ID of the transit vehicle serving this trip.
	VehicleID string `json:"vehicleId,required"`
	// The actual track information of the arriving transit vehicle.
	ActualTrack string `json:"actualTrack"`
	// Distance of the arriving transit vehicle from the stop, in meters.
	DistanceFromStop float64 `json:"distanceFromStop"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Historical occupancy information of the transit vehicle.
	HistoricalOccupancy string `json:"historicalOccupancy"`
	// Timestamp of the last update time for this arrival.
	LastUpdateTime int64 `json:"lastUpdateTime"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted"`
	// Interval for predicted arrival time, if available.
	PredictedArrivalInterval string `json:"predictedArrivalInterval"`
	// Interval for predicted departure time, if available.
	PredictedDepartureInterval string `json:"predictedDepartureInterval"`
	// Predicted occupancy status of the transit vehicle.
	PredictedOccupancy string `json:"predictedOccupancy"`
	// Optional route long name that potentially overrides the route long name in the
	// referenced route element.
	RouteLongName string `json:"routeLongName"`
	// Optional route short name that potentially overrides the route short name in the
	// referenced route element.
	RouteShortName string `json:"routeShortName"`
	// Interval for scheduled arrival time.
	ScheduledArrivalInterval string `json:"scheduledArrivalInterval"`
	// Interval for scheduled departure time.
	ScheduledDepartureInterval string `json:"scheduledDepartureInterval"`
	// Scheduled track information of the arriving transit vehicle.
	ScheduledTrack string `json:"scheduledTrack"`
	// References to situation elements (if any) applicable to this arrival.
	SituationIDs []string `json:"situationIds"`
	// Current status of the arrival.
	Status string `json:"status"`
	// Trip-specific status for the arriving transit vehicle.
	TripStatus ArrivalAndDepartureGetResponseDataEntryTripStatus `json:"tripStatus"`
	JSON       arrivalAndDepartureGetResponseDataEntryJSON       `json:"-"`
}

func (*ArrivalAndDepartureGetResponseDataEntry) UnmarshalJSON

func (r *ArrivalAndDepartureGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type ArrivalAndDepartureGetResponseDataEntryTripStatus

type ArrivalAndDepartureGetResponseDataEntryTripStatus struct {
	// Trip ID of the trip the vehicle is actively serving.
	ActiveTripID string `json:"activeTripId,required"`
	// Index of the active trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// ID of the closest stop to the current location of the transit vehicle.
	ClosestStop string `json:"closestStop,required"`
	// Distance, in meters, the transit vehicle has progressed along the active trip.
	DistanceAlongTrip float64 `json:"distanceAlongTrip,required"`
	// Last known distance along the trip received in real-time from the transit
	// vehicle.
	LastKnownDistanceAlongTrip float64 `json:"lastKnownDistanceAlongTrip,required"`
	// Timestamp of the last known real-time location update from the transit vehicle.
	LastLocationUpdateTime int64 `json:"lastLocationUpdateTime,required"`
	// Timestamp of the last known real-time update from the transit vehicle.
	LastUpdateTime int64 `json:"lastUpdateTime,required"`
	// Capacity of the transit vehicle in terms of occupancy.
	OccupancyCapacity int64 `json:"occupancyCapacity,required"`
	// Current count of occupants in the transit vehicle.
	OccupancyCount int64 `json:"occupancyCount,required"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus,required"`
	// Current journey phase of the trip.
	Phase string `json:"phase,required"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted,required"`
	// Deviation from the schedule in seconds (positive for late, negative for early).
	ScheduleDeviation int64 `json:"scheduleDeviation,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// Current status modifiers for the trip.
	Status string `json:"status,required"`
	// Total length of the trip, in meters.
	TotalDistanceAlongTrip float64 `json:"totalDistanceAlongTrip,required"`
	// Time offset from the closest stop to the current position of the transit vehicle
	// (in seconds).
	ClosestStopTimeOffset int64 `json:"closestStopTimeOffset"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Last known location of the transit vehicle.
	LastKnownLocation ArrivalAndDepartureGetResponseDataEntryTripStatusLastKnownLocation `json:"lastKnownLocation"`
	// Last known orientation value received in real-time from the transit vehicle.
	LastKnownOrientation float64 `json:"lastKnownOrientation"`
	// ID of the next stop the transit vehicle is scheduled to arrive at.
	NextStop string `json:"nextStop"`
	// Time offset from the next stop to the current position of the transit vehicle
	// (in seconds).
	NextStopTimeOffset int64 `json:"nextStopTimeOffset"`
	// Orientation of the transit vehicle, represented as an angle in degrees.
	Orientation float64 `json:"orientation"`
	// Current position of the transit vehicle.
	Position ArrivalAndDepartureGetResponseDataEntryTripStatusPosition `json:"position"`
	// Distance, in meters, the transit vehicle is scheduled to have progressed along
	// the active trip.
	ScheduledDistanceAlongTrip float64 `json:"scheduledDistanceAlongTrip"`
	// References to situation elements (if any) applicable to this trip.
	SituationIDs []string `json:"situationIds"`
	// ID of the transit vehicle currently serving the trip.
	VehicleID string                                                `json:"vehicleId"`
	JSON      arrivalAndDepartureGetResponseDataEntryTripStatusJSON `json:"-"`
}

Trip-specific status for the arriving transit vehicle.

func (*ArrivalAndDepartureGetResponseDataEntryTripStatus) UnmarshalJSON

func (r *ArrivalAndDepartureGetResponseDataEntryTripStatus) UnmarshalJSON(data []byte) (err error)

type ArrivalAndDepartureGetResponseDataEntryTripStatusLastKnownLocation

type ArrivalAndDepartureGetResponseDataEntryTripStatusLastKnownLocation struct {
	// Latitude of the last known location of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the last known location of the transit vehicle.
	Lon  float64                                                                `json:"lon"`
	JSON arrivalAndDepartureGetResponseDataEntryTripStatusLastKnownLocationJSON `json:"-"`
}

Last known location of the transit vehicle.

func (*ArrivalAndDepartureGetResponseDataEntryTripStatusLastKnownLocation) UnmarshalJSON

type ArrivalAndDepartureGetResponseDataEntryTripStatusPosition

type ArrivalAndDepartureGetResponseDataEntryTripStatusPosition struct {
	// Latitude of the current position of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the current position of the transit vehicle.
	Lon  float64                                                       `json:"lon"`
	JSON arrivalAndDepartureGetResponseDataEntryTripStatusPositionJSON `json:"-"`
}

Current position of the transit vehicle.

func (*ArrivalAndDepartureGetResponseDataEntryTripStatusPosition) UnmarshalJSON

type ArrivalAndDepartureListParams

type ArrivalAndDepartureListParams struct {
	// Include vehicles arriving or departing in the next n minutes.
	MinutesAfter param.Field[int64] `query:"minutesAfter"`
	// Include vehicles having arrived or departed in the previous n minutes.
	MinutesBefore param.Field[int64] `query:"minutesBefore"`
	// The specific time for querying the system status.
	Time param.Field[time.Time] `query:"time" format:"date-time"`
}

func (ArrivalAndDepartureListParams) URLQuery

func (r ArrivalAndDepartureListParams) URLQuery() (v url.Values)

URLQuery serializes ArrivalAndDepartureListParams's query parameters as `url.Values`.

type ArrivalAndDepartureListResponse

type ArrivalAndDepartureListResponse struct {
	Data ArrivalAndDepartureListResponseData `json:"data,required"`
	JSON arrivalAndDepartureListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*ArrivalAndDepartureListResponse) UnmarshalJSON

func (r *ArrivalAndDepartureListResponse) UnmarshalJSON(data []byte) (err error)

type ArrivalAndDepartureListResponseData

type ArrivalAndDepartureListResponseData struct {
	Entry      ArrivalAndDepartureListResponseDataEntry `json:"entry,required"`
	References shared.References                        `json:"references,required"`
	JSON       arrivalAndDepartureListResponseDataJSON  `json:"-"`
}

func (*ArrivalAndDepartureListResponseData) UnmarshalJSON

func (r *ArrivalAndDepartureListResponseData) UnmarshalJSON(data []byte) (err error)

type ArrivalAndDepartureListResponseDataEntry

type ArrivalAndDepartureListResponseDataEntry struct {
	ArrivalsAndDepartures []ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture `json:"arrivalsAndDepartures,required"`
	JSON                  arrivalAndDepartureListResponseDataEntryJSON                   `json:"-"`
}

func (*ArrivalAndDepartureListResponseDataEntry) UnmarshalJSON

func (r *ArrivalAndDepartureListResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture struct {
	// Indicates if riders can arrive on this transit vehicle.
	ArrivalEnabled bool `json:"arrivalEnabled,required"`
	// Index of this arrival’s trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// Indicates if riders can depart from this transit vehicle.
	DepartureEnabled bool `json:"departureEnabled,required"`
	// Number of stops between the arriving transit vehicle and the current stop
	// (excluding the current stop).
	NumberOfStopsAway int64 `json:"numberOfStopsAway,required"`
	// Predicted arrival time, in milliseconds since Unix epoch (zero if no real-time
	// available).
	PredictedArrivalTime int64 `json:"predictedArrivalTime,required"`
	// Predicted departure time, in milliseconds since Unix epoch (zero if no real-time
	// available).
	PredictedDepartureTime int64 `json:"predictedDepartureTime,required"`
	// The ID of the route for the arriving vehicle.
	RouteID string `json:"routeId,required"`
	// Scheduled arrival time, in milliseconds since Unix epoch.
	ScheduledArrivalTime int64 `json:"scheduledArrivalTime,required"`
	// Scheduled departure time, in milliseconds since Unix epoch.
	ScheduledDepartureTime int64 `json:"scheduledDepartureTime,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// The ID of the stop the vehicle is arriving at.
	StopID string `json:"stopId,required"`
	// Index of the stop into the sequence of stops that make up the trip for this
	// arrival.
	StopSequence int64 `json:"stopSequence,required"`
	// Total number of stops visited on the trip for this arrival.
	TotalStopsInTrip int64 `json:"totalStopsInTrip,required"`
	// Optional trip headsign that potentially overrides the trip headsign in the
	// referenced trip element.
	TripHeadsign string `json:"tripHeadsign,required"`
	// The ID of the trip for the arriving vehicle.
	TripID string `json:"tripId,required"`
	// ID of the transit vehicle serving this trip.
	VehicleID string `json:"vehicleId,required"`
	// The actual track information of the arriving transit vehicle.
	ActualTrack string `json:"actualTrack"`
	// Distance of the arriving transit vehicle from the stop, in meters.
	DistanceFromStop float64 `json:"distanceFromStop"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Historical occupancy information of the transit vehicle.
	HistoricalOccupancy string `json:"historicalOccupancy"`
	// Timestamp of the last update time for this arrival.
	LastUpdateTime int64 `json:"lastUpdateTime"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted"`
	// Interval for predicted arrival time, if available.
	PredictedArrivalInterval string `json:"predictedArrivalInterval"`
	// Interval for predicted departure time, if available.
	PredictedDepartureInterval string `json:"predictedDepartureInterval"`
	// Predicted occupancy status of the transit vehicle.
	PredictedOccupancy string `json:"predictedOccupancy"`
	// Optional route long name that potentially overrides the route long name in the
	// referenced route element.
	RouteLongName string `json:"routeLongName"`
	// Optional route short name that potentially overrides the route short name in the
	// referenced route element.
	RouteShortName string `json:"routeShortName"`
	// Interval for scheduled arrival time.
	ScheduledArrivalInterval string `json:"scheduledArrivalInterval"`
	// Interval for scheduled departure time.
	ScheduledDepartureInterval string `json:"scheduledDepartureInterval"`
	// Scheduled track information of the arriving transit vehicle.
	ScheduledTrack string `json:"scheduledTrack"`
	// References to situation elements (if any) applicable to this arrival.
	SituationIDs []string `json:"situationIds"`
	// Current status of the arrival.
	Status string `json:"status"`
	// Trip-specific status for the arriving transit vehicle.
	TripStatus ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatus `json:"tripStatus"`
	JSON       arrivalAndDepartureListResponseDataEntryArrivalsAndDepartureJSON        `json:"-"`
}

func (*ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture) UnmarshalJSON

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatus

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatus struct {
	// Trip ID of the trip the vehicle is actively serving.
	ActiveTripID string `json:"activeTripId,required"`
	// Index of the active trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// ID of the closest stop to the current location of the transit vehicle.
	ClosestStop string `json:"closestStop,required"`
	// Distance, in meters, the transit vehicle has progressed along the active trip.
	DistanceAlongTrip float64 `json:"distanceAlongTrip,required"`
	// Last known distance along the trip received in real-time from the transit
	// vehicle.
	LastKnownDistanceAlongTrip float64 `json:"lastKnownDistanceAlongTrip,required"`
	// Timestamp of the last known real-time location update from the transit vehicle.
	LastLocationUpdateTime int64 `json:"lastLocationUpdateTime,required"`
	// Timestamp of the last known real-time update from the transit vehicle.
	LastUpdateTime int64 `json:"lastUpdateTime,required"`
	// Capacity of the transit vehicle in terms of occupancy.
	OccupancyCapacity int64 `json:"occupancyCapacity,required"`
	// Current count of occupants in the transit vehicle.
	OccupancyCount int64 `json:"occupancyCount,required"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus,required"`
	// Current journey phase of the trip.
	Phase string `json:"phase,required"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted,required"`
	// Deviation from the schedule in seconds (positive for late, negative for early).
	ScheduleDeviation int64 `json:"scheduleDeviation,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// Current status modifiers for the trip.
	Status string `json:"status,required"`
	// Total length of the trip, in meters.
	TotalDistanceAlongTrip float64 `json:"totalDistanceAlongTrip,required"`
	// Time offset from the closest stop to the current position of the transit vehicle
	// (in seconds).
	ClosestStopTimeOffset int64 `json:"closestStopTimeOffset"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Last known location of the transit vehicle.
	LastKnownLocation ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusLastKnownLocation `json:"lastKnownLocation"`
	// Last known orientation value received in real-time from the transit vehicle.
	LastKnownOrientation float64 `json:"lastKnownOrientation"`
	// ID of the next stop the transit vehicle is scheduled to arrive at.
	NextStop string `json:"nextStop"`
	// Time offset from the next stop to the current position of the transit vehicle
	// (in seconds).
	NextStopTimeOffset int64 `json:"nextStopTimeOffset"`
	// Orientation of the transit vehicle, represented as an angle in degrees.
	Orientation float64 `json:"orientation"`
	// Current position of the transit vehicle.
	Position ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusPosition `json:"position"`
	// Distance, in meters, the transit vehicle is scheduled to have progressed along
	// the active trip.
	ScheduledDistanceAlongTrip float64 `json:"scheduledDistanceAlongTrip"`
	// References to situation elements (if any) applicable to this trip.
	SituationIDs []string `json:"situationIds"`
	// ID of the transit vehicle currently serving the trip.
	VehicleID string                                                                      `json:"vehicleId"`
	JSON      arrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusJSON `json:"-"`
}

Trip-specific status for the arriving transit vehicle.

func (*ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatus) UnmarshalJSON

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusLastKnownLocation

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusLastKnownLocation struct {
	// Latitude of the last known location of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the last known location of the transit vehicle.
	Lon  float64                                                                                      `json:"lon"`
	JSON arrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusLastKnownLocationJSON `json:"-"`
}

Last known location of the transit vehicle.

func (*ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusLastKnownLocation) UnmarshalJSON

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusPosition

type ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusPosition struct {
	// Latitude of the current position of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the current position of the transit vehicle.
	Lon  float64                                                                             `json:"lon"`
	JSON arrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusPositionJSON `json:"-"`
}

Current position of the transit vehicle.

func (*ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparturesTripStatusPosition) UnmarshalJSON

type ArrivalAndDepartureService

type ArrivalAndDepartureService struct {
	Options []option.RequestOption
}

ArrivalAndDepartureService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewArrivalAndDepartureService method instead.

func NewArrivalAndDepartureService

func NewArrivalAndDepartureService(opts ...option.RequestOption) (r *ArrivalAndDepartureService)

NewArrivalAndDepartureService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ArrivalAndDepartureService) Get

arrival-and-departure-for-stop

func (*ArrivalAndDepartureService) List

arrivals-and-departures-for-stop

type BlockGetResponse

type BlockGetResponse struct {
	Data BlockGetResponseData `json:"data,required"`
	JSON blockGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*BlockGetResponse) UnmarshalJSON

func (r *BlockGetResponse) UnmarshalJSON(data []byte) (err error)

type BlockGetResponseData

type BlockGetResponseData struct {
	Entry      BlockGetResponseDataEntry `json:"entry,required"`
	References shared.References         `json:"references,required"`
	JSON       blockGetResponseDataJSON  `json:"-"`
}

func (*BlockGetResponseData) UnmarshalJSON

func (r *BlockGetResponseData) UnmarshalJSON(data []byte) (err error)

type BlockGetResponseDataEntry

type BlockGetResponseDataEntry struct {
	ID             string                                   `json:"id,required"`
	Configurations []BlockGetResponseDataEntryConfiguration `json:"configurations,required"`
	JSON           blockGetResponseDataEntryJSON            `json:"-"`
}

func (*BlockGetResponseDataEntry) UnmarshalJSON

func (r *BlockGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type BlockGetResponseDataEntryConfiguration

type BlockGetResponseDataEntryConfiguration struct {
	ActiveServiceIDs   []string                                      `json:"activeServiceIds,required"`
	Trips              []BlockGetResponseDataEntryConfigurationsTrip `json:"trips,required"`
	InactiveServiceIDs []string                                      `json:"inactiveServiceIds"`
	JSON               blockGetResponseDataEntryConfigurationJSON    `json:"-"`
}

func (*BlockGetResponseDataEntryConfiguration) UnmarshalJSON

func (r *BlockGetResponseDataEntryConfiguration) UnmarshalJSON(data []byte) (err error)

type BlockGetResponseDataEntryConfigurationsTrip

type BlockGetResponseDataEntryConfigurationsTrip struct {
	AccumulatedSlackTime float64                                                     `json:"accumulatedSlackTime,required"`
	BlockStopTimes       []BlockGetResponseDataEntryConfigurationsTripsBlockStopTime `json:"blockStopTimes,required"`
	DistanceAlongBlock   float64                                                     `json:"distanceAlongBlock,required"`
	TripID               string                                                      `json:"tripId,required"`
	JSON                 blockGetResponseDataEntryConfigurationsTripJSON             `json:"-"`
}

func (*BlockGetResponseDataEntryConfigurationsTrip) UnmarshalJSON

func (r *BlockGetResponseDataEntryConfigurationsTrip) UnmarshalJSON(data []byte) (err error)

type BlockGetResponseDataEntryConfigurationsTripsBlockStopTime

type BlockGetResponseDataEntryConfigurationsTripsBlockStopTime struct {
	AccumulatedSlackTime float64                                                            `json:"accumulatedSlackTime,required"`
	BlockSequence        int64                                                              `json:"blockSequence,required"`
	DistanceAlongBlock   float64                                                            `json:"distanceAlongBlock,required"`
	StopTime             BlockGetResponseDataEntryConfigurationsTripsBlockStopTimesStopTime `json:"stopTime,required"`
	JSON                 blockGetResponseDataEntryConfigurationsTripsBlockStopTimeJSON      `json:"-"`
}

func (*BlockGetResponseDataEntryConfigurationsTripsBlockStopTime) UnmarshalJSON

type BlockGetResponseDataEntryConfigurationsTripsBlockStopTimesStopTime

type BlockGetResponseDataEntryConfigurationsTripsBlockStopTimesStopTime struct {
	ArrivalTime   int64                                                                  `json:"arrivalTime,required"`
	DepartureTime int64                                                                  `json:"departureTime,required"`
	StopID        string                                                                 `json:"stopId,required"`
	DropOffType   int64                                                                  `json:"dropOffType"`
	PickupType    int64                                                                  `json:"pickupType"`
	JSON          blockGetResponseDataEntryConfigurationsTripsBlockStopTimesStopTimeJSON `json:"-"`
}

func (*BlockGetResponseDataEntryConfigurationsTripsBlockStopTimesStopTime) UnmarshalJSON

type BlockService

type BlockService struct {
	Options []option.RequestOption
}

BlockService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBlockService method instead.

func NewBlockService

func NewBlockService(opts ...option.RequestOption) (r *BlockService)

NewBlockService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BlockService) Get

func (r *BlockService) Get(ctx context.Context, blockID string, opts ...option.RequestOption) (res *BlockGetResponse, err error)

Get details of a specific block by ID

type Client

type Client struct {
	Options               []option.RequestOption
	AgenciesWithCoverage  *AgenciesWithCoverageService
	Agency                *AgencyService
	VehiclesForAgency     *VehiclesForAgencyService
	Config                *ConfigService
	CurrentTime           *CurrentTimeService
	StopsForLocation      *StopsForLocationService
	StopsForRoute         *StopsForRouteService
	StopsForAgency        *StopsForAgencyService
	Stop                  *StopService
	StopIDsForAgency      *StopIDsForAgencyService
	ScheduleForStop       *ScheduleForStopService
	Route                 *RouteService
	RouteIDsForAgency     *RouteIDsForAgencyService
	RoutesForLocation     *RoutesForLocationService
	RoutesForAgency       *RoutesForAgencyService
	ScheduleForRoute      *ScheduleForRouteService
	ArrivalAndDeparture   *ArrivalAndDepartureService
	Trip                  *TripService
	TripsForLocation      *TripsForLocationService
	TripDetails           *TripDetailService
	TripForVehicle        *TripForVehicleService
	TripsForRoute         *TripsForRouteService
	ReportProblemWithStop *ReportProblemWithStopService
	ReportProblemWithTrip *ReportProblemWithTripService
	SearchForStop         *SearchForStopService
	SearchForRoute        *SearchForRouteService
	Block                 *BlockService
	Shape                 *ShapeService
}

Client creates a struct with services and top level methods that help with interacting with the onebusaway-sdk API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r *Client)

NewClient generates a new client with the default option read from the environment (ONEBUSAWAY_API_KEY, ONEBUSAWAY_SDK_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type ConfigGetResponse

type ConfigGetResponse struct {
	Data ConfigGetResponseData `json:"data,required"`
	JSON configGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*ConfigGetResponse) UnmarshalJSON

func (r *ConfigGetResponse) UnmarshalJSON(data []byte) (err error)

type ConfigGetResponseData

type ConfigGetResponseData struct {
	Entry      ConfigGetResponseDataEntry `json:"entry,required"`
	References shared.References          `json:"references,required"`
	JSON       configGetResponseDataJSON  `json:"-"`
}

func (*ConfigGetResponseData) UnmarshalJSON

func (r *ConfigGetResponseData) UnmarshalJSON(data []byte) (err error)

type ConfigGetResponseDataEntry

type ConfigGetResponseDataEntry struct {
	ID              string                                  `json:"id"`
	GitProperties   ConfigGetResponseDataEntryGitProperties `json:"gitProperties"`
	Name            string                                  `json:"name"`
	ServiceDateFrom string                                  `json:"serviceDateFrom"`
	ServiceDateTo   string                                  `json:"serviceDateTo"`
	JSON            configGetResponseDataEntryJSON          `json:"-"`
}

func (*ConfigGetResponseDataEntry) UnmarshalJSON

func (r *ConfigGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type ConfigGetResponseDataEntryGitProperties

type ConfigGetResponseDataEntryGitProperties struct {
	GitBranch                string                                      `json:"git.branch"`
	GitBuildHost             string                                      `json:"git.build.host"`
	GitBuildTime             string                                      `json:"git.build.time"`
	GitBuildUserEmail        string                                      `json:"git.build.user.email"`
	GitBuildUserName         string                                      `json:"git.build.user.name"`
	GitBuildVersion          string                                      `json:"git.build.version"`
	GitClosestTagCommitCount string                                      `json:"git.closest.tag.commit.count"`
	GitClosestTagName        string                                      `json:"git.closest.tag.name"`
	GitCommitID              string                                      `json:"git.commit.id"`
	GitCommitIDAbbrev        string                                      `json:"git.commit.id.abbrev"`
	GitCommitIDDescribe      string                                      `json:"git.commit.id.describe"`
	GitCommitIDDescribeShort string                                      `json:"git.commit.id.describe-short"`
	GitCommitMessageFull     string                                      `json:"git.commit.message.full"`
	GitCommitMessageShort    string                                      `json:"git.commit.message.short"`
	GitCommitTime            string                                      `json:"git.commit.time"`
	GitCommitUserEmail       string                                      `json:"git.commit.user.email"`
	GitCommitUserName        string                                      `json:"git.commit.user.name"`
	GitDirty                 string                                      `json:"git.dirty"`
	GitRemoteOriginURL       string                                      `json:"git.remote.origin.url"`
	GitTags                  string                                      `json:"git.tags"`
	JSON                     configGetResponseDataEntryGitPropertiesJSON `json:"-"`
}

func (*ConfigGetResponseDataEntryGitProperties) UnmarshalJSON

func (r *ConfigGetResponseDataEntryGitProperties) UnmarshalJSON(data []byte) (err error)

type ConfigService

type ConfigService struct {
	Options []option.RequestOption
}

ConfigService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConfigService method instead.

func NewConfigService

func NewConfigService(opts ...option.RequestOption) (r *ConfigService)

NewConfigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ConfigService) Get

func (r *ConfigService) Get(ctx context.Context, opts ...option.RequestOption) (res *ConfigGetResponse, err error)

config

type CurrentTimeGetResponse

type CurrentTimeGetResponse struct {
	Data CurrentTimeGetResponseData `json:"data,required"`
	JSON currentTimeGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*CurrentTimeGetResponse) UnmarshalJSON

func (r *CurrentTimeGetResponse) UnmarshalJSON(data []byte) (err error)

type CurrentTimeGetResponseData

type CurrentTimeGetResponseData struct {
	Entry      CurrentTimeGetResponseDataEntry `json:"entry,required"`
	References shared.References               `json:"references,required"`
	JSON       currentTimeGetResponseDataJSON  `json:"-"`
}

func (*CurrentTimeGetResponseData) UnmarshalJSON

func (r *CurrentTimeGetResponseData) UnmarshalJSON(data []byte) (err error)

type CurrentTimeGetResponseDataEntry

type CurrentTimeGetResponseDataEntry struct {
	ReadableTime string                              `json:"readableTime"`
	Time         int64                               `json:"time"`
	JSON         currentTimeGetResponseDataEntryJSON `json:"-"`
}

func (*CurrentTimeGetResponseDataEntry) UnmarshalJSON

func (r *CurrentTimeGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type CurrentTimeService

type CurrentTimeService struct {
	Options []option.RequestOption
}

CurrentTimeService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCurrentTimeService method instead.

func NewCurrentTimeService

func NewCurrentTimeService(opts ...option.RequestOption) (r *CurrentTimeService)

NewCurrentTimeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CurrentTimeService) Get

current-time

type Error

type Error = apierror.Error

type References

type References = shared.References

This is an alias to an internal type.

type ReferencesAgency

type ReferencesAgency = shared.ReferencesAgency

This is an alias to an internal type.

type ReferencesRoute

type ReferencesRoute = shared.ReferencesRoute

This is an alias to an internal type.

type ReferencesSituation

type ReferencesSituation = shared.ReferencesSituation

This is an alias to an internal type.

type ReferencesSituationsActiveWindow

type ReferencesSituationsActiveWindow = shared.ReferencesSituationsActiveWindow

This is an alias to an internal type.

type ReferencesSituationsAllAffect

type ReferencesSituationsAllAffect = shared.ReferencesSituationsAllAffect

This is an alias to an internal type.

type ReferencesSituationsConsequence

type ReferencesSituationsConsequence = shared.ReferencesSituationsConsequence

This is an alias to an internal type.

type ReferencesSituationsConsequencesConditionDetails

type ReferencesSituationsConsequencesConditionDetails = shared.ReferencesSituationsConsequencesConditionDetails

This is an alias to an internal type.

type ReferencesSituationsConsequencesConditionDetailsDiversionPath

type ReferencesSituationsConsequencesConditionDetailsDiversionPath = shared.ReferencesSituationsConsequencesConditionDetailsDiversionPath

This is an alias to an internal type.

type ReferencesSituationsDescription

type ReferencesSituationsDescription = shared.ReferencesSituationsDescription

This is an alias to an internal type.

type ReferencesSituationsPublicationWindow

type ReferencesSituationsPublicationWindow = shared.ReferencesSituationsPublicationWindow

This is an alias to an internal type.

type ReferencesSituationsReason

type ReferencesSituationsReason = shared.ReferencesSituationsReason

Reason for the service alert, taken from TPEG codes.

This is an alias to an internal type.

type ReferencesSituationsSummary

type ReferencesSituationsSummary = shared.ReferencesSituationsSummary

This is an alias to an internal type.

type ReferencesSituationsURL

type ReferencesSituationsURL = shared.ReferencesSituationsURL

This is an alias to an internal type.

type ReferencesStop

type ReferencesStop = shared.ReferencesStop

This is an alias to an internal type.

type ReferencesStopTime

type ReferencesStopTime = shared.ReferencesStopTime

This is an alias to an internal type.

type ReferencesTrip

type ReferencesTrip = shared.ReferencesTrip

This is an alias to an internal type.

type ReportProblemWithStopGetParams

type ReportProblemWithStopGetParams struct {
	// A string code identifying the nature of the problem
	Code param.Field[ReportProblemWithStopGetParamsCode] `query:"code"`
	// Additional comment text supplied by the user describing the problem
	UserComment param.Field[string] `query:"userComment"`
	// The reporting user’s current latitude
	UserLat param.Field[float64] `query:"userLat"`
	// The reporting user’s location accuracy, in meters
	UserLocationAccuracy param.Field[float64] `query:"userLocationAccuracy"`
	// The reporting user’s current longitude
	UserLon param.Field[float64] `query:"userLon"`
}

func (ReportProblemWithStopGetParams) URLQuery

func (r ReportProblemWithStopGetParams) URLQuery() (v url.Values)

URLQuery serializes ReportProblemWithStopGetParams's query parameters as `url.Values`.

type ReportProblemWithStopGetParamsCode

type ReportProblemWithStopGetParamsCode string

A string code identifying the nature of the problem

const (
	ReportProblemWithStopGetParamsCodeStopNameWrong      ReportProblemWithStopGetParamsCode = "stop_name_wrong"
	ReportProblemWithStopGetParamsCodeStopNumberWrong    ReportProblemWithStopGetParamsCode = "stop_number_wrong"
	ReportProblemWithStopGetParamsCodeStopLocationWrong  ReportProblemWithStopGetParamsCode = "stop_location_wrong"
	ReportProblemWithStopGetParamsCodeRouteOrTripMissing ReportProblemWithStopGetParamsCode = "route_or_trip_missing"
	ReportProblemWithStopGetParamsCodeOther              ReportProblemWithStopGetParamsCode = "other"
)

func (ReportProblemWithStopGetParamsCode) IsKnown

type ReportProblemWithStopService

type ReportProblemWithStopService struct {
	Options []option.RequestOption
}

ReportProblemWithStopService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReportProblemWithStopService method instead.

func NewReportProblemWithStopService

func NewReportProblemWithStopService(opts ...option.RequestOption) (r *ReportProblemWithStopService)

NewReportProblemWithStopService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ReportProblemWithStopService) Get

Submit a user-generated problem report for a stop

type ReportProblemWithTripGetParams

type ReportProblemWithTripGetParams struct {
	// A string code identifying the nature of the problem
	Code param.Field[ReportProblemWithTripGetParamsCode] `query:"code"`
	// The service date of the trip
	ServiceDate param.Field[int64] `query:"serviceDate"`
	// A stop ID indicating where the user is experiencing the problem
	StopID param.Field[string] `query:"stopID"`
	// Additional comment text supplied by the user describing the problem
	UserComment param.Field[string] `query:"userComment"`
	// The reporting user’s current latitude
	UserLat param.Field[float64] `query:"userLat"`
	// The reporting user’s location accuracy, in meters
	UserLocationAccuracy param.Field[float64] `query:"userLocationAccuracy"`
	// The reporting user’s current longitude
	UserLon param.Field[float64] `query:"userLon"`
	// Indicator if the user is on the transit vehicle experiencing the problem
	UserOnVehicle param.Field[bool] `query:"userOnVehicle"`
	// The vehicle number, as reported by the user
	UserVehicleNumber param.Field[string] `query:"userVehicleNumber"`
	// The vehicle actively serving the trip
	VehicleID param.Field[string] `query:"vehicleID"`
}

func (ReportProblemWithTripGetParams) URLQuery

func (r ReportProblemWithTripGetParams) URLQuery() (v url.Values)

URLQuery serializes ReportProblemWithTripGetParams's query parameters as `url.Values`.

type ReportProblemWithTripGetParamsCode

type ReportProblemWithTripGetParamsCode string

A string code identifying the nature of the problem

const (
	ReportProblemWithTripGetParamsCodeVehicleNeverCame       ReportProblemWithTripGetParamsCode = "vehicle_never_came"
	ReportProblemWithTripGetParamsCodeVehicleCameEarly       ReportProblemWithTripGetParamsCode = "vehicle_came_early"
	ReportProblemWithTripGetParamsCodeVehicleCameLate        ReportProblemWithTripGetParamsCode = "vehicle_came_late"
	ReportProblemWithTripGetParamsCodeWrongHeadsign          ReportProblemWithTripGetParamsCode = "wrong_headsign"
	ReportProblemWithTripGetParamsCodeVehicleDoesNotStopHere ReportProblemWithTripGetParamsCode = "vehicle_does_not_stop_here"
	ReportProblemWithTripGetParamsCodeOther                  ReportProblemWithTripGetParamsCode = "other"
)

func (ReportProblemWithTripGetParamsCode) IsKnown

type ReportProblemWithTripService

type ReportProblemWithTripService struct {
	Options []option.RequestOption
}

ReportProblemWithTripService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReportProblemWithTripService method instead.

func NewReportProblemWithTripService

func NewReportProblemWithTripService(opts ...option.RequestOption) (r *ReportProblemWithTripService)

NewReportProblemWithTripService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ReportProblemWithTripService) Get

Submit a user-generated problem report for a particular trip.

type ResponseWrapper

type ResponseWrapper = shared.ResponseWrapper

This is an alias to an internal type.

type RouteGetResponse

type RouteGetResponse struct {
	Data RouteGetResponseData `json:"data,required"`
	JSON routeGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*RouteGetResponse) UnmarshalJSON

func (r *RouteGetResponse) UnmarshalJSON(data []byte) (err error)

type RouteGetResponseData

type RouteGetResponseData struct {
	Entry      RouteGetResponseDataEntry `json:"entry,required"`
	References shared.References         `json:"references,required"`
	JSON       routeGetResponseDataJSON  `json:"-"`
}

func (*RouteGetResponseData) UnmarshalJSON

func (r *RouteGetResponseData) UnmarshalJSON(data []byte) (err error)

type RouteGetResponseDataEntry

type RouteGetResponseDataEntry struct {
	ID                string                        `json:"id,required"`
	AgencyID          string                        `json:"agencyId,required"`
	Type              int64                         `json:"type,required"`
	Color             string                        `json:"color"`
	Description       string                        `json:"description"`
	LongName          string                        `json:"longName"`
	NullSafeShortName string                        `json:"nullSafeShortName"`
	ShortName         string                        `json:"shortName"`
	TextColor         string                        `json:"textColor"`
	URL               string                        `json:"url"`
	JSON              routeGetResponseDataEntryJSON `json:"-"`
}

func (*RouteGetResponseDataEntry) UnmarshalJSON

func (r *RouteGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type RouteIDsForAgencyListResponse

type RouteIDsForAgencyListResponse struct {
	Data RouteIDsForAgencyListResponseData `json:"data,required"`
	JSON routeIDsForAgencyListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*RouteIDsForAgencyListResponse) UnmarshalJSON

func (r *RouteIDsForAgencyListResponse) UnmarshalJSON(data []byte) (err error)

type RouteIDsForAgencyListResponseData

type RouteIDsForAgencyListResponseData struct {
	LimitExceeded bool                                  `json:"limitExceeded,required"`
	List          []string                              `json:"list,required"`
	References    shared.References                     `json:"references,required"`
	JSON          routeIDsForAgencyListResponseDataJSON `json:"-"`
}

func (*RouteIDsForAgencyListResponseData) UnmarshalJSON

func (r *RouteIDsForAgencyListResponseData) UnmarshalJSON(data []byte) (err error)

type RouteIDsForAgencyService

type RouteIDsForAgencyService struct {
	Options []option.RequestOption
}

RouteIDsForAgencyService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRouteIDsForAgencyService method instead.

func NewRouteIDsForAgencyService

func NewRouteIDsForAgencyService(opts ...option.RequestOption) (r *RouteIDsForAgencyService)

NewRouteIDsForAgencyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RouteIDsForAgencyService) List

Get route IDs for a specific agency

type RouteService

type RouteService struct {
	Options []option.RequestOption
}

RouteService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRouteService method instead.

func NewRouteService

func NewRouteService(opts ...option.RequestOption) (r *RouteService)

NewRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RouteService) Get

func (r *RouteService) Get(ctx context.Context, routeID string, opts ...option.RequestOption) (res *RouteGetResponse, err error)

Retrieve information for a specific route identified by its unique ID.

type RoutesForAgencyListResponse

type RoutesForAgencyListResponse struct {
	Data RoutesForAgencyListResponseData `json:"data,required"`
	JSON routesForAgencyListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*RoutesForAgencyListResponse) UnmarshalJSON

func (r *RoutesForAgencyListResponse) UnmarshalJSON(data []byte) (err error)

type RoutesForAgencyListResponseData

type RoutesForAgencyListResponseData struct {
	LimitExceeded bool                                  `json:"limitExceeded,required"`
	List          []RoutesForAgencyListResponseDataList `json:"list,required"`
	References    shared.References                     `json:"references,required"`
	JSON          routesForAgencyListResponseDataJSON   `json:"-"`
}

func (*RoutesForAgencyListResponseData) UnmarshalJSON

func (r *RoutesForAgencyListResponseData) UnmarshalJSON(data []byte) (err error)

type RoutesForAgencyListResponseDataList

type RoutesForAgencyListResponseDataList struct {
	ID                string                                  `json:"id,required"`
	AgencyID          string                                  `json:"agencyId,required"`
	Type              int64                                   `json:"type,required"`
	Color             string                                  `json:"color"`
	Description       string                                  `json:"description"`
	LongName          string                                  `json:"longName"`
	NullSafeShortName string                                  `json:"nullSafeShortName"`
	ShortName         string                                  `json:"shortName"`
	TextColor         string                                  `json:"textColor"`
	URL               string                                  `json:"url"`
	JSON              routesForAgencyListResponseDataListJSON `json:"-"`
}

func (*RoutesForAgencyListResponseDataList) UnmarshalJSON

func (r *RoutesForAgencyListResponseDataList) UnmarshalJSON(data []byte) (err error)

type RoutesForAgencyService

type RoutesForAgencyService struct {
	Options []option.RequestOption
}

RoutesForAgencyService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRoutesForAgencyService method instead.

func NewRoutesForAgencyService

func NewRoutesForAgencyService(opts ...option.RequestOption) (r *RoutesForAgencyService)

NewRoutesForAgencyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RoutesForAgencyService) List

Retrieve the list of all routes for a particular agency by id

type RoutesForLocationListParams

type RoutesForLocationListParams struct {
	Lat     param.Field[float64] `query:"lat,required"`
	Lon     param.Field[float64] `query:"lon,required"`
	LatSpan param.Field[float64] `query:"latSpan"`
	LonSpan param.Field[float64] `query:"lonSpan"`
	Query   param.Field[string]  `query:"query"`
	Radius  param.Field[float64] `query:"radius"`
}

func (RoutesForLocationListParams) URLQuery

func (r RoutesForLocationListParams) URLQuery() (v url.Values)

URLQuery serializes RoutesForLocationListParams's query parameters as `url.Values`.

type RoutesForLocationListResponse

type RoutesForLocationListResponse struct {
	Data RoutesForLocationListResponseData `json:"data,required"`
	JSON routesForLocationListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*RoutesForLocationListResponse) UnmarshalJSON

func (r *RoutesForLocationListResponse) UnmarshalJSON(data []byte) (err error)

type RoutesForLocationListResponseData

type RoutesForLocationListResponseData struct {
	LimitExceeded bool                                    `json:"limitExceeded,required"`
	List          []RoutesForLocationListResponseDataList `json:"list,required"`
	OutOfRange    bool                                    `json:"outOfRange,required"`
	References    shared.References                       `json:"references,required"`
	JSON          routesForLocationListResponseDataJSON   `json:"-"`
}

func (*RoutesForLocationListResponseData) UnmarshalJSON

func (r *RoutesForLocationListResponseData) UnmarshalJSON(data []byte) (err error)

type RoutesForLocationListResponseDataList

type RoutesForLocationListResponseDataList struct {
	ID                string                                    `json:"id,required"`
	AgencyID          string                                    `json:"agencyId,required"`
	Type              int64                                     `json:"type,required"`
	Color             string                                    `json:"color"`
	Description       string                                    `json:"description"`
	LongName          string                                    `json:"longName"`
	NullSafeShortName string                                    `json:"nullSafeShortName"`
	ShortName         string                                    `json:"shortName"`
	TextColor         string                                    `json:"textColor"`
	URL               string                                    `json:"url"`
	JSON              routesForLocationListResponseDataListJSON `json:"-"`
}

func (*RoutesForLocationListResponseDataList) UnmarshalJSON

func (r *RoutesForLocationListResponseDataList) UnmarshalJSON(data []byte) (err error)

type RoutesForLocationService

type RoutesForLocationService struct {
	Options []option.RequestOption
}

RoutesForLocationService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRoutesForLocationService method instead.

func NewRoutesForLocationService

func NewRoutesForLocationService(opts ...option.RequestOption) (r *RoutesForLocationService)

NewRoutesForLocationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RoutesForLocationService) List

routes-for-location

type ScheduleForRouteGetParams

type ScheduleForRouteGetParams struct {
	// The date for which you want to request a schedule in the format YYYY-MM-DD
	// (optional, defaults to current date)
	Date param.Field[time.Time] `query:"date" format:"date"`
}

func (ScheduleForRouteGetParams) URLQuery

func (r ScheduleForRouteGetParams) URLQuery() (v url.Values)

URLQuery serializes ScheduleForRouteGetParams's query parameters as `url.Values`.

type ScheduleForRouteGetResponse

type ScheduleForRouteGetResponse struct {
	Data ScheduleForRouteGetResponseData `json:"data,required"`
	JSON scheduleForRouteGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*ScheduleForRouteGetResponse) UnmarshalJSON

func (r *ScheduleForRouteGetResponse) UnmarshalJSON(data []byte) (err error)

type ScheduleForRouteGetResponseData

type ScheduleForRouteGetResponseData struct {
	Entry ScheduleForRouteGetResponseDataEntry `json:"entry,required"`
	JSON  scheduleForRouteGetResponseDataJSON  `json:"-"`
}

func (*ScheduleForRouteGetResponseData) UnmarshalJSON

func (r *ScheduleForRouteGetResponseData) UnmarshalJSON(data []byte) (err error)

type ScheduleForRouteGetResponseDataEntry

type ScheduleForRouteGetResponseDataEntry struct {
	RouteID           string                                                 `json:"routeId,required"`
	ScheduleDate      int64                                                  `json:"scheduleDate,required"`
	ServiceIDs        []string                                               `json:"serviceIds,required"`
	Stops             []ScheduleForRouteGetResponseDataEntryStop             `json:"stops,required"`
	StopTripGroupings []ScheduleForRouteGetResponseDataEntryStopTripGrouping `json:"stopTripGroupings,required"`
	Trips             []ScheduleForRouteGetResponseDataEntryTrip             `json:"trips,required"`
	JSON              scheduleForRouteGetResponseDataEntryJSON               `json:"-"`
}

func (*ScheduleForRouteGetResponseDataEntry) UnmarshalJSON

func (r *ScheduleForRouteGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type ScheduleForRouteGetResponseDataEntryStop

type ScheduleForRouteGetResponseDataEntryStop struct {
	ID                 string                                       `json:"id,required"`
	Lat                float64                                      `json:"lat,required"`
	LocationType       int64                                        `json:"locationType,required"`
	Lon                float64                                      `json:"lon,required"`
	Name               string                                       `json:"name,required"`
	Parent             string                                       `json:"parent,required"`
	RouteIDs           []string                                     `json:"routeIds,required"`
	StaticRouteIDs     []string                                     `json:"staticRouteIds,required"`
	Code               string                                       `json:"code"`
	Direction          string                                       `json:"direction"`
	WheelchairBoarding string                                       `json:"wheelchairBoarding"`
	JSON               scheduleForRouteGetResponseDataEntryStopJSON `json:"-"`
}

func (*ScheduleForRouteGetResponseDataEntryStop) UnmarshalJSON

func (r *ScheduleForRouteGetResponseDataEntryStop) UnmarshalJSON(data []byte) (err error)

type ScheduleForRouteGetResponseDataEntryStopTripGrouping

type ScheduleForRouteGetResponseDataEntryStopTripGrouping struct {
	DirectionID        string                                                                   `json:"directionId,required"`
	StopIDs            []string                                                                 `json:"stopIds,required"`
	TripHeadsigns      []string                                                                 `json:"tripHeadsigns,required"`
	TripIDs            []string                                                                 `json:"tripIds,required"`
	TripsWithStopTimes []ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTime `json:"tripsWithStopTimes"`
	JSON               scheduleForRouteGetResponseDataEntryStopTripGroupingJSON                 `json:"-"`
}

func (*ScheduleForRouteGetResponseDataEntryStopTripGrouping) UnmarshalJSON

func (r *ScheduleForRouteGetResponseDataEntryStopTripGrouping) UnmarshalJSON(data []byte) (err error)

type ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTime

type ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTime struct {
	StopTimes []ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTimesStopTime `json:"stopTimes,required"`
	TripID    string                                                                            `json:"tripId,required"`
	JSON      scheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTimeJSON        `json:"-"`
}

func (*ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTime) UnmarshalJSON

type ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTimesStopTime

type ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTimesStopTime struct {
	ArrivalEnabled   bool                                                                                `json:"arrivalEnabled,required"`
	ArrivalTime      int64                                                                               `json:"arrivalTime,required"`
	DepartureEnabled bool                                                                                `json:"departureEnabled,required"`
	DepartureTime    int64                                                                               `json:"departureTime,required"`
	StopID           string                                                                              `json:"stopId,required"`
	TripID           string                                                                              `json:"tripId,required"`
	ServiceID        string                                                                              `json:"serviceId"`
	StopHeadsign     string                                                                              `json:"stopHeadsign"`
	JSON             scheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTimesStopTimeJSON `json:"-"`
}

func (*ScheduleForRouteGetResponseDataEntryStopTripGroupingsTripsWithStopTimesStopTime) UnmarshalJSON

type ScheduleForRouteGetResponseDataEntryTrip

type ScheduleForRouteGetResponseDataEntryTrip struct {
	ID             string                                       `json:"id,required"`
	RouteID        string                                       `json:"routeId,required"`
	ServiceID      string                                       `json:"serviceId,required"`
	BlockID        string                                       `json:"blockId"`
	DirectionID    string                                       `json:"directionId"`
	PeakOffpeak    int64                                        `json:"peakOffpeak"`
	RouteShortName string                                       `json:"routeShortName"`
	ShapeID        string                                       `json:"shapeId"`
	TimeZone       string                                       `json:"timeZone"`
	TripHeadsign   string                                       `json:"tripHeadsign"`
	TripShortName  string                                       `json:"tripShortName"`
	JSON           scheduleForRouteGetResponseDataEntryTripJSON `json:"-"`
}

func (*ScheduleForRouteGetResponseDataEntryTrip) UnmarshalJSON

func (r *ScheduleForRouteGetResponseDataEntryTrip) UnmarshalJSON(data []byte) (err error)

type ScheduleForRouteService

type ScheduleForRouteService struct {
	Options []option.RequestOption
}

ScheduleForRouteService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewScheduleForRouteService method instead.

func NewScheduleForRouteService

func NewScheduleForRouteService(opts ...option.RequestOption) (r *ScheduleForRouteService)

NewScheduleForRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ScheduleForRouteService) Get

Retrieve the full schedule for a route on a particular day

type ScheduleForStopGetParams

type ScheduleForStopGetParams struct {
	// The date for which you want to request a schedule in the format YYYY-MM-DD
	// (optional, defaults to the current date)
	Date param.Field[time.Time] `query:"date" format:"date"`
}

func (ScheduleForStopGetParams) URLQuery

func (r ScheduleForStopGetParams) URLQuery() (v url.Values)

URLQuery serializes ScheduleForStopGetParams's query parameters as `url.Values`.

type ScheduleForStopGetResponse

type ScheduleForStopGetResponse struct {
	Data ScheduleForStopGetResponseData `json:"data,required"`
	JSON scheduleForStopGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*ScheduleForStopGetResponse) UnmarshalJSON

func (r *ScheduleForStopGetResponse) UnmarshalJSON(data []byte) (err error)

type ScheduleForStopGetResponseData

type ScheduleForStopGetResponseData struct {
	Entry      ScheduleForStopGetResponseDataEntry `json:"entry,required"`
	References shared.References                   `json:"references,required"`
	JSON       scheduleForStopGetResponseDataJSON  `json:"-"`
}

func (*ScheduleForStopGetResponseData) UnmarshalJSON

func (r *ScheduleForStopGetResponseData) UnmarshalJSON(data []byte) (err error)

type ScheduleForStopGetResponseDataEntry

type ScheduleForStopGetResponseDataEntry struct {
	Date               int64                                                  `json:"date,required"`
	StopID             string                                                 `json:"stopId,required"`
	StopRouteSchedules []ScheduleForStopGetResponseDataEntryStopRouteSchedule `json:"stopRouteSchedules,required"`
	JSON               scheduleForStopGetResponseDataEntryJSON                `json:"-"`
}

func (*ScheduleForStopGetResponseDataEntry) UnmarshalJSON

func (r *ScheduleForStopGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type ScheduleForStopGetResponseDataEntryStopRouteSchedule

type ScheduleForStopGetResponseDataEntryStopRouteSchedule struct {
	RouteID                     string                                                                            `json:"routeId,required"`
	StopRouteDirectionSchedules []ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedule `json:"stopRouteDirectionSchedules,required"`
	JSON                        scheduleForStopGetResponseDataEntryStopRouteScheduleJSON                          `json:"-"`
}

func (*ScheduleForStopGetResponseDataEntryStopRouteSchedule) UnmarshalJSON

func (r *ScheduleForStopGetResponseDataEntryStopRouteSchedule) UnmarshalJSON(data []byte) (err error)

type ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedule

type ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedule struct {
	ScheduleStopTimes   []ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleStopTime  `json:"scheduleStopTimes,required"`
	TripHeadsign        string                                                                                              `json:"tripHeadsign,required"`
	ScheduleFrequencies []ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleFrequency `json:"scheduleFrequencies"`
	JSON                scheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionScheduleJSON                 `json:"-"`
}

func (*ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedule) UnmarshalJSON

type ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleFrequency

type ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleFrequency struct {
	EndTime     int64                                                                                                 `json:"endTime,required"`
	Headway     int64                                                                                                 `json:"headway,required"`
	ServiceDate int64                                                                                                 `json:"serviceDate,required"`
	ServiceID   string                                                                                                `json:"serviceId,required"`
	StartTime   int64                                                                                                 `json:"startTime,required"`
	TripID      string                                                                                                `json:"tripId,required"`
	JSON        scheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleFrequencyJSON `json:"-"`
}

func (*ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleFrequency) UnmarshalJSON

type ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleStopTime

type ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleStopTime struct {
	ArrivalEnabled   bool                                                                                                 `json:"arrivalEnabled,required"`
	ArrivalTime      int64                                                                                                `json:"arrivalTime,required"`
	DepartureEnabled bool                                                                                                 `json:"departureEnabled,required"`
	DepartureTime    int64                                                                                                `json:"departureTime,required"`
	ServiceID        string                                                                                               `json:"serviceId,required"`
	TripID           string                                                                                               `json:"tripId,required"`
	StopHeadsign     string                                                                                               `json:"stopHeadsign"`
	JSON             scheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleStopTimeJSON `json:"-"`
}

func (*ScheduleForStopGetResponseDataEntryStopRouteSchedulesStopRouteDirectionSchedulesScheduleStopTime) UnmarshalJSON

type ScheduleForStopService

type ScheduleForStopService struct {
	Options []option.RequestOption
}

ScheduleForStopService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewScheduleForStopService method instead.

func NewScheduleForStopService

func NewScheduleForStopService(opts ...option.RequestOption) (r *ScheduleForStopService)

NewScheduleForStopService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ScheduleForStopService) Get

Get schedule for a specific stop

type SearchForRouteListParams

type SearchForRouteListParams struct {
	// The string to search for.
	Input param.Field[string] `query:"input,required"`
	// The max number of results to return. Defaults to 20.
	MaxCount param.Field[int64] `query:"maxCount"`
}

func (SearchForRouteListParams) URLQuery

func (r SearchForRouteListParams) URLQuery() (v url.Values)

URLQuery serializes SearchForRouteListParams's query parameters as `url.Values`.

type SearchForRouteListResponse

type SearchForRouteListResponse struct {
	Data SearchForRouteListResponseData `json:"data"`
	JSON searchForRouteListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*SearchForRouteListResponse) UnmarshalJSON

func (r *SearchForRouteListResponse) UnmarshalJSON(data []byte) (err error)

type SearchForRouteListResponseData

type SearchForRouteListResponseData struct {
	LimitExceeded bool                                 `json:"limitExceeded,required"`
	List          []SearchForRouteListResponseDataList `json:"list,required"`
	OutOfRange    bool                                 `json:"outOfRange,required"`
	References    shared.References                    `json:"references,required"`
	JSON          searchForRouteListResponseDataJSON   `json:"-"`
}

func (*SearchForRouteListResponseData) UnmarshalJSON

func (r *SearchForRouteListResponseData) UnmarshalJSON(data []byte) (err error)

type SearchForRouteListResponseDataList

type SearchForRouteListResponseDataList struct {
	ID                string                                 `json:"id,required"`
	AgencyID          string                                 `json:"agencyId,required"`
	Type              int64                                  `json:"type,required"`
	Color             string                                 `json:"color"`
	Description       string                                 `json:"description"`
	LongName          string                                 `json:"longName"`
	NullSafeShortName string                                 `json:"nullSafeShortName"`
	ShortName         string                                 `json:"shortName"`
	TextColor         string                                 `json:"textColor"`
	URL               string                                 `json:"url"`
	JSON              searchForRouteListResponseDataListJSON `json:"-"`
}

func (*SearchForRouteListResponseDataList) UnmarshalJSON

func (r *SearchForRouteListResponseDataList) UnmarshalJSON(data []byte) (err error)

type SearchForRouteService

type SearchForRouteService struct {
	Options []option.RequestOption
}

SearchForRouteService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSearchForRouteService method instead.

func NewSearchForRouteService

func NewSearchForRouteService(opts ...option.RequestOption) (r *SearchForRouteService)

NewSearchForRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SearchForRouteService) List

Search for a route based on its name.

type SearchForStopListParams

type SearchForStopListParams struct {
	// The string to search for.
	Input param.Field[string] `query:"input,required"`
	// The max number of results to return. Defaults to 20.
	MaxCount param.Field[int64] `query:"maxCount"`
}

func (SearchForStopListParams) URLQuery

func (r SearchForStopListParams) URLQuery() (v url.Values)

URLQuery serializes SearchForStopListParams's query parameters as `url.Values`.

type SearchForStopListResponse

type SearchForStopListResponse struct {
	Data SearchForStopListResponseData `json:"data"`
	JSON searchForStopListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*SearchForStopListResponse) UnmarshalJSON

func (r *SearchForStopListResponse) UnmarshalJSON(data []byte) (err error)

type SearchForStopListResponseData

type SearchForStopListResponseData struct {
	LimitExceeded bool                                `json:"limitExceeded,required"`
	List          []SearchForStopListResponseDataList `json:"list,required"`
	OutOfRange    bool                                `json:"outOfRange,required"`
	References    shared.References                   `json:"references,required"`
	JSON          searchForStopListResponseDataJSON   `json:"-"`
}

func (*SearchForStopListResponseData) UnmarshalJSON

func (r *SearchForStopListResponseData) UnmarshalJSON(data []byte) (err error)

type SearchForStopListResponseDataList

type SearchForStopListResponseDataList struct {
	ID                 string                                `json:"id,required"`
	Lat                float64                               `json:"lat,required"`
	LocationType       int64                                 `json:"locationType,required"`
	Lon                float64                               `json:"lon,required"`
	Name               string                                `json:"name,required"`
	Parent             string                                `json:"parent,required"`
	RouteIDs           []string                              `json:"routeIds,required"`
	StaticRouteIDs     []string                              `json:"staticRouteIds,required"`
	Code               string                                `json:"code"`
	Direction          string                                `json:"direction"`
	WheelchairBoarding string                                `json:"wheelchairBoarding"`
	JSON               searchForStopListResponseDataListJSON `json:"-"`
}

func (*SearchForStopListResponseDataList) UnmarshalJSON

func (r *SearchForStopListResponseDataList) UnmarshalJSON(data []byte) (err error)

type SearchForStopService

type SearchForStopService struct {
	Options []option.RequestOption
}

SearchForStopService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSearchForStopService method instead.

func NewSearchForStopService

func NewSearchForStopService(opts ...option.RequestOption) (r *SearchForStopService)

NewSearchForStopService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SearchForStopService) List

Search for a stop based on its name.

type ShapeGetResponse

type ShapeGetResponse struct {
	Data ShapeGetResponseData `json:"data,required"`
	JSON shapeGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*ShapeGetResponse) UnmarshalJSON

func (r *ShapeGetResponse) UnmarshalJSON(data []byte) (err error)

type ShapeGetResponseData

type ShapeGetResponseData struct {
	Entry      ShapeGetResponseDataEntry `json:"entry,required"`
	References shared.References         `json:"references,required"`
	JSON       shapeGetResponseDataJSON  `json:"-"`
}

func (*ShapeGetResponseData) UnmarshalJSON

func (r *ShapeGetResponseData) UnmarshalJSON(data []byte) (err error)

type ShapeGetResponseDataEntry

type ShapeGetResponseDataEntry struct {
	Length int64 `json:"length,required"`
	// Encoded polyline format representing the shape of the path
	Points string                        `json:"points,required"`
	Levels string                        `json:"levels"`
	JSON   shapeGetResponseDataEntryJSON `json:"-"`
}

func (*ShapeGetResponseDataEntry) UnmarshalJSON

func (r *ShapeGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type ShapeService

type ShapeService struct {
	Options []option.RequestOption
}

ShapeService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewShapeService method instead.

func NewShapeService

func NewShapeService(opts ...option.RequestOption) (r *ShapeService)

NewShapeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ShapeService) Get

func (r *ShapeService) Get(ctx context.Context, shapeID string, opts ...option.RequestOption) (res *ShapeGetResponse, err error)

Retrieve a shape (the path traveled by a transit vehicle) by ID.

type StopGetResponse

type StopGetResponse struct {
	Data StopGetResponseData `json:"data,required"`
	JSON stopGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*StopGetResponse) UnmarshalJSON

func (r *StopGetResponse) UnmarshalJSON(data []byte) (err error)

type StopGetResponseData

type StopGetResponseData struct {
	Entry      StopGetResponseDataEntry `json:"entry,required"`
	References shared.References        `json:"references,required"`
	JSON       stopGetResponseDataJSON  `json:"-"`
}

func (*StopGetResponseData) UnmarshalJSON

func (r *StopGetResponseData) UnmarshalJSON(data []byte) (err error)

type StopGetResponseDataEntry

type StopGetResponseDataEntry struct {
	ID                 string                       `json:"id,required"`
	Lat                float64                      `json:"lat,required"`
	LocationType       int64                        `json:"locationType,required"`
	Lon                float64                      `json:"lon,required"`
	Name               string                       `json:"name,required"`
	Parent             string                       `json:"parent,required"`
	RouteIDs           []string                     `json:"routeIds,required"`
	StaticRouteIDs     []string                     `json:"staticRouteIds,required"`
	Code               string                       `json:"code"`
	Direction          string                       `json:"direction"`
	WheelchairBoarding string                       `json:"wheelchairBoarding"`
	JSON               stopGetResponseDataEntryJSON `json:"-"`
}

func (*StopGetResponseDataEntry) UnmarshalJSON

func (r *StopGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type StopIDsForAgencyListResponse

type StopIDsForAgencyListResponse struct {
	Data StopIDsForAgencyListResponseData `json:"data,required"`
	JSON stopIDsForAgencyListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*StopIDsForAgencyListResponse) UnmarshalJSON

func (r *StopIDsForAgencyListResponse) UnmarshalJSON(data []byte) (err error)

type StopIDsForAgencyListResponseData

type StopIDsForAgencyListResponseData struct {
	LimitExceeded bool                                 `json:"limitExceeded,required"`
	List          []string                             `json:"list,required"`
	References    shared.References                    `json:"references,required"`
	JSON          stopIDsForAgencyListResponseDataJSON `json:"-"`
}

func (*StopIDsForAgencyListResponseData) UnmarshalJSON

func (r *StopIDsForAgencyListResponseData) UnmarshalJSON(data []byte) (err error)

type StopIDsForAgencyService

type StopIDsForAgencyService struct {
	Options []option.RequestOption
}

StopIDsForAgencyService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStopIDsForAgencyService method instead.

func NewStopIDsForAgencyService

func NewStopIDsForAgencyService(opts ...option.RequestOption) (r *StopIDsForAgencyService)

NewStopIDsForAgencyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StopIDsForAgencyService) List

Get stop IDs for a specific agency

type StopService

type StopService struct {
	Options []option.RequestOption
}

StopService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStopService method instead.

func NewStopService

func NewStopService(opts ...option.RequestOption) (r *StopService)

NewStopService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StopService) Get

func (r *StopService) Get(ctx context.Context, stopID string, opts ...option.RequestOption) (res *StopGetResponse, err error)

Get details of a specific stop

type StopsForAgencyListResponse

type StopsForAgencyListResponse struct {
	LimitExceeded bool                             `json:"limitExceeded,required"`
	List          []StopsForAgencyListResponseList `json:"list,required"`
	References    shared.References                `json:"references,required"`
	OutOfRange    bool                             `json:"outOfRange"`
	JSON          stopsForAgencyListResponseJSON   `json:"-"`
	shared.ResponseWrapper
}

func (*StopsForAgencyListResponse) UnmarshalJSON

func (r *StopsForAgencyListResponse) UnmarshalJSON(data []byte) (err error)

type StopsForAgencyListResponseList

type StopsForAgencyListResponseList struct {
	ID                 string                             `json:"id,required"`
	Lat                float64                            `json:"lat,required"`
	LocationType       int64                              `json:"locationType,required"`
	Lon                float64                            `json:"lon,required"`
	Name               string                             `json:"name,required"`
	Parent             string                             `json:"parent,required"`
	RouteIDs           []string                           `json:"routeIds,required"`
	StaticRouteIDs     []string                           `json:"staticRouteIds,required"`
	Code               string                             `json:"code"`
	Direction          string                             `json:"direction"`
	WheelchairBoarding string                             `json:"wheelchairBoarding"`
	JSON               stopsForAgencyListResponseListJSON `json:"-"`
}

func (*StopsForAgencyListResponseList) UnmarshalJSON

func (r *StopsForAgencyListResponseList) UnmarshalJSON(data []byte) (err error)

type StopsForAgencyService

type StopsForAgencyService struct {
	Options []option.RequestOption
}

StopsForAgencyService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStopsForAgencyService method instead.

func NewStopsForAgencyService

func NewStopsForAgencyService(opts ...option.RequestOption) (r *StopsForAgencyService)

NewStopsForAgencyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StopsForAgencyService) List

Get stops for a specific agency

type StopsForLocationListParams

type StopsForLocationListParams struct {
	Lat param.Field[float64] `query:"lat,required"`
	Lon param.Field[float64] `query:"lon,required"`
	// An alternative to radius to set the search bounding box (optional)
	LatSpan param.Field[float64] `query:"latSpan"`
	// An alternative to radius to set the search bounding box (optional)
	LonSpan param.Field[float64] `query:"lonSpan"`
	// A search query string to filter the results
	Query param.Field[string] `query:"query"`
	// The radius in meters to search within
	Radius param.Field[float64] `query:"radius"`
}

func (StopsForLocationListParams) URLQuery

func (r StopsForLocationListParams) URLQuery() (v url.Values)

URLQuery serializes StopsForLocationListParams's query parameters as `url.Values`.

type StopsForLocationListResponse

type StopsForLocationListResponse struct {
	Data StopsForLocationListResponseData `json:"data,required"`
	JSON stopsForLocationListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*StopsForLocationListResponse) UnmarshalJSON

func (r *StopsForLocationListResponse) UnmarshalJSON(data []byte) (err error)

type StopsForLocationListResponseData

type StopsForLocationListResponseData struct {
	LimitExceeded bool                                   `json:"limitExceeded,required"`
	List          []StopsForLocationListResponseDataList `json:"list,required"`
	References    shared.References                      `json:"references,required"`
	OutOfRange    bool                                   `json:"outOfRange"`
	JSON          stopsForLocationListResponseDataJSON   `json:"-"`
}

func (*StopsForLocationListResponseData) UnmarshalJSON

func (r *StopsForLocationListResponseData) UnmarshalJSON(data []byte) (err error)

type StopsForLocationListResponseDataList

type StopsForLocationListResponseDataList struct {
	ID                 string                                   `json:"id,required"`
	Lat                float64                                  `json:"lat,required"`
	LocationType       int64                                    `json:"locationType,required"`
	Lon                float64                                  `json:"lon,required"`
	Name               string                                   `json:"name,required"`
	Parent             string                                   `json:"parent,required"`
	RouteIDs           []string                                 `json:"routeIds,required"`
	StaticRouteIDs     []string                                 `json:"staticRouteIds,required"`
	Code               string                                   `json:"code"`
	Direction          string                                   `json:"direction"`
	WheelchairBoarding string                                   `json:"wheelchairBoarding"`
	JSON               stopsForLocationListResponseDataListJSON `json:"-"`
}

func (*StopsForLocationListResponseDataList) UnmarshalJSON

func (r *StopsForLocationListResponseDataList) UnmarshalJSON(data []byte) (err error)

type StopsForLocationService

type StopsForLocationService struct {
	Options []option.RequestOption
}

StopsForLocationService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStopsForLocationService method instead.

func NewStopsForLocationService

func NewStopsForLocationService(opts ...option.RequestOption) (r *StopsForLocationService)

NewStopsForLocationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StopsForLocationService) List

stops-for-location

type StopsForRouteListParams

type StopsForRouteListParams struct {
	// Include polyline elements in the response (default true)
	IncludePolylines param.Field[bool] `query:"includePolylines"`
	// Specify service date (YYYY-MM-DD or epoch) (default today)
	Time param.Field[string] `query:"time"`
}

func (StopsForRouteListParams) URLQuery

func (r StopsForRouteListParams) URLQuery() (v url.Values)

URLQuery serializes StopsForRouteListParams's query parameters as `url.Values`.

type StopsForRouteListResponse

type StopsForRouteListResponse struct {
	Data StopsForRouteListResponseData `json:"data,required"`
	JSON stopsForRouteListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*StopsForRouteListResponse) UnmarshalJSON

func (r *StopsForRouteListResponse) UnmarshalJSON(data []byte) (err error)

type StopsForRouteListResponseData

type StopsForRouteListResponseData struct {
	Entry      StopsForRouteListResponseDataEntry `json:"entry,required"`
	References shared.References                  `json:"references,required"`
	JSON       stopsForRouteListResponseDataJSON  `json:"-"`
}

func (*StopsForRouteListResponseData) UnmarshalJSON

func (r *StopsForRouteListResponseData) UnmarshalJSON(data []byte) (err error)

type StopsForRouteListResponseDataEntry

type StopsForRouteListResponseDataEntry struct {
	Polylines     []StopsForRouteListResponseDataEntryPolyline     `json:"polylines"`
	RouteID       string                                           `json:"routeId"`
	StopGroupings []StopsForRouteListResponseDataEntryStopGrouping `json:"stopGroupings"`
	StopIDs       []string                                         `json:"stopIds"`
	JSON          stopsForRouteListResponseDataEntryJSON           `json:"-"`
}

func (*StopsForRouteListResponseDataEntry) UnmarshalJSON

func (r *StopsForRouteListResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type StopsForRouteListResponseDataEntryPolyline

type StopsForRouteListResponseDataEntryPolyline struct {
	Length int64                                          `json:"length"`
	Levels string                                         `json:"levels"`
	Points string                                         `json:"points"`
	JSON   stopsForRouteListResponseDataEntryPolylineJSON `json:"-"`
}

func (*StopsForRouteListResponseDataEntryPolyline) UnmarshalJSON

func (r *StopsForRouteListResponseDataEntryPolyline) UnmarshalJSON(data []byte) (err error)

type StopsForRouteListResponseDataEntryStopGrouping

type StopsForRouteListResponseDataEntryStopGrouping struct {
	ID        string                                                    `json:"id"`
	Name      StopsForRouteListResponseDataEntryStopGroupingsName       `json:"name"`
	Polylines []StopsForRouteListResponseDataEntryStopGroupingsPolyline `json:"polylines"`
	StopIDs   []string                                                  `json:"stopIds"`
	JSON      stopsForRouteListResponseDataEntryStopGroupingJSON        `json:"-"`
}

func (*StopsForRouteListResponseDataEntryStopGrouping) UnmarshalJSON

func (r *StopsForRouteListResponseDataEntryStopGrouping) UnmarshalJSON(data []byte) (err error)

type StopsForRouteListResponseDataEntryStopGroupingsName

type StopsForRouteListResponseDataEntryStopGroupingsName struct {
	Name  string                                                  `json:"name"`
	Names []string                                                `json:"names"`
	Type  string                                                  `json:"type"`
	JSON  stopsForRouteListResponseDataEntryStopGroupingsNameJSON `json:"-"`
}

func (*StopsForRouteListResponseDataEntryStopGroupingsName) UnmarshalJSON

func (r *StopsForRouteListResponseDataEntryStopGroupingsName) UnmarshalJSON(data []byte) (err error)

type StopsForRouteListResponseDataEntryStopGroupingsPolyline

type StopsForRouteListResponseDataEntryStopGroupingsPolyline struct {
	Length int64                                                       `json:"length"`
	Levels string                                                      `json:"levels"`
	Points string                                                      `json:"points"`
	JSON   stopsForRouteListResponseDataEntryStopGroupingsPolylineJSON `json:"-"`
}

func (*StopsForRouteListResponseDataEntryStopGroupingsPolyline) UnmarshalJSON

type StopsForRouteService

type StopsForRouteService struct {
	Options []option.RequestOption
}

StopsForRouteService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStopsForRouteService method instead.

func NewStopsForRouteService

func NewStopsForRouteService(opts ...option.RequestOption) (r *StopsForRouteService)

NewStopsForRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StopsForRouteService) List

Get stops for a specific route

type TripDetailGetParams

type TripDetailGetParams struct {
	// Whether to include the full schedule element in the tripDetails section
	// (defaults to true).
	IncludeSchedule param.Field[bool] `query:"includeSchedule"`
	// Whether to include the full status element in the tripDetails section (defaults
	// to true).
	IncludeStatus param.Field[bool] `query:"includeStatus"`
	// Whether to include the full trip element in the references section (defaults to
	// true).
	IncludeTrip param.Field[bool] `query:"includeTrip"`
	// Service date for the trip as Unix time in milliseconds (optional).
	ServiceDate param.Field[int64] `query:"serviceDate"`
	// Time parameter to query the system at a specific time (optional).
	Time param.Field[int64] `query:"time"`
}

func (TripDetailGetParams) URLQuery

func (r TripDetailGetParams) URLQuery() (v url.Values)

URLQuery serializes TripDetailGetParams's query parameters as `url.Values`.

type TripDetailGetResponse

type TripDetailGetResponse struct {
	Data TripDetailGetResponseData `json:"data,required"`
	JSON tripDetailGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*TripDetailGetResponse) UnmarshalJSON

func (r *TripDetailGetResponse) UnmarshalJSON(data []byte) (err error)

type TripDetailGetResponseData

type TripDetailGetResponseData struct {
	Entry      TripDetailGetResponseDataEntry `json:"entry,required"`
	References shared.References              `json:"references,required"`
	JSON       tripDetailGetResponseDataJSON  `json:"-"`
}

func (*TripDetailGetResponseData) UnmarshalJSON

func (r *TripDetailGetResponseData) UnmarshalJSON(data []byte) (err error)

type TripDetailGetResponseDataEntry

type TripDetailGetResponseDataEntry struct {
	TripID       string                                 `json:"tripId,required"`
	Frequency    string                                 `json:"frequency,nullable"`
	Schedule     TripDetailGetResponseDataEntrySchedule `json:"schedule"`
	ServiceDate  int64                                  `json:"serviceDate"`
	SituationIDs []string                               `json:"situationIds"`
	Status       TripDetailGetResponseDataEntryStatus   `json:"status"`
	JSON         tripDetailGetResponseDataEntryJSON     `json:"-"`
}

func (*TripDetailGetResponseDataEntry) UnmarshalJSON

func (r *TripDetailGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type TripDetailGetResponseDataEntrySchedule

type TripDetailGetResponseDataEntrySchedule struct {
	NextTripID     string                                           `json:"nextTripId,required"`
	PreviousTripID string                                           `json:"previousTripId,required"`
	StopTimes      []TripDetailGetResponseDataEntryScheduleStopTime `json:"stopTimes,required"`
	TimeZone       string                                           `json:"timeZone,required"`
	Frequency      string                                           `json:"frequency,nullable"`
	JSON           tripDetailGetResponseDataEntryScheduleJSON       `json:"-"`
}

func (*TripDetailGetResponseDataEntrySchedule) UnmarshalJSON

func (r *TripDetailGetResponseDataEntrySchedule) UnmarshalJSON(data []byte) (err error)

type TripDetailGetResponseDataEntryScheduleStopTime

type TripDetailGetResponseDataEntryScheduleStopTime struct {
	ArrivalTime         int64                                              `json:"arrivalTime"`
	DepartureTime       int64                                              `json:"departureTime"`
	DistanceAlongTrip   float64                                            `json:"distanceAlongTrip"`
	HistoricalOccupancy string                                             `json:"historicalOccupancy"`
	StopHeadsign        string                                             `json:"stopHeadsign"`
	StopID              string                                             `json:"stopId"`
	JSON                tripDetailGetResponseDataEntryScheduleStopTimeJSON `json:"-"`
}

func (*TripDetailGetResponseDataEntryScheduleStopTime) UnmarshalJSON

func (r *TripDetailGetResponseDataEntryScheduleStopTime) UnmarshalJSON(data []byte) (err error)

type TripDetailGetResponseDataEntryStatus

type TripDetailGetResponseDataEntryStatus struct {
	// Trip ID of the trip the vehicle is actively serving.
	ActiveTripID string `json:"activeTripId,required"`
	// Index of the active trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// ID of the closest stop to the current location of the transit vehicle.
	ClosestStop string `json:"closestStop,required"`
	// Distance, in meters, the transit vehicle has progressed along the active trip.
	DistanceAlongTrip float64 `json:"distanceAlongTrip,required"`
	// Last known distance along the trip received in real-time from the transit
	// vehicle.
	LastKnownDistanceAlongTrip float64 `json:"lastKnownDistanceAlongTrip,required"`
	// Timestamp of the last known real-time location update from the transit vehicle.
	LastLocationUpdateTime int64 `json:"lastLocationUpdateTime,required"`
	// Timestamp of the last known real-time update from the transit vehicle.
	LastUpdateTime int64 `json:"lastUpdateTime,required"`
	// Capacity of the transit vehicle in terms of occupancy.
	OccupancyCapacity int64 `json:"occupancyCapacity,required"`
	// Current count of occupants in the transit vehicle.
	OccupancyCount int64 `json:"occupancyCount,required"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus,required"`
	// Current journey phase of the trip.
	Phase string `json:"phase,required"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted,required"`
	// Deviation from the schedule in seconds (positive for late, negative for early).
	ScheduleDeviation int64 `json:"scheduleDeviation,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// Current status modifiers for the trip.
	Status string `json:"status,required"`
	// Total length of the trip, in meters.
	TotalDistanceAlongTrip float64 `json:"totalDistanceAlongTrip,required"`
	// Time offset from the closest stop to the current position of the transit vehicle
	// (in seconds).
	ClosestStopTimeOffset int64 `json:"closestStopTimeOffset"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Last known location of the transit vehicle.
	LastKnownLocation TripDetailGetResponseDataEntryStatusLastKnownLocation `json:"lastKnownLocation"`
	// Last known orientation value received in real-time from the transit vehicle.
	LastKnownOrientation float64 `json:"lastKnownOrientation"`
	// ID of the next stop the transit vehicle is scheduled to arrive at.
	NextStop string `json:"nextStop"`
	// Time offset from the next stop to the current position of the transit vehicle
	// (in seconds).
	NextStopTimeOffset int64 `json:"nextStopTimeOffset"`
	// Orientation of the transit vehicle, represented as an angle in degrees.
	Orientation float64 `json:"orientation"`
	// Current position of the transit vehicle.
	Position TripDetailGetResponseDataEntryStatusPosition `json:"position"`
	// Distance, in meters, the transit vehicle is scheduled to have progressed along
	// the active trip.
	ScheduledDistanceAlongTrip float64 `json:"scheduledDistanceAlongTrip"`
	// References to situation elements (if any) applicable to this trip.
	SituationIDs []string `json:"situationIds"`
	// ID of the transit vehicle currently serving the trip.
	VehicleID string                                   `json:"vehicleId"`
	JSON      tripDetailGetResponseDataEntryStatusJSON `json:"-"`
}

func (*TripDetailGetResponseDataEntryStatus) UnmarshalJSON

func (r *TripDetailGetResponseDataEntryStatus) UnmarshalJSON(data []byte) (err error)

type TripDetailGetResponseDataEntryStatusLastKnownLocation

type TripDetailGetResponseDataEntryStatusLastKnownLocation struct {
	// Latitude of the last known location of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the last known location of the transit vehicle.
	Lon  float64                                                   `json:"lon"`
	JSON tripDetailGetResponseDataEntryStatusLastKnownLocationJSON `json:"-"`
}

Last known location of the transit vehicle.

func (*TripDetailGetResponseDataEntryStatusLastKnownLocation) UnmarshalJSON

func (r *TripDetailGetResponseDataEntryStatusLastKnownLocation) UnmarshalJSON(data []byte) (err error)

type TripDetailGetResponseDataEntryStatusPosition

type TripDetailGetResponseDataEntryStatusPosition struct {
	// Latitude of the current position of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the current position of the transit vehicle.
	Lon  float64                                          `json:"lon"`
	JSON tripDetailGetResponseDataEntryStatusPositionJSON `json:"-"`
}

Current position of the transit vehicle.

func (*TripDetailGetResponseDataEntryStatusPosition) UnmarshalJSON

func (r *TripDetailGetResponseDataEntryStatusPosition) UnmarshalJSON(data []byte) (err error)

type TripDetailService

type TripDetailService struct {
	Options []option.RequestOption
}

TripDetailService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTripDetailService method instead.

func NewTripDetailService

func NewTripDetailService(opts ...option.RequestOption) (r *TripDetailService)

NewTripDetailService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TripDetailService) Get

Retrieve Trip Details

type TripForVehicleGetParams

type TripForVehicleGetParams struct {
	// Determines whether full <schedule/> element is included in the <tripDetails/>
	// section. Defaults to false.
	IncludeSchedule param.Field[bool] `query:"includeSchedule"`
	// Determines whether the full <status/> element is included in the <tripDetails/>
	// section. Defaults to true.
	IncludeStatus param.Field[bool] `query:"includeStatus"`
	// Determines whether full <trip/> element is included in the <references/>
	// section. Defaults to false.
	IncludeTrip param.Field[bool] `query:"includeTrip"`
	// Time parameter to query the system at a specific time (optional).
	Time param.Field[int64] `query:"time"`
}

func (TripForVehicleGetParams) URLQuery

func (r TripForVehicleGetParams) URLQuery() (v url.Values)

URLQuery serializes TripForVehicleGetParams's query parameters as `url.Values`.

type TripForVehicleGetResponse

type TripForVehicleGetResponse struct {
	Data TripForVehicleGetResponseData `json:"data,required"`
	JSON tripForVehicleGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*TripForVehicleGetResponse) UnmarshalJSON

func (r *TripForVehicleGetResponse) UnmarshalJSON(data []byte) (err error)

type TripForVehicleGetResponseData

type TripForVehicleGetResponseData struct {
	Entry      TripForVehicleGetResponseDataEntry `json:"entry,required"`
	References shared.References                  `json:"references,required"`
	JSON       tripForVehicleGetResponseDataJSON  `json:"-"`
}

func (*TripForVehicleGetResponseData) UnmarshalJSON

func (r *TripForVehicleGetResponseData) UnmarshalJSON(data []byte) (err error)

type TripForVehicleGetResponseDataEntry

type TripForVehicleGetResponseDataEntry struct {
	TripID       string                                     `json:"tripId,required"`
	Frequency    string                                     `json:"frequency,nullable"`
	Schedule     TripForVehicleGetResponseDataEntrySchedule `json:"schedule"`
	ServiceDate  int64                                      `json:"serviceDate"`
	SituationIDs []string                                   `json:"situationIds"`
	Status       TripForVehicleGetResponseDataEntryStatus   `json:"status"`
	JSON         tripForVehicleGetResponseDataEntryJSON     `json:"-"`
}

func (*TripForVehicleGetResponseDataEntry) UnmarshalJSON

func (r *TripForVehicleGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type TripForVehicleGetResponseDataEntrySchedule

type TripForVehicleGetResponseDataEntrySchedule struct {
	NextTripID     string                                               `json:"nextTripId,required"`
	PreviousTripID string                                               `json:"previousTripId,required"`
	StopTimes      []TripForVehicleGetResponseDataEntryScheduleStopTime `json:"stopTimes,required"`
	TimeZone       string                                               `json:"timeZone,required"`
	Frequency      string                                               `json:"frequency,nullable"`
	JSON           tripForVehicleGetResponseDataEntryScheduleJSON       `json:"-"`
}

func (*TripForVehicleGetResponseDataEntrySchedule) UnmarshalJSON

func (r *TripForVehicleGetResponseDataEntrySchedule) UnmarshalJSON(data []byte) (err error)

type TripForVehicleGetResponseDataEntryScheduleStopTime

type TripForVehicleGetResponseDataEntryScheduleStopTime struct {
	ArrivalTime         int64                                                  `json:"arrivalTime"`
	DepartureTime       int64                                                  `json:"departureTime"`
	DistanceAlongTrip   float64                                                `json:"distanceAlongTrip"`
	HistoricalOccupancy string                                                 `json:"historicalOccupancy"`
	StopHeadsign        string                                                 `json:"stopHeadsign"`
	StopID              string                                                 `json:"stopId"`
	JSON                tripForVehicleGetResponseDataEntryScheduleStopTimeJSON `json:"-"`
}

func (*TripForVehicleGetResponseDataEntryScheduleStopTime) UnmarshalJSON

func (r *TripForVehicleGetResponseDataEntryScheduleStopTime) UnmarshalJSON(data []byte) (err error)

type TripForVehicleGetResponseDataEntryStatus

type TripForVehicleGetResponseDataEntryStatus struct {
	// Trip ID of the trip the vehicle is actively serving.
	ActiveTripID string `json:"activeTripId,required"`
	// Index of the active trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// ID of the closest stop to the current location of the transit vehicle.
	ClosestStop string `json:"closestStop,required"`
	// Distance, in meters, the transit vehicle has progressed along the active trip.
	DistanceAlongTrip float64 `json:"distanceAlongTrip,required"`
	// Last known distance along the trip received in real-time from the transit
	// vehicle.
	LastKnownDistanceAlongTrip float64 `json:"lastKnownDistanceAlongTrip,required"`
	// Timestamp of the last known real-time location update from the transit vehicle.
	LastLocationUpdateTime int64 `json:"lastLocationUpdateTime,required"`
	// Timestamp of the last known real-time update from the transit vehicle.
	LastUpdateTime int64 `json:"lastUpdateTime,required"`
	// Capacity of the transit vehicle in terms of occupancy.
	OccupancyCapacity int64 `json:"occupancyCapacity,required"`
	// Current count of occupants in the transit vehicle.
	OccupancyCount int64 `json:"occupancyCount,required"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus,required"`
	// Current journey phase of the trip.
	Phase string `json:"phase,required"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted,required"`
	// Deviation from the schedule in seconds (positive for late, negative for early).
	ScheduleDeviation int64 `json:"scheduleDeviation,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// Current status modifiers for the trip.
	Status string `json:"status,required"`
	// Total length of the trip, in meters.
	TotalDistanceAlongTrip float64 `json:"totalDistanceAlongTrip,required"`
	// Time offset from the closest stop to the current position of the transit vehicle
	// (in seconds).
	ClosestStopTimeOffset int64 `json:"closestStopTimeOffset"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Last known location of the transit vehicle.
	LastKnownLocation TripForVehicleGetResponseDataEntryStatusLastKnownLocation `json:"lastKnownLocation"`
	// Last known orientation value received in real-time from the transit vehicle.
	LastKnownOrientation float64 `json:"lastKnownOrientation"`
	// ID of the next stop the transit vehicle is scheduled to arrive at.
	NextStop string `json:"nextStop"`
	// Time offset from the next stop to the current position of the transit vehicle
	// (in seconds).
	NextStopTimeOffset int64 `json:"nextStopTimeOffset"`
	// Orientation of the transit vehicle, represented as an angle in degrees.
	Orientation float64 `json:"orientation"`
	// Current position of the transit vehicle.
	Position TripForVehicleGetResponseDataEntryStatusPosition `json:"position"`
	// Distance, in meters, the transit vehicle is scheduled to have progressed along
	// the active trip.
	ScheduledDistanceAlongTrip float64 `json:"scheduledDistanceAlongTrip"`
	// References to situation elements (if any) applicable to this trip.
	SituationIDs []string `json:"situationIds"`
	// ID of the transit vehicle currently serving the trip.
	VehicleID string                                       `json:"vehicleId"`
	JSON      tripForVehicleGetResponseDataEntryStatusJSON `json:"-"`
}

func (*TripForVehicleGetResponseDataEntryStatus) UnmarshalJSON

func (r *TripForVehicleGetResponseDataEntryStatus) UnmarshalJSON(data []byte) (err error)

type TripForVehicleGetResponseDataEntryStatusLastKnownLocation

type TripForVehicleGetResponseDataEntryStatusLastKnownLocation struct {
	// Latitude of the last known location of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the last known location of the transit vehicle.
	Lon  float64                                                       `json:"lon"`
	JSON tripForVehicleGetResponseDataEntryStatusLastKnownLocationJSON `json:"-"`
}

Last known location of the transit vehicle.

func (*TripForVehicleGetResponseDataEntryStatusLastKnownLocation) UnmarshalJSON

type TripForVehicleGetResponseDataEntryStatusPosition

type TripForVehicleGetResponseDataEntryStatusPosition struct {
	// Latitude of the current position of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the current position of the transit vehicle.
	Lon  float64                                              `json:"lon"`
	JSON tripForVehicleGetResponseDataEntryStatusPositionJSON `json:"-"`
}

Current position of the transit vehicle.

func (*TripForVehicleGetResponseDataEntryStatusPosition) UnmarshalJSON

func (r *TripForVehicleGetResponseDataEntryStatusPosition) UnmarshalJSON(data []byte) (err error)

type TripForVehicleService

type TripForVehicleService struct {
	Options []option.RequestOption
}

TripForVehicleService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTripForVehicleService method instead.

func NewTripForVehicleService

func NewTripForVehicleService(opts ...option.RequestOption) (r *TripForVehicleService)

NewTripForVehicleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TripForVehicleService) Get

Retrieve trip for a specific vehicle

type TripGetResponse

type TripGetResponse struct {
	Data TripGetResponseData `json:"data,required"`
	JSON tripGetResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*TripGetResponse) UnmarshalJSON

func (r *TripGetResponse) UnmarshalJSON(data []byte) (err error)

type TripGetResponseData

type TripGetResponseData struct {
	Entry      TripGetResponseDataEntry `json:"entry,required"`
	References shared.References        `json:"references,required"`
	JSON       tripGetResponseDataJSON  `json:"-"`
}

func (*TripGetResponseData) UnmarshalJSON

func (r *TripGetResponseData) UnmarshalJSON(data []byte) (err error)

type TripGetResponseDataEntry

type TripGetResponseDataEntry struct {
	ID             string                       `json:"id,required"`
	RouteID        string                       `json:"routeId,required"`
	ServiceID      string                       `json:"serviceId,required"`
	BlockID        string                       `json:"blockId"`
	DirectionID    string                       `json:"directionId"`
	PeakOffpeak    int64                        `json:"peakOffpeak"`
	RouteShortName string                       `json:"routeShortName"`
	ShapeID        string                       `json:"shapeId"`
	TimeZone       string                       `json:"timeZone"`
	TripHeadsign   string                       `json:"tripHeadsign"`
	TripShortName  string                       `json:"tripShortName"`
	JSON           tripGetResponseDataEntryJSON `json:"-"`
}

func (*TripGetResponseDataEntry) UnmarshalJSON

func (r *TripGetResponseDataEntry) UnmarshalJSON(data []byte) (err error)

type TripService

type TripService struct {
	Options []option.RequestOption
}

TripService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTripService method instead.

func NewTripService

func NewTripService(opts ...option.RequestOption) (r *TripService)

NewTripService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TripService) Get

func (r *TripService) Get(ctx context.Context, tripID string, opts ...option.RequestOption) (res *TripGetResponse, err error)

Get details of a specific trip

type TripsForLocationListParams

type TripsForLocationListParams struct {
	// The latitude coordinate of the search center
	Lat param.Field[float64] `query:"lat,required"`
	// Latitude span of the search bounding box
	LatSpan param.Field[float64] `query:"latSpan,required"`
	// The longitude coordinate of the search center
	Lon param.Field[float64] `query:"lon,required"`
	// Longitude span of the search bounding box
	LonSpan param.Field[float64] `query:"lonSpan,required"`
	// Whether to include full schedule elements in the tripDetails section. Defaults
	// to false.
	IncludeSchedule param.Field[bool] `query:"includeSchedule"`
	// Whether to include full trip elements in the references section. Defaults to
	// false.
	IncludeTrip param.Field[bool] `query:"includeTrip"`
	// Specific time for the query. Defaults to the current time.
	Time param.Field[int64] `query:"time"`
}

func (TripsForLocationListParams) URLQuery

func (r TripsForLocationListParams) URLQuery() (v url.Values)

URLQuery serializes TripsForLocationListParams's query parameters as `url.Values`.

type TripsForLocationListResponse

type TripsForLocationListResponse struct {
	Data TripsForLocationListResponseData `json:"data,required"`
	JSON tripsForLocationListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*TripsForLocationListResponse) UnmarshalJSON

func (r *TripsForLocationListResponse) UnmarshalJSON(data []byte) (err error)

type TripsForLocationListResponseData

type TripsForLocationListResponseData struct {
	// Indicates if the limit of trips has been exceeded
	LimitExceeded bool                                   `json:"limitExceeded,required"`
	List          []TripsForLocationListResponseDataList `json:"list,required"`
	References    shared.References                      `json:"references,required"`
	// Indicates if the search location is out of range
	OutOfRange bool                                 `json:"outOfRange"`
	JSON       tripsForLocationListResponseDataJSON `json:"-"`
}

func (*TripsForLocationListResponseData) UnmarshalJSON

func (r *TripsForLocationListResponseData) UnmarshalJSON(data []byte) (err error)

type TripsForLocationListResponseDataList

type TripsForLocationListResponseDataList struct {
	Schedule     TripsForLocationListResponseDataListSchedule `json:"schedule,required"`
	Status       TripsForLocationListResponseDataListStatus   `json:"status,required"`
	TripID       string                                       `json:"tripId,required"`
	Frequency    string                                       `json:"frequency,nullable"`
	ServiceDate  int64                                        `json:"serviceDate"`
	SituationIDs []string                                     `json:"situationIds"`
	JSON         tripsForLocationListResponseDataListJSON     `json:"-"`
}

func (*TripsForLocationListResponseDataList) UnmarshalJSON

func (r *TripsForLocationListResponseDataList) UnmarshalJSON(data []byte) (err error)

type TripsForLocationListResponseDataListSchedule

type TripsForLocationListResponseDataListSchedule struct {
	NextTripID     string                                                 `json:"nextTripId,required"`
	PreviousTripID string                                                 `json:"previousTripId,required"`
	StopTimes      []TripsForLocationListResponseDataListScheduleStopTime `json:"stopTimes,required"`
	TimeZone       string                                                 `json:"timeZone,required"`
	Frequency      string                                                 `json:"frequency,nullable"`
	JSON           tripsForLocationListResponseDataListScheduleJSON       `json:"-"`
}

func (*TripsForLocationListResponseDataListSchedule) UnmarshalJSON

func (r *TripsForLocationListResponseDataListSchedule) UnmarshalJSON(data []byte) (err error)

type TripsForLocationListResponseDataListScheduleStopTime

type TripsForLocationListResponseDataListScheduleStopTime struct {
	ArrivalTime         int64                                                    `json:"arrivalTime"`
	DepartureTime       int64                                                    `json:"departureTime"`
	DistanceAlongTrip   float64                                                  `json:"distanceAlongTrip"`
	HistoricalOccupancy string                                                   `json:"historicalOccupancy"`
	StopHeadsign        string                                                   `json:"stopHeadsign"`
	StopID              string                                                   `json:"stopId"`
	JSON                tripsForLocationListResponseDataListScheduleStopTimeJSON `json:"-"`
}

func (*TripsForLocationListResponseDataListScheduleStopTime) UnmarshalJSON

func (r *TripsForLocationListResponseDataListScheduleStopTime) UnmarshalJSON(data []byte) (err error)

type TripsForLocationListResponseDataListStatus

type TripsForLocationListResponseDataListStatus struct {
	// Trip ID of the trip the vehicle is actively serving.
	ActiveTripID string `json:"activeTripId,required"`
	// Index of the active trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// ID of the closest stop to the current location of the transit vehicle.
	ClosestStop string `json:"closestStop,required"`
	// Distance, in meters, the transit vehicle has progressed along the active trip.
	DistanceAlongTrip float64 `json:"distanceAlongTrip,required"`
	// Last known distance along the trip received in real-time from the transit
	// vehicle.
	LastKnownDistanceAlongTrip float64 `json:"lastKnownDistanceAlongTrip,required"`
	// Timestamp of the last known real-time location update from the transit vehicle.
	LastLocationUpdateTime int64 `json:"lastLocationUpdateTime,required"`
	// Timestamp of the last known real-time update from the transit vehicle.
	LastUpdateTime int64 `json:"lastUpdateTime,required"`
	// Capacity of the transit vehicle in terms of occupancy.
	OccupancyCapacity int64 `json:"occupancyCapacity,required"`
	// Current count of occupants in the transit vehicle.
	OccupancyCount int64 `json:"occupancyCount,required"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus,required"`
	// Current journey phase of the trip.
	Phase string `json:"phase,required"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted,required"`
	// Deviation from the schedule in seconds (positive for late, negative for early).
	ScheduleDeviation int64 `json:"scheduleDeviation,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// Current status modifiers for the trip.
	Status string `json:"status,required"`
	// Total length of the trip, in meters.
	TotalDistanceAlongTrip float64 `json:"totalDistanceAlongTrip,required"`
	// Time offset from the closest stop to the current position of the transit vehicle
	// (in seconds).
	ClosestStopTimeOffset int64 `json:"closestStopTimeOffset"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Last known location of the transit vehicle.
	LastKnownLocation TripsForLocationListResponseDataListStatusLastKnownLocation `json:"lastKnownLocation"`
	// Last known orientation value received in real-time from the transit vehicle.
	LastKnownOrientation float64 `json:"lastKnownOrientation"`
	// ID of the next stop the transit vehicle is scheduled to arrive at.
	NextStop string `json:"nextStop"`
	// Time offset from the next stop to the current position of the transit vehicle
	// (in seconds).
	NextStopTimeOffset int64 `json:"nextStopTimeOffset"`
	// Orientation of the transit vehicle, represented as an angle in degrees.
	Orientation float64 `json:"orientation"`
	// Current position of the transit vehicle.
	Position TripsForLocationListResponseDataListStatusPosition `json:"position"`
	// Distance, in meters, the transit vehicle is scheduled to have progressed along
	// the active trip.
	ScheduledDistanceAlongTrip float64 `json:"scheduledDistanceAlongTrip"`
	// References to situation elements (if any) applicable to this trip.
	SituationIDs []string `json:"situationIds"`
	// ID of the transit vehicle currently serving the trip.
	VehicleID string                                         `json:"vehicleId"`
	JSON      tripsForLocationListResponseDataListStatusJSON `json:"-"`
}

func (*TripsForLocationListResponseDataListStatus) UnmarshalJSON

func (r *TripsForLocationListResponseDataListStatus) UnmarshalJSON(data []byte) (err error)

type TripsForLocationListResponseDataListStatusLastKnownLocation

type TripsForLocationListResponseDataListStatusLastKnownLocation struct {
	// Latitude of the last known location of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the last known location of the transit vehicle.
	Lon  float64                                                         `json:"lon"`
	JSON tripsForLocationListResponseDataListStatusLastKnownLocationJSON `json:"-"`
}

Last known location of the transit vehicle.

func (*TripsForLocationListResponseDataListStatusLastKnownLocation) UnmarshalJSON

type TripsForLocationListResponseDataListStatusPosition

type TripsForLocationListResponseDataListStatusPosition struct {
	// Latitude of the current position of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the current position of the transit vehicle.
	Lon  float64                                                `json:"lon"`
	JSON tripsForLocationListResponseDataListStatusPositionJSON `json:"-"`
}

Current position of the transit vehicle.

func (*TripsForLocationListResponseDataListStatusPosition) UnmarshalJSON

func (r *TripsForLocationListResponseDataListStatusPosition) UnmarshalJSON(data []byte) (err error)

type TripsForLocationService

type TripsForLocationService struct {
	Options []option.RequestOption
}

TripsForLocationService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTripsForLocationService method instead.

func NewTripsForLocationService

func NewTripsForLocationService(opts ...option.RequestOption) (r *TripsForLocationService)

NewTripsForLocationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TripsForLocationService) List

Retrieve trips for a given location

type TripsForRouteListParams

type TripsForRouteListParams struct {
	// Determine whether full schedule elements are included. Defaults to false.
	IncludeSchedule param.Field[bool] `query:"includeSchedule"`
	// Determine whether full tripStatus elements with real-time information are
	// included. Defaults to false.
	IncludeStatus param.Field[bool] `query:"includeStatus"`
	// Query the system at a specific time. Useful for testing.
	Time param.Field[int64] `query:"time"`
}

func (TripsForRouteListParams) URLQuery

func (r TripsForRouteListParams) URLQuery() (v url.Values)

URLQuery serializes TripsForRouteListParams's query parameters as `url.Values`.

type TripsForRouteListResponse

type TripsForRouteListResponse struct {
	Data TripsForRouteListResponseData `json:"data,required"`
	JSON tripsForRouteListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*TripsForRouteListResponse) UnmarshalJSON

func (r *TripsForRouteListResponse) UnmarshalJSON(data []byte) (err error)

type TripsForRouteListResponseData

type TripsForRouteListResponseData struct {
	LimitExceeded bool                                `json:"limitExceeded,required"`
	List          []TripsForRouteListResponseDataList `json:"list,required"`
	References    shared.References                   `json:"references,required"`
	JSON          tripsForRouteListResponseDataJSON   `json:"-"`
}

func (*TripsForRouteListResponseData) UnmarshalJSON

func (r *TripsForRouteListResponseData) UnmarshalJSON(data []byte) (err error)

type TripsForRouteListResponseDataList

type TripsForRouteListResponseDataList struct {
	Schedule     TripsForRouteListResponseDataListSchedule `json:"schedule,required"`
	Status       TripsForRouteListResponseDataListStatus   `json:"status,required"`
	TripID       string                                    `json:"tripId,required"`
	Frequency    string                                    `json:"frequency,nullable"`
	ServiceDate  int64                                     `json:"serviceDate"`
	SituationIDs []string                                  `json:"situationIds"`
	JSON         tripsForRouteListResponseDataListJSON     `json:"-"`
}

func (*TripsForRouteListResponseDataList) UnmarshalJSON

func (r *TripsForRouteListResponseDataList) UnmarshalJSON(data []byte) (err error)

type TripsForRouteListResponseDataListSchedule

type TripsForRouteListResponseDataListSchedule struct {
	NextTripID     string                                              `json:"nextTripId,required"`
	PreviousTripID string                                              `json:"previousTripId,required"`
	StopTimes      []TripsForRouteListResponseDataListScheduleStopTime `json:"stopTimes,required"`
	TimeZone       string                                              `json:"timeZone,required"`
	Frequency      string                                              `json:"frequency,nullable"`
	JSON           tripsForRouteListResponseDataListScheduleJSON       `json:"-"`
}

func (*TripsForRouteListResponseDataListSchedule) UnmarshalJSON

func (r *TripsForRouteListResponseDataListSchedule) UnmarshalJSON(data []byte) (err error)

type TripsForRouteListResponseDataListScheduleStopTime

type TripsForRouteListResponseDataListScheduleStopTime struct {
	ArrivalTime         int64                                                 `json:"arrivalTime"`
	DepartureTime       int64                                                 `json:"departureTime"`
	DistanceAlongTrip   float64                                               `json:"distanceAlongTrip"`
	HistoricalOccupancy string                                                `json:"historicalOccupancy"`
	StopHeadsign        string                                                `json:"stopHeadsign"`
	StopID              string                                                `json:"stopId"`
	JSON                tripsForRouteListResponseDataListScheduleStopTimeJSON `json:"-"`
}

func (*TripsForRouteListResponseDataListScheduleStopTime) UnmarshalJSON

func (r *TripsForRouteListResponseDataListScheduleStopTime) UnmarshalJSON(data []byte) (err error)

type TripsForRouteListResponseDataListStatus

type TripsForRouteListResponseDataListStatus struct {
	// Trip ID of the trip the vehicle is actively serving.
	ActiveTripID string `json:"activeTripId,required"`
	// Index of the active trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// ID of the closest stop to the current location of the transit vehicle.
	ClosestStop string `json:"closestStop,required"`
	// Distance, in meters, the transit vehicle has progressed along the active trip.
	DistanceAlongTrip float64 `json:"distanceAlongTrip,required"`
	// Last known distance along the trip received in real-time from the transit
	// vehicle.
	LastKnownDistanceAlongTrip float64 `json:"lastKnownDistanceAlongTrip,required"`
	// Timestamp of the last known real-time location update from the transit vehicle.
	LastLocationUpdateTime int64 `json:"lastLocationUpdateTime,required"`
	// Timestamp of the last known real-time update from the transit vehicle.
	LastUpdateTime int64 `json:"lastUpdateTime,required"`
	// Capacity of the transit vehicle in terms of occupancy.
	OccupancyCapacity int64 `json:"occupancyCapacity,required"`
	// Current count of occupants in the transit vehicle.
	OccupancyCount int64 `json:"occupancyCount,required"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus,required"`
	// Current journey phase of the trip.
	Phase string `json:"phase,required"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted,required"`
	// Deviation from the schedule in seconds (positive for late, negative for early).
	ScheduleDeviation int64 `json:"scheduleDeviation,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// Current status modifiers for the trip.
	Status string `json:"status,required"`
	// Total length of the trip, in meters.
	TotalDistanceAlongTrip float64 `json:"totalDistanceAlongTrip,required"`
	// Time offset from the closest stop to the current position of the transit vehicle
	// (in seconds).
	ClosestStopTimeOffset int64 `json:"closestStopTimeOffset"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Last known location of the transit vehicle.
	LastKnownLocation TripsForRouteListResponseDataListStatusLastKnownLocation `json:"lastKnownLocation"`
	// Last known orientation value received in real-time from the transit vehicle.
	LastKnownOrientation float64 `json:"lastKnownOrientation"`
	// ID of the next stop the transit vehicle is scheduled to arrive at.
	NextStop string `json:"nextStop"`
	// Time offset from the next stop to the current position of the transit vehicle
	// (in seconds).
	NextStopTimeOffset int64 `json:"nextStopTimeOffset"`
	// Orientation of the transit vehicle, represented as an angle in degrees.
	Orientation float64 `json:"orientation"`
	// Current position of the transit vehicle.
	Position TripsForRouteListResponseDataListStatusPosition `json:"position"`
	// Distance, in meters, the transit vehicle is scheduled to have progressed along
	// the active trip.
	ScheduledDistanceAlongTrip float64 `json:"scheduledDistanceAlongTrip"`
	// References to situation elements (if any) applicable to this trip.
	SituationIDs []string `json:"situationIds"`
	// ID of the transit vehicle currently serving the trip.
	VehicleID string                                      `json:"vehicleId"`
	JSON      tripsForRouteListResponseDataListStatusJSON `json:"-"`
}

func (*TripsForRouteListResponseDataListStatus) UnmarshalJSON

func (r *TripsForRouteListResponseDataListStatus) UnmarshalJSON(data []byte) (err error)

type TripsForRouteListResponseDataListStatusLastKnownLocation

type TripsForRouteListResponseDataListStatusLastKnownLocation struct {
	// Latitude of the last known location of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the last known location of the transit vehicle.
	Lon  float64                                                      `json:"lon"`
	JSON tripsForRouteListResponseDataListStatusLastKnownLocationJSON `json:"-"`
}

Last known location of the transit vehicle.

func (*TripsForRouteListResponseDataListStatusLastKnownLocation) UnmarshalJSON

type TripsForRouteListResponseDataListStatusPosition

type TripsForRouteListResponseDataListStatusPosition struct {
	// Latitude of the current position of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the current position of the transit vehicle.
	Lon  float64                                             `json:"lon"`
	JSON tripsForRouteListResponseDataListStatusPositionJSON `json:"-"`
}

Current position of the transit vehicle.

func (*TripsForRouteListResponseDataListStatusPosition) UnmarshalJSON

func (r *TripsForRouteListResponseDataListStatusPosition) UnmarshalJSON(data []byte) (err error)

type TripsForRouteService

type TripsForRouteService struct {
	Options []option.RequestOption
}

TripsForRouteService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTripsForRouteService method instead.

func NewTripsForRouteService

func NewTripsForRouteService(opts ...option.RequestOption) (r *TripsForRouteService)

NewTripsForRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TripsForRouteService) List

Search for active trips for a specific route.

type VehiclesForAgencyListParams

type VehiclesForAgencyListParams struct {
	// Specific time for querying the status (timestamp format)
	Time param.Field[string] `query:"time"`
}

func (VehiclesForAgencyListParams) URLQuery

func (r VehiclesForAgencyListParams) URLQuery() (v url.Values)

URLQuery serializes VehiclesForAgencyListParams's query parameters as `url.Values`.

type VehiclesForAgencyListResponse

type VehiclesForAgencyListResponse struct {
	Data VehiclesForAgencyListResponseData `json:"data,required"`
	JSON vehiclesForAgencyListResponseJSON `json:"-"`
	shared.ResponseWrapper
}

func (*VehiclesForAgencyListResponse) UnmarshalJSON

func (r *VehiclesForAgencyListResponse) UnmarshalJSON(data []byte) (err error)

type VehiclesForAgencyListResponseData

type VehiclesForAgencyListResponseData struct {
	LimitExceeded bool                                    `json:"limitExceeded,required"`
	List          []VehiclesForAgencyListResponseDataList `json:"list,required"`
	References    shared.References                       `json:"references,required"`
	JSON          vehiclesForAgencyListResponseDataJSON   `json:"-"`
}

func (*VehiclesForAgencyListResponseData) UnmarshalJSON

func (r *VehiclesForAgencyListResponseData) UnmarshalJSON(data []byte) (err error)

type VehiclesForAgencyListResponseDataList

type VehiclesForAgencyListResponseDataList struct {
	LastLocationUpdateTime int64                                           `json:"lastLocationUpdateTime,required"`
	LastUpdateTime         int64                                           `json:"lastUpdateTime,required"`
	Location               VehiclesForAgencyListResponseDataListLocation   `json:"location,required"`
	TripID                 string                                          `json:"tripId,required"`
	TripStatus             VehiclesForAgencyListResponseDataListTripStatus `json:"tripStatus,required"`
	VehicleID              string                                          `json:"vehicleId,required"`
	OccupancyCapacity      int64                                           `json:"occupancyCapacity"`
	OccupancyCount         int64                                           `json:"occupancyCount"`
	OccupancyStatus        string                                          `json:"occupancyStatus"`
	Phase                  string                                          `json:"phase"`
	Status                 string                                          `json:"status"`
	JSON                   vehiclesForAgencyListResponseDataListJSON       `json:"-"`
}

func (*VehiclesForAgencyListResponseDataList) UnmarshalJSON

func (r *VehiclesForAgencyListResponseDataList) UnmarshalJSON(data []byte) (err error)

type VehiclesForAgencyListResponseDataListLocation

type VehiclesForAgencyListResponseDataListLocation struct {
	Lat  float64                                           `json:"lat"`
	Lon  float64                                           `json:"lon"`
	JSON vehiclesForAgencyListResponseDataListLocationJSON `json:"-"`
}

func (*VehiclesForAgencyListResponseDataListLocation) UnmarshalJSON

func (r *VehiclesForAgencyListResponseDataListLocation) UnmarshalJSON(data []byte) (err error)

type VehiclesForAgencyListResponseDataListTripStatus

type VehiclesForAgencyListResponseDataListTripStatus struct {
	// Trip ID of the trip the vehicle is actively serving.
	ActiveTripID string `json:"activeTripId,required"`
	// Index of the active trip into the sequence of trips for the active block.
	BlockTripSequence int64 `json:"blockTripSequence,required"`
	// ID of the closest stop to the current location of the transit vehicle.
	ClosestStop string `json:"closestStop,required"`
	// Distance, in meters, the transit vehicle has progressed along the active trip.
	DistanceAlongTrip float64 `json:"distanceAlongTrip,required"`
	// Last known distance along the trip received in real-time from the transit
	// vehicle.
	LastKnownDistanceAlongTrip float64 `json:"lastKnownDistanceAlongTrip,required"`
	// Timestamp of the last known real-time location update from the transit vehicle.
	LastLocationUpdateTime int64 `json:"lastLocationUpdateTime,required"`
	// Timestamp of the last known real-time update from the transit vehicle.
	LastUpdateTime int64 `json:"lastUpdateTime,required"`
	// Capacity of the transit vehicle in terms of occupancy.
	OccupancyCapacity int64 `json:"occupancyCapacity,required"`
	// Current count of occupants in the transit vehicle.
	OccupancyCount int64 `json:"occupancyCount,required"`
	// Current occupancy status of the transit vehicle.
	OccupancyStatus string `json:"occupancyStatus,required"`
	// Current journey phase of the trip.
	Phase string `json:"phase,required"`
	// Indicates if real-time arrival info is available for this trip.
	Predicted bool `json:"predicted,required"`
	// Deviation from the schedule in seconds (positive for late, negative for early).
	ScheduleDeviation int64 `json:"scheduleDeviation,required"`
	// Time, in milliseconds since the Unix epoch, of midnight for the start of the
	// service date for the trip.
	ServiceDate int64 `json:"serviceDate,required"`
	// Current status modifiers for the trip.
	Status string `json:"status,required"`
	// Total length of the trip, in meters.
	TotalDistanceAlongTrip float64 `json:"totalDistanceAlongTrip,required"`
	// Time offset from the closest stop to the current position of the transit vehicle
	// (in seconds).
	ClosestStopTimeOffset int64 `json:"closestStopTimeOffset"`
	// Information about frequency-based scheduling, if applicable to the trip.
	Frequency string `json:"frequency"`
	// Last known location of the transit vehicle.
	LastKnownLocation VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation `json:"lastKnownLocation"`
	// Last known orientation value received in real-time from the transit vehicle.
	LastKnownOrientation float64 `json:"lastKnownOrientation"`
	// ID of the next stop the transit vehicle is scheduled to arrive at.
	NextStop string `json:"nextStop"`
	// Time offset from the next stop to the current position of the transit vehicle
	// (in seconds).
	NextStopTimeOffset int64 `json:"nextStopTimeOffset"`
	// Orientation of the transit vehicle, represented as an angle in degrees.
	Orientation float64 `json:"orientation"`
	// Current position of the transit vehicle.
	Position VehiclesForAgencyListResponseDataListTripStatusPosition `json:"position"`
	// Distance, in meters, the transit vehicle is scheduled to have progressed along
	// the active trip.
	ScheduledDistanceAlongTrip float64 `json:"scheduledDistanceAlongTrip"`
	// References to situation elements (if any) applicable to this trip.
	SituationIDs []string `json:"situationIds"`
	// ID of the transit vehicle currently serving the trip.
	VehicleID string                                              `json:"vehicleId"`
	JSON      vehiclesForAgencyListResponseDataListTripStatusJSON `json:"-"`
}

func (*VehiclesForAgencyListResponseDataListTripStatus) UnmarshalJSON

func (r *VehiclesForAgencyListResponseDataListTripStatus) UnmarshalJSON(data []byte) (err error)

type VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation

type VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation struct {
	// Latitude of the last known location of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the last known location of the transit vehicle.
	Lon  float64                                                              `json:"lon"`
	JSON vehiclesForAgencyListResponseDataListTripStatusLastKnownLocationJSON `json:"-"`
}

Last known location of the transit vehicle.

func (*VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation) UnmarshalJSON

type VehiclesForAgencyListResponseDataListTripStatusPosition

type VehiclesForAgencyListResponseDataListTripStatusPosition struct {
	// Latitude of the current position of the transit vehicle.
	Lat float64 `json:"lat"`
	// Longitude of the current position of the transit vehicle.
	Lon  float64                                                     `json:"lon"`
	JSON vehiclesForAgencyListResponseDataListTripStatusPositionJSON `json:"-"`
}

Current position of the transit vehicle.

func (*VehiclesForAgencyListResponseDataListTripStatusPosition) UnmarshalJSON

type VehiclesForAgencyService

type VehiclesForAgencyService struct {
	Options []option.RequestOption
}

VehiclesForAgencyService contains methods and other services that help with interacting with the onebusaway-sdk API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVehiclesForAgencyService method instead.

func NewVehiclesForAgencyService

func NewVehiclesForAgencyService(opts ...option.RequestOption) (r *VehiclesForAgencyService)

NewVehiclesForAgencyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VehiclesForAgencyService) List

Get vehicles for a specific agency

Jump to

Keyboard shortcuts

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