Table of Contents

Class StationClient

Namespace
DotBahn.Stations
Assembly
DotBahn.Stations.dll

Client for accessing 'Deutsche Bahn StaDa'-API

public class StationClient : ClientBase, IDisposable, IStationClient
Inheritance
StationClient
Implements
Inherited Members

Constructors

StationClient(ClientOptions, AuthorizationOptions)

Client for accessing 'Deutsche Bahn StaDa'-API

public StationClient(ClientOptions options, AuthorizationOptions auth)

Parameters

options ClientOptions

The options for this instance

auth AuthorizationOptions

The auth credentials for the client

Remarks

Creates and owns its own HttpClient. Dispose this instance to release it. Use only when instantiating manually without a DI container

Exceptions

ArgumentNullException

Thrown when options is null

ArgumentNullException

Thrown when auth is null

Properties

ApiName

The API identifier used for telemetry tags

protected override string ApiName { get; }

Property Value

string

Methods

GetStationsAsync(StationQuery, CancellationToken)

Searches for stations using a query structure

public Task<IReadOnlyList<Station>> GetStationsAsync(StationQuery query, CancellationToken ct = default)

Parameters

query StationQuery

The query to specify results with

ct CancellationToken

Token to cancel the request

Returns

Task<IReadOnlyList<Station>>

List of stations matching the search criteria

Exceptions

HttpRequestException

Thrown when non-success status codes occur

ArgumentNullException

Thrown when query is null