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.BusStops.BusStop Class Reference

Stores information about a single bus stop. Related to the "List Of Bus Stops" API. More...

Public Member Functions

 BusStop ()
 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...
 
 BusStop (string actoCode)
 Used to create a snub/ fake object for passing to function calls, if all you need to pass is an acto-code to the function. More...
 
async Task< LiveRecord[]> GetLiveData ()
 Gets live data from a bus stop. More...
 
BusService[] GetServices (Company busOperator)
 Finds the 'BusService' object for all of the bus services which visit this stop. More...
 
Point GetPoint ()
 Gets the geographical position of the bus stop. More...
 
Task< Journey[]> GetTimeTable (DateTime date)
 Gets time table data at this specific bus stop. More...
 
Task< Journey[]> GetTimeTable (DateTime date, BusService service)
 Gets time table data at this specific bus stop. More...
 
Task< HistoricJourney[]> GetArchivedTimeTable (DateTime date)
 Gets the archived real bus departure and arrival times along with their time table history at this specific bus stop. More...
 
async Task< HistoricJourney[]> GetArchivedTimeTable (DateTime date, BusService service)
 Gets the archived real bus departure and arrival times along with their time table history at this specific bus stop. 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 acto code as this uniquely identifies the stop. More...
 

Package Functions

 BusStop (BusStopIntermediary intermediary)
 Constructs a BusStop object from an intermediary bus stop object. More...
 
void Merge (BusStopIntermediary otherStop)
 Combines two bus stops together that are the same, but report different services that stop at the them. More...
 

Properties

string ActoCode [get, set]
 The unique identifier for a bus stop. More...
 
string CommonName [get, set]
 The public, easy to understand stop name. More...
 
string Latitude [get, set]
 The latitude of the bus stop More...
 
string Longitude [get, set]
 The longitude of the bus stop More...
 
string Bearing [get, set]
 The bearing of the bus stop More...
 
string BayNumber [get, set]
 The bus stop bay number, may be null if not applicable. More...
 
List< BusServiceServiceObjects = new List<BusService>() [get, set]
 A reference to the bus services at this stop. More...
 

Detailed Description

Stores information about a single bus stop. Related to the "List Of Bus Stops" API.

Constructor & Destructor Documentation

◆ BusStop() [1/3]

ReadingBusesAPI.BusStops.BusStop.BusStop ( )

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.

◆ BusStop() [2/3]

ReadingBusesAPI.BusStops.BusStop.BusStop ( BusStopIntermediary  intermediary)
package

Constructs a BusStop object from an intermediary bus stop object.

Parameters
intermediaryIntermediary bus stop.

◆ BusStop() [3/3]

ReadingBusesAPI.BusStops.BusStop.BusStop ( string  actoCode)

Used to create a snub/ fake object for passing to function calls, if all you need to pass is an acto-code to the function.

Parameters
actoCodeID of the bus stop.

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.BusStops.BusStop.Equals ( object  obj)

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

Parameters
objOther bus stop object.
Returns
True if acto codes match.

◆ GetArchivedTimeTable() [1/2]

Task< HistoricJourney[]> ReadingBusesAPI.BusStops.BusStop.GetArchivedTimeTable ( DateTime  date)

Gets the archived real bus departure and arrival times along with their time table history at this specific bus stop.

Parameters
dateThe date you want time table data for. This should be a date in the past.
Returns

◆ GetArchivedTimeTable() [2/2]

async Task< HistoricJourney[]> ReadingBusesAPI.BusStops.BusStop.GetArchivedTimeTable ( DateTime  date,
BusService  service 
)

Gets the archived real bus departure and arrival times along with their time table history at this specific bus stop.

Parameters
dateThe date you want time table data for. This should be a date in the past.
service(optional) the service you want time table data for specifically. If null, you get time table data for all services at this stop.
Returns

◆ GetHashCode()

override int ReadingBusesAPI.BusStops.BusStop.GetHashCode ( )

Hashcode of the object is based on the acto code as this uniquely identifies the stop.

Returns

◆ GetLiveData()

async Task< LiveRecord[]> ReadingBusesAPI.BusStops.BusStop.GetLiveData ( )

Gets live data from a bus stop.

Returns
Returns a list of Live Records, which are individual buses due to arrive at the bus stop.

◆ GetPoint()

Point ReadingBusesAPI.BusStops.BusStop.GetPoint ( )

Gets the geographical position of the bus stop.

Returns
A Point Object for the position of the bus stop.

◆ GetServices()

BusService[] ReadingBusesAPI.BusStops.BusStop.GetServices ( Company  busOperator)

Finds the 'BusService' object for all of the bus services which visit this stop.

Parameters
busOperator
Returns
A list of BusService Objects for services which visit this bus stop.

◆ GetTimeTable() [1/2]

Task< Journey[]> ReadingBusesAPI.BusStops.BusStop.GetTimeTable ( DateTime  date)

Gets time table data at this specific bus stop.

Parameters
dateThe date you want time table data for.
Returns
An array of time table records for 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]

Task< Journey[]> ReadingBusesAPI.BusStops.BusStop.GetTimeTable ( DateTime  date,
BusService  service 
)

Gets time table data at this specific bus stop.

Parameters
dateThe date you want time table data for.
service(optional) the service you want time table data for specifically. If null, you get time table data for all services at this stop.
Returns
An array of time table records for 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.

◆ Merge()

void ReadingBusesAPI.BusStops.BusStop.Merge ( BusStopIntermediary  otherStop)
package

Combines two bus stops together that are the same, but report different services that stop at the them.

Parameters
otherStopThe other stop to merge with this one.

Property Documentation

◆ ActoCode

string ReadingBusesAPI.BusStops.BusStop.ActoCode
getset

The unique identifier for a bus stop.

◆ BayNumber

string ReadingBusesAPI.BusStops.BusStop.BayNumber
getset

The bus stop bay number, may be null if not applicable.

◆ Bearing

string ReadingBusesAPI.BusStops.BusStop.Bearing
getset

The bearing of the bus stop

◆ CommonName

string ReadingBusesAPI.BusStops.BusStop.CommonName
getset

The public, easy to understand stop name.

◆ Latitude

string ReadingBusesAPI.BusStops.BusStop.Latitude
getset

The latitude of the bus stop

◆ Longitude

string ReadingBusesAPI.BusStops.BusStop.Longitude
getset

The longitude of the bus stop

◆ ServiceObjects

List<BusService> ReadingBusesAPI.BusStops.BusStop.ServiceObjects = new List<BusService>()
getset

A reference to the bus services at this stop.


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