Exemplo n.º 1
0
        /// <summary>Gets the TravelTime overlay.</summary>
        /// <param name="z">The zoom level.</param>
        /// <param name="pinLat">The latitude of the pin.</param>
        /// <param name="pinLon">The longitude of the pin.</param>
        /// <param name="mapCenterLat">The map center latitude.</param>
        /// <param name="mapCenterLon">The map center longitude.</param>
        /// <param name="scenarioTitle">The title of the scenario.</param>
        /// <param name="timeOfDayId">The id for the time of day (AM/INTER/PM)</param>
        /// <param name="modeId">The id of the mode.</param>
        /// <param name="width">The width of the requested overlay.</param>
        /// <param name="height">The height of the requested overlay.</param>
        /// <param name="direction">The direction of travel.</param>
        /// <param name="travelTimeInterval">The total minutes between the travel time bands</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiTravelTimeException">A server side error occurred.</exception>
        public async Task <object> GetOverlayAsync(int z, double pinLat, double pinLon, double mapCenterLat, double mapCenterLon, string scenarioTitle, string timeOfDayId, string modeId, int width, int height, OverlayDirection direction, int travelTimeInterval, CancellationToken cancellationToken)
        {
            if (scenarioTitle == null)
            {
                throw new ArgumentNullException("scenarioTitle");
            }

            if (timeOfDayId == null)
            {
                throw new ArgumentNullException("timeOfDayId");
            }

            if (modeId == null)
            {
                throw new ArgumentNullException("modeId");
            }

            return(await GetAsync <object>(cancellationToken,
                                           "/TravelTimes/overlay/{z}/mapcenter/{mapCenterLat}/{mapCenterLon}/pinlocation/{pinLat}/{pinLon}/dimensions/{width}/{height}",
                                           ("z", z),
                                           ("mapCenterLat", mapCenterLat),
                                           ("mapCenterLon", mapCenterLon),
                                           ("pinLat", pinLat),
                                           ("pinLon", pinLon),
                                           ("width", width),
                                           ("height", height),
                                           ("scenarioTitle", scenarioTitle),
                                           ("timeOfDayId", timeOfDayId),
                                           ("modeId", modeId),
                                           ("direction", direction),
                                           ("travelTimeInterval", travelTimeInterval)
                                           ));
        }
        /// <summary>Gets the place overlay for a given set of co-ordinates and a given width/height.</summary>
        /// <param name="z">The zoom level</param>
        /// <param name="type">The place type (a valid list of place types can be obtained from the /Place/Meta/placeTypes endpoint)</param>
        /// <param name="width">The width of the requested overlay.</param>
        /// <param name="height">The height of the requested overlay.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiPlaceException">A server side error occurred.</exception>
        public async Task <object> GetOverlayAsync(int z, IEnumerable <string> type, int width, int height, string lat, string lon, double locationlat, double locationlon, CancellationToken cancellationToken)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (lat == null)
            {
                throw new ArgumentNullException("lat");
            }

            if (lon == null)
            {
                throw new ArgumentNullException("lon");
            }

            return(await GetAsync <object>(cancellationToken,
                                           "/Place/{type}/overlay/{z}/{Lat}/{Lon}/{width}/{height}",
                                           ("type", type),
                                           ("z", z),
                                           ("lat", lat),
                                           ("lon", lon),
                                           ("width", width),
                                           ("height", height)
                                           ));
        }
Exemplo n.º 3
0
        public async Task <IEnumerable <RundownFunction> > GetByHandlerAsync(EHandlerType handler)
        {
            HttpResponseMessage response = await GetAsync(GetByHandlerAddress, (nameof(handler), handler.ToString()))
                                           .ConfigureAwait(false);

            return(await response.DeserializeOrDefaultAsync <IEnumerable <RundownFunction> >().ConfigureAwait(false));
        }
Exemplo n.º 4
0
        /// <summary>Gets a StopPoint for a given sms code.</summary>
        /// <param name="id">A 5-digit Countdown Bus Stop Code e.g. 73241, 50435, 56334.</param>
        /// <param name="output">If set to "web", a 302 redirect to relevant website bus stop page is returned. Valid values are : web. All other values are ignored.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <object> GetBySmsAsync(string id, string output, CancellationToken cancellationToken)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            return(await GetAsync <object>(cancellationToken, "/StopPoint/Sms/{id}", ("id", id), ("output", output)));
        }
Exemplo n.º 5
0
        /// <summary>Gets a list of StopPoints filtered by the modes available at that StopPoint.</summary>
        /// <param name="modes">A comma-seperated list of modes e.g. tube,dlr</param>
        /// <param name="page">The data set page to return. Page 1 equates to the first 1000 stop points, page 2 equates to 1001-2000 etc. Must be entered for bus mode as data set is too large.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <StopPointsResponse> GetByModeAsync(IEnumerable <string> modes, int?page, CancellationToken cancellationToken)
        {
            if (modes == null)
            {
                throw new ArgumentNullException("modes");
            }

            return(await GetAsync <StopPointsResponse>(cancellationToken, "/StopPoint/Mode/{modes}", ("modes", modes), ("page", page)));
        }
        /// <summary>Gets the line status of for given line ids e.g Minor Delays</summary>
        /// <param name="ids">A comma-separated list of line ids e.g. victoria,circle,N133. Max. approx. 20 ids.</param>
        /// <param name="detail">Include details of the disruptions that are causing the line status including the affected stops and routes</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiLineException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Line> > StatusByIdsAsync(IEnumerable <string> ids, bool?detail, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <Line> >(cancellationToken, "/Line/{ids}/Status", ("ids", ids)));
        }
        /// <summary>Gets the bike point with the given id.</summary>
        /// <param name="id">A bike point id (a list of ids can be obtained from the above BikePoint call)</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiBikePointException">A server side error occurred.</exception>
        public async Task <Place> GetAsync(string id, CancellationToken cancellationToken)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            return(await GetAsync <Place>(cancellationToken, "/BikePoint/{id}", ("id", id)));
        }
Exemplo n.º 8
0
        /// <summary>Gets the specified roads with the status aggregated over the date range specified, or now until the end of today if no dates are passed.</summary>
        /// <param name="ids">Comma-separated list of road identifiers e.g. "A406, A2" or use "all" to ignore id filter (a full list of supported road identifiers can be found at the /Road/ endpoint)</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiRoadException">A server side error occurred.</exception>
        public async Task <ObservableCollection <RoadCorridor> > StatusAsync(IEnumerable <string> ids, DateTime?startDate, DateTime?dateRangeNullableendDate, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <RoadCorridor> >(cancellationToken, "/Road/{ids}/Status", ("ids", ids), ("dateRangeNullableStartDate", startDate), ("dateRangeNullableEndDate", dateRangeNullableendDate)));;
        }
        /// <summary>Gets the line status of for all lines for the given modes</summary>
        /// <param name="modes">A comma-separated list of modes to filter by. e.g. tube,dlr</param>
        /// <param name="detail">Include details of the disruptions that are causing the line status including the affected stops and routes</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiLineException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Line> > StatusByModeAsync(IEnumerable <string> modes, bool?detail, CancellationToken cancellationToken)
        {
            if (modes == null)
            {
                throw new ArgumentNullException("modes");
            }

            return(await GetAsync <ObservableCollection <Line> >(cancellationToken, "/Line/Mode/{modes}/Status", ("modes", modes)));
        }
Exemplo n.º 10
0
        /// <summary>Gets the occupancy for a car park with a given id</summary>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiOccupancyException">A server side error occurred.</exception>
        public async Task <CarParkOccupancy> GetAsync(string id, CancellationToken cancellationToken)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            return(await GetAsync <CarParkOccupancy>(cancellationToken, "/Occupancy/CarPark/{id}", ("id", id)));
        }
Exemplo n.º 11
0
        /// <summary>Gets all stop points of a given type</summary>
        /// <param name="types">A comma-separated list of the types to return. Max. approx. 12 types.
        ///             A list of valid stop types can be obtained from the StopPoint/meta/stoptypes endpoint.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <StopPoint> > GetByTypeAsync(IEnumerable <string> types, CancellationToken cancellationToken)
        {
            if (types == null)
            {
                throw new ArgumentNullException("types");
            }

            return(await GetAsync <ObservableCollection <StopPoint> >(cancellationToken, "/StopPoint/Type/{types}", ("types", types)));
        }
Exemplo n.º 12
0
        /// <summary>Gets the Emissions Surcharge compliance for the Vehicle</summary>
        /// <param name="vrm">The Vehicle Registration Mark</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiVehicleException">A server side error occurred.</exception>
        public async Task <EmissionsSurchargeVehicle> GetVehicleAsync(string vrm, CancellationToken cancellationToken)
        {
            if (vrm == null)
            {
                throw new ArgumentNullException("vrm");
            }

            return(await GetAsync <EmissionsSurchargeVehicle>(cancellationToken, "/Vehicle/EmissionSurcharge", ("vrm", vrm)));
        }
        /// <summary>Searches the bus schedules folder on S3 for a given bus number.</summary>
        /// <param name="query">The search query</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiSearchException">A server side error occurred.</exception>
        public async Task <SearchResponse> BusSchedulesAsync(string query, CancellationToken cancellationToken)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            return(await GetAsync <SearchResponse>(cancellationToken, "/Search/BusSchedules", ("query", query)));
        }
Exemplo n.º 14
0
        /// <summary>Gets the predictions for a given list of vehicle Id's.</summary>
        /// <param name="ids">A comma-separated list of vehicle ids e.g. LX58CFV,LX11AZB,LX58CFE. Max approx. 25 ids.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiVehicleException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Prediction> > GetAsync(IEnumerable <string> ids, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <Prediction> >(cancellationToken, "/Vehicle/{ids}/Arrivals", ("ids", ids)));
        }
        /// <summary>Get disruptions for all lines of the given modes.</summary>
        /// <param name="modes">A comma-separated list of modes e.g. tube,dlr</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiLineException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Disruption> > DisruptionByModeAsync(IEnumerable <string> modes, CancellationToken cancellationToken)
        {
            if (modes == null)
            {
                throw new ArgumentNullException("modes");
            }

            return(await GetAsync <ObservableCollection <Disruption> >(cancellationToken, "/Line/Mode/{modes}/Disruption", ("modes", modes)));
        }
        /// <summary>Get disruptions for the given line ids</summary>
        /// <param name="ids">A comma-separated list of line ids e.g. victoria,circle,N133. Max. approx. 20 ids.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiLineException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Disruption> > DisruptionAsync(IEnumerable <string> ids, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <Disruption> >(cancellationToken, "/Line/{ids}/Disruption", ("ids", ids)));
        }
Exemplo n.º 17
0
        /// <summary>Gets a list of taxi ranks corresponding to the given stop point id.</summary>
        /// <param name="stopPointId">stopPointId is required to get the taxi ranks.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Place> > GetTaxiRanksByIdsAsync(string stopPointId, CancellationToken cancellationToken)
        {
            if (stopPointId == null)
            {
                throw new ArgumentNullException("stopPointId");
            }

            return(await GetAsync <ObservableCollection <Place> >(cancellationToken, "/StopPoint/{stopPointId}/TaxiRanks", ("stopPointId", stopPointId)));
        }
        /// <summary>Gets the next arrival predictions for all stops of a given mode</summary>
        /// <param name="mode">A mode name e.g. tube, dlr</param>
        /// <param name="count">A number of arrivals to return for each stop, -1 to return all available.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiModeException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Prediction> > ArrivalsAsync(string mode, int?count, CancellationToken cancellationToken)
        {
            if (mode == null)
            {
                throw new ArgumentNullException("mode");
            }

            return(await GetAsync <ObservableCollection <Prediction> >(cancellationToken, "/Mode/{mode}/Arrivals", ("mode", mode)));
        }
Exemplo n.º 19
0
        /// <summary>Gets a list of StopPoints corresponding to the given list of stop ids.</summary>
        /// <param name="ids">A comma-separated list of stop point ids (station naptan code e.g. 940GZZLUASL). Max. approx. 20 ids.
        ///             You can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name.</param>
        /// <param name="includeCrowdingData">Include the crowding data (static). To Filter further use: /StopPoint/{ids}/Crowding/{line}</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <StopPoint> > GetAsync(IEnumerable <string> ids, bool?includeCrowdingData, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <StopPoint> >(cancellationToken, "/StopPoint/{ids}", ("ids", ids)));
        }
Exemplo n.º 20
0
        /// <summary>Gets a list of active disruptions filtered by disruption Ids.</summary>
        /// <param name="disruptionIds">Comma-separated list of disruption identifiers to filter by.</param>
        /// <param name="stripContent">Optional, defaults to false. When true, removes every property/node except for id, point, severity, severityDescription, startDate, endDate, corridor details, location and comments.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiRoadException">A server side error occurred.</exception>
        public async Task <RoadDisruption> DisruptionByIdAsync(IEnumerable <string> disruptionIds, bool?stripContent, CancellationToken cancellationToken)
        {
            if (disruptionIds == null)
            {
                throw new ArgumentNullException("disruptionIds");
            }

            return(await GetAsync <RoadDisruption>(cancellationToken, "/Road/all/Disruption/{disruptionIds}", ("disruptionIds", disruptionIds), ("stripContent", stripContent)));
        }
Exemplo n.º 21
0
        /// <summary>Gets the service types for a given stoppoint</summary>
        /// <param name="id">The Naptan id of the stop</param>
        /// <param name="lineIds">The lines which contain the given Naptan id (all lines relevant to the given stoppoint if empty)</param>
        /// <param name="modes">The modes which the lines are relevant to (all if empty)</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <LineServiceType> > GetServiceTypesAsync(string id, IEnumerable <string> lineIds, IEnumerable <string> modes, CancellationToken cancellationToken)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            return(await GetAsync <ObservableCollection <LineServiceType> >(cancellationToken, "/StopPoint/ServiceTypes", ("id", id), ("lineIds", lineIds), ("modes", modes)));
        }
        /// <summary>Search for lines or routes matching the query string</summary>
        /// <param name="query">Search term e.g victoria</param>
        /// <param name="modes">Optionally filter by the specified modes</param>
        /// <param name="serviceTypes">A comma seperated list of service types to filter on. If not specified. Supported values: Regular, Night. Defaulted to 'Regular' if not specified</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiLineException">A server side error occurred.</exception>
        public async Task <RouteSearchResponse> SearchAsync(string query, IEnumerable <string> modes, IEnumerable <ServiceType> serviceTypes, CancellationToken cancellationToken)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            return(await GetAsync <RouteSearchResponse>(cancellationToken, "/Line/Search/{query}", ("query", query)));
        }
Exemplo n.º 23
0
        /// <summary>Get active disruptions, filtered by road ids</summary>
        /// <param name="ids">Comma-separated list of road identifiers e.g. "A406, A2" use all for all to ignore id filter (a full list of supported road identifiers can be found at the /Road/ endpoint)</param>
        /// <param name="stripContent">Optional, defaults to false. When true, removes every property/node except for id, point, severity, severityDescription, startDate, endDate, corridor details, location, comments and streets</param>
        /// <param name="severities">an optional list of Severity names to filter on (a valid list of severities can be obtained from the /Road/Meta/severities endpoint)</param>
        /// <param name="categories">an optional list of category names to filter on (a valid list of categories can be obtained from the /Road/Meta/categories endpoint)</param>
        /// <param name="closures">Optional, defaults to true. When true, always includes disruptions that have road closures, regardless of the severity filter. When false, the severity filter works as normal.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiRoadException">A server side error occurred.</exception>
        public async Task <ObservableCollection <RoadDisruption> > DisruptionAsync(IEnumerable <string> ids, bool?stripContent, IEnumerable <string> severities, IEnumerable <string> categories, bool?closures, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <RoadDisruption> >(cancellationToken, "/Road/{ids}/Disruption", ("ids", ids), ("stripContent", stripContent), ("severities", severities), ("categories", categories), ("closures", closures)));
        }
Exemplo n.º 24
0
        /// <summary>Gets the list of arrival predictions for the given stop point id</summary>
        /// <param name="id">A StopPoint id (station naptan code e.g. 940GZZLUASL, you can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name)</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Prediction> > ArrivalsAsync(string id, CancellationToken cancellationToken)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            return(await GetAsync <ObservableCollection <Prediction> >(cancellationToken, "/StopPoint/{id}/Arrivals", ("id", id)));
        }
Exemplo n.º 25
0
        /// <summary>Gets the road with the specified id (e.g. A1)</summary>
        /// <param name="ids">Comma-separated list of road identifiers e.g. "A406, A2" (a full list of supported road identifiers can be found at the /Road/ endpoint)</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiRoadException">A server side error occurred.</exception>
        public async Task <ObservableCollection <RoadCorridor> > GetAsync(IEnumerable <string> ids, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <RoadCorridor> >(cancellationToken, "/Road", ("ids", ids)));
        }
Exemplo n.º 26
0
        /// <summary>Returns the route sections for all the lines that service the given stop point ids</summary>
        /// <param name="id">A stop point id (station naptan codes e.g. 940GZZLUASL, you can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name)</param>
        /// <param name="serviceTypes">A comma-separated list of service types to filter on. If not specified. Supported values: Regular, Night. Defaulted to 'Regular' if not specified</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <StopPointRouteSection> > RouteAsync(string id, IEnumerable <ServiceType> serviceTypes, CancellationToken cancellationToken)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            return(await GetAsync <ObservableCollection <StopPointRouteSection> >(cancellationToken, "/StopPoint/{id}/Route", ("id", id), ("serviceTypes", serviceTypes)));
        }
Exemplo n.º 27
0
        /// <summary>
        /// Gets various backpack.tf user information.
        /// <para /> This method functions correctly but is undocumented and may be removed from the API without warning.
        /// </summary>
        /// <param name="steamIds">A collection of SteamID64 identifiers.</param>
        public async Task <BackpackUsers> GetUsersAsync(params ulong[] steamIds)
        {
            if (steamIds.Length == 0)
            {
                throw new ArgumentException("Steam ID collection must not be empty", nameof(steamIds));
            }

            return(await GetAsync <BackpackUsers>("users/info/v1", ("steamids", string.Join(",", steamIds.Distinct()))).ConfigureAwait(false));
        }
Exemplo n.º 28
0
        /// <summary>Gets a distinct list of disrupted stop points for the given modes</summary>
        /// <param name="modes">A comma-seperated list of modes e.g. tube,dlr</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <DisruptedPoint> > DisruptionByModeAsync(IEnumerable <string> modes, bool?includeRouteBlockedStops, CancellationToken cancellationToken)
        {
            if (modes == null)
            {
                throw new ArgumentNullException("modes");
            }

            return(await GetAsync <ObservableCollection <DisruptedPoint> >(cancellationToken, "/StopPoint/Mode/{modes}/Disruption", ("modes", modes), ("includeRouteBlockedStops", includeRouteBlockedStops)));
        }
        /// <summary>Search for bike stations by their name, a bike point's name often contains information about the name of the street
        ///             or nearby landmarks, for example. Note that the search result does not contain the PlaceProperties i.e. the status
        ///             or occupancy of the BikePoint, to get that information you should retrieve the BikePoint by its id on /BikePoint/id.</summary>
        /// <param name="query">The search term e.g. "St. James"</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiBikePointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <Place> > SearchAsync(string query, CancellationToken cancellationToken)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            return(await GetAsync <ObservableCollection <Place> >(cancellationToken, "/BikePoint/Search", ("query", query)));
        }
Exemplo n.º 30
0
        /// <summary>Gets all disruptions for the specified StopPointId, plus disruptions for any child Naptan records it may have.</summary>
        /// <param name="ids">A comma-seperated list of stop point ids. Max. approx. 20 ids.
        ///             You can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name.</param>
        /// <param name="getFamily">Specify true to return disruptions for entire family, or false to return disruptions for just this stop point. Defaults to false.</param>
        /// <param name="flattenResponse">Specify true to associate all disruptions with parent stop point. (Only applicable when getFamily is true).</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>OK</returns>
        /// <exception cref="TflUnifiedApiStopPointException">A server side error occurred.</exception>
        public async Task <ObservableCollection <DisruptedPoint> > DisruptionAsync(IEnumerable <string> ids, bool?getFamily, bool?includeRouteBlockedStops, bool?flattenResponse, CancellationToken cancellationToken)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }

            return(await GetAsync <ObservableCollection <DisruptedPoint> >(cancellationToken, "/StopPoint/{ids}/Disruption", ("ids", ids), ("getFamily", getFamily), ("includeRouteBlockedStops", includeRouteBlockedStops), ("flattenResponse", flattenResponse)));
        }