Class TimetableClient
- Namespace
- DotBahn.Timetables
- Assembly
- DotBahn.Timetables.dll
Client for accessing 'Deutsche Bahn Timetables'-API
public class TimetableClient : ClientBase, IDisposable, ITimetableClient
- Inheritance
-
TimetableClient
- Implements
- Inherited Members
Constructors
TimetableClient(ClientOptions, AuthorizationOptions)
Client for accessing 'Deutsche Bahn Timetables'-API
public TimetableClient(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
GetFullChangesAsync(int, Timetable?, CancellationToken)
Gets full changes for a specific station. If a Timetable is supplied, the changes are merged onto this instance
public Task<Timetable> GetFullChangesAsync(int eva, Timetable? mergeOn = null, CancellationToken ct = default)
Parameters
evaintThe EVA station number
mergeOnTimetableCurrent timetable on which these changes should apply
ctCancellationTokenToken to cancel the request
Returns
Exceptions
- HttpRequestException
Thrown when non-success status codes occur
GetRecentChangesAsync(int, Timetable?, CancellationToken)
Gets recent changes for a specific station. If a Timetable is supplied, the changes are merged onto this instance
public Task<Timetable> GetRecentChangesAsync(int eva, Timetable? mergeOn = null, CancellationToken ct = default)
Parameters
evaintThe EVA station number
mergeOnTimetableCurrent timetable on which these changes should apply
ctCancellationTokenToken to cancel the request
Returns
Exceptions
- HttpRequestException
Thrown when non-success status codes occur
GetTimetableAsync(int, DateTime, CancellationToken)
Gets the timetable for a specific station and time
public Task<Timetable> GetTimetableAsync(int eva, DateTime dateTime, CancellationToken ct = default)
Parameters
evaintThe EVA station number
dateTimeDateTimeThe date and hour (only YYMMDD/HH are used)
ctCancellationTokenToken to cancel the request
Returns
Exceptions
- HttpRequestException
Thrown when non-success status codes occur