Reading Buses APIV2.1.0
A C#, .net Standard Library for the Reading Buses Open Data API (http://rtl2.ods-live.co.uk/cms/apiservice), available to use in your C# console, WPF, UWP or Win Form Applications.
ReadingBusesAPI.BusServices.BusService Class Reference

Stores information about an individual bus services. Related to the "List Of Services" API. More...

Public Member Functions

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 stops the bus service travels too as an array of ActoCode 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. More...
async Task< LivePosition[]> GetLivePositions ()
Gets the Live GPS positions for all Vehicles operating on this service. More...
Task< BusTimeTable[]> GetTimeTable (DateTime date)
Gets the full bus time table, for a specific date. More...
Task< BusTimeTable[]> GetTimeTable (DateTime date, BusStop location)
Gets the full bus time table, for a specific date. More...
Task< IGrouping< string, BusTimeTable >[]> GetGroupedTimeTable (DateTime date)
Gets the time table for this specific bus service, split into groups by the journey code. More...
Task< IGrouping< string, BusTimeTable >[]> GetGroupedTimeTable (DateTime date, BusStop location)
Gets the time table for this specific bus service, split into groups by the journey code. More...
Task< ArchivedBusTimeTable[]> 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...
Task< ArchivedBusTimeTable[]> 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...
Task< IGrouping< string, ArchivedBusTimeTable >[]> GetGroupedArchivedTimeTable (DateTime date)
Gets the archived real bus departure and arrival times along with their time table history for this service on a specific date, split into groups by the journey code. More...
Task< IGrouping< string, ArchivedBusTimeTable >[]> GetGroupedArchivedTimeTable (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, split into groups by the journey code. More...

Package Functions

BusService ()
The default constructor, used for automatic phrasing of data. 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 OperatorCode [get, set]
The operator enum value. More...

Private Member Functions

async Task< List< string > > GetStops ()
Gets a list of bus stops acto codes, if this is the first time it's asked for call upon the API This is delayed so only to call the API when needed. More...

Private Attributes

List< string > _stops
Stores a list of bus stops acto-code/IDs the service visits. More...
BusStop[] _stopsObjects
Stores a list of 'BusStops' objects the service visits. More...

Detailed Description

Stores information about an individual bus services. Related to the "List Of Services" API.

Constructor & Destructor Documentation

BusService() [1/3]

ReadingBusesAPI.BusServices.BusService.BusService ( )
package

The default constructor, used for automatic phrasing of data.

BusService() [2/3]

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.

Parameters
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.

BusService() [3/3]

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.

Parameters
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.

Member Function Documentation

GetArchivedTimeTable() [1/2]

Task<ArchivedBusTimeTable[]> 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.

Parameters
date the date on which you want a archived timetable data for. This should be a date in the past.
Returns
An array of time table records, containing the scheduled and actual arrival and departure times of buses.
Exceptions
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.

GetArchivedTimeTable() [2/2]

Task<ArchivedBusTimeTable[]> 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.

Parameters
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.
Returns
An array of time table records, containing the scheduled and actual arrival and departure times of buses.
Exceptions
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.

GetGroupedArchivedTimeTable() [1/2]

Task<IGrouping<string, ArchivedBusTimeTable>[]> ReadingBusesAPI.BusServices.BusService.GetGroupedArchivedTimeTable ( DateTime date )

Gets the archived real bus departure and arrival times along with their time table history for this service on a specific date, split into groups by the journey code.

Parameters
date The date on which you want the time table for. This should be a date in the past.
Returns
A grouping of arrays of time table records based upon journey code.
Exceptions
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.

GetGroupedArchivedTimeTable() [2/2]

Task<IGrouping<string, ArchivedBusTimeTable>[]> ReadingBusesAPI.BusServices.BusService.GetGroupedArchivedTimeTable ( 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, split into groups by the journey code.

Parameters
date The date on which you want the time table for. This should be a date in the past.
location (optional) The specific bus stop you want time table data for. Leave as null if you want the whole routes timetable.
Returns
A grouping of arrays of time table records based upon journey code.
Exceptions
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.

GetGroupedTimeTable() [1/2]

Task<IGrouping<string, BusTimeTable>[]> ReadingBusesAPI.BusServices.BusService.GetGroupedTimeTable ( DateTime date )

Gets the time table for this specific bus service, split into groups by the journey code.

Parameters
date The date on which you want the time table for.
Returns
A grouping of arrays of time table records based upon journey code.

GetGroupedTimeTable() [2/2]

Task<IGrouping<string, BusTimeTable>[]> ReadingBusesAPI.BusServices.BusService.GetGroupedTimeTable ( DateTime date,
BusStop location
)

Gets the time table for this specific bus service, split into groups by the journey code.

Parameters
date The date on which you want the time table for.
location (optional) The specific bus stop you want time table data for. Leave as null if you want the whole routes timetable.
Returns
A grouping of arrays of time table records based upon journey code.

GetLivePositions()

async Task<LivePosition[]> ReadingBusesAPI.BusServices.BusService.GetLivePositions ( )

Gets the Live GPS positions for all Vehicles operating on this service.

Returns
An array of GPS data points for all vehicles currently operating on this service.

GetLocations()

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.

Returns
An array of BusStop objects for the stops visited by this service.

GetLocationsActo()

async Task<string[]> ReadingBusesAPI.BusServices.BusService.GetLocationsActo ( )

Gets an array of stops the bus service travels too as an array of ActoCode

Returns
An array of Acto-Codes for the stops visited by this services.

GetStops()

async Task<List<string> > ReadingBusesAPI.BusServices.BusService.GetStops ( )
private

Gets a list of bus stops acto codes, if this is the first time it's asked for call upon the API This is delayed so only to call the API when needed.

Exceptions
ReadingBusesApiException Thrown if you have an invalid or expired API key.

GetTimeTable() [1/2]

Task<BusTimeTable[]> ReadingBusesAPI.BusServices.BusService.GetTimeTable ( DateTime date )

Gets the full bus time table, for a specific date.

Parameters
date the date on which you want a timetable for.
Returns
An array for the time table at a particular bus stop.
Exceptions
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.

GetTimeTable() [2/2]

Task<BusTimeTable[]> ReadingBusesAPI.BusServices.BusService.GetTimeTable ( DateTime date,
BusStop location
)

Gets the full bus time table, for a specific date.

Parameters
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.
Returns
An array for the time table at a particular bus stop.
Exceptions
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.

Member Data Documentation

_stops

List<string> ReadingBusesAPI.BusServices.BusService._stops
private

Stores a list of bus stops acto-code/IDs the service visits.

_stopsObjects

BusStop [] ReadingBusesAPI.BusServices.BusService._stopsObjects
private

Stores a list of 'BusStops' objects the service visits.

Property Documentation

BrandName

string ReadingBusesAPI.BusServices.BusService.BrandName
get set

The brand name for the service, used mainly for Reading Buses services, such as Lion, Purple or Orange.

OperatorCode

Company ReadingBusesAPI.BusServices.BusService.OperatorCode
get set

The operator enum value.

ServiceId

string ReadingBusesAPI.BusServices.BusService.ServiceId
get set

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.


The documentation for this class was generated from the following file: