Class StationClient
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
optionsClientOptionsThe options for this instance
authAuthorizationOptionsThe 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
optionsisnull- ArgumentNullException
Thrown when
authisnull
Properties
ApiName
The API identifier used for telemetry tags
protected override string ApiName { get; }
Property Value
Methods
GetStationsAsync(StationQuery, CancellationToken)
Searches for stations using a query structure
public Task<IReadOnlyList<Station>> GetStationsAsync(StationQuery query, CancellationToken ct = default)
Parameters
queryStationQueryThe query to specify results with
ctCancellationTokenToken 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
queryisnull