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.Common.UrlConstructor Class Reference

Returns back the URL needed to make a get command to the Reading Buses Open Data API. You can use this for testing purposes to check the API is returning what you were expecting. More...

Static Public Member Functions

static string ListOfBusStops ()
Returns back the URL needed for a get request to the 'List of Bus Stops' API. More...
static string LiveVehiclePositions ()
Returns back the URL needed for a get request to the 'Live Vehicle Positions' API. More...
static string LiveJourneyDetails ()
Returns back the URL needed for a get request to the 'Live Journey Details' API. More...
static string StopPredictions (string actoCode)
Returns back the URL needed for a get request to the 'Stop Predictions' API. More...
static string ListOfServices ()
Returns back the URL needed for a get request to the 'List of Services' API. More...
static string LinePatterns (BusService service)
Returns back the URL needed for a get request to the 'Line Patterns' API. More...
static string TimetabledJourneys (BusService service, BusStop location, DateTime date)
Returns back the URL needed for a get request to the 'Time Tabled Journeys' API. More...
static string TrackingHistory (BusService service, BusStop location, DateTime date, string vehicle)
Returns back the URL needed for a get request to the 'Tracking History' API. More...
static string VehiclePositionHistory (DateTime dateStartTime, TimeSpan? timeSpan, string vehicle)
Returns back the URL needed for a get request to the 'Vehicle Position History' API. More...

Static Private Member Functions

static DateTime AddTimeSpan (DateTime start, TimeSpan? timeSpan)
Adds the time span onto the start date time. If the time span expands into the next day stop it and limit it to today only. If no time span was given then assume they want a full day of data. More...

Static Private Attributes

const string ReadingBusesApi = "https://rtl2.ods-live.co.uk/api/"
URL for the Reading buses Open Data API server. More...
const string DummyApi = "https://jonathanfoot.com/Projects/RBAPI/test-data/"
URL for the Reading buses Open Data API server. More...

Detailed Description

Returns back the URL needed to make a get command to the Reading Buses Open Data API. You can use this for testing purposes to check the API is returning what you were expecting.

Member Function Documentation

AddTimeSpan()

static DateTime ReadingBusesAPI.Common.UrlConstructor.AddTimeSpan ( DateTime start,
TimeSpan? timeSpan
)
static private

Adds the time span onto the start date time. If the time span expands into the next day stop it and limit it to today only. If no time span was given then assume they want a full day of data.

Parameters
start The start date time, for what day and what time they want to get data from.
timeSpan The length of time you want data for. Must be a positive value. When added to 'start' it should not take you into the next day.
Returns
The new DateTime object, which has the start date time object incremented by the time span safely.

LinePatterns()

static string ReadingBusesAPI.Common.UrlConstructor.LinePatterns ( BusService service )
static

Returns back the URL needed for a get request to the 'Line Patterns' API.

Parameters
service The bus service to query for.
Returns
Returns back the URL needed for a get request to the 'Line Patterns' API.

ListOfBusStops()

static string ReadingBusesAPI.Common.UrlConstructor.ListOfBusStops ( )
static

Returns back the URL needed for a get request to the 'List of Bus Stops' API.

Returns
Returns back the URL needed for a get request to the 'List of Bus Stops' API.

ListOfServices()

static string ReadingBusesAPI.Common.UrlConstructor.ListOfServices ( )
static

Returns back the URL needed for a get request to the 'List of Services' API.

Returns
Returns back the URL needed for a get request to the 'List of Services' API.

LiveJourneyDetails()

static string ReadingBusesAPI.Common.UrlConstructor.LiveJourneyDetails ( )
static

Returns back the URL needed for a get request to the 'Live Journey Details' API.

Returns
Returns back the URL needed for a get request to the 'Live Journey Details' API.

LiveVehiclePositions()

static string ReadingBusesAPI.Common.UrlConstructor.LiveVehiclePositions ( )
static

Returns back the URL needed for a get request to the 'Live Vehicle Positions' API.

Returns
Returns back the URL needed for a get request to the 'Live Vehicle Positions' API.

StopPredictions()

static string ReadingBusesAPI.Common.UrlConstructor.StopPredictions ( string actoCode )
static

Returns back the URL needed for a get request to the 'Stop Predictions' API.

Parameters
actoCode The bus stop ID code.
Returns
Returns back the URL needed for a get request to the 'Stop Predictions' API.

TimetabledJourneys()

static string ReadingBusesAPI.Common.UrlConstructor.TimetabledJourneys ( BusService service,
BusStop location,
DateTime date
)
static

Returns back the URL needed for a get request to the 'Time Tabled Journeys' API.

Parameters
service The bus service to query for.
location The bus stop to query for.
date The date you want to query at.
Returns
Returns back the URL needed for a get request to the 'Time Tabled Journeys' API.

TrackingHistory()

static string ReadingBusesAPI.Common.UrlConstructor.TrackingHistory ( BusService service,
BusStop location,
DateTime date,
string vehicle
)
static

Returns back the URL needed for a get request to the 'Tracking History' API.

Parameters
service The bus service to query for.
location The bus stop to query for.
date The date you want to query at.
vehicle A vehicle ID to query for.
Returns
Returns back the URL needed for a get request to the 'Tracking History' API.

VehiclePositionHistory()

static string ReadingBusesAPI.Common.UrlConstructor.VehiclePositionHistory ( DateTime dateStartTime,
TimeSpan? timeSpan,
string vehicle
)
static

Returns back the URL needed for a get request to the 'Vehicle Position History' API.

Parameters
dateStartTime The date and time you want to query for.
timeSpan The length of the time period to query for.
vehicle A vehicle ID to query for.
Returns
Returns back the URL needed for a get request to the 'Vehicle Position History' API.

Member Data Documentation

DummyApi

const string ReadingBusesAPI.Common.UrlConstructor.DummyApi = "https://jonathanfoot.com/Projects/RBAPI/test-data/"
static private

URL for the Reading buses Open Data API server.

ReadingBusesApi

const string ReadingBusesAPI.Common.UrlConstructor.ReadingBusesApi = "https://rtl2.ods-live.co.uk/api/"
static private

URL for the Reading buses Open Data API server.


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