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.
ReadingBusesAPI.BusServices.BusService Class Reference

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

Detailed Description

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

Constructor & Destructor Documentation

◆ BusService() [1/3]

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.

◆ 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
serviceNumberID 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
serviceNumberID of the bus service.
operatorsThe 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

◆ Equals()

override bool ReadingBusesAPI.BusServices.BusService.Equals ( object  obj)

States if two objects are the same as each other or not.

Parameters
objOther bus service object.
Returns
True if service id and bus operator match.

◆ GetArchivedTimeTable() [1/2]

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.

Parameters
datethe 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
ReadingBusesApiExceptionMalformedQueryIf 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.
ReadingBusesApiExceptionBadQueryThrown if the API responds with an error message.
ReadingBusesApiExceptionCriticalThrown if the API fails, but provides no reason.

◆ GetArchivedTimeTable() [2/2]

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.

Parameters
datethe 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
ReadingBusesApiExceptionMalformedQueryIf 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.
ReadingBusesApiExceptionBadQueryThrown if the API responds with an error message.
ReadingBusesApiExceptionCriticalThrown if the API fails, but provides no reason.

◆ GetHashCode()

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.

Returns

◆ GetLiveJourneyData()

async Task< HistoricJourney[]> ReadingBusesAPI.BusServices.BusService.GetLiveJourneyData ( )

Gets live journey tracking information for this service.

Returns
The live journey tracing information for this service.

◆ GetLivePositions()

async Task< LiveVehiclePosition[]> 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() [1/2]

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.

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

◆ GetLocations() [2/2]

async Task< BusStop[]> ReadingBusesAPI.BusServices.BusService.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.

Parameters
directionThe direction for stops, outbound or inbound
Returns
returns back all the bus stop objects visited by the service, for the direction of travel specified.

◆ GetLocationsActo() [1/2]

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.

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

◆ GetLocationsActo() [2/2]

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

Gets an array of acto-codes for the bus stops that the services visits.

Parameters
directionDo you want outbound acto-codes or inbound.
Returns

◆ GetTimeTable() [1/2]

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

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

Parameters
datethe date on which you want a timetable for.
Returns
An array for the time table at a particular bus stop.
Exceptions
ReadingBusesApiExceptionMalformedQueryIf you have not provided any date.
ReadingBusesApiExceptionBadQueryThrown if the API responds with an error message.
ReadingBusesApiExceptionCriticalThrown if the API fails, but provides no reason.

◆ GetTimeTable() [2/2]

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

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

Parameters
datethe 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
ReadingBusesApiExceptionMalformedQueryIf you have not provided any date.
ReadingBusesApiExceptionBadQueryThrown if the API responds with an error message.
ReadingBusesApiExceptionCriticalThrown if the API fails, but provides no reason.

Property Documentation

◆ BrandName

string ReadingBusesAPI.BusServices.BusService.BrandName
getset

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

◆ Company

Company ReadingBusesAPI.BusServices.BusService.Company
getset

The operator of the service enum value.

◆ ServiceId

string ReadingBusesAPI.BusServices.BusService.ServiceId
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.


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