![]() |
Reading Buses API V3.0.0
A C#, .net Standard Library for the Reading Buses Open Data API (https://reading-opendata.r2p.com/), available to use in your C# console, WPF, UWP or Win Form Applications.
|
Stores information about an individual bus services. Related to the "List Of Lines" API. More...
Public Member Functions | |
BusService () | |
The default constructor, used only for JSON Parsing. Will be made internal when System.Text.Json add support for internal constructors in a future update. More... | |
BusService (string serviceNumber) | |
Used to create a snub/ fake object for passing to function calls, if all you need to pass is an service number to the function. Makes operator code, "other" by default. More... | |
BusService (string serviceNumber, Company operators) | |
Used to create a snub/ fake object for passing to function calls, if all you need to pass is an service number to the function. More... | |
async Task< string[]> | GetLocationsActo () |
Gets an array of acto-codes for the bus stops that the services visits. The first set of results are the outbound, the final set are the inbound. More... | |
async Task< string[]> | GetLocationsActo (Direction direction) |
Gets an array of acto-codes for the bus stops that the services visits. More... | |
async Task< BusStop[]> | GetLocations () |
Gets an array of 'BusStop' objects the bus service travels too as an array of BusStop objects. If the API is invalid and links to a Bus Stop not in the list of locations it will simply be ignored. Ordered on all the outbound stops first and then all the inbound stops. More... | |
async Task< BusStop[]> | GetLocations (Direction direction) |
Gets an array of 'BusStop' objects the bus service travels too as an array of BusStop objects. If the API is invalid and links to a Bus Stop not in the list of locations it will simply be ignored. More... | |
async Task< LiveVehiclePosition[]> | GetLivePositions () |
Gets the Live GPS positions for all Vehicles operating on this service. More... | |
async Task< HistoricJourney[]> | GetLiveJourneyData () |
Gets live journey tracking information for this service. More... | |
async Task< Journey[]> | GetTimeTable (DateTime date) |
Gets the full bus time table, for a specific date. More... | |
async Task< Journey[]> | GetTimeTable (DateTime date, BusStop location) |
Gets the full bus time table, for a specific date. More... | |
async Task< HistoricJourney[]> | GetArchivedTimeTable (DateTime date) |
Gets the archived real bus departure and arrival times along with their time table history for this service on a specific date. More... | |
async Task< HistoricJourney[]> | GetArchivedTimeTable (DateTime date, BusStop location) |
Gets the archived real bus departure and arrival times along with their time table history for this service on a specific date. More... | |
override bool | Equals (object obj) |
States if two objects are the same as each other or not. More... | |
override int | GetHashCode () |
Hashcode of the object is based on the service id and the operating company as this uniquely identifies the service. More... | |
Properties | |
string | ServiceId [get, set] |
string | BrandName [get, set] |
The brand name for the service, used mainly for Reading Buses services, such as Lion, Purple or Orange. More... | |
Company | Company [get, set] |
The operator of the service enum value. More... | |
Stores information about an individual bus services. Related to the "List Of Lines" API.
ReadingBusesAPI.BusServices.BusService.BusService | ( | ) |
The default constructor, used only for JSON Parsing. Will be made internal when System.Text.Json add support for internal constructors in a future update.
ReadingBusesAPI.BusServices.BusService.BusService | ( | string | serviceNumber | ) |
Used to create a snub/ fake object for passing to function calls, if all you need to pass is an service number to the function. Makes operator code, "other" by default.
serviceNumber | ID of the bus service. |
Unless you are doing something very strange, you probably should not need to use this, it is more for testing purposes.
ReadingBusesAPI.BusServices.BusService.BusService | ( | string | serviceNumber, |
Company | operators | ||
) |
Used to create a snub/ fake object for passing to function calls, if all you need to pass is an service number to the function.
serviceNumber | ID of the bus service. |
operators | The operator who runs the service. |
Unless you are doing something very strange, you probably should not need to use this, it is more for testing purposes.
override bool ReadingBusesAPI.BusServices.BusService.Equals | ( | object | obj | ) |
States if two objects are the same as each other or not.
obj | Other bus service object. |
async Task< HistoricJourney[]> ReadingBusesAPI.BusServices.BusService.GetArchivedTimeTable | ( | DateTime | date | ) |
Gets the archived real bus departure and arrival times along with their time table history for this service on a specific date.
date | the date on which you want a archived timetable data for. This should be a date in the past. |
ReadingBusesApiExceptionMalformedQuery | If you have tried to get data for a date in the future. Or if you have not provided any date, and/or you have not provided at least either the service or location or vehicle. |
ReadingBusesApiExceptionBadQuery | Thrown if the API responds with an error message. |
ReadingBusesApiExceptionCritical | Thrown if the API fails, but provides no reason. |
async Task< HistoricJourney[]> ReadingBusesAPI.BusServices.BusService.GetArchivedTimeTable | ( | DateTime | date, |
BusStop | location | ||
) |
Gets the archived real bus departure and arrival times along with their time table history for this service on a specific date.
date | the date on which you want a archived timetable data for. This should be a date in the past. |
location | (optional) a specific bus stop you want archived timetables for, if null it will get a timetable for every bus stop on route. |
ReadingBusesApiExceptionMalformedQuery | If you have tried to get data for a date in the future. Or if you have not provided any date, and/or you have not provided at least either the service or location or vehicle. |
ReadingBusesApiExceptionBadQuery | Thrown if the API responds with an error message. |
ReadingBusesApiExceptionCritical | Thrown if the API fails, but provides no reason. |
override int ReadingBusesAPI.BusServices.BusService.GetHashCode | ( | ) |
Hashcode of the object is based on the service id and the operating company as this uniquely identifies the service.
async Task< HistoricJourney[]> ReadingBusesAPI.BusServices.BusService.GetLiveJourneyData | ( | ) |
Gets live journey tracking information for this service.
async Task< LiveVehiclePosition[]> ReadingBusesAPI.BusServices.BusService.GetLivePositions | ( | ) |
Gets the Live GPS positions for all Vehicles operating on this service.
async Task< BusStop[]> ReadingBusesAPI.BusServices.BusService.GetLocations | ( | ) |
Gets an array of 'BusStop' objects the bus service travels too as an array of BusStop objects. If the API is invalid and links to a Bus Stop not in the list of locations it will simply be ignored. Ordered on all the outbound stops first and then all the inbound stops.
Gets an array of 'BusStop' objects the bus service travels too as an array of BusStop objects. If the API is invalid and links to a Bus Stop not in the list of locations it will simply be ignored.
direction | The direction for stops, outbound or inbound |
async Task< string[]> ReadingBusesAPI.BusServices.BusService.GetLocationsActo | ( | ) |
Gets an array of acto-codes for the bus stops that the services visits. The first set of results are the outbound, the final set are the inbound.
async Task< string[]> ReadingBusesAPI.BusServices.BusService.GetLocationsActo | ( | Direction | direction | ) |
Gets an array of acto-codes for the bus stops that the services visits.
direction | Do you want outbound acto-codes or inbound. |
async Task< Journey[]> ReadingBusesAPI.BusServices.BusService.GetTimeTable | ( | DateTime | date | ) |
Gets the full bus time table, for a specific date.
date | the date on which you want a timetable for. |
ReadingBusesApiExceptionMalformedQuery | If you have not provided any date. |
ReadingBusesApiExceptionBadQuery | Thrown if the API responds with an error message. |
ReadingBusesApiExceptionCritical | Thrown if the API fails, but provides no reason. |
async Task< Journey[]> ReadingBusesAPI.BusServices.BusService.GetTimeTable | ( | DateTime | date, |
BusStop | location | ||
) |
Gets the full bus time table, for a specific date.
date | the date on which you want a timetable for. |
location | (optional) a specific bus stop you want timetables for, if null it will get a timetable for every bus stop on route. |
ReadingBusesApiExceptionMalformedQuery | If you have not provided any date. |
ReadingBusesApiExceptionBadQuery | Thrown if the API responds with an error message. |
ReadingBusesApiExceptionCritical | Thrown if the API fails, but provides no reason. |
|
getset |
The brand name for the service, used mainly for Reading Buses services, such as Lion, Purple or Orange.
|
getset |
The operator of the service enum value.
|
getset |
The service number for the bus service, this is only guaranteed to be unique per operator, not in the API as a whole. For example Reading Buses and Newbury And District both operate a number '2' service.