From 08da3ce8cbfea734a9d5ce084d233ab7e679ce87 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 25 Oct 2021 20:35:52 +0000 Subject: [PATCH] CodeGen from PR 16534 in Azure/azure-rest-api-specs Merge 3c16aae50c7110e1aad241ac93995621d4093d46 into 746ded2884c35d4c9794e864ae75247e7a918256 --- .../src/Generated/IRouteClient.cs | 2483 ++++++++ .../Generated/Models/AlternativeRouteType.cs | 30 + .../src/Generated/Models/BatchItem.cs | 51 + .../src/Generated/Models/BatchQuery.cs | 55 + .../src/Generated/Models/BatchRequestBody.cs | 51 + .../src/Generated/Models/BatchResponse.cs | 52 + .../Generated/Models/BatchResponseSummary.cs | 61 + .../src/Generated/Models/ComputeTravelTime.cs | 32 + .../src/Generated/Models/DelayMagnitude.cs | 40 + .../src/Generated/Models/DrivingSide.cs | 28 + .../src/Generated/Models/EffectiveSetting.cs | 59 + .../Generated/Models/ErrorAdditionalInfo.cs | 59 + .../src/Generated/Models/ErrorDetail.cs | 85 + .../src/Generated/Models/ErrorResponse.cs | 56 + .../Models/ErrorResponseException.cs | 62 + .../src/Generated/Models/GeoJsonFeature.cs | 117 + .../Models/GeoJsonFeatureCollection.cs | 101 + .../Models/GeoJsonFeatureCollectionData.cs | 77 + .../Generated/Models/GeoJsonFeatureData.cs | 91 + .../src/Generated/Models/GeoJsonGeometry.cs | 39 + .../Models/GeoJsonGeometryCollection.cs | 72 + .../Models/GeoJsonGeometryCollectionData.cs | 70 + .../src/Generated/Models/GeoJsonLineString.cs | 69 + .../Generated/Models/GeoJsonLineStringData.cs | 65 + .../Models/GeoJsonMultiLineString.cs | 70 + .../Models/GeoJsonMultiLineStringData.cs | 66 + .../src/Generated/Models/GeoJsonMultiPoint.cs | 69 + .../Generated/Models/GeoJsonMultiPointData.cs | 68 + .../Generated/Models/GeoJsonMultiPolygon.cs | 72 + .../Models/GeoJsonMultiPolygonData.cs | 68 + .../src/Generated/Models/GeoJsonObject.cs | 36 + .../src/Generated/Models/GeoJsonObjectType.cs | 129 + .../src/Generated/Models/GeoJsonPoint.cs | 66 + .../src/Generated/Models/GeoJsonPointData.cs | 65 + .../src/Generated/Models/GeoJsonPolygon.cs | 69 + .../Generated/Models/GeoJsonPolygonData.cs | 65 + .../Models/GetRouteDirectionsBatchHeaders.cs | 55 + .../Generated/Models/GetRouteMatrixHeaders.cs | 53 + .../Models/GuidanceInstructionType.cs | 44 + .../src/Generated/Models/GuidanceManeuver.cs | 152 + .../src/Generated/Models/InclineLevel.cs | 32 + .../src/Generated/Models/JunctionType.cs | 32 + .../src/Generated/Models/LatLongPair.cs | 59 + .../src/Generated/Models/Report.cs | 24 + .../RequestRouteDirectionsBatchHeaders.cs | 55 + .../Models/RequestRouteMatrixHeaders.cs | 53 + .../src/Generated/Models/ResponseFormat.cs | 29 + .../Generated/Models/ResponseSectionType.cs | 69 + .../Generated/Models/ResponseTravelMode.cs | 61 + .../src/Generated/Models/RouteAvoidType.cs | 50 + .../Models/RouteDirectionParameters.cs | 164 + .../src/Generated/Models/RouteDirections.cs | 105 + .../Models/RouteDirectionsBatchItem.cs | 55 + .../RouteDirectionsBatchItemResponse.cs | 116 + .../Models/RouteDirectionsBatchResponse.cs | 59 + .../src/Generated/Models/RouteGuidance.cs | 65 + .../src/Generated/Models/RouteInstruction.cs | 331 ++ .../Generated/Models/RouteInstructionGroup.cs | 86 + .../Generated/Models/RouteInstructionsType.cs | 46 + .../src/Generated/Models/RouteLeg.cs | 61 + .../src/Generated/Models/RouteLegSummary.cs | 176 + .../src/Generated/Models/RouteMatrixQuery.cs | 72 + .../Generated/Models/RouteMatrixResponse.cs | 71 + .../src/Generated/Models/RouteMatrixResult.cs | 58 + .../Models/RouteMatrixResultResponse.cs | 49 + .../Generated/Models/RouteMatrixSummary.cs | 62 + .../src/Generated/Models/RouteModel.cs | 70 + .../Models/RouteOptimizedWaypoint.cs | 61 + .../src/Generated/Models/RouteRange.cs | 63 + .../Generated/Models/RouteRangeResponse.cs | 63 + .../src/Generated/Models/RouteReport.cs | 54 + .../Models/RouteRepresentationForBestOrder.cs | 34 + .../src/Generated/Models/RouteSection.cs | 134 + .../src/Generated/Models/RouteSectionTec.cs | 69 + .../Generated/Models/RouteSectionTecCause.cs | 72 + .../src/Generated/Models/RouteSummary.cs | 96 + .../src/Generated/Models/RouteType.cs | 40 + .../src/Generated/Models/SectionType.cs | 69 + .../src/Generated/Models/SimpleCategory.cs | 36 + .../src/Generated/Models/TravelMode.cs | 57 + .../src/Generated/Models/VehicleEngineType.cs | 28 + .../src/Generated/Models/VehicleLoadType.cs | 68 + .../src/Generated/Models/WindingnessLevel.cs | 32 + .../src/Generated/RouteClient.cs | 5130 +++++++++++++++++ .../src/Generated/RouteClientExtensions.cs | 2369 ++++++++ .../src/Generated/SdkInfo_RouteClient.cs | 35 + 86 files changed, 15672 insertions(+) create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/IRouteClient.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/AlternativeRouteType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchItem.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchQuery.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBody.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponse.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponseSummary.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ComputeTravelTime.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/DelayMagnitude.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/DrivingSide.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/EffectiveSetting.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorAdditionalInfo.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorDetail.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponse.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponseException.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeature.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollection.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollectionData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometry.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollection.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollectionData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineString.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineStringData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineString.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineStringData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPoint.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPointData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygon.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygonData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObject.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObjectType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPoint.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPointData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygon.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygonData.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteDirectionsBatchHeaders.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteMatrixHeaders.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceInstructionType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceManeuver.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/InclineLevel.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/JunctionType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/LatLongPair.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/Report.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteDirectionsBatchHeaders.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteMatrixHeaders.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseFormat.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseSectionType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseTravelMode.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteAvoidType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionParameters.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirections.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItem.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItemResponse.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchResponse.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGuidance.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstruction.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionGroup.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionsType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLeg.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLegSummary.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixQuery.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResponse.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResult.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResultResponse.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixSummary.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteModel.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteOptimizedWaypoint.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRange.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRangeResponse.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteReport.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRepresentationForBestOrder.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSection.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTec.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTecCause.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSummary.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/SectionType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/SimpleCategory.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/TravelMode.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleEngineType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleLoadType.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/Models/WindingnessLevel.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/RouteClient.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/RouteClientExtensions.cs create mode 100644 sdk/maps/Azure.Maps.Route/src/Generated/SdkInfo_RouteClient.cs diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/IRouteClient.cs b/sdk/maps/Azure.Maps.Route/src/Generated/IRouteClient.cs new file mode 100644 index 000000000000..ad350183b593 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/IRouteClient.cs @@ -0,0 +1,2483 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route +{ + using Microsoft.Rest; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Azure Maps Route REST APIs + /// + public partial interface IRouteClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Version number of Azure Maps API. + /// + string ApiVersion { get; set; } + + /// + /// Specifies which account is intended for usage in conjunction with + /// the Azure AD security model. It represents a unique ID for the + /// Azure Maps account and can be retrieved from the Azure Maps + /// management plane Account API. To use Azure AD security in Azure + /// Maps see the following [articles](https://aka.ms/amauthdetails) for + /// guidance. + /// + string ClientId { get; set; } + + /// + /// Subscription credentials which uniquely identify client + /// subscription. + /// + ServiceClientCredentials Credentials { get; } + + + /// + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// The Matrix Routing service allows calculation of a matrix of route + /// summaries for a set of routes defined by origin and destination + /// locations by using an asynchronous (async) or synchronous (sync) + /// POST request. For every given origin, the service calculates the + /// cost of routing from that origin to every given destination. The + /// set of origins and the set of destinations can be thought of as the + /// column and row headers of a table and each cell in the table + /// contains the costs of routing from the origin to the destination + /// for that cell. As an example, let's say a food delivery company has + /// 20 drivers and they need to find the closest driver to pick up the + /// delivery from the restaurant. To solve this use case, they can call + /// Matrix Route API. + /// + /// + /// For each route, the travel times and distances are returned. You + /// can use the computed costs to determine which detailed routes to + /// calculate using the Route Directions API. + /// + /// + /// The maximum size of a matrix for async request is **700** and for + /// sync request it's **100** (the number of origins multiplied by the + /// number of destinations). + /// + /// + /// + /// ### Submit Synchronous Route Matrix Request + /// If your scenario requires synchronous requests and the maximum size + /// of the matrix is less than or equal to 100, you might want to make + /// synchronous request. The maximum size of a matrix for this API is + /// **100** (the number of origins multiplied by the number of + /// destinations). With that constraint in mind, examples of possible + /// matrix dimensions are: 10x10, 6x8, 9x8 (it does not need to be + /// square). + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// ### Submit Asynchronous Route Matrix Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex routing requests. When you make a request by + /// using async request, by default the service returns a 202 response + /// code along a redirect URL in the Location field of the response + /// header. This URL should be checked periodically until the response + /// data or error information is available. If `waitForResults` + /// parameter in the request is set to true, user will get a 200 + /// response if the request is finished under 120 seconds. + /// + /// + /// The maximum size of a matrix for this API is **700** (the number of + /// origins multiplied by the number of destinations). With that + /// constraint in mind, examples of possible matrix dimensions are: + /// 50x10, 10x10, 28x25. 10x70 (it does not need to be square). + /// + /// + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// + /// + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// Here's a typical sequence of asynchronous operations: + /// 1. Client sends a Route Matrix POST request to Azure Maps + /// + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Route Matrix request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Route Matrix + /// request. This could either be a 400 Bad Request or any other Error + /// status code. + /// + /// + /// 3. If the Matrix Route request was accepted successfully, the + /// Location header in the response contains the URL to download the + /// results of the request. This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step + /// 3 to download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service + /// returns 200 response code for successful request and a response + /// array. The response body will contain the data and there will be no + /// possibility to retrieve the results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is + /// being processed using our async pipeline. You will be given a URL + /// to check the progress of your async request in the location header + /// of the response. This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following + /// responses when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The + /// response body contains all of the results. + /// + /// + /// The matrix of origin and destination coordinates to compute the + /// route distance, travel time and other summary for each cell of the + /// matrix based on the input parameters. The minimum and the maximum + /// cell count supported are 1 and **700** for async and **100** for + /// sync respectively. For example, it can be 35 origins and 20 + /// destinations or 25 origins and 25 destinations for async API. + /// + /// + /// Boolean to indicate whether to execute the request synchronously. + /// If set to true, user will get a 200 response if the request is + /// finished under 120 seconds. Otherwise, user will get a 202 response + /// right away. Please refer to the API description for more details on + /// 202 response. **Supported only for async request**. + /// + /// + /// Specifies whether to return additional travel times using different + /// types of traffic information (none, historic, live) as well as the + /// default best-estimate travel time. Possible values include: 'none', + /// 'all' + /// + /// + /// Specifies which of the section types is reported in the route + /// response. <br><br>For example if sectionType = + /// pedestrian the sections which are suited for pedestrians only are + /// returned. Multiple types can be used. The default sectionType + /// refers to the travelMode input. By default travelMode is set to + /// car. Possible values include: 'CarOrTrain', 'Country', 'Ferry', + /// 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be + /// specified as a dateTime. When a time zone offset is not specified + /// it will be assumed to be that of the destination point. The + /// arriveAt value must be in the future. The arriveAt parameter cannot + /// be used in conjunction with departAt, minDeviationDistance or + /// minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure + /// times apart from now must be specified as a dateTime. When a time + /// zone offset is not specified, it will be assumed to be that of the + /// origin point. The departAt value must be in the future in the + /// date-time format (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that + /// weight restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the + /// vehicle profile is used to check whether a vehicle is allowed on + /// motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will + /// be determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For + /// example, the current traffic flow is 60 km/hour. If the vehicle + /// maximum speed is set to 50 km/hour, the routing engine will + /// consider 60 km/hour as this is the current situation. If the + /// maximum speed of the vehicle is provided as 80 km/hour but the + /// current traffic flow is 60 km/hour, then routing engine will again + /// use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used + /// in conjunction with `routeType`=thrilling. Possible values include: + /// 'low', 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be + /// used in conjunction with `routeType`=thrilling. Possible values + /// include: 'low', 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default + /// is 'car'. Note that the requested travelMode may not be available + /// for the entire route. Where the requested travelMode is not + /// available for a particular section, the travelMode element of the + /// response for that section will be "other". Note that travel modes + /// bus, motorcycle, taxi and van are BETA functionality. Full + /// restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and + /// pedestrian must not be used. Possible values include: 'car', + /// 'truck', 'taxi', 'bus', 'van', 'motorcycle', 'bicycle', + /// 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid + /// when determining the route. Can be specified multiple times in one + /// request, for example, + /// '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must + /// not be used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during + /// routing + /// * false - Ignore current traffic data during routing. Note that + /// although the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road + /// speeds is still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and + /// restricted from some roads. Available vehicleLoadType values are US + /// Hazmat classes 1 through 9, plus generic classifications for use in + /// other countries. Values beginning with USHazmat are for US routing + /// while otherHazmat should be used for all other countries. + /// vehicleLoadType can be specified multiple times. This parameter is + /// currently only considered for travelMode=truck. Possible values + /// include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', + /// 'USHazmatClass7', 'USHazmatClass8', 'USHazmatClass9', + /// 'otherHazmatExplosive', 'otherHazmatGeneral', + /// 'otherHazmatHarmfulToWater' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> RequestRouteMatrixWithHttpMessagesAsync(RouteMatrixQuery routeMatrixQuery, bool? waitForResults = default(bool?), string computeTravelTime = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// If the Matrix Route request was accepted successfully, the Location + /// header in the response contains the URL to download the results of + /// the request. This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step + /// 3 to download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service + /// returns 200 response code for successful request and a response + /// array. The response body will contain the data and there will be no + /// possibility to retrieve the results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is + /// being processed using our async pipeline. You will be given a URL + /// to check the progress of your async request in the location header + /// of the response. This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following + /// responses when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The + /// response body contains all of the results. + /// + /// + /// Matrix id received after the Matrix Route request was accepted + /// successfully. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetRouteMatrixWithHttpMessagesAsync(string matrixId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// The Matrix Routing service allows calculation of a matrix of route + /// summaries for a set of routes defined by origin and destination + /// locations by using an asynchronous (async) or synchronous (sync) + /// POST request. For every given origin, the service calculates the + /// cost of routing from that origin to every given destination. The + /// set of origins and the set of destinations can be thought of as the + /// column and row headers of a table and each cell in the table + /// contains the costs of routing from the origin to the destination + /// for that cell. As an example, let's say a food delivery company has + /// 20 drivers and they need to find the closest driver to pick up the + /// delivery from the restaurant. To solve this use case, they can call + /// Matrix Route API. + /// + /// + /// For each route, the travel times and distances are returned. You + /// can use the computed costs to determine which detailed routes to + /// calculate using the Route Directions API. + /// + /// + /// The maximum size of a matrix for async request is **700** and for + /// sync request it's **100** (the number of origins multiplied by the + /// number of destinations). + /// + /// + /// + /// ### Submit Synchronous Route Matrix Request + /// If your scenario requires synchronous requests and the maximum size + /// of the matrix is less than or equal to 100, you might want to make + /// synchronous request. The maximum size of a matrix for this API is + /// **100** (the number of origins multiplied by the number of + /// destinations). With that constraint in mind, examples of possible + /// matrix dimensions are: 10x10, 6x8, 9x8 (it does not need to be + /// square). + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// ### Submit Asynchronous Route Matrix Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex routing requests. When you make a request by + /// using async request, by default the service returns a 202 response + /// code along a redirect URL in the Location field of the response + /// header. This URL should be checked periodically until the response + /// data or error information is available. If `waitForResults` + /// parameter in the request is set to true, user will get a 200 + /// response if the request is finished under 120 seconds. + /// + /// + /// The maximum size of a matrix for this API is **700** (the number of + /// origins multiplied by the number of destinations). With that + /// constraint in mind, examples of possible matrix dimensions are: + /// 50x10, 10x10, 28x25. 10x70 (it does not need to be square). + /// + /// + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// + /// + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// Here's a typical sequence of asynchronous operations: + /// 1. Client sends a Route Matrix POST request to Azure Maps + /// + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Route Matrix request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Route Matrix + /// request. This could either be a 400 Bad Request or any other Error + /// status code. + /// + /// + /// 3. If the Matrix Route request was accepted successfully, the + /// Location header in the response contains the URL to download the + /// results of the request. This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step + /// 3 to download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service + /// returns 200 response code for successful request and a response + /// array. The response body will contain the data and there will be no + /// possibility to retrieve the results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is + /// being processed using our async pipeline. You will be given a URL + /// to check the progress of your async request in the location header + /// of the response. This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following + /// responses when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The + /// response body contains all of the results. + /// + /// + /// The matrix of origin and destination coordinates to compute the + /// route distance, travel time and other summary for each cell of the + /// matrix based on the input parameters. The minimum and the maximum + /// cell count supported are 1 and **700** for async and **100** for + /// sync respectively. For example, it can be 35 origins and 20 + /// destinations or 25 origins and 25 destinations for async API. + /// + /// + /// Boolean to indicate whether to execute the request synchronously. + /// If set to true, user will get a 200 response if the request is + /// finished under 120 seconds. Otherwise, user will get a 202 response + /// right away. Please refer to the API description for more details on + /// 202 response. **Supported only for async request**. + /// + /// + /// Specifies whether to return additional travel times using different + /// types of traffic information (none, historic, live) as well as the + /// default best-estimate travel time. Possible values include: 'none', + /// 'all' + /// + /// + /// Specifies which of the section types is reported in the route + /// response. <br><br>For example if sectionType = + /// pedestrian the sections which are suited for pedestrians only are + /// returned. Multiple types can be used. The default sectionType + /// refers to the travelMode input. By default travelMode is set to + /// car. Possible values include: 'CarOrTrain', 'Country', 'Ferry', + /// 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be + /// specified as a dateTime. When a time zone offset is not specified + /// it will be assumed to be that of the destination point. The + /// arriveAt value must be in the future. The arriveAt parameter cannot + /// be used in conjunction with departAt, minDeviationDistance or + /// minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure + /// times apart from now must be specified as a dateTime. When a time + /// zone offset is not specified, it will be assumed to be that of the + /// origin point. The departAt value must be in the future in the + /// date-time format (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that + /// weight restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the + /// vehicle profile is used to check whether a vehicle is allowed on + /// motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will + /// be determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For + /// example, the current traffic flow is 60 km/hour. If the vehicle + /// maximum speed is set to 50 km/hour, the routing engine will + /// consider 60 km/hour as this is the current situation. If the + /// maximum speed of the vehicle is provided as 80 km/hour but the + /// current traffic flow is 60 km/hour, then routing engine will again + /// use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used + /// in conjunction with `routeType`=thrilling. Possible values include: + /// 'low', 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be + /// used in conjunction with `routeType`=thrilling. Possible values + /// include: 'low', 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default + /// is 'car'. Note that the requested travelMode may not be available + /// for the entire route. Where the requested travelMode is not + /// available for a particular section, the travelMode element of the + /// response for that section will be "other". Note that travel modes + /// bus, motorcycle, taxi and van are BETA functionality. Full + /// restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and + /// pedestrian must not be used. Possible values include: 'car', + /// 'truck', 'taxi', 'bus', 'van', 'motorcycle', 'bicycle', + /// 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid + /// when determining the route. Can be specified multiple times in one + /// request, for example, + /// '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must + /// not be used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during + /// routing + /// * false - Ignore current traffic data during routing. Note that + /// although the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road + /// speeds is still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and + /// restricted from some roads. Available vehicleLoadType values are US + /// Hazmat classes 1 through 9, plus generic classifications for use in + /// other countries. Values beginning with USHazmat are for US routing + /// while otherHazmat should be used for all other countries. + /// vehicleLoadType can be specified multiple times. This parameter is + /// currently only considered for travelMode=truck. Possible values + /// include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', + /// 'USHazmatClass7', 'USHazmatClass8', 'USHazmatClass9', + /// 'otherHazmatExplosive', 'otherHazmatGeneral', + /// 'otherHazmatHarmfulToWater' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> RequestRouteMatrixSyncWithHttpMessagesAsync(RouteMatrixQuery routeMatrixQuery, bool? waitForResults = default(bool?), string computeTravelTime = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns a route between an origin and a destination, passing + /// through waypoints if they are specified. The route will take into + /// account factors such as current traffic and the typical road speeds + /// on the requested day of the week and time of day. + /// + /// Information returned includes the distance, estimated travel time, + /// and a representation of the route geometry. Additional routing + /// information such as optimized waypoint order or turn by turn + /// instructions is also available, depending on the options selected. + /// + /// Routing service provides a set of parameters for a detailed + /// description of vehicle-specific Consumption Model. Please check + /// [Consumption + /// Model](https://docs.microsoft.com/azure/azure-maps/consumption-model) + /// for detailed explanation of the concepts and parameters involved. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The Coordinates through which the route is calculated, delimited by + /// a colon. A minimum of two coordinates is required. The first one + /// is the origin and the last is the destination of the route. + /// Optional coordinates in-between act as WayPoints in the route. You + /// can pass up to 150 WayPoints. + /// + /// + /// Number of desired alternative routes to be calculated. Default: 0, + /// minimum: 0 and maximum: 5 + /// + /// + /// Controls the optimality, with respect to the given planning + /// criteria, of the calculated alternatives compared to the reference + /// route. Possible values include: 'anyRoute', 'betterRoute' + /// + /// + /// All alternative routes returned will follow the reference route + /// (see section POST Requests) from the origin point of the + /// calculateRoute request for at least this number of meters. Can only + /// be used when reconstructing a route. The minDeviationDistance + /// parameter cannot be used in conjunction with arriveAt + /// + /// + /// The date and time of arrival at the destination point. It must be + /// specified as a dateTime. When a time zone offset is not specified + /// it will be assumed to be that of the destination point. The + /// arriveAt value must be in the future. The arriveAt parameter cannot + /// be used in conjunction with departAt, minDeviationDistance or + /// minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure + /// times apart from now must be specified as a dateTime. When a time + /// zone offset is not specified, it will be assumed to be that of the + /// origin point. The departAt value must be in the future in the + /// date-time format (1996-12-19T16:39:57-08:00). + /// + /// + /// All alternative routes returned will follow the reference route + /// (see section POST Requests) from the origin point of the + /// calculateRoute request for at least this number of seconds. Can + /// only be used when reconstructing a route. The minDeviationTime + /// parameter cannot be used in conjunction with arriveAt. Default + /// value is 0. Setting )minDeviationTime_ to a value greater than zero + /// has the following consequences: + /// - The origin point of the _calculateRoute_ Request must be on + /// (or very near) the input reference route. + /// - If this is not the case, an error is returned. + /// - However, the origin point does not need to be at the beginning + /// of the input reference route (it can be thought of as the current + /// vehicle position on the reference route). + /// - The reference route, returned as the first route in the + /// _calculateRoute_ + /// Response, will start at the origin point specified in the + /// _calculateRoute_ + /// Request. The initial part of the input reference route up until the + /// origin + /// point will be excluded from the Response. + /// - The values of _minDeviationDistance_ and _minDeviationTime_ + /// determine + /// how far alternative routes will be guaranteed to follow the + /// reference + /// route from the origin point onwards. + /// - The route must use _departAt_. + /// - The _vehicleHeading_ is ignored. + /// + /// + /// If specified, guidance instructions will be returned. Note that the + /// instructionsType parameter cannot be used in conjunction with + /// routeRepresentation=none. Possible values include: 'coded', 'text', + /// 'tagged' + /// + /// + /// The language parameter determines the language of the guidance + /// messages. Proper nouns (the names of streets, plazas, etc.) are + /// returned in the specified language, or if that is not available, + /// they are returned in an available language that is close to it. + /// Allowed values are (a subset of) the IETF language tags. The + /// currently supported languages are listed in the [Supported + /// languages + /// section](https://docs.microsoft.com/azure/azure-maps/supported-languages). + /// + /// Default value: en-GB + /// + /// + /// Re-order the route waypoints using a fast heuristic algorithm to + /// reduce the route length. Yields best results when used in + /// conjunction with routeType _shortest_. Notice that origin and + /// destination are excluded from the optimized waypoint indices. To + /// include origin and destination in the response, please increase all + /// the indices by 1 to account for the origin, and then add the + /// destination as the final index. Possible values are true or false. + /// True computes a better order if possible, but is not allowed to be + /// used in conjunction with maxAlternatives value greater than 0 or in + /// conjunction with circle waypoints. False will use the locations in + /// the given order and not allowed to be used in conjunction with + /// routeRepresentation _none_. + /// + /// + /// Specifies the representation of the set of routes provided as + /// response. This parameter value can only be used in conjunction with + /// computeBestOrder=true. Possible values include: 'polyline', + /// 'summaryOnly', 'none' + /// + /// + /// Specifies whether to return additional travel times using different + /// types of traffic information (none, historic, live) as well as the + /// default best-estimate travel time. Possible values include: 'none', + /// 'all' + /// + /// + /// The directional heading of the vehicle in degrees starting at true + /// North and continuing in clockwise direction. North is 0 degrees, + /// east is 90 degrees, south is 180 degrees, west is 270 degrees. + /// Possible values 0-359 + /// + /// + /// Specifies which data should be reported for diagnosis purposes. The + /// only possible value is _effectiveSettings_. Reports the effective + /// parameters or data used when calling the API. In the case of + /// defaulted parameters the default will be reflected where the + /// parameter was not specified by the caller. Possible values include: + /// 'effectiveSettings' + /// + /// + /// Specifies which of the section types is reported in the route + /// response. <br><br>For example if sectionType = + /// pedestrian the sections which are suited for pedestrians only are + /// returned. Multiple types can be used. The default sectionType + /// refers to the travelMode input. By default travelMode is set to + /// car. Possible values include: 'CarOrTrain', 'Country', 'Ferry', + /// 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that + /// weight restrictions per axle are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the + /// vehicle profile is used to check whether a vehicle is allowed on + /// motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will + /// be determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For + /// example, the current traffic flow is 60 km/hour. If the vehicle + /// maximum speed is set to 50 km/hour, the routing engine will + /// consider 60 km/hour as this is the current situation. If the + /// maximum speed of the vehicle is provided as 80 km/hour but the + /// current traffic flow is 60 km/hour, then routing engine will again + /// use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the + /// Consumption Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value + /// of **vehicleWeight** is non-zero, then weight restrictions are + /// considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric + /// Model** : 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial + /// vehicles may not be allowed to drive on some roads. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used + /// in conjunction with `routeType`=thrilling. Possible values include: + /// 'low', 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be + /// used in conjunction with `routeType`=thrilling. Possible values + /// include: 'low', 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default + /// is 'car'. Note that the requested travelMode may not be available + /// for the entire route. Where the requested travelMode is not + /// available for a particular section, the travelMode element of the + /// response for that section will be "other". Note that travel modes + /// bus, motorcycle, taxi and van are BETA functionality. Full + /// restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and + /// pedestrian must not be used. Possible values include: 'car', + /// 'truck', 'taxi', 'bus', 'van', 'motorcycle', 'bicycle', + /// 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid + /// when determining the route. Can be specified multiple times in one + /// request, for example, + /// '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must + /// not be used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during + /// routing + /// * false - Ignore current traffic data during routing. Note that + /// although the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road + /// speeds is still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and + /// restricted from some roads. Available vehicleLoadType values are US + /// Hazmat classes 1 through 9, plus generic classifications for use in + /// other countries. Values beginning with USHazmat are for US routing + /// while otherHazmat should be used for all other countries. + /// vehicleLoadType can be specified multiple times. This parameter is + /// currently only considered for travelMode=truck. Possible values + /// include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', + /// 'USHazmatClass7', 'USHazmatClass8', 'USHazmatClass9', + /// 'otherHazmatExplosive', 'otherHazmatGeneral', + /// 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is + /// specified, it must be consistent with the value of + /// **vehicleEngineType**. Possible values include: 'combustion', + /// 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption + /// curve. Consumption rates for speeds not in the list are found as + /// follows: + /// + /// * by linear interpolation, if the given speed lies in between two + /// speeds in the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the + /// list + /// + /// The list must contain between 1 and 25 points (inclusive), and may + /// not contain duplicate points for the same speed. If it only + /// contains a single point, then the consumption rate of that point is + /// used without further processing. + /// + /// Consumption specified for the largest speed must be greater than or + /// equal to that of the penultimate largest speed. This ensures that + /// extrapolation does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds + /// in the list cannot lead to a negative consumption rate for any + /// smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion + /// Consumption Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary + /// systems of the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems + /// such as AC systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel + /// in megajoules (MJ). It is used in conjunction with the + /// ***Efficiency** parameters for conversions between saved or + /// consumed energy and fuel. For example, energy density is 34.2 MJ/l + /// for gasoline, and 35.8 MJ/l for Diesel fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in + /// fuel to kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). + /// ChemicalEnergyConsumed_ is obtained by converting consumed fuel to + /// chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to + /// 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric + /// Model** : 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is + /// obtained by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to + /// 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric + /// Model** : 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in + /// fuel to potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). + /// ChemicalEnergyConsumed_ is obtained by converting consumed fuel to + /// chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric + /// Model** : 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved + /// (not consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is + /// obtained by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric + /// Model** : 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The + /// list defines points on a consumption curve. Consumption rates for + /// speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two + /// speeds in the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the + /// list + /// + /// The list must contain between 1 and 25 points (inclusive), and may + /// not contain duplicate points for the same speed. If it only + /// contains a single point, then the consumption rate of that point is + /// used without further processing. + /// + /// Consumption specified for the largest speed must be greater than or + /// equal to that of the penultimate largest speed. This ensures that + /// extrapolation does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds + /// in the list cannot lead to a negative consumption rate for any + /// smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) + /// is between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours + /// (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours + /// (kWh) that may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to + /// **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary + /// systems, in kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems + /// such as AC systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetRouteDirectionsWithHttpMessagesAsync(string format, string routePoints, int? maxAlternatives = default(int?), string alternativeType = default(string), int? minDeviationDistance = default(int?), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? minDeviationTime = default(int?), string instructionsType = default(string), string language = default(string), bool? computeBestWaypointOrder = default(bool?), string routeRepresentationForBestOrder = default(string), string computeTravelTime = default(string), int? vehicleHeading = default(int?), string report = default(string), string filterSectionType = default(string), int? vehicleAxleWeight = 0, double? vehicleWidth = 0, double? vehicleHeight = 0, double? vehicleLength = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns a route between an origin and a destination, passing + /// through waypoints if they are specified. The route will take into + /// account factors such as current traffic and the typical road speeds + /// on the requested day of the week and time of day. + /// + /// Information returned includes the distance, estimated travel time, + /// and a representation of the route geometry. Additional routing + /// information such as optimized waypoint order or turn by turn + /// instructions is also available, depending on the options selected. + /// + /// Routing service provides a set of parameters for a detailed + /// description of a vehicle-specific Consumption Model. Please check + /// [Consumption + /// Model](https://docs.microsoft.com/azure/azure-maps/consumption-model) + /// for detailed explanation of the concepts and parameters involved. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The Coordinates through which the route is calculated, delimited by + /// a colon. A minimum of two coordinates is required. The first one + /// is the origin and the last is the destination of the route. + /// Optional coordinates in-between act as WayPoints in the route. You + /// can pass up to 150 WayPoints. + /// + /// + /// Used for reconstructing a route and for calculating zero or more + /// alternative routes to this reference route. The provided sequence + /// of coordinates is used as input for route reconstruction. The + /// alternative routes are calculated between the origin and + /// destination points specified in the base path parameter locations. + /// If both minDeviationDistance and minDeviationTime are set to zero, + /// then these origin and destination points are expected to be at (or + /// very near) the beginning and end of the reference route, + /// respectively. Intermediate locations (waypoints) are not supported + /// when using supportingPoints. + /// + /// Setting at least one of minDeviationDistance or minDeviationTime to + /// a value greater than zero has the following consequences: + /// + /// * The origin point of the calculateRoute request must be on (or + /// very near) the input reference route. If this is not the case, an + /// error is returned. However, the origin point does not need to be at + /// the beginning of the input reference route (it can be thought of + /// as the current vehicle position on the reference route). + /// * The reference route, returned as the first route in the + /// calculateRoute response, will start at the origin point specified + /// in the calculateRoute request. The initial part of the input + /// reference route up until the origin point will be excluded from + /// the response. + /// * The values of minDeviationDistance and minDeviationTime + /// determine how far alternative routes will be guaranteed to follow + /// the reference route from the origin point onwards. + /// * The route must use departAt. + /// * The vehicleHeading is ignored. + /// + /// + /// Number of desired alternative routes to be calculated. Default: 0, + /// minimum: 0 and maximum: 5 + /// + /// + /// Controls the optimality, with respect to the given planning + /// criteria, of the calculated alternatives compared to the reference + /// route. Possible values include: 'anyRoute', 'betterRoute' + /// + /// + /// All alternative routes returned will follow the reference route + /// (see section POST Requests) from the origin point of the + /// calculateRoute request for at least this number of meters. Can only + /// be used when reconstructing a route. The minDeviationDistance + /// parameter cannot be used in conjunction with arriveAt + /// + /// + /// All alternative routes returned will follow the reference route + /// (see section POST Requests) from the origin point of the + /// calculateRoute request for at least this number of seconds. Can + /// only be used when reconstructing a route. The minDeviationTime + /// parameter cannot be used in conjunction with arriveAt. Default + /// value is 0. Setting )minDeviationTime_ to a value greater than zero + /// has the following consequences: + /// - The origin point of the _calculateRoute_ Request must be on + /// (or very near) the input reference route. + /// - If this is not the case, an error is returned. + /// - However, the origin point does not need to be at the beginning + /// of the input reference route (it can be thought of as the current + /// vehicle position on the reference route). + /// - The reference route, returned as the first route in the + /// _calculateRoute_ + /// Response, will start at the origin point specified in the + /// _calculateRoute_ + /// Request. The initial part of the input reference route up until the + /// origin + /// point will be excluded from the Response. + /// - The values of _minDeviationDistance_ and _minDeviationTime_ + /// determine + /// how far alternative routes will be guaranteed to follow the + /// reference + /// route from the origin point onwards. + /// - The route must use _departAt_. + /// - The _vehicleHeading_ is ignored. + /// + /// + /// If specified, guidance instructions will be returned. Note that the + /// instructionsType parameter cannot be used in conjunction with + /// routeRepresentation=none. Possible values include: 'coded', 'text', + /// 'tagged' + /// + /// + /// The language parameter determines the language of the guidance + /// messages. It does not affect proper nouns (the names of streets, + /// plazas, etc.) It has no effect when instructionsType=coded. Allowed + /// values are (a subset of) the IETF language tags described + /// + /// + /// Re-order the route waypoints using a fast heuristic algorithm to + /// reduce the route length. Yields best results when used in + /// conjunction with routeType _shortest_. Notice that origin and + /// destination are excluded from the optimized waypoint indices. To + /// include origin and destination in the response, please increase all + /// the indices by 1 to account for the origin, and then add the + /// destination as the final index. Possible values are true or false. + /// True computes a better order if possible, but is not allowed to be + /// used in conjunction with maxAlternatives value greater than 0 or in + /// conjunction with circle waypoints. False will use the locations in + /// the given order and not allowed to be used in conjunction with + /// routeRepresentation _none_. + /// + /// + /// Specifies the representation of the set of routes provided as + /// response. This parameter value can only be used in conjunction with + /// computeBestOrder=true. Possible values include: 'polyline', + /// 'summaryOnly', 'none' + /// + /// + /// Specifies whether to return additional travel times using different + /// types of traffic information (none, historic, live) as well as the + /// default best-estimate travel time. Possible values include: 'none', + /// 'all' + /// + /// + /// The directional heading of the vehicle in degrees starting at true + /// North and continuing in clockwise direction. North is 0 degrees, + /// east is 90 degrees, south is 180 degrees, west is 270 degrees. + /// Possible values 0-359 + /// + /// + /// Specifies which data should be reported for diagnosis purposes. The + /// only possible value is _effectiveSettings_. Reports the effective + /// parameters or data used when calling the API. In the case of + /// defaulted parameters the default will be reflected where the + /// parameter was not specified by the caller. Possible values include: + /// 'effectiveSettings' + /// + /// + /// Specifies which of the section types is reported in the route + /// response. <br><br>For example if sectionType = + /// pedestrian the sections which are suited for pedestrians only are + /// returned. Multiple types can be used. The default sectionType + /// refers to the travelMode input. By default travelMode is set to + /// car. Possible values include: 'CarOrTrain', 'Country', 'Ferry', + /// 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be + /// specified as a dateTime. When a time zone offset is not specified + /// it will be assumed to be that of the destination point. The + /// arriveAt value must be in the future. The arriveAt parameter cannot + /// be used in conjunction with departAt, minDeviationDistance or + /// minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure + /// times apart from now must be specified as a dateTime. When a time + /// zone offset is not specified, it will be assumed to be that of the + /// origin point. The departAt value must be in the future in the + /// date-time format (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that + /// weight restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the + /// vehicle profile is used to check whether a vehicle is allowed on + /// motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will + /// be determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For + /// example, the current traffic flow is 60 km/hour. If the vehicle + /// maximum speed is set to 50 km/hour, the routing engine will + /// consider 60 km/hour as this is the current situation. If the + /// maximum speed of the vehicle is provided as 80 km/hour but the + /// current traffic flow is 60 km/hour, then routing engine will again + /// use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the + /// Consumption Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value + /// of **vehicleWeight** is non-zero, then weight restrictions are + /// considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric + /// Model** : 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial + /// vehicles may not be allowed to drive on some roads. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used + /// in conjunction with `routeType`=thrilling. Possible values include: + /// 'low', 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be + /// used in conjunction with `routeType`=thrilling. Possible values + /// include: 'low', 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default + /// is 'car'. Note that the requested travelMode may not be available + /// for the entire route. Where the requested travelMode is not + /// available for a particular section, the travelMode element of the + /// response for that section will be "other". Note that travel modes + /// bus, motorcycle, taxi and van are BETA functionality. Full + /// restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and + /// pedestrian must not be used. Possible values include: 'car', + /// 'truck', 'taxi', 'bus', 'van', 'motorcycle', 'bicycle', + /// 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid + /// when determining the route. Can be specified multiple times in one + /// request, for example, + /// '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must + /// not be used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during + /// routing + /// * false - Ignore current traffic data during routing. Note that + /// although the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road + /// speeds is still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and + /// restricted from some roads. Available vehicleLoadType values are US + /// Hazmat classes 1 through 9, plus generic classifications for use in + /// other countries. Values beginning with USHazmat are for US routing + /// while otherHazmat should be used for all other countries. + /// vehicleLoadType can be specified multiple times. This parameter is + /// currently only considered for travelMode=truck. Possible values + /// include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', + /// 'USHazmatClass7', 'USHazmatClass8', 'USHazmatClass9', + /// 'otherHazmatExplosive', 'otherHazmatGeneral', + /// 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is + /// specified, it must be consistent with the value of + /// **vehicleEngineType**. Possible values include: 'combustion', + /// 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption + /// curve. Consumption rates for speeds not in the list are found as + /// follows: + /// + /// * by linear interpolation, if the given speed lies in between two + /// speeds in the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the + /// list + /// + /// The list must contain between 1 and 25 points (inclusive), and may + /// not contain duplicate points for the same speed. If it only + /// contains a single point, then the consumption rate of that point is + /// used without further processing. + /// + /// Consumption specified for the largest speed must be greater than or + /// equal to that of the penultimate largest speed. This ensures that + /// extrapolation does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds + /// in the list cannot lead to a negative consumption rate for any + /// smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion + /// Consumption Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary + /// systems of the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems + /// such as AC systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel + /// in megajoules (MJ). It is used in conjunction with the + /// ***Efficiency** parameters for conversions between saved or + /// consumed energy and fuel. For example, energy density is 34.2 MJ/l + /// for gasoline, and 35.8 MJ/l for Diesel fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in + /// fuel to kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). + /// ChemicalEnergyConsumed_ is obtained by converting consumed fuel to + /// chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to + /// 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric + /// Model** : 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is + /// obtained by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to + /// 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric + /// Model** : 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in + /// fuel to potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). + /// ChemicalEnergyConsumed_ is obtained by converting consumed fuel to + /// chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric + /// Model** : 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved + /// (not consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is + /// obtained by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric + /// Model** : 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The + /// list defines points on a consumption curve. Consumption rates for + /// speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two + /// speeds in the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the + /// list + /// + /// The list must contain between 1 and 25 points (inclusive), and may + /// not contain duplicate points for the same speed. If it only + /// contains a single point, then the consumption rate of that point is + /// used without further processing. + /// + /// Consumption specified for the largest speed must be greater than or + /// equal to that of the penultimate largest speed. This ensures that + /// extrapolation does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds + /// in the list cannot lead to a negative consumption rate for any + /// smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) + /// is between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours + /// (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours + /// (kWh) that may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to + /// **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary + /// systems, in kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems + /// such as AC systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetRouteDirectionsWithAdditionalParametersWithHttpMessagesAsync(string format, string routePoints, RouteDirectionParameters routeDirectionParameters, int? maxAlternatives = default(int?), string alternativeType = default(string), int? minDeviationDistance = default(int?), int? minDeviationTime = default(int?), string instructionsType = default(string), string language = default(string), bool? computeBestWaypointOrder = default(bool?), string routeRepresentationForBestOrder = default(string), string computeTravelTime = default(string), int? vehicleHeading = default(int?), string report = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// __Route Range (Isochrone) API__ + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// This service will calculate a set of locations that can be reached + /// from the origin point based on fuel, energy, time or distance + /// budget that is specified. A polygon boundary (or Isochrone) is + /// returned in a counterclockwise orientation as well as the precise + /// polygon center which was the result of the origin point. + /// + /// The returned polygon can be used for further processing such as + /// [Search Inside + /// Geometry](https://docs.microsoft.com/rest/api/maps/search/postsearchinsidegeometry) + /// to search for POIs within the provided Isochrone. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The Coordinate from which the range calculation should start. + /// + /// + /// Fuel budget in liters that determines maximal range which can be + /// travelled using the specified Combustion Consumption + /// Model.<br> When fuelBudgetInLiters is used, it is mandatory + /// to specify a detailed Combustion Consumption Model.<br> + /// Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, + /// timeBudgetInSec, or distanceBudgetInMeters) must be used. + /// + /// + /// Electric energy budget in kilowatt hours (kWh) that determines + /// maximal range which can be travelled using the specified Electric + /// Consumption Model.<br> When energyBudgetInkWh is used, it is + /// mandatory to specify a detailed Electric Consumption + /// Model.<br> Exactly one budget (fuelBudgetInLiters, + /// energyBudgetInkWh, timeBudgetInSec, or distanceBudgetInMeters) must + /// be used. + /// + /// + /// Time budget in seconds that determines maximal range which can be + /// travelled using driving time. The Consumption Model will only + /// affect the range when routeType is eco.<br> Exactly one + /// budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// Distance budget in meters that determines maximal range which can + /// be travelled using driving distance. The Consumption Model will + /// only affect the range when routeType is eco.<br> Exactly one + /// budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// The date and time of departure from the origin point. Departure + /// times apart from now must be specified as a dateTime. When a time + /// zone offset is not specified, it will be assumed to be that of the + /// origin point. The departAt value must be in the future in the + /// date-time format (1996-12-19T16:39:57-08:00). + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during + /// routing + /// * false - Ignore current traffic data during routing. Note that + /// although the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road + /// speeds is still incorporated. + /// + /// + /// Specifies something that the route calculation should try to avoid + /// when determining the route. Can be specified multiple times in one + /// request, for example, + /// '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must + /// not be used. + /// + /// + /// The mode of travel for the requested route. If not defined, default + /// is 'car'. Note that the requested travelMode may not be available + /// for the entire route. Where the requested travelMode is not + /// available for a particular section, the travelMode element of the + /// response for that section will be "other". Note that travel modes + /// bus, motorcycle, taxi and van are BETA functionality. Full + /// restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and + /// pedestrian must not be used. Possible values include: 'car', + /// 'truck', 'taxi', 'bus', 'van', 'motorcycle', 'bicycle', + /// 'pedestrian' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be + /// used in conjunction with `routeType`=thrilling. Possible values + /// include: 'low', 'normal', 'high' + /// + /// + /// Level of turns for thrilling route. This parameter can only be used + /// in conjunction with `routeType`=thrilling. Possible values include: + /// 'low', 'normal', 'high' + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that + /// weight restrictions per axle are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the + /// vehicle profile is used to check whether a vehicle is allowed on + /// motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will + /// be determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For + /// example, the current traffic flow is 60 km/hour. If the vehicle + /// maximum speed is set to 50 km/hour, the routing engine will + /// consider 60 km/hour as this is the current situation. If the + /// maximum speed of the vehicle is provided as 80 km/hour but the + /// current traffic flow is 60 km/hour, then routing engine will again + /// use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the + /// Consumption Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value + /// of **vehicleWeight** is non-zero, then weight restrictions are + /// considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric + /// Model** : 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial + /// vehicles may not be allowed to drive on some roads. + /// + /// + /// Types of cargo that may be classified as hazardous materials and + /// restricted from some roads. Available vehicleLoadType values are US + /// Hazmat classes 1 through 9, plus generic classifications for use in + /// other countries. Values beginning with USHazmat are for US routing + /// while otherHazmat should be used for all other countries. + /// vehicleLoadType can be specified multiple times. This parameter is + /// currently only considered for travelMode=truck. Possible values + /// include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', + /// 'USHazmatClass7', 'USHazmatClass8', 'USHazmatClass9', + /// 'otherHazmatExplosive', 'otherHazmatGeneral', + /// 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is + /// specified, it must be consistent with the value of + /// **vehicleEngineType**. Possible values include: 'combustion', + /// 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption + /// curve. Consumption rates for speeds not in the list are found as + /// follows: + /// + /// * by linear interpolation, if the given speed lies in between two + /// speeds in the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the + /// list + /// + /// The list must contain between 1 and 25 points (inclusive), and may + /// not contain duplicate points for the same speed. If it only + /// contains a single point, then the consumption rate of that point is + /// used without further processing. + /// + /// Consumption specified for the largest speed must be greater than or + /// equal to that of the penultimate largest speed. This ensures that + /// extrapolation does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds + /// in the list cannot lead to a negative consumption rate for any + /// smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion + /// Consumption Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary + /// systems of the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems + /// such as AC systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel + /// in megajoules (MJ). It is used in conjunction with the + /// ***Efficiency** parameters for conversions between saved or + /// consumed energy and fuel. For example, energy density is 34.2 MJ/l + /// for gasoline, and 35.8 MJ/l for Diesel fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in + /// fuel to kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). + /// ChemicalEnergyConsumed_ is obtained by converting consumed fuel to + /// chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to + /// 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric + /// Model** : 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is + /// obtained by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to + /// 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric + /// Model** : 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in + /// fuel to potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). + /// ChemicalEnergyConsumed_ is obtained by converting consumed fuel to + /// chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric + /// Model** : 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved + /// (not consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is + /// obtained by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric + /// Model** : 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The + /// list defines points on a consumption curve. Consumption rates for + /// speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two + /// speeds in the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the + /// list + /// + /// The list must contain between 1 and 25 points (inclusive), and may + /// not contain duplicate points for the same speed. If it only + /// contains a single point, then the consumption rate of that point is + /// used without further processing. + /// + /// Consumption specified for the largest speed must be greater than or + /// equal to that of the penultimate largest speed. This ensures that + /// extrapolation does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds + /// in the list cannot lead to a negative consumption rate for any + /// smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) + /// is between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours + /// (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours + /// (kWh) that may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to + /// **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary + /// systems, in kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems + /// such as AC systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetRouteRangeWithHttpMessagesAsync(string format, IList query, double? fuelBudgetInLiters = default(double?), double? energyBudgetInKwH = default(double?), double? timeBudgetInSec = default(double?), double? distanceBudgetInMeters = default(double?), System.DateTime? departAt = default(System.DateTime?), string routeType = default(string), bool? useTrafficData = default(bool?), IList avoid = default(IList), string travelMode = default(string), string inclineLevel = default(string), string windingness = default(string), int? vehicleAxleWeight = 0, double? vehicleWidth = 0, double? vehicleHeight = 0, double? vehicleLength = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// **Route Directions Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Route Directions Batch API sends batches of queries to [Route + /// Directions + /// API](https://docs.microsoft.com/rest/api/maps/route/getroutedirections) + /// using just a single API call. You can call Route Directions Batch + /// API to run either asynchronously (async) or synchronously (sync). + /// The async API allows caller to batch up to **700** queries and sync + /// API up to **100** queries. + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex route requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **700** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Route Directions Batch `POST` request to Azure + /// Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` GET + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0 + /// ``` + /// Note:- Please remember to add AUTH information + /// (subscription-key/azure_auth - See [Security](#security)) to the + /// _status URI_ before running it. <br> + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _route directions_ queries you will use a `POST` + /// request where the request body will contain the `batchItems` array + /// in `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 3 + /// _route directions_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// { "query": + /// "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" + /// }, + /// { "query": + /// "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" + /// }, + /// { "query": "?query=48.923159,-122.557362:32.621279,-116.840362" } + /// ] + /// } + /// ``` + /// + /// A _route directions_ query in a batch is just a partial URL + /// _without_ the protocol, base URL, path, api-version and + /// subscription-key. It can accept any of the supported _route + /// directions_ [URI + /// parameters](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#uri-parameters). + /// The string values in the _route directions_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should + /// also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **700** queries and sync + /// API up to **100** queries, and the batch should contain at least + /// **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of route directions queries/requests to process. The list + /// can contain a max of 700 queries for async and 100 queries for sync + /// version and must contain at least 1 query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> RequestRouteDirectionsBatchWithHttpMessagesAsync(BatchRequestBody routeDirectionsBatchQueries, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetRouteDirectionsBatchWithHttpMessagesAsync(string batchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// **Route Directions Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Route Directions Batch API sends batches of queries to [Route + /// Directions + /// API](https://docs.microsoft.com/rest/api/maps/route/getroutedirections) + /// using just a single API call. You can call Route Directions Batch + /// API to run either asynchronously (async) or synchronously (sync). + /// The async API allows caller to batch up to **700** queries and sync + /// API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of route directions queries/requests to process. The list + /// can contain a max of 700 queries for async and 100 queries for + /// sync version and must contain at least 1 query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> RequestRouteDirectionsBatchSyncWithHttpMessagesAsync(BatchRequestBody routeDirectionsBatchQueries, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/AlternativeRouteType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/AlternativeRouteType.cs new file mode 100644 index 000000000000..bc6a477319fd --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/AlternativeRouteType.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for AlternativeRouteType. + /// + public static class AlternativeRouteType + { + /// + /// Allow any alternative route to be returned irrespective of how it + /// compares to the reference route in terms of optimality. + /// + public const string AnyRoute = "anyRoute"; + /// + /// Return an alternative route only if it is better than the reference + /// route according to the given planning criteria. + /// + public const string BetterRoute = "betterRoute"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchItem.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchItem.cs new file mode 100644 index 000000000000..0637a757f6a7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchItem.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An item returned from Batch API. Extend with 'response' property. + /// + public partial class BatchItem + { + /// + /// Initializes a new instance of the BatchItem class. + /// + public BatchItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchItem class. + /// + /// HTTP request status code. + public BatchItem(double? statusCode = default(double?)) + { + StatusCode = statusCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets HTTP request status code. + /// + [JsonProperty(PropertyName = "statusCode")] + public double? StatusCode { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchQuery.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchQuery.cs new file mode 100644 index 000000000000..db3b90567bf9 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchQuery.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Batch Query object + /// + public partial class BatchQuery + { + /// + /// Initializes a new instance of the BatchQuery class. + /// + public BatchQuery() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchQuery class. + /// + /// A query string for the corresponding batch API + /// endpoint. It is the exact query string you would use for a single + /// (non-batch) API request. + public BatchQuery(string query = default(string)) + { + Query = query; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a query string for the corresponding batch API + /// endpoint. It is the exact query string you would use for a single + /// (non-batch) API request. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBody.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBody.cs new file mode 100644 index 000000000000..129582cc4f58 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBody.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This type represents the request body for the Batch service. + /// + public partial class BatchRequestBody + { + /// + /// Initializes a new instance of the BatchRequestBody class. + /// + public BatchRequestBody() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchRequestBody class. + /// + public BatchRequestBody(IList batchItems = default(IList)) + { + BatchItems = batchItems; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "batchItems")] + public IList BatchItems { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponse.cs new file mode 100644 index 000000000000..bd56606bb88d --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponse.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This object is returned from a successful Batch service call. Extend + /// with 'batchItems' property. + /// + public partial class BatchResponse + { + /// + /// Initializes a new instance of the BatchResponse class. + /// + public BatchResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchResponse class. + /// + /// Summary for the batch request + public BatchResponse(BatchResponseSummary summary = default(BatchResponseSummary)) + { + Summary = summary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary for the batch request + /// + [JsonProperty(PropertyName = "summary")] + public BatchResponseSummary Summary { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponseSummary.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponseSummary.cs new file mode 100644 index 000000000000..6be47e329270 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchResponseSummary.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary for the batch request + /// + public partial class BatchResponseSummary + { + /// + /// Initializes a new instance of the BatchResponseSummary class. + /// + public BatchResponseSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchResponseSummary class. + /// + /// Number of successful requests in + /// the batch + /// Total number of requests in the + /// batch + public BatchResponseSummary(int? successfulRequests = default(int?), int? totalRequests = default(int?)) + { + SuccessfulRequests = successfulRequests; + TotalRequests = totalRequests; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets number of successful requests in the batch + /// + [JsonProperty(PropertyName = "successfulRequests")] + public int? SuccessfulRequests { get; private set; } + + /// + /// Gets total number of requests in the batch + /// + [JsonProperty(PropertyName = "totalRequests")] + public int? TotalRequests { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ComputeTravelTime.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ComputeTravelTime.cs new file mode 100644 index 000000000000..35fce033ed22 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ComputeTravelTime.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for ComputeTravelTime. + /// + public static class ComputeTravelTime + { + /// + /// Does not compute additional travel times. + /// + public const string None = "none"; + /// + /// Computes travel times for all types of traffic information and + /// specifies all results in the fields noTrafficTravelTimeInSeconds, + /// historicTrafficTravelTimeInSeconds and + /// liveTrafficIncidentsTravelTimeInSeconds being included in the + /// summaries in the route response. + /// + public const string All = "all"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/DelayMagnitude.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/DelayMagnitude.cs new file mode 100644 index 000000000000..9d2b836826c6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/DelayMagnitude.cs @@ -0,0 +1,40 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for DelayMagnitude. + /// + public static class DelayMagnitude + { + /// + /// Unknown. + /// + public const string Unknown = "0"; + /// + /// Minor. + /// + public const string Minor = "1"; + /// + /// Moderate. + /// + public const string Moderate = "2"; + /// + /// Major. + /// + public const string Major = "3"; + /// + /// Undefined, used for road closures and other indefinite delays. + /// + public const string Undefined = "4"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/DrivingSide.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/DrivingSide.cs new file mode 100644 index 000000000000..07c5053d972e --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/DrivingSide.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for DrivingSide. + /// + public static class DrivingSide + { + /// + /// Left side. + /// + public const string LEFT = "LEFT"; + /// + /// Right side. + /// + public const string RIGHT = "RIGHT"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/EffectiveSetting.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/EffectiveSetting.cs new file mode 100644 index 000000000000..9b7d15d36e9f --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/EffectiveSetting.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Effective parameter or data used when calling this Route API. + /// + public partial class EffectiveSetting + { + /// + /// Initializes a new instance of the EffectiveSetting class. + /// + public EffectiveSetting() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveSetting class. + /// + /// Name of the parameter used. + /// Value of the parameter used. + public EffectiveSetting(string key = default(string), string value = default(string)) + { + Key = key; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the parameter used. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; private set; } + + /// + /// Gets value of the parameter used. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..28490fce8da1 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorDetail.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..8abbcaf1761b --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..5f99f646497c --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponseException.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..3c04b59f56e6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeature.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeature.cs new file mode 100644 index 000000000000..4f4b3cc4deb0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeature.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A valid `GeoJSON Feature` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.2) for details. + /// + public partial class GeoJsonFeature + { + /// + /// Initializes a new instance of the GeoJsonFeature class. + /// + public GeoJsonFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeature class. + /// + /// Specifies the `GeoJSON` type. Must be one of the + /// nine valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// Properties can contain any additional + /// metadata about the `Feature`. Value can be any JSON object or a + /// JSON null value + /// Identifier for the feature. + /// The type of the feature. The value + /// depends on the data model the current feature is part of. Some data + /// models may have an empty value. + public GeoJsonFeature(GeoJsonObjectType type, GeoJsonGeometry geometry, object properties = default(object), string id = default(string), string featureType = default(string)) + { + Type = type; + Geometry = geometry; + Properties = properties; + Id = id; + FeatureType = featureType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the `GeoJSON` type. Must be one of the nine + /// valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// + [JsonProperty(PropertyName = "type")] + public GeoJsonObjectType Type { get; set; } + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonGeometry Geometry { get; set; } + + /// + /// Gets or sets properties can contain any additional metadata about + /// the `Feature`. Value can be any JSON object or a JSON null value + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// Gets or sets identifier for the feature. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the type of the feature. The value depends on the data + /// model the current feature is part of. Some data models may have an + /// empty value. + /// + [JsonProperty(PropertyName = "featureType")] + public string FeatureType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometry == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometry"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollection.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollection.cs new file mode 100644 index 000000000000..c72e2deb7723 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollection.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON FeatureCollection` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. + /// + public partial class GeoJsonFeatureCollection + { + /// + /// Initializes a new instance of the GeoJsonFeatureCollection class. + /// + public GeoJsonFeatureCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureCollection class. + /// + /// Specifies the `GeoJSON` type. Must be one of the + /// nine valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// Contains a list of valid `GeoJSON Feature` + /// objects. + public GeoJsonFeatureCollection(GeoJsonObjectType type, IList features) + { + Type = type; + Features = features; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the `GeoJSON` type. Must be one of the nine + /// valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// + [JsonProperty(PropertyName = "type")] + public GeoJsonObjectType Type { get; set; } + + /// + /// Gets or sets contains a list of valid `GeoJSON Feature` objects. + /// + [JsonProperty(PropertyName = "features")] + public IList Features { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Features == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Features"); + } + if (Features != null) + { + foreach (var element in Features) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollectionData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollectionData.cs new file mode 100644 index 000000000000..b6448f42f241 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollectionData.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonFeatureCollectionData + { + /// + /// Initializes a new instance of the GeoJsonFeatureCollectionData + /// class. + /// + public GeoJsonFeatureCollectionData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureCollectionData + /// class. + /// + /// Contains a list of valid `GeoJSON Feature` + /// objects. + public GeoJsonFeatureCollectionData(IList features) + { + Features = features; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Feature` objects. + /// + [JsonProperty(PropertyName = "features")] + public IList Features { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Features == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Features"); + } + if (Features != null) + { + foreach (var element in Features) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureData.cs new file mode 100644 index 000000000000..9917041013ac --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureData.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class GeoJsonFeatureData + { + /// + /// Initializes a new instance of the GeoJsonFeatureData class. + /// + public GeoJsonFeatureData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureData class. + /// + /// Properties can contain any additional + /// metadata about the `Feature`. Value can be any JSON object or a + /// JSON null value + /// Identifier for the feature. + /// The type of the feature. The value + /// depends on the data model the current feature is part of. Some data + /// models may have an empty value. + public GeoJsonFeatureData(GeoJsonGeometry geometry, object properties = default(object), string id = default(string), string featureType = default(string)) + { + Geometry = geometry; + Properties = properties; + Id = id; + FeatureType = featureType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonGeometry Geometry { get; set; } + + /// + /// Gets or sets properties can contain any additional metadata about + /// the `Feature`. Value can be any JSON object or a JSON null value + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// Gets or sets identifier for the feature. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the type of the feature. The value depends on the data + /// model the current feature is part of. Some data models may have an + /// empty value. + /// + [JsonProperty(PropertyName = "featureType")] + public string FeatureType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometry == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometry"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometry.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometry.cs new file mode 100644 index 000000000000..cf38641cc224 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometry.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using System.Linq; + + /// + /// A valid `GeoJSON` geometry object. The type must be one of the seven + /// valid GeoJSON geometry types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please + /// refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) + /// for details. + /// + public partial class GeoJsonGeometry : GeoJsonObject + { + /// + /// Initializes a new instance of the GeoJsonGeometry class. + /// + public GeoJsonGeometry() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollection.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollection.cs new file mode 100644 index 000000000000..bafd7e331395 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollection.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON GeometryCollection` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.8) for details. + /// + public partial class GeoJsonGeometryCollection + { + /// + /// Initializes a new instance of the GeoJsonGeometryCollection class. + /// + public GeoJsonGeometryCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonGeometryCollection class. + /// + /// Contains a list of valid `GeoJSON` + /// geometry objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonGeometryCollection(IList geometries) + { + Geometries = geometries; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON` geometry objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "geometries")] + public IList Geometries { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometries"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollectionData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollectionData.cs new file mode 100644 index 000000000000..e40c8c4ef95d --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonGeometryCollectionData.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonGeometryCollectionData + { + /// + /// Initializes a new instance of the GeoJsonGeometryCollectionData + /// class. + /// + public GeoJsonGeometryCollectionData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonGeometryCollectionData + /// class. + /// + /// Contains a list of valid `GeoJSON` + /// geometry objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonGeometryCollectionData(IList geometries) + { + Geometries = geometries; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON` geometry objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "geometries")] + public IList Geometries { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometries"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineString.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineString.cs new file mode 100644 index 000000000000..744c428e4f35 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineString.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON LineString` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details. + /// + public partial class GeoJsonLineString + { + /// + /// Initializes a new instance of the GeoJsonLineString class. + /// + public GeoJsonLineString() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonLineString class. + /// + /// Coordinates for the `GeoJson LineString` + /// geometry. + public GeoJsonLineString(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson LineString` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineStringData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineStringData.cs new file mode 100644 index 000000000000..3e71c890766a --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonLineStringData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonLineStringData + { + /// + /// Initializes a new instance of the GeoJsonLineStringData class. + /// + public GeoJsonLineStringData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonLineStringData class. + /// + /// Coordinates for the `GeoJson LineString` + /// geometry. + public GeoJsonLineStringData(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson LineString` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineString.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineString.cs new file mode 100644 index 000000000000..b7d3b0c7c651 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineString.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiLineString` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.5) for details. + /// + public partial class GeoJsonMultiLineString + { + /// + /// Initializes a new instance of the GeoJsonMultiLineString class. + /// + public GeoJsonMultiLineString() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiLineString class. + /// + /// Coordinates for the `GeoJson + /// MultiLineString` geometry. + public GeoJsonMultiLineString(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiLineString` + /// geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineStringData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineStringData.cs new file mode 100644 index 000000000000..c1acb5a4691d --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiLineStringData.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonMultiLineStringData + { + /// + /// Initializes a new instance of the GeoJsonMultiLineStringData class. + /// + public GeoJsonMultiLineStringData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiLineStringData class. + /// + /// Coordinates for the `GeoJson + /// MultiLineString` geometry. + public GeoJsonMultiLineStringData(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiLineString` + /// geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPoint.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPoint.cs new file mode 100644 index 000000000000..1b43742a18c9 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPoint.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiPoint` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.3) for details. + /// + public partial class GeoJsonMultiPoint + { + /// + /// Initializes a new instance of the GeoJsonMultiPoint class. + /// + public GeoJsonMultiPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPoint class. + /// + /// Coordinates for the `GeoJson MultiPoint` + /// geometry. + public GeoJsonMultiPoint(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiPoint` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPointData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPointData.cs new file mode 100644 index 000000000000..dc75dffde360 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPointData.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data contained by a `GeoJson MultiPoint`. + /// + public partial class GeoJsonMultiPointData + { + /// + /// Initializes a new instance of the GeoJsonMultiPointData class. + /// + public GeoJsonMultiPointData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPointData class. + /// + /// Coordinates for the `GeoJson MultiPoint` + /// geometry. + public GeoJsonMultiPointData(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiPoint` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygon.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygon.cs new file mode 100644 index 000000000000..ac4ae58c60f2 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygon.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiPolygon` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.7) for details. + /// + public partial class GeoJsonMultiPolygon + { + /// + /// Initializes a new instance of the GeoJsonMultiPolygon class. + /// + public GeoJsonMultiPolygon() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPolygon class. + /// + /// Contains a list of valid `GeoJSON + /// Polygon` objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonMultiPolygon(IList>>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Polygon` objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygonData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygonData.cs new file mode 100644 index 000000000000..2ac09a6701ac --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonMultiPolygonData.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonMultiPolygonData + { + /// + /// Initializes a new instance of the GeoJsonMultiPolygonData class. + /// + public GeoJsonMultiPolygonData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPolygonData class. + /// + /// Contains a list of valid `GeoJSON + /// Polygon` objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonMultiPolygonData(IList>>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Polygon` objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObject.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObject.cs new file mode 100644 index 000000000000..6cb48b8b3f8d --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObject.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using System.Linq; + + /// + /// A valid `GeoJSON` object. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3) for details. + /// + public partial class GeoJsonObject + { + /// + /// Initializes a new instance of the GeoJsonObject class. + /// + public GeoJsonObject() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObjectType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObjectType.cs new file mode 100644 index 000000000000..f07bffc2dd28 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObjectType.cs @@ -0,0 +1,129 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for GeoJsonObjectType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum GeoJsonObjectType + { + /// + /// `GeoJSON Point` geometry. + /// + [EnumMember(Value = "Point")] + GeoJsonPoint, + /// + /// `GeoJSON MultiPoint` geometry. + /// + [EnumMember(Value = "MultiPoint")] + GeoJsonMultiPoint, + /// + /// `GeoJSON LineString` geometry. + /// + [EnumMember(Value = "LineString")] + GeoJsonLineString, + /// + /// `GeoJSON MultiLineString` geometry. + /// + [EnumMember(Value = "MultiLineString")] + GeoJsonMultiLineString, + /// + /// `GeoJSON Polygon` geometry. + /// + [EnumMember(Value = "Polygon")] + GeoJsonPolygon, + /// + /// `GeoJSON MultiPolygon` geometry. + /// + [EnumMember(Value = "MultiPolygon")] + GeoJsonMultiPolygon, + /// + /// `GeoJSON GeometryCollection` geometry. + /// + [EnumMember(Value = "GeometryCollection")] + GeoJsonGeometryCollection, + /// + /// `GeoJSON Feature` object. + /// + [EnumMember(Value = "Feature")] + GeoJsonFeature, + /// + /// `GeoJSON FeatureCollection` object. + /// + [EnumMember(Value = "FeatureCollection")] + GeoJsonFeatureCollection + } + internal static class GeoJsonObjectTypeEnumExtension + { + internal static string ToSerializedValue(this GeoJsonObjectType? value) + { + return value == null ? null : ((GeoJsonObjectType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this GeoJsonObjectType value) + { + switch( value ) + { + case GeoJsonObjectType.GeoJsonPoint: + return "Point"; + case GeoJsonObjectType.GeoJsonMultiPoint: + return "MultiPoint"; + case GeoJsonObjectType.GeoJsonLineString: + return "LineString"; + case GeoJsonObjectType.GeoJsonMultiLineString: + return "MultiLineString"; + case GeoJsonObjectType.GeoJsonPolygon: + return "Polygon"; + case GeoJsonObjectType.GeoJsonMultiPolygon: + return "MultiPolygon"; + case GeoJsonObjectType.GeoJsonGeometryCollection: + return "GeometryCollection"; + case GeoJsonObjectType.GeoJsonFeature: + return "Feature"; + case GeoJsonObjectType.GeoJsonFeatureCollection: + return "FeatureCollection"; + } + return null; + } + + internal static GeoJsonObjectType? ParseGeoJsonObjectType(this string value) + { + switch( value ) + { + case "Point": + return GeoJsonObjectType.GeoJsonPoint; + case "MultiPoint": + return GeoJsonObjectType.GeoJsonMultiPoint; + case "LineString": + return GeoJsonObjectType.GeoJsonLineString; + case "MultiLineString": + return GeoJsonObjectType.GeoJsonMultiLineString; + case "Polygon": + return GeoJsonObjectType.GeoJsonPolygon; + case "MultiPolygon": + return GeoJsonObjectType.GeoJsonMultiPolygon; + case "GeometryCollection": + return GeoJsonObjectType.GeoJsonGeometryCollection; + case "Feature": + return GeoJsonObjectType.GeoJsonFeature; + case "FeatureCollection": + return GeoJsonObjectType.GeoJsonFeatureCollection; + } + return null; + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPoint.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPoint.cs new file mode 100644 index 000000000000..31db349629f7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPoint.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON Point` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details. + /// + public partial class GeoJsonPoint + { + /// + /// Initializes a new instance of the GeoJsonPoint class. + /// + public GeoJsonPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPoint class. + /// + public GeoJsonPoint(IList coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "coordinates")] + public IList Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPointData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPointData.cs new file mode 100644 index 000000000000..07b8e9d4274d --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPointData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data contained by a `GeoJson Point`. + /// + public partial class GeoJsonPointData + { + /// + /// Initializes a new instance of the GeoJsonPointData class. + /// + public GeoJsonPointData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPointData class. + /// + public GeoJsonPointData(IList coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "coordinates")] + public IList Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygon.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygon.cs new file mode 100644 index 000000000000..dcf82b56d0c6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygon.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON Polygon` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.6) for details. + /// + public partial class GeoJsonPolygon + { + /// + /// Initializes a new instance of the GeoJsonPolygon class. + /// + public GeoJsonPolygon() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPolygon class. + /// + /// Coordinates for the `GeoJson Polygon` + /// geometry type. + public GeoJsonPolygon(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson Polygon` geometry type. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygonData.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygonData.cs new file mode 100644 index 000000000000..7c1e44f5918f --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonPolygonData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonPolygonData + { + /// + /// Initializes a new instance of the GeoJsonPolygonData class. + /// + public GeoJsonPolygonData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPolygonData class. + /// + /// Coordinates for the `GeoJson Polygon` + /// geometry type. + public GeoJsonPolygonData(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson Polygon` geometry type. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteDirectionsBatchHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteDirectionsBatchHeaders.cs new file mode 100644 index 000000000000..79d2c087d00f --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteDirectionsBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetRouteDirectionsBatch operation. + /// + public partial class GetRouteDirectionsBatchHeaders + { + /// + /// Initializes a new instance of the GetRouteDirectionsBatchHeaders + /// class. + /// + public GetRouteDirectionsBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GetRouteDirectionsBatchHeaders + /// class. + /// + /// New URL to check for the results of the long + /// running process. + public GetRouteDirectionsBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteMatrixHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteMatrixHeaders.cs new file mode 100644 index 000000000000..840a53a55837 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteMatrixHeaders.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetRouteMatrix operation. + /// + public partial class GetRouteMatrixHeaders + { + /// + /// Initializes a new instance of the GetRouteMatrixHeaders class. + /// + public GetRouteMatrixHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GetRouteMatrixHeaders class. + /// + /// New URL to check for the results of the long + /// running process. + public GetRouteMatrixHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceInstructionType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceInstructionType.cs new file mode 100644 index 000000000000..21939b788143 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceInstructionType.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for GuidanceInstructionType. + /// + public static class GuidanceInstructionType + { + /// + /// Turn. + /// + public const string Turn = "TURN"; + /// + /// Road Change. + /// + public const string RoadChange = "ROAD_CHANGE"; + /// + /// Departure location. + /// + public const string LocationDeparture = "LOCATION_DEPARTURE"; + /// + /// Arrival location. + /// + public const string LocationArrival = "LOCATION_ARRIVAL"; + /// + /// Direction information. + /// + public const string DirectionInfo = "DIRECTION_INFO"; + /// + /// Way point location. + /// + public const string LocationWaypoint = "LOCATION_WAYPOINT"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceManeuver.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceManeuver.cs new file mode 100644 index 000000000000..ff813ef56fba --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GuidanceManeuver.cs @@ -0,0 +1,152 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for GuidanceManeuver. + /// + public static class GuidanceManeuver + { + /// + /// You have arrived. + /// + public const string Arrive = "ARRIVE"; + /// + /// You have arrived. Your destination is on the left. + /// + public const string ArriveLeft = "ARRIVE_LEFT"; + /// + /// You have arrived. Your destination is on the right. + /// + public const string ArriveRight = "ARRIVE_RIGHT"; + /// + /// Leave. + /// + public const string Depart = "DEPART"; + /// + /// Keep straight on. + /// + public const string Straight = "STRAIGHT"; + /// + /// Keep right. + /// + public const string KeepRight = "KEEP_RIGHT"; + /// + /// Bear right. + /// + public const string BearRight = "BEAR_RIGHT"; + /// + /// Turn right. + /// + public const string TurnRight = "TURN_RIGHT"; + /// + /// Turn sharp right. + /// + public const string SharpRight = "SHARP_RIGHT"; + /// + /// Keep left. + /// + public const string KeepLeft = "KEEP_LEFT"; + /// + /// Bear left. + /// + public const string BearLeft = "BEAR_LEFT"; + /// + /// Turn left. + /// + public const string TurnLeft = "TURN_LEFT"; + /// + /// Turn sharp left. + /// + public const string SharpLeft = "SHARP_LEFT"; + /// + /// Make a U-turn. + /// + public const string MakeUTurn = "MAKE_UTURN"; + /// + /// Take the motorway. + /// + public const string EnterMotorway = "ENTER_MOTORWAY"; + /// + /// Take the freeway. + /// + public const string EnterFreeway = "ENTER_FREEWAY"; + /// + /// Take the highway. + /// + public const string EnterHighway = "ENTER_HIGHWAY"; + /// + /// Take the exit. + /// + public const string TakeExit = "TAKE_EXIT"; + /// + /// Take the left exit. + /// + public const string MotorwayExitLeft = "MOTORWAY_EXIT_LEFT"; + /// + /// Take the right exit. + /// + public const string MotorwayExitRight = "MOTORWAY_EXIT_RIGHT"; + /// + /// Take the ferry. + /// + public const string TakeFerry = "TAKE_FERRY"; + /// + /// Cross the roundabout. + /// + public const string RoundaboutCross = "ROUNDABOUT_CROSS"; + /// + /// At the roundabout take the exit on the right. + /// + public const string RoundaboutRight = "ROUNDABOUT_RIGHT"; + /// + /// At the roundabout take the exit on the left. + /// + public const string RoundaboutLeft = "ROUNDABOUT_LEFT"; + /// + /// Go around the roundabout. + /// + public const string RoundaboutBack = "ROUNDABOUT_BACK"; + /// + /// Try to make a U-turn. + /// + public const string TryMakeUTurn = "TRY_MAKE_UTURN"; + /// + /// Follow. + /// + public const string Follow = "FOLLOW"; + /// + /// Switch to the parallel road. + /// + public const string SwitchParallelRoad = "SWITCH_PARALLEL_ROAD"; + /// + /// Switch to the main road. + /// + public const string SwitchMainRoad = "SWITCH_MAIN_ROAD"; + /// + /// Take the ramp. + /// + public const string EntranceRamp = "ENTRANCE_RAMP"; + /// + /// You have reached the waypoint. It is on the left. + /// + public const string WaypointLeft = "WAYPOINT_LEFT"; + /// + /// You have reached the waypoint. It is on the right. + /// + public const string WaypointRight = "WAYPOINT_RIGHT"; + /// + /// You have reached the waypoint. + /// + public const string WaypointReached = "WAYPOINT_REACHED"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/InclineLevel.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/InclineLevel.cs new file mode 100644 index 000000000000..a89e9949e4f1 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/InclineLevel.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for InclineLevel. + /// + public static class InclineLevel + { + /// + /// low + /// + public const string Low = "low"; + /// + /// normal + /// + public const string Normal = "normal"; + /// + /// high + /// + public const string High = "high"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/JunctionType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/JunctionType.cs new file mode 100644 index 000000000000..928c23eec8ae --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/JunctionType.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for JunctionType. + /// + public static class JunctionType + { + /// + /// regular + /// + public const string REGULAR = "REGULAR"; + /// + /// roundabout + /// + public const string ROUNDABOUT = "ROUNDABOUT"; + /// + /// bifurcation + /// + public const string BIFURCATION = "BIFURCATION"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/LatLongPair.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/LatLongPair.cs new file mode 100644 index 000000000000..f3fa090e6938 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/LatLongPair.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A location represented as a latitude and longitude. + /// + public partial class LatLongPair + { + /// + /// Initializes a new instance of the LatLongPair class. + /// + public LatLongPair() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LatLongPair class. + /// + /// Latitude property + /// Longitude property + public LatLongPair(double? latitude = default(double?), double? longitude = default(double?)) + { + Latitude = latitude; + Longitude = longitude; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets latitude property + /// + [JsonProperty(PropertyName = "latitude")] + public double? Latitude { get; set; } + + /// + /// Gets or sets longitude property + /// + [JsonProperty(PropertyName = "longitude")] + public double? Longitude { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/Report.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/Report.cs new file mode 100644 index 000000000000..63e4da9a19c5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/Report.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for Report. + /// + public static class Report + { + /// + /// Reports the effective parameters or data used when calling the API. + /// + public const string EffectiveSettings = "effectiveSettings"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteDirectionsBatchHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteDirectionsBatchHeaders.cs new file mode 100644 index 000000000000..e955c1e63f0a --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteDirectionsBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for RequestRouteDirectionsBatch operation. + /// + public partial class RequestRouteDirectionsBatchHeaders + { + /// + /// Initializes a new instance of the + /// RequestRouteDirectionsBatchHeaders class. + /// + public RequestRouteDirectionsBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// RequestRouteDirectionsBatchHeaders class. + /// + /// New URL to check for the results of the long + /// running process. + public RequestRouteDirectionsBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteMatrixHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteMatrixHeaders.cs new file mode 100644 index 000000000000..630529c7e22d --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RequestRouteMatrixHeaders.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for RequestRouteMatrix operation. + /// + public partial class RequestRouteMatrixHeaders + { + /// + /// Initializes a new instance of the RequestRouteMatrixHeaders class. + /// + public RequestRouteMatrixHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RequestRouteMatrixHeaders class. + /// + /// New URL to check for the results of the long + /// running process. + public RequestRouteMatrixHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseFormat.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseFormat.cs new file mode 100644 index 000000000000..3b15fb7342f3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseFormat.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for ResponseFormat. + /// + public static class ResponseFormat + { + /// + /// [The JavaScript Object Notation Data Interchange + /// Format](https://tools.ietf.org/html/rfc8259) + /// + public const string Json = "json"; + /// + /// [The Extensible Markup Language](https://www.w3.org/TR/xml/) + /// + public const string Xml = "xml"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseSectionType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseSectionType.cs new file mode 100644 index 000000000000..71778179207e --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseSectionType.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for ResponseSectionType. + /// + public static class ResponseSectionType + { + /// + /// Sections of the route that are cars or trains. + /// + public const string CarOrTrain = "CAR_TRAIN"; + /// + /// Sections indicating which countries the route is in. + /// + public const string Country = "COUNTRY"; + /// + /// Sections of the route that are ferries. + /// + public const string Ferry = "FERRY"; + /// + /// Sections of the route that are motorways. + /// + public const string Motorway = "MOTORWAY"; + /// + /// Sections of the route that are only suited for pedestrians. + /// + public const string Pedestrian = "PEDESTRIAN"; + /// + /// Sections of the route that require a toll to be payed. + /// + public const string TollRoad = "TOLL_ROAD"; + /// + /// Sections of the route that require a toll vignette to be present. + /// + public const string TollVignette = "TOLL_VIGNETTE"; + /// + /// Sections of the route that contain traffic information. + /// + public const string Traffic = "TRAFFIC"; + /// + /// Sections in relation to the request parameter `travelMode`. + /// + public const string TravelMode = "TRAVEL_MODE"; + /// + /// Sections of the route that are tunnels. + /// + public const string Tunnel = "TUNNEL"; + /// + /// Sections of the route that require use of carpool (HOV/High + /// Occupancy Vehicle) lanes. + /// + public const string Carpool = "CARPOOL"; + /// + /// Sections of the route that are located within urban areas. + /// + public const string Urban = "URBAN"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseTravelMode.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseTravelMode.cs new file mode 100644 index 000000000000..480756ba061b --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ResponseTravelMode.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for ResponseTravelMode. + /// + public static class ResponseTravelMode + { + /// + /// The returned routes are optimized for cars. + /// + public const string Car = "car"; + /// + /// The returned routes are optimized for commercial vehicles, like for + /// trucks. + /// + public const string Truck = "truck"; + /// + /// The returned routes are optimized for taxis. BETA functionality. + /// + public const string Taxi = "taxi"; + /// + /// The returned routes are optimized for buses, including the use of + /// bus only lanes. BETA functionality. + /// + public const string Bus = "bus"; + /// + /// The returned routes are optimized for vans. BETA functionality. + /// + public const string Van = "van"; + /// + /// The returned routes are optimized for motorcycles. BETA + /// functionality. + /// + public const string Motorcycle = "motorcycle"; + /// + /// The returned routes are optimized for bicycles, including use of + /// bicycle lanes. + /// + public const string Bicycle = "bicycle"; + /// + /// The returned routes are optimized for pedestrians, including the + /// use of sidewalks. + /// + public const string Pedestrian = "pedestrian"; + /// + /// The given mode of transport is not possible in this section + /// + public const string Other = "other"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteAvoidType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteAvoidType.cs new file mode 100644 index 000000000000..24fbb71c705a --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteAvoidType.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for RouteAvoidType. + /// + public static class RouteAvoidType + { + /// + /// Avoids toll roads. + /// + public const string TollRoads = "tollRoads"; + /// + /// Avoids motorways + /// + public const string Motorways = "motorways"; + /// + /// Avoids ferries + /// + public const string Ferries = "ferries"; + /// + /// Avoids unpaved roads + /// + public const string UnpavedRoads = "unpavedRoads"; + /// + /// Avoids routes that require the use of carpool (HOV/High Occupancy + /// Vehicle) lanes. + /// + public const string Carpools = "carpools"; + /// + /// Avoids using the same road multiple times. Most useful in + /// conjunction with `routeType`=thrilling. + /// + public const string AlreadyUsedRoads = "alreadyUsedRoads"; + /// + /// Avoids border crossings in route calculation. + /// + public const string BorderCrossings = "borderCrossings"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionParameters.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionParameters.cs new file mode 100644 index 000000000000..8be93bcb7275 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionParameters.cs @@ -0,0 +1,164 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Post body parameters for Route directions. + /// + public partial class RouteDirectionParameters + { + /// + /// Initializes a new instance of the RouteDirectionParameters class. + /// + public RouteDirectionParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteDirectionParameters class. + /// + /// A GeoJSON Geometry collection + /// representing sequence of coordinates used as input for route + /// reconstruction and for calculating zero or more alternative routes + /// to this reference route. + /// - The provided sequence of supporting points is used as input for + /// route reconstruction. + /// - The alternative routes are calculated between the origin and + /// destination points specified in the base path parameter locations. + /// - If both _minDeviationDistance_ and _minDeviationTime_ are set to + /// zero, then these origin and destination points are + /// expected to be at (or very near) the beginning and end of the + /// reference route, respectively. + /// - Intermediate locations (_waypoints_) are not supported when using + /// <_supportingPoints_>. + /// - The reference route may contain traffic incidents of type + /// _ROAD_CLOSURE_, which are + /// ignored for the calculation of the reference route's travel time + /// and traffic delay. + /// Please refer to [Supporting + /// Points](https://docs.microsoft.com/azure/azure-maps/how-to-use-best-practices-for-routing#calculate-and-bias-alternative-routes-using-supporting-points) + /// for details. + /// This is a list of 3-character, ISO + /// 3166-1, alpha-3 country codes of countries in which all toll roads + /// with vignettes are to be avoided, e.g. "AUS,CHE". Toll roads with + /// vignettes in countries not in the list are unaffected. Note: It is + /// an error to specify both **avoidVignette** and + /// **allowVignette**. + /// This is a list of 3-character, ISO + /// 3166-1, alpha-3 country codes of countries in which toll roads with + /// vignettes are allowed, e.g. "AUS,CHE". Specifying **allowVignette** + /// with some countries X is equivalent to specifying **avoidVignette** + /// with all countries but X. Specifying **allowVignette** with an + /// empty list is the same as avoiding all toll roads with vignettes. + /// Note: It is an error to specify both **avoidVignette** and + /// **allowVignette**. + /// A GeoJSON MultiPolygon representing list + /// of areas to avoid. Only rectangle polygons are supported. The + /// maximum size of a rectangle is about 160x160 km. Maximum number of + /// avoided areas is **10**. It cannot cross the 180th meridian. It + /// must be between -80 and +80 degrees of latitude. + public RouteDirectionParameters(GeoJsonGeometryCollection supportingPoints = default(GeoJsonGeometryCollection), IList avoidVignette = default(IList), IList allowVignette = default(IList), GeoJsonMultiPolygon avoidAreas = default(GeoJsonMultiPolygon)) + { + SupportingPoints = supportingPoints; + AvoidVignette = avoidVignette; + AllowVignette = allowVignette; + AvoidAreas = avoidAreas; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a GeoJSON Geometry collection representing sequence of + /// coordinates used as input for route reconstruction and for + /// calculating zero or more alternative routes to this reference + /// route. + /// - The provided sequence of supporting points is used as input for + /// route reconstruction. + /// - The alternative routes are calculated between the origin and + /// destination points specified in the base path parameter locations. + /// - If both _minDeviationDistance_ and _minDeviationTime_ are set to + /// zero, then these origin and destination points are + /// expected to be at (or very near) the beginning and end of the + /// reference route, respectively. + /// - Intermediate locations (_waypoints_) are not supported when using + /// &lt;_supportingPoints_&gt;. + /// - The reference route may contain traffic incidents of type + /// _ROAD_CLOSURE_, which are + /// ignored for the calculation of the reference route's travel time + /// and traffic delay. + /// Please refer to [Supporting + /// Points](https://docs.microsoft.com/azure/azure-maps/how-to-use-best-practices-for-routing#calculate-and-bias-alternative-routes-using-supporting-points) + /// for details. + /// + [JsonProperty(PropertyName = "supportingPoints")] + public GeoJsonGeometryCollection SupportingPoints { get; set; } + + /// + /// Gets or sets this is a list of 3-character, ISO 3166-1, alpha-3 + /// country codes of countries in which all toll roads with vignettes + /// are to be avoided, e.g. "AUS,CHE". Toll roads with vignettes in + /// countries not in the list are unaffected. Note: It is an error to + /// specify both **avoidVignette** and **allowVignette**. + /// + [JsonProperty(PropertyName = "avoidVignette")] + public IList AvoidVignette { get; set; } + + /// + /// Gets or sets this is a list of 3-character, ISO 3166-1, alpha-3 + /// country codes of countries in which toll roads with vignettes are + /// allowed, e.g. "AUS,CHE". Specifying **allowVignette** with some + /// countries X is equivalent to specifying **avoidVignette** with all + /// countries but X. Specifying **allowVignette** with an empty list is + /// the same as avoiding all toll roads with vignettes. Note: It is an + /// error to specify both **avoidVignette** and **allowVignette**. + /// + [JsonProperty(PropertyName = "allowVignette")] + public IList AllowVignette { get; set; } + + /// + /// Gets or sets a GeoJSON MultiPolygon representing list of areas to + /// avoid. Only rectangle polygons are supported. The maximum size of a + /// rectangle is about 160x160 km. Maximum number of avoided areas is + /// **10**. It cannot cross the 180th meridian. It must be between -80 + /// and +80 degrees of latitude. + /// + [JsonProperty(PropertyName = "avoidAreas")] + public GeoJsonMultiPolygon AvoidAreas { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SupportingPoints != null) + { + SupportingPoints.Validate(); + } + if (AvoidAreas != null) + { + AvoidAreas.Validate(); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirections.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirections.cs new file mode 100644 index 000000000000..671d2dbe4f64 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirections.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Route Directions call + /// + public partial class RouteDirections + { + /// + /// Initializes a new instance of the RouteDirections class. + /// + public RouteDirections() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteDirections class. + /// + /// Format Version property + /// Routes array + /// Optimized sequence of waypoints. + /// It shows the index from the user provided waypoint sequence for the + /// original and optimized list. For instance, a response: + /// + /// ``` + /// <optimizedWaypoints> + /// <waypoint providedIndex="0" optimizedIndex="1"/> + /// <waypoint providedIndex="1" optimizedIndex="2"/> + /// <waypoint providedIndex="2" optimizedIndex="0"/> + /// </optimizedWaypoints> + /// ``` + /// + /// means that the original sequence is [0, 1, 2] and optimized + /// sequence is [1, 2, 0]. Since the index starts by 0 the original is + /// "first, second, third" while the optimized is "second, third, + /// first". + public RouteDirections(string formatVersion = default(string), IList routes = default(IList), IList optimizedWaypoints = default(IList), RouteReport report = default(RouteReport)) + { + FormatVersion = formatVersion; + Routes = routes; + OptimizedWaypoints = optimizedWaypoints; + Report = report; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets format Version property + /// + [JsonProperty(PropertyName = "formatVersion")] + public string FormatVersion { get; private set; } + + /// + /// Gets routes array + /// + [JsonProperty(PropertyName = "routes")] + public IList Routes { get; private set; } + + /// + /// Gets optimized sequence of waypoints. It shows the index from the + /// user provided waypoint sequence for the original and optimized + /// list. For instance, a response: + /// + /// ``` + /// &lt;optimizedWaypoints&gt; + /// &lt;waypoint providedIndex="0" optimizedIndex="1"/&gt; + /// &lt;waypoint providedIndex="1" optimizedIndex="2"/&gt; + /// &lt;waypoint providedIndex="2" optimizedIndex="0"/&gt; + /// &lt;/optimizedWaypoints&gt; + /// ``` + /// + /// means that the original sequence is [0, 1, 2] and optimized + /// sequence is [1, 2, 0]. Since the index starts by 0 the original is + /// "first, second, third" while the optimized is "second, third, + /// first". + /// + [JsonProperty(PropertyName = "optimizedWaypoints")] + public IList OptimizedWaypoints { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "report")] + public RouteReport Report { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItem.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItem.cs new file mode 100644 index 000000000000..8e5eff78dc3e --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItem.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An item returned from Route Directions Batch service call. + /// + public partial class RouteDirectionsBatchItem : BatchItem + { + /// + /// Initializes a new instance of the RouteDirectionsBatchItem class. + /// + public RouteDirectionsBatchItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteDirectionsBatchItem class. + /// + /// HTTP request status code. + /// The result of the query. RouteDirections if + /// the query completed successfully, ErrorResponse otherwise. + public RouteDirectionsBatchItem(double? statusCode = default(double?), RouteDirectionsBatchItemResponse response = default(RouteDirectionsBatchItemResponse)) + : base(statusCode) + { + Response = response; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the result of the query. RouteDirections if the query + /// completed successfully, ErrorResponse otherwise. + /// + [JsonProperty(PropertyName = "response")] + public RouteDirectionsBatchItemResponse Response { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItemResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItemResponse.cs new file mode 100644 index 000000000000..1c5e73184458 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItemResponse.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of the query. RouteDirections if the query completed + /// successfully, ErrorResponse otherwise. + /// + public partial class RouteDirectionsBatchItemResponse + { + /// + /// Initializes a new instance of the RouteDirectionsBatchItemResponse + /// class. + /// + public RouteDirectionsBatchItemResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteDirectionsBatchItemResponse + /// class. + /// + /// Format Version property + /// Routes array + /// Optimized sequence of waypoints. + /// It shows the index from the user provided waypoint sequence for the + /// original and optimized list. For instance, a response: + /// + /// ``` + /// <optimizedWaypoints> + /// <waypoint providedIndex="0" optimizedIndex="1"/> + /// <waypoint providedIndex="1" optimizedIndex="2"/> + /// <waypoint providedIndex="2" optimizedIndex="0"/> + /// </optimizedWaypoints> + /// ``` + /// + /// means that the original sequence is [0, 1, 2] and optimized + /// sequence is [1, 2, 0]. Since the index starts by 0 the original is + /// "first, second, third" while the optimized is "second, third, + /// first". + /// The error object. + public RouteDirectionsBatchItemResponse(string formatVersion = default(string), IList routes = default(IList), IList optimizedWaypoints = default(IList), RouteReport report = default(RouteReport), ErrorDetail error = default(ErrorDetail)) + { + FormatVersion = formatVersion; + Routes = routes; + OptimizedWaypoints = optimizedWaypoints; + Report = report; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets format Version property + /// + [JsonProperty(PropertyName = "formatVersion")] + public string FormatVersion { get; private set; } + + /// + /// Gets routes array + /// + [JsonProperty(PropertyName = "routes")] + public IList Routes { get; private set; } + + /// + /// Gets optimized sequence of waypoints. It shows the index from the + /// user provided waypoint sequence for the original and optimized + /// list. For instance, a response: + /// + /// ``` + /// &lt;optimizedWaypoints&gt; + /// &lt;waypoint providedIndex="0" optimizedIndex="1"/&gt; + /// &lt;waypoint providedIndex="1" optimizedIndex="2"/&gt; + /// &lt;waypoint providedIndex="2" optimizedIndex="0"/&gt; + /// &lt;/optimizedWaypoints&gt; + /// ``` + /// + /// means that the original sequence is [0, 1, 2] and optimized + /// sequence is [1, 2, 0]. Since the index starts by 0 the original is + /// "first, second, third" while the optimized is "second, third, + /// first". + /// + [JsonProperty(PropertyName = "optimizedWaypoints")] + public IList OptimizedWaypoints { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "report")] + public RouteReport Report { get; set; } + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchResponse.cs new file mode 100644 index 000000000000..3e98ee54881a --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchResponse.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Route Directions Batch + /// service call. + /// + public partial class RouteDirectionsBatchResponse : BatchResponse + { + /// + /// Initializes a new instance of the RouteDirectionsBatchResponse + /// class. + /// + public RouteDirectionsBatchResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteDirectionsBatchResponse + /// class. + /// + /// Summary for the batch request + /// Array containing the batch + /// results. + public RouteDirectionsBatchResponse(BatchResponseSummary summary = default(BatchResponseSummary), IList batchItems = default(IList)) + : base(summary) + { + BatchItems = batchItems; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets array containing the batch results. + /// + [JsonProperty(PropertyName = "batchItems")] + public IList BatchItems { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGuidance.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGuidance.cs new file mode 100644 index 000000000000..4cb4bf9f6e82 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGuidance.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Contains guidance related elements. This field is present only when + /// guidance was requested and is available. + /// + public partial class RouteGuidance + { + /// + /// Initializes a new instance of the RouteGuidance class. + /// + public RouteGuidance() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteGuidance class. + /// + /// A list of instructions describing + /// maneuvers. + /// Groups a sequence of instruction + /// elements which are related to each other. + public RouteGuidance(IList instructions = default(IList), IList instructionGroups = default(IList)) + { + Instructions = instructions; + InstructionGroups = instructionGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a list of instructions describing maneuvers. + /// + [JsonProperty(PropertyName = "instructions")] + public IList Instructions { get; private set; } + + /// + /// Gets groups a sequence of instruction elements which are related to + /// each other. + /// + [JsonProperty(PropertyName = "instructionGroups")] + public IList InstructionGroups { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstruction.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstruction.cs new file mode 100644 index 000000000000..ce66da83695b --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstruction.cs @@ -0,0 +1,331 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep + /// left', 'Take the ferry', 'Take the motorway', 'Arrive'. + /// + public partial class RouteInstruction + { + /// + /// Initializes a new instance of the RouteInstruction class. + /// + public RouteInstruction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteInstruction class. + /// + /// Distance from the start of the + /// route to the point of the instruction. + /// Estimated travel time up to the + /// point corresponding to routeOffsetInMeters. + /// The index of the point in the list of + /// polyline "points" corresponding to the point of the + /// instruction. + /// Type of the instruction, e.g., turn + /// or change of road form. Possible values include: 'Turn', + /// 'RoadChange', 'LocationDeparture', 'LocationArrival', + /// 'DirectionInfo', 'LocationWaypoint' + /// The road number(s) of the next + /// significant road segment(s) after the maneuver, or of the road(s) + /// to be followed. Example: ["E34", "N205"] + /// The number(s) of a highway exit taken by + /// the current maneuver. If an exit has multiple exit numbers, they + /// will be separated by "," and possibly aggregated by "-", e.g., "10, + /// 13-15". + /// Street name of the next significant road + /// segment after the maneuver, or of the street that should be + /// followed. + /// The text on a signpost which is most + /// relevant to the maneuver, or to the direction that should be + /// followed. + /// 3-character [ISO + /// 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-3 + /// country code. E.g. USA. + /// A subdivision (e.g., state) of the country, + /// represented by the second part of an [ISO + /// 3166-2](https://www.iso.org/standard/63546.html) code. This is only + /// available for some countries like the US, Canada, and + /// Mexico. + /// The type of the junction where the + /// maneuver takes place. For larger roundabouts, two separate + /// instructions are generated for entering and leaving the roundabout. + /// Possible values include: 'REGULAR', 'ROUNDABOUT', + /// 'BIFURCATION' + /// Indicates the direction of an + /// instruction. If junctionType indicates a turn instruction: + /// + /// * 180 = U-turn + /// * [-179, -1] = Left turn + /// * 0 = Straight on (a '0 degree' turn) + /// * [1, 179] = Right turn + /// + /// If junctionType indicates a bifurcation instruction: + /// + /// * <0 - keep left + /// * \>0 - keep right + /// This indicates which exit to + /// take at a roundabout. + /// It is possible to optionally + /// combine the instruction with the next one. This can be used to + /// build messages like "Turn left and then turn right". + /// Indicates left-hand vs. right-hand side + /// driving at the point of the maneuver. Possible values include: + /// 'LEFT', 'RIGHT' + /// A code identifying the maneuver. Possible + /// values include: 'Arrive', 'ArriveLeft', 'ArriveRight', 'Depart', + /// 'Straight', 'KeepRight', 'BearRight', 'TurnRight', 'SharpRight', + /// 'KeepLeft', 'BearLeft', 'TurnLeft', 'SharpLeft', 'MakeUTurn', + /// 'EnterMotorway', 'EnterFreeway', 'EnterHighway', 'TakeExit', + /// 'MotorwayExitLeft', 'MotorwayExitRight', 'TakeFerry', + /// 'RoundaboutCross', 'RoundaboutRight', 'RoundaboutLeft', + /// 'RoundaboutBack', 'TryMakeUTurn', 'Follow', 'SwitchParallelRoad', + /// 'SwitchMainRoad', 'EntranceRamp', 'WaypointLeft', 'WaypointRight', + /// 'WaypointReached' + /// A human-readable message for the + /// maneuver. + /// A human-readable message for the + /// maneuver combined with the message from the next instruction. + /// Sometimes it is possible to combine two successive instructions + /// into a single instruction making it easier to follow. When this is + /// the case the possibleCombineWithNext flag will be true. For + /// example: + /// + /// ``` + /// 10. Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + /// 11. Follow Einsteinweg/A10/E22 towards Ring Amsterdam + /// ``` + /// + /// The possibleCombineWithNext flag on instruction 10 is true. This + /// indicates to the clients of coded guidance that it can be combined + /// with instruction 11. The instructions will be combined + /// automatically for clients requesting human-readable guidance. The + /// combinedMessage field contains the combined message: + /// + /// ``` + /// Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + /// then follow Einsteinweg/A10/E22 towards Ring Amsterdam. + /// ``` + public RouteInstruction(int? routeOffsetInMeters = default(int?), int? travelTimeInSeconds = default(int?), LatLongPair point = default(LatLongPair), int? pointIndex = default(int?), string instructionType = default(string), IList roadNumbers = default(IList), string exitNumber = default(string), string street = default(string), string signpostText = default(string), string countryCode = default(string), string stateCode = default(string), string junctionType = default(string), int? turnAngleInDegrees = default(int?), string roundaboutExitNumber = default(string), bool? possibleCombineWithNext = default(bool?), string drivingSide = default(string), string maneuver = default(string), string message = default(string), string combinedMessage = default(string)) + { + RouteOffsetInMeters = routeOffsetInMeters; + TravelTimeInSeconds = travelTimeInSeconds; + Point = point; + PointIndex = pointIndex; + InstructionType = instructionType; + RoadNumbers = roadNumbers; + ExitNumber = exitNumber; + Street = street; + SignpostText = signpostText; + CountryCode = countryCode; + StateCode = stateCode; + JunctionType = junctionType; + TurnAngleInDegrees = turnAngleInDegrees; + RoundaboutExitNumber = roundaboutExitNumber; + PossibleCombineWithNext = possibleCombineWithNext; + DrivingSide = drivingSide; + Maneuver = maneuver; + Message = message; + CombinedMessage = combinedMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets distance from the start of the route to the point of the + /// instruction. + /// + [JsonProperty(PropertyName = "routeOffsetInMeters")] + public int? RouteOffsetInMeters { get; private set; } + + /// + /// Gets estimated travel time up to the point corresponding to + /// routeOffsetInMeters. + /// + [JsonProperty(PropertyName = "travelTimeInSeconds")] + public int? TravelTimeInSeconds { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "point")] + public LatLongPair Point { get; set; } + + /// + /// Gets the index of the point in the list of polyline "points" + /// corresponding to the point of the instruction. + /// + [JsonProperty(PropertyName = "pointIndex")] + public int? PointIndex { get; private set; } + + /// + /// Gets or sets type of the instruction, e.g., turn or change of road + /// form. Possible values include: 'Turn', 'RoadChange', + /// 'LocationDeparture', 'LocationArrival', 'DirectionInfo', + /// 'LocationWaypoint' + /// + [JsonProperty(PropertyName = "instructionType")] + public string InstructionType { get; set; } + + /// + /// Gets the road number(s) of the next significant road segment(s) + /// after the maneuver, or of the road(s) to be followed. Example: + /// ["E34", "N205"] + /// + [JsonProperty(PropertyName = "roadNumbers")] + public IList RoadNumbers { get; private set; } + + /// + /// Gets the number(s) of a highway exit taken by the current maneuver. + /// If an exit has multiple exit numbers, they will be separated by "," + /// and possibly aggregated by "-", e.g., "10, 13-15". + /// + [JsonProperty(PropertyName = "exitNumber")] + public string ExitNumber { get; private set; } + + /// + /// Gets street name of the next significant road segment after the + /// maneuver, or of the street that should be followed. + /// + [JsonProperty(PropertyName = "street")] + public string Street { get; private set; } + + /// + /// Gets the text on a signpost which is most relevant to the maneuver, + /// or to the direction that should be followed. + /// + [JsonProperty(PropertyName = "signpostText")] + public string SignpostText { get; private set; } + + /// + /// Gets 3-character [ISO + /// 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-3 + /// country code. E.g. USA. + /// + [JsonProperty(PropertyName = "countryCode")] + public string CountryCode { get; private set; } + + /// + /// Gets a subdivision (e.g., state) of the country, represented by the + /// second part of an [ISO + /// 3166-2](https://www.iso.org/standard/63546.html) code. This is only + /// available for some countries like the US, Canada, and Mexico. + /// + [JsonProperty(PropertyName = "stateCode")] + public string StateCode { get; private set; } + + /// + /// Gets the type of the junction where the maneuver takes place. For + /// larger roundabouts, two separate instructions are generated for + /// entering and leaving the roundabout. Possible values include: + /// 'REGULAR', 'ROUNDABOUT', 'BIFURCATION' + /// + [JsonProperty(PropertyName = "junctionType")] + public string JunctionType { get; private set; } + + /// + /// Gets indicates the direction of an instruction. If junctionType + /// indicates a turn instruction: + /// + /// * 180 = U-turn + /// * [-179, -1] = Left turn + /// * 0 = Straight on (a '0 degree' turn) + /// * [1, 179] = Right turn + /// + /// If junctionType indicates a bifurcation instruction: + /// + /// * &lt;0 - keep left + /// * \&gt;0 - keep right + /// + [JsonProperty(PropertyName = "turnAngleInDecimalDegrees")] + public int? TurnAngleInDegrees { get; private set; } + + /// + /// Gets this indicates which exit to take at a roundabout. + /// + [JsonProperty(PropertyName = "roundaboutExitNumber")] + public string RoundaboutExitNumber { get; private set; } + + /// + /// Gets it is possible to optionally combine the instruction with the + /// next one. This can be used to build messages like "Turn left and + /// then turn right". + /// + [JsonProperty(PropertyName = "possibleCombineWithNext")] + public bool? PossibleCombineWithNext { get; private set; } + + /// + /// Gets indicates left-hand vs. right-hand side driving at the point + /// of the maneuver. Possible values include: 'LEFT', 'RIGHT' + /// + [JsonProperty(PropertyName = "drivingSide")] + public string DrivingSide { get; private set; } + + /// + /// Gets a code identifying the maneuver. Possible values include: + /// 'Arrive', 'ArriveLeft', 'ArriveRight', 'Depart', 'Straight', + /// 'KeepRight', 'BearRight', 'TurnRight', 'SharpRight', 'KeepLeft', + /// 'BearLeft', 'TurnLeft', 'SharpLeft', 'MakeUTurn', 'EnterMotorway', + /// 'EnterFreeway', 'EnterHighway', 'TakeExit', 'MotorwayExitLeft', + /// 'MotorwayExitRight', 'TakeFerry', 'RoundaboutCross', + /// 'RoundaboutRight', 'RoundaboutLeft', 'RoundaboutBack', + /// 'TryMakeUTurn', 'Follow', 'SwitchParallelRoad', 'SwitchMainRoad', + /// 'EntranceRamp', 'WaypointLeft', 'WaypointRight', 'WaypointReached' + /// + [JsonProperty(PropertyName = "maneuver")] + public string Maneuver { get; private set; } + + /// + /// Gets a human-readable message for the maneuver. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets a human-readable message for the maneuver combined with the + /// message from the next instruction. Sometimes it is possible to + /// combine two successive instructions into a single instruction + /// making it easier to follow. When this is the case the + /// possibleCombineWithNext flag will be true. For example: + /// + /// ``` + /// 10. Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + /// 11. Follow Einsteinweg/A10/E22 towards Ring Amsterdam + /// ``` + /// + /// The possibleCombineWithNext flag on instruction 10 is true. This + /// indicates to the clients of coded guidance that it can be combined + /// with instruction 11. The instructions will be combined + /// automatically for clients requesting human-readable guidance. The + /// combinedMessage field contains the combined message: + /// + /// ``` + /// Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + /// then follow Einsteinweg/A10/E22 towards Ring Amsterdam. + /// ``` + /// + [JsonProperty(PropertyName = "combinedMessage")] + public string CombinedMessage { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionGroup.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionGroup.cs new file mode 100644 index 000000000000..0669212f7d58 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionGroup.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Groups a sequence of instruction elements which are related to each + /// other. The sequence range is constrained with firstInstructionIndex and + /// lastInstructionIndex. When human-readable text messages are requested + /// for guidance (instructionType=text or tagged), then the + /// instructionGroup has a summary message returned when available. + /// + public partial class RouteInstructionGroup + { + /// + /// Initializes a new instance of the RouteInstructionGroup class. + /// + public RouteInstructionGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteInstructionGroup class. + /// + /// Index of the first instruction + /// in the instructions and belonging to this group. + /// Index of the last instruction in + /// the instructions and belonging to this group. + /// Length of the group. + /// Summary message when human-readable text + /// messages are requested for guidance (instructionType=text or + /// tagged). + public RouteInstructionGroup(int? firstInstructionIndex = default(int?), int? lastInstructionIndex = default(int?), int? groupLengthInMeters = default(int?), string groupMessage = default(string)) + { + FirstInstructionIndex = firstInstructionIndex; + LastInstructionIndex = lastInstructionIndex; + GroupLengthInMeters = groupLengthInMeters; + GroupMessage = groupMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets index of the first instruction in the instructions and + /// belonging to this group. + /// + [JsonProperty(PropertyName = "firstInstructionIndex")] + public int? FirstInstructionIndex { get; private set; } + + /// + /// Gets index of the last instruction in the instructions and + /// belonging to this group. + /// + [JsonProperty(PropertyName = "lastInstructionIndex")] + public int? LastInstructionIndex { get; private set; } + + /// + /// Gets length of the group. + /// + [JsonProperty(PropertyName = "groupLengthInMeters")] + public int? GroupLengthInMeters { get; private set; } + + /// + /// Gets summary message when human-readable text messages are + /// requested for guidance (instructionType=text or tagged). + /// + [JsonProperty(PropertyName = "groupMessage")] + public string GroupMessage { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionsType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionsType.cs new file mode 100644 index 000000000000..cb480ddae5b3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteInstructionsType.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for RouteInstructionsType. + /// + public static class RouteInstructionsType + { + /// + /// Returns raw instruction data without human-readable messages. + /// + public const string Coded = "coded"; + /// + /// Returns raw instructions data with human-readable messages in plain + /// text. + /// + public const string Text = "text"; + /// + /// Returns raw instruction data with tagged human-readable messages to + /// permit formatting. A human-readable message is built up from + /// repeatable identified elements. These are tagged to allow client + /// applications to format them correctly. The following message + /// components are tagged when instructionsType=tagged: street, + /// roadNumber, signpostText, exitNumber, roundaboutExitNumber. + /// + /// Example of tagged 'Turn left' message:​ + /// + /// ``` + /// Turn left onto + /// A4/E19 + /// towards Den Haag + /// ``` + /// + public const string Tagged = "tagged"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLeg.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLeg.cs new file mode 100644 index 000000000000..1e7b41f2615f --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLeg.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A description of a part of a route, comprised of a list of points. Each + /// additional waypoint provided in the request will result in an + /// additional leg in the returned route. + /// + public partial class RouteLeg + { + /// + /// Initializes a new instance of the RouteLeg class. + /// + public RouteLeg() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteLeg class. + /// + /// Points array + public RouteLeg(RouteLegSummary summary = default(RouteLegSummary), IList points = default(IList)) + { + Summary = summary; + Points = points; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "summary")] + public RouteLegSummary Summary { get; set; } + + /// + /// Gets points array + /// + [JsonProperty(PropertyName = "points")] + public IList Points { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLegSummary.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLegSummary.cs new file mode 100644 index 000000000000..51e8de28f531 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteLegSummary.cs @@ -0,0 +1,176 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary object for route section. + /// + public partial class RouteLegSummary + { + /// + /// Initializes a new instance of the RouteLegSummary class. + /// + public RouteLegSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteLegSummary class. + /// + /// Length In Meters property + /// Estimated travel time in seconds + /// property that includes the delay due to real-time traffic. Note + /// that even when traffic=false travelTimeInSeconds still includes the + /// delay due to traffic. If DepartAt is in the future, travel time is + /// calculated using time-dependent historic traffic data. + /// Estimated delay in seconds + /// caused by the real-time incident(s) according to traffic + /// information. For routes planned with departure time in the future, + /// delays is always 0. To return additional travel times using + /// different types of traffic information, parameter + /// computeTravelTimeFor=all needs to be added. + /// Estimated travel time + /// calculated as if there are no delays on the route due to traffic + /// conditions (e.g. congestion). Included only if computeTravelTimeFor + /// = all is used in the query. + /// Estimated travel + /// time calculated using time-dependent historic traffic data. + /// Included only if computeTravelTimeFor = all is used in the + /// query. + /// Estimated + /// travel time calculated using real-time speed data. Included only if + /// computeTravelTimeFor = all is used in the query. + /// Estimated fuel consumption in + /// liters using the Combustion Consumption Model. Included if + /// vehicleEngineType is set to _combustion_ and + /// constantSpeedConsumptionInLitersPerHundredkm is specified. The + /// value will be non-negative. + /// Estimated electric energy + /// consumption in kilowatt hours (kWh) using the Electric Consumption + /// Model. Included if vehicleEngineType is set to electric and + /// constantSpeedConsumptionInkWhPerHundredkm is specified. The value + /// of batteryConsumptionInkWh includes the recuperated electric energy + /// and can therefore be negative (which indicates gaining energy). If + /// both maxChargeInkWh and currentChargeInkWh are specified, + /// recuperation will be capped to ensure that the battery charge level + /// never exceeds maxChargeInkWh. If neither maxChargeInkWh nor + /// currentChargeInkWh are specified, unconstrained recuperation is + /// assumed in the consumption calculation. + public RouteLegSummary(int? lengthInMeters = default(int?), int? travelTimeInSeconds = default(int?), int? trafficDelayInSeconds = default(int?), System.DateTime? departureTime = default(System.DateTime?), System.DateTime? arrivalTime = default(System.DateTime?), int? noTrafficTravelTimeInSeconds = default(int?), int? historicTrafficTravelTimeInSeconds = default(int?), int? liveTrafficIncidentsTravelTimeInSeconds = default(int?), double? fuelConsumptionInLiters = default(double?), double? batteryConsumptionInKwH = default(double?)) + { + LengthInMeters = lengthInMeters; + TravelTimeInSeconds = travelTimeInSeconds; + TrafficDelayInSeconds = trafficDelayInSeconds; + DepartureTime = departureTime; + ArrivalTime = arrivalTime; + NoTrafficTravelTimeInSeconds = noTrafficTravelTimeInSeconds; + HistoricTrafficTravelTimeInSeconds = historicTrafficTravelTimeInSeconds; + LiveTrafficIncidentsTravelTimeInSeconds = liveTrafficIncidentsTravelTimeInSeconds; + FuelConsumptionInLiters = fuelConsumptionInLiters; + BatteryConsumptionInKwH = batteryConsumptionInKwH; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets length In Meters property + /// + [JsonProperty(PropertyName = "lengthInMeters")] + public int? LengthInMeters { get; private set; } + + /// + /// Gets estimated travel time in seconds property that includes the + /// delay due to real-time traffic. Note that even when traffic=false + /// travelTimeInSeconds still includes the delay due to traffic. If + /// DepartAt is in the future, travel time is calculated using + /// time-dependent historic traffic data. + /// + [JsonProperty(PropertyName = "travelTimeInSeconds")] + public int? TravelTimeInSeconds { get; private set; } + + /// + /// Gets estimated delay in seconds caused by the real-time incident(s) + /// according to traffic information. For routes planned with departure + /// time in the future, delays is always 0. To return additional travel + /// times using different types of traffic information, parameter + /// computeTravelTimeFor=all needs to be added. + /// + [JsonProperty(PropertyName = "trafficDelayInSeconds")] + public int? TrafficDelayInSeconds { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "departureTime")] + public System.DateTime? DepartureTime { get; set; } + + /// + /// + [JsonProperty(PropertyName = "arrivalTime")] + public System.DateTime? ArrivalTime { get; set; } + + /// + /// Gets estimated travel time calculated as if there are no delays on + /// the route due to traffic conditions (e.g. congestion). Included + /// only if computeTravelTimeFor = all is used in the query. + /// + [JsonProperty(PropertyName = "noTrafficTravelTimeInSeconds")] + public int? NoTrafficTravelTimeInSeconds { get; private set; } + + /// + /// Gets estimated travel time calculated using time-dependent historic + /// traffic data. Included only if computeTravelTimeFor = all is used + /// in the query. + /// + [JsonProperty(PropertyName = "historicTrafficTravelTimeInSeconds")] + public int? HistoricTrafficTravelTimeInSeconds { get; private set; } + + /// + /// Gets estimated travel time calculated using real-time speed data. + /// Included only if computeTravelTimeFor = all is used in the query. + /// + [JsonProperty(PropertyName = "liveTrafficIncidentsTravelTimeInSeconds")] + public int? LiveTrafficIncidentsTravelTimeInSeconds { get; private set; } + + /// + /// Gets estimated fuel consumption in liters using the Combustion + /// Consumption Model. Included if vehicleEngineType is set to + /// _combustion_ and constantSpeedConsumptionInLitersPerHundredkm is + /// specified. The value will be non-negative. + /// + [JsonProperty(PropertyName = "fuelConsumptionInLiters")] + public double? FuelConsumptionInLiters { get; private set; } + + /// + /// Gets estimated electric energy consumption in kilowatt hours (kWh) + /// using the Electric Consumption Model. Included if vehicleEngineType + /// is set to electric and constantSpeedConsumptionInkWhPerHundredkm is + /// specified. The value of batteryConsumptionInkWh includes the + /// recuperated electric energy and can therefore be negative (which + /// indicates gaining energy). If both maxChargeInkWh and + /// currentChargeInkWh are specified, recuperation will be capped to + /// ensure that the battery charge level never exceeds maxChargeInkWh. + /// If neither maxChargeInkWh nor currentChargeInkWh are specified, + /// unconstrained recuperation is assumed in the consumption + /// calculation. + /// + [JsonProperty(PropertyName = "batteryConsumptionInkWh")] + public double? BatteryConsumptionInKwH { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixQuery.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixQuery.cs new file mode 100644 index 000000000000..588cdd1c130e --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixQuery.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An object with a matrix of coordinates. + /// + public partial class RouteMatrixQuery + { + /// + /// Initializes a new instance of the RouteMatrixQuery class. + /// + public RouteMatrixQuery() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteMatrixQuery class. + /// + public RouteMatrixQuery(GeoJsonMultiPoint origins = default(GeoJsonMultiPoint), GeoJsonMultiPoint destinations = default(GeoJsonMultiPoint)) + { + Origins = origins; + Destinations = destinations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "origins")] + public GeoJsonMultiPoint Origins { get; set; } + + /// + /// + [JsonProperty(PropertyName = "destinations")] + public GeoJsonMultiPoint Destinations { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Origins != null) + { + Origins.Validate(); + } + if (Destinations != null) + { + Destinations.Validate(); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResponse.cs new file mode 100644 index 000000000000..049d488ad947 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResponse.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Route Matrix call. For ex, if + /// 2 origins and 3 destinations are provided, there are going to 2 arrays + /// with 3 elements in each. Each element's content depends on the options + /// provided in the query. + /// + public partial class RouteMatrixResponse + { + /// + /// Initializes a new instance of the RouteMatrixResponse class. + /// + public RouteMatrixResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteMatrixResponse class. + /// + /// Format Version property + /// Results as a 2 dimensional array of route + /// summaries. + public RouteMatrixResponse(string formatVersion = default(string), IList> matrix = default(IList>), RouteMatrixSummary summary = default(RouteMatrixSummary)) + { + FormatVersion = formatVersion; + Matrix = matrix; + Summary = summary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets format Version property + /// + [JsonProperty(PropertyName = "formatVersion")] + public string FormatVersion { get; private set; } + + /// + /// Gets results as a 2 dimensional array of route summaries. + /// + [JsonProperty(PropertyName = "matrix")] + public IList> Matrix { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "summary")] + public RouteMatrixSummary Summary { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResult.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResult.cs new file mode 100644 index 000000000000..0e3d8b0181d0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResult.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Matrix result object + /// + public partial class RouteMatrixResult + { + /// + /// Initializes a new instance of the RouteMatrixResult class. + /// + public RouteMatrixResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteMatrixResult class. + /// + /// StatusCode property for the current cell + /// in the input matrix. + public RouteMatrixResult(int? statusCode = default(int?), RouteMatrixResultResponse response = default(RouteMatrixResultResponse)) + { + StatusCode = statusCode; + Response = response; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets statusCode property for the current cell in the input matrix. + /// + [JsonProperty(PropertyName = "statusCode")] + public int? StatusCode { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "response")] + public RouteMatrixResultResponse Response { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResultResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResultResponse.cs new file mode 100644 index 000000000000..ab102681b151 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixResultResponse.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response object of the current cell in the input matrix. + /// + public partial class RouteMatrixResultResponse + { + /// + /// Initializes a new instance of the RouteMatrixResultResponse class. + /// + public RouteMatrixResultResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteMatrixResultResponse class. + /// + public RouteMatrixResultResponse(RouteLegSummary summary = default(RouteLegSummary)) + { + Summary = summary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "routeSummary")] + public RouteLegSummary Summary { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixSummary.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixSummary.cs new file mode 100644 index 000000000000..1c90f67236d4 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteMatrixSummary.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary object + /// + public partial class RouteMatrixSummary + { + /// + /// Initializes a new instance of the RouteMatrixSummary class. + /// + public RouteMatrixSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteMatrixSummary class. + /// + /// Number of successful routes in the + /// response. + /// Total number of routes requested. Number + /// of cells in the input matrix. + public RouteMatrixSummary(int? successfulRoutes = default(int?), int? totalRoutes = default(int?)) + { + SuccessfulRoutes = successfulRoutes; + TotalRoutes = totalRoutes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets number of successful routes in the response. + /// + [JsonProperty(PropertyName = "successfulRoutes")] + public int? SuccessfulRoutes { get; private set; } + + /// + /// Gets total number of routes requested. Number of cells in the input + /// matrix. + /// + [JsonProperty(PropertyName = "totalRoutes")] + public int? TotalRoutes { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteModel.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteModel.cs new file mode 100644 index 000000000000..fbbffa3ca8ba --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteModel.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class RouteModel + { + /// + /// Initializes a new instance of the RouteModel class. + /// + public RouteModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteModel class. + /// + /// Legs array + /// Sections array + public RouteModel(RouteSummary summary = default(RouteSummary), IList legs = default(IList), IList sections = default(IList), RouteGuidance guidance = default(RouteGuidance)) + { + Summary = summary; + Legs = legs; + Sections = sections; + Guidance = guidance; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "summary")] + public RouteSummary Summary { get; set; } + + /// + /// Gets legs array + /// + [JsonProperty(PropertyName = "legs")] + public IList Legs { get; private set; } + + /// + /// Gets sections array + /// + [JsonProperty(PropertyName = "sections")] + public IList Sections { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "guidance")] + public RouteGuidance Guidance { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteOptimizedWaypoint.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteOptimizedWaypoint.cs new file mode 100644 index 000000000000..443c8611725b --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteOptimizedWaypoint.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Optimized way point object. + /// + public partial class RouteOptimizedWaypoint + { + /// + /// Initializes a new instance of the RouteOptimizedWaypoint class. + /// + public RouteOptimizedWaypoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteOptimizedWaypoint class. + /// + /// Way point index provided by the + /// user. + /// Optimized way point index from the + /// system. + public RouteOptimizedWaypoint(int? providedIndex = default(int?), int? optimizedIndex = default(int?)) + { + ProvidedIndex = providedIndex; + OptimizedIndex = optimizedIndex; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets way point index provided by the user. + /// + [JsonProperty(PropertyName = "providedIndex")] + public int? ProvidedIndex { get; private set; } + + /// + /// Gets optimized way point index from the system. + /// + [JsonProperty(PropertyName = "optimizedIndex")] + public int? OptimizedIndex { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRange.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRange.cs new file mode 100644 index 000000000000..8d56026d374d --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRange.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Reachable Range + /// + public partial class RouteRange + { + /// + /// Initializes a new instance of the RouteRange class. + /// + public RouteRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteRange class. + /// + /// Center point of the reachable range + /// Polygon boundary of the reachable range + /// represented as a list of points. + public RouteRange(LatLongPair center = default(LatLongPair), IList boundary = default(IList)) + { + Center = center; + Boundary = boundary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets center point of the reachable range + /// + [JsonProperty(PropertyName = "center")] + public LatLongPair Center { get; set; } + + /// + /// Gets polygon boundary of the reachable range represented as a list + /// of points. + /// + [JsonProperty(PropertyName = "boundary")] + public IList Boundary { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRangeResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRangeResponse.cs new file mode 100644 index 000000000000..5ba32be4dcd8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRangeResponse.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This object is returned from a successful Route Reachable Range call + /// + public partial class RouteRangeResponse + { + /// + /// Initializes a new instance of the RouteRangeResponse class. + /// + public RouteRangeResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteRangeResponse class. + /// + /// Format Version property + public RouteRangeResponse(string formatVersion = default(string), RouteRange reachableRange = default(RouteRange), RouteReport report = default(RouteReport)) + { + FormatVersion = formatVersion; + ReachableRange = reachableRange; + Report = report; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets format Version property + /// + [JsonProperty(PropertyName = "formatVersion")] + public string FormatVersion { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "reachableRange")] + public RouteRange ReachableRange { get; set; } + + /// + /// + [JsonProperty(PropertyName = "report")] + public RouteReport Report { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteReport.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteReport.cs new file mode 100644 index 000000000000..15d0b5c9e6f9 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteReport.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Reports the effective settings used in the current call. + /// + public partial class RouteReport + { + /// + /// Initializes a new instance of the RouteReport class. + /// + public RouteReport() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteReport class. + /// + /// Effective parameters or data used + /// when calling this Route API. + public RouteReport(IList effectiveSettings = default(IList)) + { + EffectiveSettings = effectiveSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets effective parameters or data used when calling this Route API. + /// + [JsonProperty(PropertyName = "effectiveSettings")] + public IList EffectiveSettings { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRepresentationForBestOrder.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRepresentationForBestOrder.cs new file mode 100644 index 000000000000..361d4b6786d0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRepresentationForBestOrder.cs @@ -0,0 +1,34 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for RouteRepresentationForBestOrder. + /// + public static class RouteRepresentationForBestOrder + { + /// + /// Includes route geometry in the response. + /// + public const string Polyline = "polyline"; + /// + /// Summary as per polyline but excluding the point geometry elements + /// for the routes in the response. + /// + public const string SummaryOnly = "summaryOnly"; + /// + /// Includes only the optimized waypoint indices but does not include + /// the route geometry in the response. + /// + public const string None = "none"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSection.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSection.cs new file mode 100644 index 000000000000..b8d5e9019fe0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSection.cs @@ -0,0 +1,134 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Route sections contain additional information about parts of a route. + /// Each section contains at least the elements `startPointIndex`, + /// `endPointIndex`, and `sectionType`. + /// + public partial class RouteSection + { + /// + /// Initializes a new instance of the RouteSection class. + /// + public RouteSection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteSection class. + /// + /// Index of the first point (offset 0) + /// in the route this section applies to. + /// Index of the last point (offset 0) in + /// the route this section applies to. + /// Possible values include: 'CarOrTrain', + /// 'Country', 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', + /// 'TollVignette', 'Traffic', 'TravelMode', 'Tunnel', 'Carpool', + /// 'Urban' + /// Possible values include: 'car', 'truck', + /// 'taxi', 'bus', 'van', 'motorcycle', 'bicycle', 'pedestrian', + /// 'other' + /// Possible values include: 'Jam', + /// 'RoadWork', 'RoadClosure', 'Other' + /// Effective speed of the incident + /// in km/h, averaged over its entire length. + /// Delay in seconds caused by the + /// incident. + /// Possible values include: 'Unknown', + /// 'Minor', 'Moderate', 'Major', 'Undefined' + public RouteSection(int? startPointIndex = default(int?), int? endPointIndex = default(int?), string sectionType = default(string), string travelMode = default(string), string simpleCategory = default(string), int? effectiveSpeedInKmh = default(int?), int? delayInSeconds = default(int?), string magnitudeOfDelay = default(string), RouteSectionTec tec = default(RouteSectionTec)) + { + StartPointIndex = startPointIndex; + EndPointIndex = endPointIndex; + SectionType = sectionType; + TravelMode = travelMode; + SimpleCategory = simpleCategory; + EffectiveSpeedInKmh = effectiveSpeedInKmh; + DelayInSeconds = delayInSeconds; + MagnitudeOfDelay = magnitudeOfDelay; + Tec = tec; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets index of the first point (offset 0) in the route this section + /// applies to. + /// + [JsonProperty(PropertyName = "startPointIndex")] + public int? StartPointIndex { get; private set; } + + /// + /// Gets index of the last point (offset 0) in the route this section + /// applies to. + /// + [JsonProperty(PropertyName = "endPointIndex")] + public int? EndPointIndex { get; private set; } + + /// + /// Gets or sets possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', + /// 'Traffic', 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + [JsonProperty(PropertyName = "sectionType")] + public string SectionType { get; set; } + + /// + /// Gets or sets possible values include: 'car', 'truck', 'taxi', + /// 'bus', 'van', 'motorcycle', 'bicycle', 'pedestrian', 'other' + /// + [JsonProperty(PropertyName = "travelMode")] + public string TravelMode { get; set; } + + /// + /// Gets or sets possible values include: 'Jam', 'RoadWork', + /// 'RoadClosure', 'Other' + /// + [JsonProperty(PropertyName = "simpleCategory")] + public string SimpleCategory { get; set; } + + /// + /// Gets effective speed of the incident in km/h, averaged over its + /// entire length. + /// + [JsonProperty(PropertyName = "effectiveSpeedInKmh")] + public int? EffectiveSpeedInKmh { get; private set; } + + /// + /// Gets delay in seconds caused by the incident. + /// + [JsonProperty(PropertyName = "delayInSeconds")] + public int? DelayInSeconds { get; private set; } + + /// + /// Gets or sets possible values include: 'Unknown', 'Minor', + /// 'Moderate', 'Major', 'Undefined' + /// + [JsonProperty(PropertyName = "magnitudeOfDelay")] + public string MagnitudeOfDelay { get; set; } + + /// + /// + [JsonProperty(PropertyName = "tec")] + public RouteSectionTec Tec { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTec.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTec.cs new file mode 100644 index 000000000000..0dfc28fcd4ea --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTec.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Details of the traffic event, using definitions in the + /// [TPEG2-TEC](https://www.iso.org/standard/63116.html) standard. Can + /// contain effectCode and causes elements. + /// + public partial class RouteSectionTec + { + /// + /// Initializes a new instance of the RouteSectionTec class. + /// + public RouteSectionTec() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteSectionTec class. + /// + /// The effect on the traffic flow. Contains a + /// value in the tec001:EffectCode table, as defined in the + /// [TPEG2-TEC](https://www.iso.org/standard/63116.html) standard. Can + /// be used to color-code traffic events according to severity. + /// Causes array + public RouteSectionTec(int? effectCode = default(int?), IList causes = default(IList)) + { + EffectCode = effectCode; + Causes = causes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the effect on the traffic flow. Contains a value in the + /// tec001:EffectCode table, as defined in the + /// [TPEG2-TEC](https://www.iso.org/standard/63116.html) standard. Can + /// be used to color-code traffic events according to severity. + /// + [JsonProperty(PropertyName = "effectCode")] + public int? EffectCode { get; private set; } + + /// + /// Gets or sets causes array + /// + [JsonProperty(PropertyName = "causes")] + public IList Causes { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTecCause.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTecCause.cs new file mode 100644 index 000000000000..fad76ba24884 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSectionTecCause.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The cause of the traffic event. Can contain mainCauseCode and + /// subCauseCode elements. Can be used to define iconography and + /// descriptions. + /// + public partial class RouteSectionTecCause + { + /// + /// Initializes a new instance of the RouteSectionTecCause class. + /// + public RouteSectionTecCause() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteSectionTecCause class. + /// + /// The main cause of the traffic event. + /// Contains a value in the tec002:CauseCode table, as defined in the + /// [TPEG2-TEC](https://www.iso.org/standard/63116.html) + /// standard. + /// The subcause of the traffic event. + /// Contains a value in the sub cause table defined by the + /// mainCauseCode, as defined in the + /// [TPEG2-TEC](https://www.iso.org/standard/63116.html) + /// standard. + public RouteSectionTecCause(int? mainCauseCode = default(int?), int? subCauseCode = default(int?)) + { + MainCauseCode = mainCauseCode; + SubCauseCode = subCauseCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the main cause of the traffic event. Contains a value in the + /// tec002:CauseCode table, as defined in the + /// [TPEG2-TEC](https://www.iso.org/standard/63116.html) standard. + /// + [JsonProperty(PropertyName = "mainCauseCode")] + public int? MainCauseCode { get; private set; } + + /// + /// Gets the subcause of the traffic event. Contains a value in the sub + /// cause table defined by the mainCauseCode, as defined in the + /// [TPEG2-TEC](https://www.iso.org/standard/63116.html) standard. + /// + [JsonProperty(PropertyName = "subCauseCode")] + public int? SubCauseCode { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSummary.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSummary.cs new file mode 100644 index 000000000000..5709c5f98754 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteSummary.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary object + /// + public partial class RouteSummary + { + /// + /// Initializes a new instance of the RouteSummary class. + /// + public RouteSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteSummary class. + /// + /// Length In Meters property + /// Estimated travel time in seconds + /// property that includes the delay due to real-time traffic. Note + /// that even when traffic=false travelTimeInSeconds still includes the + /// delay due to traffic. If DepartAt is in the future, travel time is + /// calculated using time-dependent historic traffic data. + /// Estimated delay in seconds + /// caused by the real-time incident(s) according to traffic + /// information. For routes planned with departure time in the future, + /// delays is always 0. To return additional travel times using + /// different types of traffic information, parameter + /// computeTravelTimeFor=all needs to be added. + public RouteSummary(int? lengthInMeters = default(int?), int? travelTimeInSeconds = default(int?), int? trafficDelayInSeconds = default(int?), System.DateTime? departureTime = default(System.DateTime?), System.DateTime? arrivalTime = default(System.DateTime?)) + { + LengthInMeters = lengthInMeters; + TravelTimeInSeconds = travelTimeInSeconds; + TrafficDelayInSeconds = trafficDelayInSeconds; + DepartureTime = departureTime; + ArrivalTime = arrivalTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets length In Meters property + /// + [JsonProperty(PropertyName = "lengthInMeters")] + public int? LengthInMeters { get; private set; } + + /// + /// Gets estimated travel time in seconds property that includes the + /// delay due to real-time traffic. Note that even when traffic=false + /// travelTimeInSeconds still includes the delay due to traffic. If + /// DepartAt is in the future, travel time is calculated using + /// time-dependent historic traffic data. + /// + [JsonProperty(PropertyName = "travelTimeInSeconds")] + public int? TravelTimeInSeconds { get; private set; } + + /// + /// Gets estimated delay in seconds caused by the real-time incident(s) + /// according to traffic information. For routes planned with departure + /// time in the future, delays is always 0. To return additional travel + /// times using different types of traffic information, parameter + /// computeTravelTimeFor=all needs to be added. + /// + [JsonProperty(PropertyName = "trafficDelayInSeconds")] + public int? TrafficDelayInSeconds { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "departureTime")] + public System.DateTime? DepartureTime { get; set; } + + /// + /// + [JsonProperty(PropertyName = "arrivalTime")] + public System.DateTime? ArrivalTime { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteType.cs new file mode 100644 index 000000000000..739c265095d3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteType.cs @@ -0,0 +1,40 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for RouteType. + /// + public static class RouteType + { + /// + /// The fastest route. + /// + public const string Fastest = "fastest"; + /// + /// The shortest route by distance. + /// + public const string Shortest = "shortest"; + /// + /// A route balanced by economy and speed. + /// + public const string Economy = "eco"; + /// + /// Includes interesting or challenging roads and uses as few motorways + /// as possible. You can choose the level of turns included and also + /// the degree of hilliness. See the hilliness and windingness + /// parameters for how to set this. There is a limit of 900 km on + /// routes planned with `routeType`=thrilling + /// + public const string Thrilling = "thrilling"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/SectionType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/SectionType.cs new file mode 100644 index 000000000000..331f4706de86 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/SectionType.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for SectionType. + /// + public static class SectionType + { + /// + /// Sections of the route that are cars or trains. + /// + public const string CarOrTrain = "carTrain"; + /// + /// Sections indicating which countries the route is in. + /// + public const string Country = "country"; + /// + /// Sections of the route that are ferries. + /// + public const string Ferry = "ferry"; + /// + /// Sections of the route that are motorways. + /// + public const string Motorway = "motorway"; + /// + /// Sections of the route that are only suited for pedestrians. + /// + public const string Pedestrian = "pedestrian"; + /// + /// Sections of the route that require a toll to be payed. + /// + public const string TollRoad = "tollRoad"; + /// + /// Sections of the route that require a toll vignette to be present. + /// + public const string TollVignette = "tollVignette"; + /// + /// Sections of the route that contain traffic information. + /// + public const string Traffic = "traffic"; + /// + /// Sections in relation to the request parameter `travelMode`. + /// + public const string TravelMode = "travelMode"; + /// + /// Sections of the route that are tunnels. + /// + public const string Tunnel = "tunnel"; + /// + /// Sections of the route that require use of carpool (HOV/High + /// Occupancy Vehicle) lanes. + /// + public const string Carpool = "carpool"; + /// + /// Sections of the route that are located within urban areas. + /// + public const string Urban = "urban"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/SimpleCategory.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/SimpleCategory.cs new file mode 100644 index 000000000000..d11dee7ab6e7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/SimpleCategory.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for SimpleCategory. + /// + public static class SimpleCategory + { + /// + /// Traffic jam. + /// + public const string Jam = "JAM"; + /// + /// Road work. + /// + public const string RoadWork = "ROAD_WORK"; + /// + /// Road closure. + /// + public const string RoadClosure = "ROAD_CLOSURE"; + /// + /// Other. + /// + public const string Other = "OTHER"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/TravelMode.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/TravelMode.cs new file mode 100644 index 000000000000..28082c1c453e --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/TravelMode.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for TravelMode. + /// + public static class TravelMode + { + /// + /// The returned routes are optimized for cars. + /// + public const string Car = "car"; + /// + /// The returned routes are optimized for commercial vehicles, like for + /// trucks. + /// + public const string Truck = "truck"; + /// + /// The returned routes are optimized for taxis. BETA functionality. + /// + public const string Taxi = "taxi"; + /// + /// The returned routes are optimized for buses, including the use of + /// bus only lanes. BETA functionality. + /// + public const string Bus = "bus"; + /// + /// The returned routes are optimized for vans. BETA functionality. + /// + public const string Van = "van"; + /// + /// The returned routes are optimized for motorcycles. BETA + /// functionality. + /// + public const string Motorcycle = "motorcycle"; + /// + /// The returned routes are optimized for bicycles, including use of + /// bicycle lanes. + /// + public const string Bicycle = "bicycle"; + /// + /// The returned routes are optimized for pedestrians, including the + /// use of sidewalks. + /// + public const string Pedestrian = "pedestrian"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleEngineType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleEngineType.cs new file mode 100644 index 000000000000..085bcf7381ff --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleEngineType.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for VehicleEngineType. + /// + public static class VehicleEngineType + { + /// + /// Internal combustion engine. + /// + public const string Combustion = "combustion"; + /// + /// Electric engine. + /// + public const string Electric = "electric"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleLoadType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleLoadType.cs new file mode 100644 index 000000000000..2f4bff1efb26 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/VehicleLoadType.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for VehicleLoadType. + /// + public static class VehicleLoadType + { + /// + /// Explosives + /// + public const string USHazmatClass1 = "USHazmatClass1"; + /// + /// Compressed gas + /// + public const string USHazmatClass2 = "USHazmatClass2"; + /// + /// Flammable liquids + /// + public const string USHazmatClass3 = "USHazmatClass3"; + /// + /// Flammable solids + /// + public const string USHazmatClass4 = "USHazmatClass4"; + /// + /// Oxidizers + /// + public const string USHazmatClass5 = "USHazmatClass5"; + /// + /// Poisons + /// + public const string USHazmatClass6 = "USHazmatClass6"; + /// + /// Radioactive + /// + public const string USHazmatClass7 = "USHazmatClass7"; + /// + /// Corrosives + /// + public const string USHazmatClass8 = "USHazmatClass8"; + /// + /// Miscellaneous + /// + public const string USHazmatClass9 = "USHazmatClass9"; + /// + /// Explosives + /// + public const string OtherHazmatExplosive = "otherHazmatExplosive"; + /// + /// Miscellaneous + /// + public const string OtherHazmatGeneral = "otherHazmatGeneral"; + /// + /// Harmful to water + /// + public const string OtherHazmatHarmfulToWater = "otherHazmatHarmfulToWater"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/WindingnessLevel.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/WindingnessLevel.cs new file mode 100644 index 000000000000..e8d6b6914aac --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/WindingnessLevel.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route.Models +{ + + /// + /// Defines values for WindingnessLevel. + /// + public static class WindingnessLevel + { + /// + /// low + /// + public const string Low = "low"; + /// + /// normal + /// + public const string Normal = "normal"; + /// + /// high + /// + public const string High = "high"; + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/RouteClient.cs b/sdk/maps/Azure.Maps.Route/src/Generated/RouteClient.cs new file mode 100644 index 000000000000..c18f72bbb40f --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/RouteClient.cs @@ -0,0 +1,5130 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Azure Maps Route REST APIs + /// + public partial class RouteClient : ServiceClient, IRouteClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Version number of Azure Maps API. + /// + public string ApiVersion { get; set; } + + /// + /// Specifies which account is intended for usage in conjunction with the Azure + /// AD security model. It represents a unique ID for the Azure Maps account + /// and can be retrieved from the Azure Maps management plane Account API. To + /// use Azure AD security in Azure Maps see the following + /// [articles](https://aka.ms/amauthdetails) for guidance. + /// + public string ClientId { get; set; } + + /// + /// Subscription credentials which uniquely identify client subscription. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling RouteClient.Dispose(). False: will not dispose provided httpClient + protected RouteClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected RouteClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected RouteClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected RouteClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected RouteClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RouteClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling RouteClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public RouteClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RouteClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RouteClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RouteClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RouteClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + BaseUri = new System.Uri("https://atlas.microsoft.com"); + ApiVersion = "1.0"; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + CustomInitialize(); + } + /// + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// The Matrix Routing service allows calculation of a matrix of route + /// summaries for a set of routes defined by origin and destination locations + /// by using an asynchronous (async) or synchronous (sync) POST request. For + /// every given origin, the service calculates the cost of routing from that + /// origin to every given destination. The set of origins and the set of + /// destinations can be thought of as the column and row headers of a table and + /// each cell in the table contains the costs of routing from the origin to the + /// destination for that cell. As an example, let's say a food delivery company + /// has 20 drivers and they need to find the closest driver to pick up the + /// delivery from the restaurant. To solve this use case, they can call Matrix + /// Route API. + /// + /// + /// For each route, the travel times and distances are returned. You can use + /// the computed costs to determine which detailed routes to calculate using + /// the Route Directions API. + /// + /// + /// The maximum size of a matrix for async request is **700** and for sync + /// request it's **100** (the number of origins multiplied by the number of + /// destinations). + /// + /// + /// + /// ### Submit Synchronous Route Matrix Request + /// If your scenario requires synchronous requests and the maximum size of the + /// matrix is less than or equal to 100, you might want to make synchronous + /// request. The maximum size of a matrix for this API is **100** (the number + /// of origins multiplied by the number of destinations). With that constraint + /// in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it + /// does not need to be square). + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// ### Submit Asynchronous Route Matrix Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex routing requests. When you make a request by using async + /// request, by default the service returns a 202 response code along a + /// redirect URL in the Location field of the response header. This URL should + /// be checked periodically until the response data or error information is + /// available. If `waitForResults` parameter in the request is set to true, + /// user will get a 200 response if the request is finished under 120 seconds. + /// + /// + /// The maximum size of a matrix for this API is **700** (the number of origins + /// multiplied by the number of destinations). With that constraint in mind, + /// examples of possible matrix dimensions are: 50x10, 10x10, 28x25. 10x70 (it + /// does not need to be square). + /// + /// + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// + /// + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// Here's a typical sequence of asynchronous operations: + /// 1. Client sends a Route Matrix POST request to Azure Maps + /// + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Route Matrix request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Route Matrix + /// request. This could either be a 400 Bad Request or any other Error status + /// code. + /// + /// + /// 3. If the Matrix Route request was accepted successfully, the Location + /// header in the response contains the URL to download the results of the + /// request. This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step 3 to + /// download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service returns + /// 200 response code for successful request and a response array. The response + /// body will contain the data and there will be no possibility to retrieve the + /// results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is being + /// processed using our async pipeline. You will be given a URL to check the + /// progress of your async request in the location header of the response. + /// This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following responses + /// when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The response + /// body contains all of the results. + /// + /// + /// The matrix of origin and destination coordinates to compute the route + /// distance, travel time and other summary for each cell of the matrix based + /// on the input parameters. The minimum and the maximum cell count supported + /// are 1 and **700** for async and **100** for sync respectively. For example, + /// it can be 35 origins and 20 destinations or 25 origins and 25 destinations + /// for async API. + /// + /// + /// Boolean to indicate whether to execute the request synchronously. If set to + /// true, user will get a 200 response if the request is finished under 120 + /// seconds. Otherwise, user will get a 202 response right away. Please refer + /// to the API description for more details on 202 response. **Supported only + /// for async request**. + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RequestRouteMatrixWithHttpMessagesAsync(RouteMatrixQuery routeMatrixQuery, bool? waitForResults = default(bool?), string computeTravelTime = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (routeMatrixQuery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeMatrixQuery"); + } + if (routeMatrixQuery != null) + { + routeMatrixQuery.Validate(); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("waitForResults", waitForResults); + tracingParameters.Add("computeTravelTime", computeTravelTime); + tracingParameters.Add("filterSectionType", filterSectionType); + tracingParameters.Add("arriveAt", arriveAt); + tracingParameters.Add("departAt", departAt); + tracingParameters.Add("vehicleAxleWeight", vehicleAxleWeight); + tracingParameters.Add("vehicleLength", vehicleLength); + tracingParameters.Add("vehicleHeight", vehicleHeight); + tracingParameters.Add("vehicleWidth", vehicleWidth); + tracingParameters.Add("vehicleMaxSpeed", vehicleMaxSpeed); + tracingParameters.Add("vehicleWeight", vehicleWeight); + tracingParameters.Add("windingness", windingness); + tracingParameters.Add("inclineLevel", inclineLevel); + tracingParameters.Add("travelMode", travelMode); + tracingParameters.Add("avoid", avoid); + tracingParameters.Add("useTrafficData", useTrafficData); + tracingParameters.Add("routeType", routeType); + tracingParameters.Add("vehicleLoadType", vehicleLoadType); + tracingParameters.Add("routeMatrixQuery", routeMatrixQuery); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RequestRouteMatrix", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/matrix/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (waitForResults != null) + { + _queryParameters.Add(string.Format("waitForResults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(waitForResults, SerializationSettings).Trim('"')))); + } + if (computeTravelTime != null) + { + _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTime))); + } + if (filterSectionType != null) + { + _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(filterSectionType))); + } + if (arriveAt != null) + { + _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(arriveAt, SerializationSettings).Trim('"')))); + } + if (departAt != null) + { + _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(departAt, SerializationSettings).Trim('"')))); + } + if (vehicleAxleWeight != null) + { + _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleAxleWeight, SerializationSettings).Trim('"')))); + } + if (vehicleLength != null) + { + _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleLength, SerializationSettings).Trim('"')))); + } + if (vehicleHeight != null) + { + _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleHeight, SerializationSettings).Trim('"')))); + } + if (vehicleWidth != null) + { + _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWidth, SerializationSettings).Trim('"')))); + } + if (vehicleMaxSpeed != null) + { + _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleMaxSpeed, SerializationSettings).Trim('"')))); + } + if (vehicleWeight != null) + { + _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWeight, SerializationSettings).Trim('"')))); + } + if (windingness != null) + { + _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness))); + } + if (inclineLevel != null) + { + _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(inclineLevel))); + } + if (travelMode != null) + { + _queryParameters.Add(string.Format("travelMode={0}", System.Uri.EscapeDataString(travelMode))); + } + if (avoid != null) + { + if (avoid.Count == 0) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString(string.Empty))); + } + else + { + foreach (var _item in avoid) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString("" + _item))); + } + } + } + if (useTrafficData != null) + { + _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(useTrafficData, SerializationSettings).Trim('"')))); + } + if (routeType != null) + { + _queryParameters.Add(string.Format("routeType={0}", System.Uri.EscapeDataString(routeType))); + } + if (vehicleLoadType != null) + { + _queryParameters.Add(string.Format("vehicleLoadType={0}", System.Uri.EscapeDataString(vehicleLoadType))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(routeMatrixQuery != null) + { + _requestContent = SafeJsonConvert.SerializeObject(routeMatrixQuery, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// If the Matrix Route request was accepted successfully, the Location header + /// in the response contains the URL to download the results of the request. + /// This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step 3 to + /// download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service returns + /// 200 response code for successful request and a response array. The response + /// body will contain the data and there will be no possibility to retrieve the + /// results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is being + /// processed using our async pipeline. You will be given a URL to check the + /// progress of your async request in the location header of the response. + /// This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following responses + /// when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The response + /// body contains all of the results. + /// + /// + /// Matrix id received after the Matrix Route request was accepted + /// successfully. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetRouteMatrixWithHttpMessagesAsync(string matrixId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (matrixId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "matrixId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("matrixId", matrixId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetRouteMatrix", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/matrix/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(matrixId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// The Matrix Routing service allows calculation of a matrix of route + /// summaries for a set of routes defined by origin and destination locations + /// by using an asynchronous (async) or synchronous (sync) POST request. For + /// every given origin, the service calculates the cost of routing from that + /// origin to every given destination. The set of origins and the set of + /// destinations can be thought of as the column and row headers of a table and + /// each cell in the table contains the costs of routing from the origin to the + /// destination for that cell. As an example, let's say a food delivery company + /// has 20 drivers and they need to find the closest driver to pick up the + /// delivery from the restaurant. To solve this use case, they can call Matrix + /// Route API. + /// + /// + /// For each route, the travel times and distances are returned. You can use + /// the computed costs to determine which detailed routes to calculate using + /// the Route Directions API. + /// + /// + /// The maximum size of a matrix for async request is **700** and for sync + /// request it's **100** (the number of origins multiplied by the number of + /// destinations). + /// + /// + /// + /// ### Submit Synchronous Route Matrix Request + /// If your scenario requires synchronous requests and the maximum size of the + /// matrix is less than or equal to 100, you might want to make synchronous + /// request. The maximum size of a matrix for this API is **100** (the number + /// of origins multiplied by the number of destinations). With that constraint + /// in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it + /// does not need to be square). + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// ### Submit Asynchronous Route Matrix Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex routing requests. When you make a request by using async + /// request, by default the service returns a 202 response code along a + /// redirect URL in the Location field of the response header. This URL should + /// be checked periodically until the response data or error information is + /// available. If `waitForResults` parameter in the request is set to true, + /// user will get a 200 response if the request is finished under 120 seconds. + /// + /// + /// The maximum size of a matrix for this API is **700** (the number of origins + /// multiplied by the number of destinations). With that constraint in mind, + /// examples of possible matrix dimensions are: 50x10, 10x10, 28x25. 10x70 (it + /// does not need to be square). + /// + /// + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// + /// + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// Here's a typical sequence of asynchronous operations: + /// 1. Client sends a Route Matrix POST request to Azure Maps + /// + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Route Matrix request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Route Matrix + /// request. This could either be a 400 Bad Request or any other Error status + /// code. + /// + /// + /// 3. If the Matrix Route request was accepted successfully, the Location + /// header in the response contains the URL to download the results of the + /// request. This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step 3 to + /// download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service returns + /// 200 response code for successful request and a response array. The response + /// body will contain the data and there will be no possibility to retrieve the + /// results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is being + /// processed using our async pipeline. You will be given a URL to check the + /// progress of your async request in the location header of the response. + /// This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following responses + /// when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The response + /// body contains all of the results. + /// + /// + /// The matrix of origin and destination coordinates to compute the route + /// distance, travel time and other summary for each cell of the matrix based + /// on the input parameters. The minimum and the maximum cell count supported + /// are 1 and **700** for async and **100** for sync respectively. For example, + /// it can be 35 origins and 20 destinations or 25 origins and 25 destinations + /// for async API. + /// + /// + /// Boolean to indicate whether to execute the request synchronously. If set to + /// true, user will get a 200 response if the request is finished under 120 + /// seconds. Otherwise, user will get a 202 response right away. Please refer + /// to the API description for more details on 202 response. **Supported only + /// for async request**. + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RequestRouteMatrixSyncWithHttpMessagesAsync(RouteMatrixQuery routeMatrixQuery, bool? waitForResults = default(bool?), string computeTravelTime = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (routeMatrixQuery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeMatrixQuery"); + } + if (routeMatrixQuery != null) + { + routeMatrixQuery.Validate(); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("waitForResults", waitForResults); + tracingParameters.Add("computeTravelTime", computeTravelTime); + tracingParameters.Add("filterSectionType", filterSectionType); + tracingParameters.Add("arriveAt", arriveAt); + tracingParameters.Add("departAt", departAt); + tracingParameters.Add("vehicleAxleWeight", vehicleAxleWeight); + tracingParameters.Add("vehicleLength", vehicleLength); + tracingParameters.Add("vehicleHeight", vehicleHeight); + tracingParameters.Add("vehicleWidth", vehicleWidth); + tracingParameters.Add("vehicleMaxSpeed", vehicleMaxSpeed); + tracingParameters.Add("vehicleWeight", vehicleWeight); + tracingParameters.Add("windingness", windingness); + tracingParameters.Add("inclineLevel", inclineLevel); + tracingParameters.Add("travelMode", travelMode); + tracingParameters.Add("avoid", avoid); + tracingParameters.Add("useTrafficData", useTrafficData); + tracingParameters.Add("routeType", routeType); + tracingParameters.Add("vehicleLoadType", vehicleLoadType); + tracingParameters.Add("routeMatrixQuery", routeMatrixQuery); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RequestRouteMatrixSync", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/matrix/sync/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (waitForResults != null) + { + _queryParameters.Add(string.Format("waitForResults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(waitForResults, SerializationSettings).Trim('"')))); + } + if (computeTravelTime != null) + { + _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTime))); + } + if (filterSectionType != null) + { + _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(filterSectionType))); + } + if (arriveAt != null) + { + _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(arriveAt, SerializationSettings).Trim('"')))); + } + if (departAt != null) + { + _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(departAt, SerializationSettings).Trim('"')))); + } + if (vehicleAxleWeight != null) + { + _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleAxleWeight, SerializationSettings).Trim('"')))); + } + if (vehicleLength != null) + { + _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleLength, SerializationSettings).Trim('"')))); + } + if (vehicleHeight != null) + { + _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleHeight, SerializationSettings).Trim('"')))); + } + if (vehicleWidth != null) + { + _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWidth, SerializationSettings).Trim('"')))); + } + if (vehicleMaxSpeed != null) + { + _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleMaxSpeed, SerializationSettings).Trim('"')))); + } + if (vehicleWeight != null) + { + _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWeight, SerializationSettings).Trim('"')))); + } + if (windingness != null) + { + _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness))); + } + if (inclineLevel != null) + { + _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(inclineLevel))); + } + if (travelMode != null) + { + _queryParameters.Add(string.Format("travelMode={0}", System.Uri.EscapeDataString(travelMode))); + } + if (avoid != null) + { + if (avoid.Count == 0) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString(string.Empty))); + } + else + { + foreach (var _item in avoid) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString("" + _item))); + } + } + } + if (useTrafficData != null) + { + _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(useTrafficData, SerializationSettings).Trim('"')))); + } + if (routeType != null) + { + _queryParameters.Add(string.Format("routeType={0}", System.Uri.EscapeDataString(routeType))); + } + if (vehicleLoadType != null) + { + _queryParameters.Add(string.Format("vehicleLoadType={0}", System.Uri.EscapeDataString(vehicleLoadType))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(routeMatrixQuery != null) + { + _requestContent = SafeJsonConvert.SerializeObject(routeMatrixQuery, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 408) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 408) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns a route between an origin and a destination, passing through + /// waypoints if they are specified. The route will take into account factors + /// such as current traffic and the typical road speeds on the requested day of + /// the week and time of day. + /// + /// Information returned includes the distance, estimated travel time, and a + /// representation of the route geometry. Additional routing information such + /// as optimized waypoint order or turn by turn instructions is also available, + /// depending on the options selected. + /// + /// Routing service provides a set of parameters for a detailed description of + /// vehicle-specific Consumption Model. Please check [Consumption + /// Model](https://docs.microsoft.com/azure/azure-maps/consumption-model) for + /// detailed explanation of the concepts and parameters involved. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The Coordinates through which the route is calculated, delimited by a + /// colon. A minimum of two coordinates is required. The first one is the + /// origin and the last is the destination of the route. Optional coordinates + /// in-between act as WayPoints in the route. You can pass up to 150 + /// WayPoints. + /// + /// + /// Number of desired alternative routes to be calculated. Default: 0, minimum: + /// 0 and maximum: 5 + /// + /// + /// Controls the optimality, with respect to the given planning criteria, of + /// the calculated alternatives compared to the reference route. Possible + /// values include: 'anyRoute', 'betterRoute' + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of meters. Can only be used when reconstructing a + /// route. The minDeviationDistance parameter cannot be used in conjunction + /// with arriveAt + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of seconds. Can only be used when reconstructing a + /// route. The minDeviationTime parameter cannot be used in conjunction with + /// arriveAt. Default value is 0. Setting )minDeviationTime_ to a value greater + /// than zero has the following consequences: + /// - The origin point of the _calculateRoute_ Request must be on + /// (or very near) the input reference route. + /// - If this is not the case, an error is returned. + /// - However, the origin point does not need to be at the beginning + /// of the input reference route (it can be thought of as the current + /// vehicle position on the reference route). + /// - The reference route, returned as the first route in the _calculateRoute_ + /// Response, will start at the origin point specified in the _calculateRoute_ + /// Request. The initial part of the input reference route up until the origin + /// point will be excluded from the Response. + /// - The values of _minDeviationDistance_ and _minDeviationTime_ determine + /// how far alternative routes will be guaranteed to follow the reference + /// route from the origin point onwards. + /// - The route must use _departAt_. + /// - The _vehicleHeading_ is ignored. + /// + /// + /// If specified, guidance instructions will be returned. Note that the + /// instructionsType parameter cannot be used in conjunction with + /// routeRepresentation=none. Possible values include: 'coded', 'text', + /// 'tagged' + /// + /// + /// The language parameter determines the language of the guidance messages. + /// Proper nouns (the names of streets, plazas, etc.) are returned in the + /// specified language, or if that is not available, they are returned in an + /// available language that is close to it. Allowed values are (a subset of) + /// the IETF language tags. The currently supported languages are listed in + /// the [Supported languages + /// section](https://docs.microsoft.com/azure/azure-maps/supported-languages). + /// + /// Default value: en-GB + /// + /// + /// Re-order the route waypoints using a fast heuristic algorithm to reduce the + /// route length. Yields best results when used in conjunction with routeType + /// _shortest_. Notice that origin and destination are excluded from the + /// optimized waypoint indices. To include origin and destination in the + /// response, please increase all the indices by 1 to account for the origin, + /// and then add the destination as the final index. Possible values are true + /// or false. True computes a better order if possible, but is not allowed to + /// be used in conjunction with maxAlternatives value greater than 0 or in + /// conjunction with circle waypoints. False will use the locations in the + /// given order and not allowed to be used in conjunction with + /// routeRepresentation _none_. + /// + /// + /// Specifies the representation of the set of routes provided as response. + /// This parameter value can only be used in conjunction with + /// computeBestOrder=true. Possible values include: 'polyline', 'summaryOnly', + /// 'none' + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// The directional heading of the vehicle in degrees starting at true North + /// and continuing in clockwise direction. North is 0 degrees, east is 90 + /// degrees, south is 180 degrees, west is 270 degrees. Possible values 0-359 + /// + /// + /// Specifies which data should be reported for diagnosis purposes. The only + /// possible value is _effectiveSettings_. Reports the effective parameters or + /// data used when calling the API. In the case of defaulted parameters the + /// default will be reflected where the parameter was not specified by the + /// caller. Possible values include: 'effectiveSettings' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the Consumption + /// Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value of + /// **vehicleWeight** is non-zero, then weight restrictions are considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : + /// 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial vehicles + /// may not be allowed to drive on some roads. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is specified, + /// it must be consistent with the value of **vehicleEngineType**. Possible + /// values include: 'combustion', 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption curve. + /// Consumption rates for speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is between + /// 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion Consumption + /// Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary systems of + /// the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel in + /// megajoules (MJ). It is used in conjunction with the ***Efficiency** + /// parameters for conversions between saved or consumed energy and fuel. For + /// example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel + /// fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : + /// 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is obtained by + /// converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : + /// 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : + /// 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved (not + /// consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is obtained + /// by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : + /// 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The list + /// defines points on a consumption curve. Consumption rates for speeds not in + /// the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours (kWh) that + /// may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary systems, in + /// kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetRouteDirectionsWithHttpMessagesAsync(string format, string routePoints, int? maxAlternatives = default(int?), string alternativeType = default(string), int? minDeviationDistance = default(int?), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? minDeviationTime = default(int?), string instructionsType = default(string), string language = default(string), bool? computeBestWaypointOrder = default(bool?), string routeRepresentationForBestOrder = default(string), string computeTravelTime = default(string), int? vehicleHeading = default(int?), string report = default(string), string filterSectionType = default(string), int? vehicleAxleWeight = 0, double? vehicleWidth = 0, double? vehicleHeight = 0, double? vehicleLength = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (routePoints == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routePoints"); + } + if (maxAlternatives > 5) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "maxAlternatives", 5); + } + if (maxAlternatives < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "maxAlternatives", 0); + } + if (vehicleHeading > 359) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "vehicleHeading", 359); + } + if (vehicleHeading < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "vehicleHeading", 0); + } + if (accelerationEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "accelerationEfficiency", 1); + } + if (accelerationEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "accelerationEfficiency", 0); + } + if (decelerationEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "decelerationEfficiency", 1); + } + if (decelerationEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "decelerationEfficiency", 0); + } + if (uphillEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "uphillEfficiency", 1); + } + if (uphillEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "uphillEfficiency", 0); + } + if (downhillEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "downhillEfficiency", 1); + } + if (downhillEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "downhillEfficiency", 0); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("routePoints", routePoints); + tracingParameters.Add("maxAlternatives", maxAlternatives); + tracingParameters.Add("alternativeType", alternativeType); + tracingParameters.Add("minDeviationDistance", minDeviationDistance); + tracingParameters.Add("arriveAt", arriveAt); + tracingParameters.Add("departAt", departAt); + tracingParameters.Add("minDeviationTime", minDeviationTime); + tracingParameters.Add("instructionsType", instructionsType); + tracingParameters.Add("language", language); + tracingParameters.Add("computeBestWaypointOrder", computeBestWaypointOrder); + tracingParameters.Add("routeRepresentationForBestOrder", routeRepresentationForBestOrder); + tracingParameters.Add("computeTravelTime", computeTravelTime); + tracingParameters.Add("vehicleHeading", vehicleHeading); + tracingParameters.Add("report", report); + tracingParameters.Add("filterSectionType", filterSectionType); + tracingParameters.Add("vehicleAxleWeight", vehicleAxleWeight); + tracingParameters.Add("vehicleWidth", vehicleWidth); + tracingParameters.Add("vehicleHeight", vehicleHeight); + tracingParameters.Add("vehicleLength", vehicleLength); + tracingParameters.Add("vehicleMaxSpeed", vehicleMaxSpeed); + tracingParameters.Add("vehicleWeight", vehicleWeight); + tracingParameters.Add("isCommercialVehicle", isCommercialVehicle); + tracingParameters.Add("windingness", windingness); + tracingParameters.Add("inclineLevel", inclineLevel); + tracingParameters.Add("travelMode", travelMode); + tracingParameters.Add("avoid", avoid); + tracingParameters.Add("useTrafficData", useTrafficData); + tracingParameters.Add("routeType", routeType); + tracingParameters.Add("vehicleLoadType", vehicleLoadType); + tracingParameters.Add("vehicleEngineType", vehicleEngineType); + tracingParameters.Add("constantSpeedConsumptionInLitersPerHundredKm", constantSpeedConsumptionInLitersPerHundredKm); + tracingParameters.Add("currentFuelInLiters", currentFuelInLiters); + tracingParameters.Add("auxiliaryPowerInLitersPerHour", auxiliaryPowerInLitersPerHour); + tracingParameters.Add("fuelEnergyDensityInMegajoulesPerLiter", fuelEnergyDensityInMegajoulesPerLiter); + tracingParameters.Add("accelerationEfficiency", accelerationEfficiency); + tracingParameters.Add("decelerationEfficiency", decelerationEfficiency); + tracingParameters.Add("uphillEfficiency", uphillEfficiency); + tracingParameters.Add("downhillEfficiency", downhillEfficiency); + tracingParameters.Add("constantSpeedConsumptionInKwHPerHundredKm", constantSpeedConsumptionInKwHPerHundredKm); + tracingParameters.Add("currentChargeInKwH", currentChargeInKwH); + tracingParameters.Add("maxChargeInKwH", maxChargeInKwH); + tracingParameters.Add("auxiliaryPowerInKw", auxiliaryPowerInKw); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetRouteDirections", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/directions/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (routePoints != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(routePoints))); + } + if (maxAlternatives != null) + { + _queryParameters.Add(string.Format("maxAlternatives={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxAlternatives, SerializationSettings).Trim('"')))); + } + if (alternativeType != null) + { + _queryParameters.Add(string.Format("alternativeType={0}", System.Uri.EscapeDataString(alternativeType))); + } + if (minDeviationDistance != null) + { + _queryParameters.Add(string.Format("minDeviationDistance={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(minDeviationDistance, SerializationSettings).Trim('"')))); + } + if (arriveAt != null) + { + _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(arriveAt, SerializationSettings).Trim('"')))); + } + if (departAt != null) + { + _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(departAt, SerializationSettings).Trim('"')))); + } + if (minDeviationTime != null) + { + _queryParameters.Add(string.Format("minDeviationTime={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(minDeviationTime, SerializationSettings).Trim('"')))); + } + if (instructionsType != null) + { + _queryParameters.Add(string.Format("instructionsType={0}", System.Uri.EscapeDataString(instructionsType))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (computeBestWaypointOrder != null) + { + _queryParameters.Add(string.Format("computeBestOrder={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(computeBestWaypointOrder, SerializationSettings).Trim('"')))); + } + if (routeRepresentationForBestOrder != null) + { + _queryParameters.Add(string.Format("routeRepresentation={0}", System.Uri.EscapeDataString(routeRepresentationForBestOrder))); + } + if (computeTravelTime != null) + { + _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTime))); + } + if (vehicleHeading != null) + { + _queryParameters.Add(string.Format("vehicleHeading={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleHeading, SerializationSettings).Trim('"')))); + } + if (report != null) + { + _queryParameters.Add(string.Format("report={0}", System.Uri.EscapeDataString(report))); + } + if (filterSectionType != null) + { + _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(filterSectionType))); + } + if (vehicleAxleWeight != null) + { + _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleAxleWeight, SerializationSettings).Trim('"')))); + } + if (vehicleWidth != null) + { + _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWidth, SerializationSettings).Trim('"')))); + } + if (vehicleHeight != null) + { + _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleHeight, SerializationSettings).Trim('"')))); + } + if (vehicleLength != null) + { + _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleLength, SerializationSettings).Trim('"')))); + } + if (vehicleMaxSpeed != null) + { + _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleMaxSpeed, SerializationSettings).Trim('"')))); + } + if (vehicleWeight != null) + { + _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWeight, SerializationSettings).Trim('"')))); + } + if (isCommercialVehicle != null) + { + _queryParameters.Add(string.Format("vehicleCommercial={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(isCommercialVehicle, SerializationSettings).Trim('"')))); + } + if (windingness != null) + { + _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness))); + } + if (inclineLevel != null) + { + _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(inclineLevel))); + } + if (travelMode != null) + { + _queryParameters.Add(string.Format("travelMode={0}", System.Uri.EscapeDataString(travelMode))); + } + if (avoid != null) + { + if (avoid.Count == 0) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString(string.Empty))); + } + else + { + foreach (var _item in avoid) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString("" + _item))); + } + } + } + if (useTrafficData != null) + { + _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(useTrafficData, SerializationSettings).Trim('"')))); + } + if (routeType != null) + { + _queryParameters.Add(string.Format("routeType={0}", System.Uri.EscapeDataString(routeType))); + } + if (vehicleLoadType != null) + { + _queryParameters.Add(string.Format("vehicleLoadType={0}", System.Uri.EscapeDataString(vehicleLoadType))); + } + if (vehicleEngineType != null) + { + _queryParameters.Add(string.Format("vehicleEngineType={0}", System.Uri.EscapeDataString(vehicleEngineType))); + } + if (constantSpeedConsumptionInLitersPerHundredKm != null) + { + _queryParameters.Add(string.Format("constantSpeedConsumptionInLitersPerHundredkm={0}", System.Uri.EscapeDataString(constantSpeedConsumptionInLitersPerHundredKm))); + } + if (currentFuelInLiters != null) + { + _queryParameters.Add(string.Format("currentFuelInLiters={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(currentFuelInLiters, SerializationSettings).Trim('"')))); + } + if (auxiliaryPowerInLitersPerHour != null) + { + _queryParameters.Add(string.Format("auxiliaryPowerInLitersPerHour={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(auxiliaryPowerInLitersPerHour, SerializationSettings).Trim('"')))); + } + if (fuelEnergyDensityInMegajoulesPerLiter != null) + { + _queryParameters.Add(string.Format("fuelEnergyDensityInMJoulesPerLiter={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(fuelEnergyDensityInMegajoulesPerLiter, SerializationSettings).Trim('"')))); + } + if (accelerationEfficiency != null) + { + _queryParameters.Add(string.Format("accelerationEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(accelerationEfficiency, SerializationSettings).Trim('"')))); + } + if (decelerationEfficiency != null) + { + _queryParameters.Add(string.Format("decelerationEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(decelerationEfficiency, SerializationSettings).Trim('"')))); + } + if (uphillEfficiency != null) + { + _queryParameters.Add(string.Format("uphillEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(uphillEfficiency, SerializationSettings).Trim('"')))); + } + if (downhillEfficiency != null) + { + _queryParameters.Add(string.Format("downhillEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(downhillEfficiency, SerializationSettings).Trim('"')))); + } + if (constantSpeedConsumptionInKwHPerHundredKm != null) + { + _queryParameters.Add(string.Format("constantSpeedConsumptionInkWhPerHundredkm={0}", System.Uri.EscapeDataString(constantSpeedConsumptionInKwHPerHundredKm))); + } + if (currentChargeInKwH != null) + { + _queryParameters.Add(string.Format("currentChargeInkWh={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(currentChargeInKwH, SerializationSettings).Trim('"')))); + } + if (maxChargeInKwH != null) + { + _queryParameters.Add(string.Format("maxChargeInkWh={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxChargeInKwH, SerializationSettings).Trim('"')))); + } + if (auxiliaryPowerInKw != null) + { + _queryParameters.Add(string.Format("auxiliaryPowerInkW={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(auxiliaryPowerInKw, SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns a route between an origin and a destination, passing through + /// waypoints if they are specified. The route will take into account factors + /// such as current traffic and the typical road speeds on the requested day of + /// the week and time of day. + /// + /// Information returned includes the distance, estimated travel time, and a + /// representation of the route geometry. Additional routing information such + /// as optimized waypoint order or turn by turn instructions is also available, + /// depending on the options selected. + /// + /// Routing service provides a set of parameters for a detailed description of + /// a vehicle-specific Consumption Model. Please check [Consumption + /// Model](https://docs.microsoft.com/azure/azure-maps/consumption-model) for + /// detailed explanation of the concepts and parameters involved. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The Coordinates through which the route is calculated, delimited by a + /// colon. A minimum of two coordinates is required. The first one is the + /// origin and the last is the destination of the route. Optional coordinates + /// in-between act as WayPoints in the route. You can pass up to 150 + /// WayPoints. + /// + /// + /// Used for reconstructing a route and for calculating zero or more + /// alternative routes to this reference route. The provided sequence of + /// coordinates is used as input for route reconstruction. The alternative + /// routes are calculated between the origin and destination points specified + /// in the base path parameter locations. If both minDeviationDistance and + /// minDeviationTime are set to zero, then these origin and destination points + /// are expected to be at (or very near) the beginning and end of the reference + /// route, respectively. Intermediate locations (waypoints) are not supported + /// when using supportingPoints. + /// + /// Setting at least one of minDeviationDistance or minDeviationTime to a value + /// greater than zero has the following consequences: + /// + /// * The origin point of the calculateRoute request must be on (or very near) + /// the input reference route. If this is not the case, an error is returned. + /// However, the origin point does not need to be at the beginning of the + /// input reference route (it can be thought of as the current vehicle position + /// on the reference route). + /// * The reference route, returned as the first route in the calculateRoute + /// response, will start at the origin point specified in the calculateRoute + /// request. The initial part of the input reference route up until the origin + /// point will be excluded from the response. + /// * The values of minDeviationDistance and minDeviationTime determine how + /// far alternative routes will be guaranteed to follow the reference route + /// from the origin point onwards. + /// * The route must use departAt. + /// * The vehicleHeading is ignored. + /// + /// + /// Number of desired alternative routes to be calculated. Default: 0, minimum: + /// 0 and maximum: 5 + /// + /// + /// Controls the optimality, with respect to the given planning criteria, of + /// the calculated alternatives compared to the reference route. Possible + /// values include: 'anyRoute', 'betterRoute' + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of meters. Can only be used when reconstructing a + /// route. The minDeviationDistance parameter cannot be used in conjunction + /// with arriveAt + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of seconds. Can only be used when reconstructing a + /// route. The minDeviationTime parameter cannot be used in conjunction with + /// arriveAt. Default value is 0. Setting )minDeviationTime_ to a value greater + /// than zero has the following consequences: + /// - The origin point of the _calculateRoute_ Request must be on + /// (or very near) the input reference route. + /// - If this is not the case, an error is returned. + /// - However, the origin point does not need to be at the beginning + /// of the input reference route (it can be thought of as the current + /// vehicle position on the reference route). + /// - The reference route, returned as the first route in the _calculateRoute_ + /// Response, will start at the origin point specified in the _calculateRoute_ + /// Request. The initial part of the input reference route up until the origin + /// point will be excluded from the Response. + /// - The values of _minDeviationDistance_ and _minDeviationTime_ determine + /// how far alternative routes will be guaranteed to follow the reference + /// route from the origin point onwards. + /// - The route must use _departAt_. + /// - The _vehicleHeading_ is ignored. + /// + /// + /// If specified, guidance instructions will be returned. Note that the + /// instructionsType parameter cannot be used in conjunction with + /// routeRepresentation=none. Possible values include: 'coded', 'text', + /// 'tagged' + /// + /// + /// The language parameter determines the language of the guidance messages. It + /// does not affect proper nouns (the names of streets, plazas, etc.) It has no + /// effect when instructionsType=coded. Allowed values are (a subset of) the + /// IETF language tags described + /// + /// + /// Re-order the route waypoints using a fast heuristic algorithm to reduce the + /// route length. Yields best results when used in conjunction with routeType + /// _shortest_. Notice that origin and destination are excluded from the + /// optimized waypoint indices. To include origin and destination in the + /// response, please increase all the indices by 1 to account for the origin, + /// and then add the destination as the final index. Possible values are true + /// or false. True computes a better order if possible, but is not allowed to + /// be used in conjunction with maxAlternatives value greater than 0 or in + /// conjunction with circle waypoints. False will use the locations in the + /// given order and not allowed to be used in conjunction with + /// routeRepresentation _none_. + /// + /// + /// Specifies the representation of the set of routes provided as response. + /// This parameter value can only be used in conjunction with + /// computeBestOrder=true. Possible values include: 'polyline', 'summaryOnly', + /// 'none' + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// The directional heading of the vehicle in degrees starting at true North + /// and continuing in clockwise direction. North is 0 degrees, east is 90 + /// degrees, south is 180 degrees, west is 270 degrees. Possible values 0-359 + /// + /// + /// Specifies which data should be reported for diagnosis purposes. The only + /// possible value is _effectiveSettings_. Reports the effective parameters or + /// data used when calling the API. In the case of defaulted parameters the + /// default will be reflected where the parameter was not specified by the + /// caller. Possible values include: 'effectiveSettings' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the Consumption + /// Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value of + /// **vehicleWeight** is non-zero, then weight restrictions are considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : + /// 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial vehicles + /// may not be allowed to drive on some roads. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is specified, + /// it must be consistent with the value of **vehicleEngineType**. Possible + /// values include: 'combustion', 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption curve. + /// Consumption rates for speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is between + /// 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion Consumption + /// Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary systems of + /// the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel in + /// megajoules (MJ). It is used in conjunction with the ***Efficiency** + /// parameters for conversions between saved or consumed energy and fuel. For + /// example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel + /// fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : + /// 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is obtained by + /// converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : + /// 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : + /// 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved (not + /// consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is obtained + /// by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : + /// 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The list + /// defines points on a consumption curve. Consumption rates for speeds not in + /// the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours (kWh) that + /// may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary systems, in + /// kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetRouteDirectionsWithAdditionalParametersWithHttpMessagesAsync(string format, string routePoints, RouteDirectionParameters routeDirectionParameters, int? maxAlternatives = default(int?), string alternativeType = default(string), int? minDeviationDistance = default(int?), int? minDeviationTime = default(int?), string instructionsType = default(string), string language = default(string), bool? computeBestWaypointOrder = default(bool?), string routeRepresentationForBestOrder = default(string), string computeTravelTime = default(string), int? vehicleHeading = default(int?), string report = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (routePoints == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routePoints"); + } + if (maxAlternatives > 5) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "maxAlternatives", 5); + } + if (maxAlternatives < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "maxAlternatives", 0); + } + if (vehicleHeading > 359) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "vehicleHeading", 359); + } + if (vehicleHeading < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "vehicleHeading", 0); + } + if (accelerationEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "accelerationEfficiency", 1); + } + if (accelerationEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "accelerationEfficiency", 0); + } + if (decelerationEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "decelerationEfficiency", 1); + } + if (decelerationEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "decelerationEfficiency", 0); + } + if (uphillEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "uphillEfficiency", 1); + } + if (uphillEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "uphillEfficiency", 0); + } + if (downhillEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "downhillEfficiency", 1); + } + if (downhillEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "downhillEfficiency", 0); + } + if (routeDirectionParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeDirectionParameters"); + } + if (routeDirectionParameters != null) + { + routeDirectionParameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("routePoints", routePoints); + tracingParameters.Add("maxAlternatives", maxAlternatives); + tracingParameters.Add("alternativeType", alternativeType); + tracingParameters.Add("minDeviationDistance", minDeviationDistance); + tracingParameters.Add("minDeviationTime", minDeviationTime); + tracingParameters.Add("instructionsType", instructionsType); + tracingParameters.Add("language", language); + tracingParameters.Add("computeBestWaypointOrder", computeBestWaypointOrder); + tracingParameters.Add("routeRepresentationForBestOrder", routeRepresentationForBestOrder); + tracingParameters.Add("computeTravelTime", computeTravelTime); + tracingParameters.Add("vehicleHeading", vehicleHeading); + tracingParameters.Add("report", report); + tracingParameters.Add("filterSectionType", filterSectionType); + tracingParameters.Add("arriveAt", arriveAt); + tracingParameters.Add("departAt", departAt); + tracingParameters.Add("vehicleAxleWeight", vehicleAxleWeight); + tracingParameters.Add("vehicleLength", vehicleLength); + tracingParameters.Add("vehicleHeight", vehicleHeight); + tracingParameters.Add("vehicleWidth", vehicleWidth); + tracingParameters.Add("vehicleMaxSpeed", vehicleMaxSpeed); + tracingParameters.Add("vehicleWeight", vehicleWeight); + tracingParameters.Add("isCommercialVehicle", isCommercialVehicle); + tracingParameters.Add("windingness", windingness); + tracingParameters.Add("inclineLevel", inclineLevel); + tracingParameters.Add("travelMode", travelMode); + tracingParameters.Add("avoid", avoid); + tracingParameters.Add("useTrafficData", useTrafficData); + tracingParameters.Add("routeType", routeType); + tracingParameters.Add("vehicleLoadType", vehicleLoadType); + tracingParameters.Add("vehicleEngineType", vehicleEngineType); + tracingParameters.Add("constantSpeedConsumptionInLitersPerHundredKm", constantSpeedConsumptionInLitersPerHundredKm); + tracingParameters.Add("currentFuelInLiters", currentFuelInLiters); + tracingParameters.Add("auxiliaryPowerInLitersPerHour", auxiliaryPowerInLitersPerHour); + tracingParameters.Add("fuelEnergyDensityInMegajoulesPerLiter", fuelEnergyDensityInMegajoulesPerLiter); + tracingParameters.Add("accelerationEfficiency", accelerationEfficiency); + tracingParameters.Add("decelerationEfficiency", decelerationEfficiency); + tracingParameters.Add("uphillEfficiency", uphillEfficiency); + tracingParameters.Add("downhillEfficiency", downhillEfficiency); + tracingParameters.Add("constantSpeedConsumptionInKwHPerHundredKm", constantSpeedConsumptionInKwHPerHundredKm); + tracingParameters.Add("currentChargeInKwH", currentChargeInKwH); + tracingParameters.Add("maxChargeInKwH", maxChargeInKwH); + tracingParameters.Add("auxiliaryPowerInKw", auxiliaryPowerInKw); + tracingParameters.Add("routeDirectionParameters", routeDirectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetRouteDirectionsWithAdditionalParameters", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/directions/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (routePoints != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(routePoints))); + } + if (maxAlternatives != null) + { + _queryParameters.Add(string.Format("maxAlternatives={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxAlternatives, SerializationSettings).Trim('"')))); + } + if (alternativeType != null) + { + _queryParameters.Add(string.Format("alternativeType={0}", System.Uri.EscapeDataString(alternativeType))); + } + if (minDeviationDistance != null) + { + _queryParameters.Add(string.Format("minDeviationDistance={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(minDeviationDistance, SerializationSettings).Trim('"')))); + } + if (minDeviationTime != null) + { + _queryParameters.Add(string.Format("minDeviationTime={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(minDeviationTime, SerializationSettings).Trim('"')))); + } + if (instructionsType != null) + { + _queryParameters.Add(string.Format("instructionsType={0}", System.Uri.EscapeDataString(instructionsType))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (computeBestWaypointOrder != null) + { + _queryParameters.Add(string.Format("computeBestOrder={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(computeBestWaypointOrder, SerializationSettings).Trim('"')))); + } + if (routeRepresentationForBestOrder != null) + { + _queryParameters.Add(string.Format("routeRepresentation={0}", System.Uri.EscapeDataString(routeRepresentationForBestOrder))); + } + if (computeTravelTime != null) + { + _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTime))); + } + if (vehicleHeading != null) + { + _queryParameters.Add(string.Format("vehicleHeading={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleHeading, SerializationSettings).Trim('"')))); + } + if (report != null) + { + _queryParameters.Add(string.Format("report={0}", System.Uri.EscapeDataString(report))); + } + if (filterSectionType != null) + { + _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(filterSectionType))); + } + if (arriveAt != null) + { + _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(arriveAt, SerializationSettings).Trim('"')))); + } + if (departAt != null) + { + _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(departAt, SerializationSettings).Trim('"')))); + } + if (vehicleAxleWeight != null) + { + _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleAxleWeight, SerializationSettings).Trim('"')))); + } + if (vehicleLength != null) + { + _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleLength, SerializationSettings).Trim('"')))); + } + if (vehicleHeight != null) + { + _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleHeight, SerializationSettings).Trim('"')))); + } + if (vehicleWidth != null) + { + _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWidth, SerializationSettings).Trim('"')))); + } + if (vehicleMaxSpeed != null) + { + _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleMaxSpeed, SerializationSettings).Trim('"')))); + } + if (vehicleWeight != null) + { + _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWeight, SerializationSettings).Trim('"')))); + } + if (isCommercialVehicle != null) + { + _queryParameters.Add(string.Format("vehicleCommercial={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(isCommercialVehicle, SerializationSettings).Trim('"')))); + } + if (windingness != null) + { + _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness))); + } + if (inclineLevel != null) + { + _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(inclineLevel))); + } + if (travelMode != null) + { + _queryParameters.Add(string.Format("travelMode={0}", System.Uri.EscapeDataString(travelMode))); + } + if (avoid != null) + { + if (avoid.Count == 0) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString(string.Empty))); + } + else + { + foreach (var _item in avoid) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString("" + _item))); + } + } + } + if (useTrafficData != null) + { + _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(useTrafficData, SerializationSettings).Trim('"')))); + } + if (routeType != null) + { + _queryParameters.Add(string.Format("routeType={0}", System.Uri.EscapeDataString(routeType))); + } + if (vehicleLoadType != null) + { + _queryParameters.Add(string.Format("vehicleLoadType={0}", System.Uri.EscapeDataString(vehicleLoadType))); + } + if (vehicleEngineType != null) + { + _queryParameters.Add(string.Format("vehicleEngineType={0}", System.Uri.EscapeDataString(vehicleEngineType))); + } + if (constantSpeedConsumptionInLitersPerHundredKm != null) + { + _queryParameters.Add(string.Format("constantSpeedConsumptionInLitersPerHundredkm={0}", System.Uri.EscapeDataString(constantSpeedConsumptionInLitersPerHundredKm))); + } + if (currentFuelInLiters != null) + { + _queryParameters.Add(string.Format("currentFuelInLiters={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(currentFuelInLiters, SerializationSettings).Trim('"')))); + } + if (auxiliaryPowerInLitersPerHour != null) + { + _queryParameters.Add(string.Format("auxiliaryPowerInLitersPerHour={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(auxiliaryPowerInLitersPerHour, SerializationSettings).Trim('"')))); + } + if (fuelEnergyDensityInMegajoulesPerLiter != null) + { + _queryParameters.Add(string.Format("fuelEnergyDensityInMJoulesPerLiter={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(fuelEnergyDensityInMegajoulesPerLiter, SerializationSettings).Trim('"')))); + } + if (accelerationEfficiency != null) + { + _queryParameters.Add(string.Format("accelerationEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(accelerationEfficiency, SerializationSettings).Trim('"')))); + } + if (decelerationEfficiency != null) + { + _queryParameters.Add(string.Format("decelerationEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(decelerationEfficiency, SerializationSettings).Trim('"')))); + } + if (uphillEfficiency != null) + { + _queryParameters.Add(string.Format("uphillEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(uphillEfficiency, SerializationSettings).Trim('"')))); + } + if (downhillEfficiency != null) + { + _queryParameters.Add(string.Format("downhillEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(downhillEfficiency, SerializationSettings).Trim('"')))); + } + if (constantSpeedConsumptionInKwHPerHundredKm != null) + { + _queryParameters.Add(string.Format("constantSpeedConsumptionInkWhPerHundredkm={0}", System.Uri.EscapeDataString(constantSpeedConsumptionInKwHPerHundredKm))); + } + if (currentChargeInKwH != null) + { + _queryParameters.Add(string.Format("currentChargeInkWh={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(currentChargeInKwH, SerializationSettings).Trim('"')))); + } + if (maxChargeInKwH != null) + { + _queryParameters.Add(string.Format("maxChargeInkWh={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxChargeInKwH, SerializationSettings).Trim('"')))); + } + if (auxiliaryPowerInKw != null) + { + _queryParameters.Add(string.Format("auxiliaryPowerInkW={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(auxiliaryPowerInKw, SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(routeDirectionParameters != null) + { + _requestContent = SafeJsonConvert.SerializeObject(routeDirectionParameters, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// __Route Range (Isochrone) API__ + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// This service will calculate a set of locations that can be reached from the + /// origin point based on fuel, energy, time or distance budget that is + /// specified. A polygon boundary (or Isochrone) is returned in a + /// counterclockwise orientation as well as the precise polygon center which + /// was the result of the origin point. + /// + /// The returned polygon can be used for further processing such as [Search + /// Inside + /// Geometry](https://docs.microsoft.com/rest/api/maps/search/postsearchinsidegeometry) + /// to search for POIs within the provided Isochrone. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The Coordinate from which the range calculation should start. + /// + /// + /// Fuel budget in liters that determines maximal range which can be travelled + /// using the specified Combustion Consumption Model.<br> When + /// fuelBudgetInLiters is used, it is mandatory to specify a detailed + /// Combustion Consumption Model.<br> Exactly one budget + /// (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// Electric energy budget in kilowatt hours (kWh) that determines maximal + /// range which can be travelled using the specified Electric Consumption + /// Model.<br> When energyBudgetInkWh is used, it is mandatory to specify + /// a detailed Electric Consumption Model.<br> Exactly one budget + /// (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// Time budget in seconds that determines maximal range which can be travelled + /// using driving time. The Consumption Model will only affect the range when + /// routeType is eco.<br> Exactly one budget (fuelBudgetInLiters, + /// energyBudgetInkWh, timeBudgetInSec, or distanceBudgetInMeters) must be + /// used. + /// + /// + /// Distance budget in meters that determines maximal range which can be + /// travelled using driving distance. The Consumption Model will only affect + /// the range when routeType is eco.<br> Exactly one budget + /// (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the Consumption + /// Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value of + /// **vehicleWeight** is non-zero, then weight restrictions are considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : + /// 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial vehicles + /// may not be allowed to drive on some roads. + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is specified, + /// it must be consistent with the value of **vehicleEngineType**. Possible + /// values include: 'combustion', 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption curve. + /// Consumption rates for speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is between + /// 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion Consumption + /// Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary systems of + /// the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel in + /// megajoules (MJ). It is used in conjunction with the ***Efficiency** + /// parameters for conversions between saved or consumed energy and fuel. For + /// example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel + /// fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : + /// 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is obtained by + /// converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : + /// 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : + /// 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved (not + /// consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is obtained + /// by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : + /// 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The list + /// defines points on a consumption curve. Consumption rates for speeds not in + /// the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours (kWh) that + /// may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary systems, in + /// kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetRouteRangeWithHttpMessagesAsync(string format, IList query, double? fuelBudgetInLiters = default(double?), double? energyBudgetInKwH = default(double?), double? timeBudgetInSec = default(double?), double? distanceBudgetInMeters = default(double?), System.DateTime? departAt = default(System.DateTime?), string routeType = default(string), bool? useTrafficData = default(bool?), IList avoid = default(IList), string travelMode = default(string), string inclineLevel = default(string), string windingness = default(string), int? vehicleAxleWeight = 0, double? vehicleWidth = 0, double? vehicleHeight = 0, double? vehicleLength = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (query != null) + { + if (query.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "query", 2); + } + if (query.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "query", 2); + } + } + if (accelerationEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "accelerationEfficiency", 1); + } + if (accelerationEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "accelerationEfficiency", 0); + } + if (decelerationEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "decelerationEfficiency", 1); + } + if (decelerationEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "decelerationEfficiency", 0); + } + if (uphillEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "uphillEfficiency", 1); + } + if (uphillEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "uphillEfficiency", 0); + } + if (downhillEfficiency > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "downhillEfficiency", 1); + } + if (downhillEfficiency < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "downhillEfficiency", 0); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("fuelBudgetInLiters", fuelBudgetInLiters); + tracingParameters.Add("energyBudgetInKwH", energyBudgetInKwH); + tracingParameters.Add("timeBudgetInSec", timeBudgetInSec); + tracingParameters.Add("distanceBudgetInMeters", distanceBudgetInMeters); + tracingParameters.Add("departAt", departAt); + tracingParameters.Add("routeType", routeType); + tracingParameters.Add("useTrafficData", useTrafficData); + tracingParameters.Add("avoid", avoid); + tracingParameters.Add("travelMode", travelMode); + tracingParameters.Add("inclineLevel", inclineLevel); + tracingParameters.Add("windingness", windingness); + tracingParameters.Add("vehicleAxleWeight", vehicleAxleWeight); + tracingParameters.Add("vehicleWidth", vehicleWidth); + tracingParameters.Add("vehicleHeight", vehicleHeight); + tracingParameters.Add("vehicleLength", vehicleLength); + tracingParameters.Add("vehicleMaxSpeed", vehicleMaxSpeed); + tracingParameters.Add("vehicleWeight", vehicleWeight); + tracingParameters.Add("isCommercialVehicle", isCommercialVehicle); + tracingParameters.Add("vehicleLoadType", vehicleLoadType); + tracingParameters.Add("vehicleEngineType", vehicleEngineType); + tracingParameters.Add("constantSpeedConsumptionInLitersPerHundredKm", constantSpeedConsumptionInLitersPerHundredKm); + tracingParameters.Add("currentFuelInLiters", currentFuelInLiters); + tracingParameters.Add("auxiliaryPowerInLitersPerHour", auxiliaryPowerInLitersPerHour); + tracingParameters.Add("fuelEnergyDensityInMegajoulesPerLiter", fuelEnergyDensityInMegajoulesPerLiter); + tracingParameters.Add("accelerationEfficiency", accelerationEfficiency); + tracingParameters.Add("decelerationEfficiency", decelerationEfficiency); + tracingParameters.Add("uphillEfficiency", uphillEfficiency); + tracingParameters.Add("downhillEfficiency", downhillEfficiency); + tracingParameters.Add("constantSpeedConsumptionInKwHPerHundredKm", constantSpeedConsumptionInKwHPerHundredKm); + tracingParameters.Add("currentChargeInKwH", currentChargeInKwH); + tracingParameters.Add("maxChargeInKwH", maxChargeInKwH); + tracingParameters.Add("auxiliaryPowerInKw", auxiliaryPowerInKw); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetRouteRange", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/range/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", query)))); + } + if (fuelBudgetInLiters != null) + { + _queryParameters.Add(string.Format("fuelBudgetInLiters={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(fuelBudgetInLiters, SerializationSettings).Trim('"')))); + } + if (energyBudgetInKwH != null) + { + _queryParameters.Add(string.Format("energyBudgetInkWh={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(energyBudgetInKwH, SerializationSettings).Trim('"')))); + } + if (timeBudgetInSec != null) + { + _queryParameters.Add(string.Format("timeBudgetInSec={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeBudgetInSec, SerializationSettings).Trim('"')))); + } + if (distanceBudgetInMeters != null) + { + _queryParameters.Add(string.Format("distanceBudgetInMeters={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(distanceBudgetInMeters, SerializationSettings).Trim('"')))); + } + if (departAt != null) + { + _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(departAt, SerializationSettings).Trim('"')))); + } + if (routeType != null) + { + _queryParameters.Add(string.Format("routeType={0}", System.Uri.EscapeDataString(routeType))); + } + if (useTrafficData != null) + { + _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(useTrafficData, SerializationSettings).Trim('"')))); + } + if (avoid != null) + { + if (avoid.Count == 0) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString(string.Empty))); + } + else + { + foreach (var _item in avoid) + { + _queryParameters.Add(string.Format("avoid={0}", System.Uri.EscapeDataString("" + _item))); + } + } + } + if (travelMode != null) + { + _queryParameters.Add(string.Format("travelMode={0}", System.Uri.EscapeDataString(travelMode))); + } + if (inclineLevel != null) + { + _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(inclineLevel))); + } + if (windingness != null) + { + _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness))); + } + if (vehicleAxleWeight != null) + { + _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleAxleWeight, SerializationSettings).Trim('"')))); + } + if (vehicleWidth != null) + { + _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWidth, SerializationSettings).Trim('"')))); + } + if (vehicleHeight != null) + { + _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleHeight, SerializationSettings).Trim('"')))); + } + if (vehicleLength != null) + { + _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleLength, SerializationSettings).Trim('"')))); + } + if (vehicleMaxSpeed != null) + { + _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleMaxSpeed, SerializationSettings).Trim('"')))); + } + if (vehicleWeight != null) + { + _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(vehicleWeight, SerializationSettings).Trim('"')))); + } + if (isCommercialVehicle != null) + { + _queryParameters.Add(string.Format("vehicleCommercial={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(isCommercialVehicle, SerializationSettings).Trim('"')))); + } + if (vehicleLoadType != null) + { + _queryParameters.Add(string.Format("vehicleLoadType={0}", System.Uri.EscapeDataString(vehicleLoadType))); + } + if (vehicleEngineType != null) + { + _queryParameters.Add(string.Format("vehicleEngineType={0}", System.Uri.EscapeDataString(vehicleEngineType))); + } + if (constantSpeedConsumptionInLitersPerHundredKm != null) + { + _queryParameters.Add(string.Format("constantSpeedConsumptionInLitersPerHundredkm={0}", System.Uri.EscapeDataString(constantSpeedConsumptionInLitersPerHundredKm))); + } + if (currentFuelInLiters != null) + { + _queryParameters.Add(string.Format("currentFuelInLiters={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(currentFuelInLiters, SerializationSettings).Trim('"')))); + } + if (auxiliaryPowerInLitersPerHour != null) + { + _queryParameters.Add(string.Format("auxiliaryPowerInLitersPerHour={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(auxiliaryPowerInLitersPerHour, SerializationSettings).Trim('"')))); + } + if (fuelEnergyDensityInMegajoulesPerLiter != null) + { + _queryParameters.Add(string.Format("fuelEnergyDensityInMJoulesPerLiter={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(fuelEnergyDensityInMegajoulesPerLiter, SerializationSettings).Trim('"')))); + } + if (accelerationEfficiency != null) + { + _queryParameters.Add(string.Format("accelerationEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(accelerationEfficiency, SerializationSettings).Trim('"')))); + } + if (decelerationEfficiency != null) + { + _queryParameters.Add(string.Format("decelerationEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(decelerationEfficiency, SerializationSettings).Trim('"')))); + } + if (uphillEfficiency != null) + { + _queryParameters.Add(string.Format("uphillEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(uphillEfficiency, SerializationSettings).Trim('"')))); + } + if (downhillEfficiency != null) + { + _queryParameters.Add(string.Format("downhillEfficiency={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(downhillEfficiency, SerializationSettings).Trim('"')))); + } + if (constantSpeedConsumptionInKwHPerHundredKm != null) + { + _queryParameters.Add(string.Format("constantSpeedConsumptionInkWhPerHundredkm={0}", System.Uri.EscapeDataString(constantSpeedConsumptionInKwHPerHundredKm))); + } + if (currentChargeInKwH != null) + { + _queryParameters.Add(string.Format("currentChargeInkWh={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(currentChargeInKwH, SerializationSettings).Trim('"')))); + } + if (maxChargeInKwH != null) + { + _queryParameters.Add(string.Format("maxChargeInkWh={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxChargeInKwH, SerializationSettings).Trim('"')))); + } + if (auxiliaryPowerInKw != null) + { + _queryParameters.Add(string.Format("auxiliaryPowerInkW={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(auxiliaryPowerInKw, SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Route Directions Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Route Directions Batch API sends batches of queries to [Route + /// Directions + /// API](https://docs.microsoft.com/rest/api/maps/route/getroutedirections) + /// using just a single API call. You can call Route Directions Batch API to + /// run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **700** queries and sync API up to **100** + /// queries. + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex route requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **700** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Route Directions Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` GET + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0 + /// ``` + /// Note:- Please remember to add AUTH information (subscription-key/azure_auth + /// - See [Security](#security)) to the _status URI_ before running it. + /// <br> + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _route directions_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 3 _route directions_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// { "query": + /// "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" + /// }, + /// { "query": + /// "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" + /// }, + /// { "query": "?query=48.923159,-122.557362:32.621279,-116.840362" } + /// ] + /// } + /// ``` + /// + /// A _route directions_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _route directions_ [URI + /// parameters](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#uri-parameters). + /// The string values in the _route directions_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **700** queries and sync API up + /// to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of route directions queries/requests to process. The list can + /// contain a max of 700 queries for async and 100 queries for sync version and + /// must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RequestRouteDirectionsBatchWithHttpMessagesAsync(BatchRequestBody routeDirectionsBatchQueries, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (routeDirectionsBatchQueries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeDirectionsBatchQueries"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("routeDirectionsBatchQueries", routeDirectionsBatchQueries); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RequestRouteDirectionsBatch", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/directions/batch/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(routeDirectionsBatchQueries != null) + { + _requestContent = SafeJsonConvert.SerializeObject(routeDirectionsBatchQueries, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetRouteDirectionsBatchWithHttpMessagesAsync(string batchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (batchId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "batchId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("batchId", batchId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetRouteDirectionsBatch", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/directions/batch/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(batchId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Route Directions Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Route Directions Batch API sends batches of queries to [Route + /// Directions + /// API](https://docs.microsoft.com/rest/api/maps/route/getroutedirections) + /// using just a single API call. You can call Route Directions Batch API to + /// run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **700** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of route directions queries/requests to process. The list can + /// contain a max of 700 queries for async and 100 queries for sync version + /// and must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RequestRouteDirectionsBatchSyncWithHttpMessagesAsync(BatchRequestBody routeDirectionsBatchQueries, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (routeDirectionsBatchQueries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeDirectionsBatchQueries"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("routeDirectionsBatchQueries", routeDirectionsBatchQueries); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RequestRouteDirectionsBatchSync", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "route/directions/batch/sync/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(routeDirectionsBatchQueries != null) + { + _requestContent = SafeJsonConvert.SerializeObject(routeDirectionsBatchQueries, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 408) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 408) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/RouteClientExtensions.cs b/sdk/maps/Azure.Maps.Route/src/Generated/RouteClientExtensions.cs new file mode 100644 index 000000000000..217c4c987cd8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/RouteClientExtensions.cs @@ -0,0 +1,2369 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route +{ + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RouteClient. + /// + public static partial class RouteClientExtensions + { + /// + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// The Matrix Routing service allows calculation of a matrix of route + /// summaries for a set of routes defined by origin and destination locations + /// by using an asynchronous (async) or synchronous (sync) POST request. For + /// every given origin, the service calculates the cost of routing from that + /// origin to every given destination. The set of origins and the set of + /// destinations can be thought of as the column and row headers of a table and + /// each cell in the table contains the costs of routing from the origin to the + /// destination for that cell. As an example, let's say a food delivery company + /// has 20 drivers and they need to find the closest driver to pick up the + /// delivery from the restaurant. To solve this use case, they can call Matrix + /// Route API. + /// + /// + /// For each route, the travel times and distances are returned. You can use + /// the computed costs to determine which detailed routes to calculate using + /// the Route Directions API. + /// + /// + /// The maximum size of a matrix for async request is **700** and for sync + /// request it's **100** (the number of origins multiplied by the number of + /// destinations). + /// + /// + /// + /// ### Submit Synchronous Route Matrix Request + /// If your scenario requires synchronous requests and the maximum size of the + /// matrix is less than or equal to 100, you might want to make synchronous + /// request. The maximum size of a matrix for this API is **100** (the number + /// of origins multiplied by the number of destinations). With that constraint + /// in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it + /// does not need to be square). + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// ### Submit Asynchronous Route Matrix Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex routing requests. When you make a request by using async + /// request, by default the service returns a 202 response code along a + /// redirect URL in the Location field of the response header. This URL should + /// be checked periodically until the response data or error information is + /// available. If `waitForResults` parameter in the request is set to true, + /// user will get a 200 response if the request is finished under 120 seconds. + /// + /// + /// The maximum size of a matrix for this API is **700** (the number of origins + /// multiplied by the number of destinations). With that constraint in mind, + /// examples of possible matrix dimensions are: 50x10, 10x10, 28x25. 10x70 (it + /// does not need to be square). + /// + /// + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// + /// + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// Here's a typical sequence of asynchronous operations: + /// 1. Client sends a Route Matrix POST request to Azure Maps + /// + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Route Matrix request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Route Matrix + /// request. This could either be a 400 Bad Request or any other Error status + /// code. + /// + /// + /// 3. If the Matrix Route request was accepted successfully, the Location + /// header in the response contains the URL to download the results of the + /// request. This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step 3 to + /// download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service returns + /// 200 response code for successful request and a response array. The response + /// body will contain the data and there will be no possibility to retrieve the + /// results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is being + /// processed using our async pipeline. You will be given a URL to check the + /// progress of your async request in the location header of the response. + /// This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following responses + /// when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The response + /// body contains all of the results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The matrix of origin and destination coordinates to compute the route + /// distance, travel time and other summary for each cell of the matrix based + /// on the input parameters. The minimum and the maximum cell count supported + /// are 1 and **700** for async and **100** for sync respectively. For example, + /// it can be 35 origins and 20 destinations or 25 origins and 25 destinations + /// for async API. + /// + /// + /// Boolean to indicate whether to execute the request synchronously. If set to + /// true, user will get a 200 response if the request is finished under 120 + /// seconds. Otherwise, user will get a 202 response right away. Please refer + /// to the API description for more details on 202 response. **Supported only + /// for async request**. + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// The cancellation token. + /// + public static async Task RequestRouteMatrixAsync(this IRouteClient operations, RouteMatrixQuery routeMatrixQuery, bool? waitForResults = default(bool?), string computeTravelTime = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RequestRouteMatrixWithHttpMessagesAsync(routeMatrixQuery, waitForResults, computeTravelTime, filterSectionType, arriveAt, departAt, vehicleAxleWeight, vehicleLength, vehicleHeight, vehicleWidth, vehicleMaxSpeed, vehicleWeight, windingness, inclineLevel, travelMode, avoid, useTrafficData, routeType, vehicleLoadType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// If the Matrix Route request was accepted successfully, the Location header + /// in the response contains the URL to download the results of the request. + /// This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step 3 to + /// download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service returns + /// 200 response code for successful request and a response array. The response + /// body will contain the data and there will be no possibility to retrieve the + /// results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is being + /// processed using our async pipeline. You will be given a URL to check the + /// progress of your async request in the location header of the response. + /// This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following responses + /// when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The response + /// body contains all of the results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Matrix id received after the Matrix Route request was accepted + /// successfully. + /// + /// + /// The cancellation token. + /// + public static async Task GetRouteMatrixAsync(this IRouteClient operations, string matrixId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetRouteMatrixWithHttpMessagesAsync(matrixId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// The Matrix Routing service allows calculation of a matrix of route + /// summaries for a set of routes defined by origin and destination locations + /// by using an asynchronous (async) or synchronous (sync) POST request. For + /// every given origin, the service calculates the cost of routing from that + /// origin to every given destination. The set of origins and the set of + /// destinations can be thought of as the column and row headers of a table and + /// each cell in the table contains the costs of routing from the origin to the + /// destination for that cell. As an example, let's say a food delivery company + /// has 20 drivers and they need to find the closest driver to pick up the + /// delivery from the restaurant. To solve this use case, they can call Matrix + /// Route API. + /// + /// + /// For each route, the travel times and distances are returned. You can use + /// the computed costs to determine which detailed routes to calculate using + /// the Route Directions API. + /// + /// + /// The maximum size of a matrix for async request is **700** and for sync + /// request it's **100** (the number of origins multiplied by the number of + /// destinations). + /// + /// + /// + /// ### Submit Synchronous Route Matrix Request + /// If your scenario requires synchronous requests and the maximum size of the + /// matrix is less than or equal to 100, you might want to make synchronous + /// request. The maximum size of a matrix for this API is **100** (the number + /// of origins multiplied by the number of destinations). With that constraint + /// in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it + /// does not need to be square). + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// ### Submit Asynchronous Route Matrix Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex routing requests. When you make a request by using async + /// request, by default the service returns a 202 response code along a + /// redirect URL in the Location field of the response header. This URL should + /// be checked periodically until the response data or error information is + /// available. If `waitForResults` parameter in the request is set to true, + /// user will get a 200 response if the request is finished under 120 seconds. + /// + /// + /// The maximum size of a matrix for this API is **700** (the number of origins + /// multiplied by the number of destinations). With that constraint in mind, + /// examples of possible matrix dimensions are: 50x10, 10x10, 28x25. 10x70 (it + /// does not need to be square). + /// + /// + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// + /// + /// + /// ``` + /// POST + /// https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// + /// Here's a typical sequence of asynchronous operations: + /// 1. Client sends a Route Matrix POST request to Azure Maps + /// + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Route Matrix request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Route Matrix + /// request. This could either be a 400 Bad Request or any other Error status + /// code. + /// + /// + /// 3. If the Matrix Route request was accepted successfully, the Location + /// header in the response contains the URL to download the results of the + /// request. This status URI looks like the following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// + /// 4. Client issues a GET request on the download URL obtained in Step 3 to + /// download the results + /// + /// ### Download Sync Results + /// When you make a POST request for Route Matrix Sync API, the service returns + /// 200 response code for successful request and a response array. The response + /// body will contain the data and there will be no possibility to retrieve the + /// results later. + /// + /// ### Download Async Results + /// When a request issues a `202 Accepted` response, the request is being + /// processed using our async pipeline. You will be given a URL to check the + /// progress of your async request in the location header of the response. + /// This status URI looks like the following: + /// ``` + /// GET + /// https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + /// ``` + /// + /// The URL provided by the location header will return the following responses + /// when a `GET` request is issued. + /// + /// > HTTP `202 Accepted` - Matrix request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Matrix request successfully processed. The response + /// body contains all of the results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The matrix of origin and destination coordinates to compute the route + /// distance, travel time and other summary for each cell of the matrix based + /// on the input parameters. The minimum and the maximum cell count supported + /// are 1 and **700** for async and **100** for sync respectively. For example, + /// it can be 35 origins and 20 destinations or 25 origins and 25 destinations + /// for async API. + /// + /// + /// Boolean to indicate whether to execute the request synchronously. If set to + /// true, user will get a 200 response if the request is finished under 120 + /// seconds. Otherwise, user will get a 202 response right away. Please refer + /// to the API description for more details on 202 response. **Supported only + /// for async request**. + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// The cancellation token. + /// + public static async Task RequestRouteMatrixSyncAsync(this IRouteClient operations, RouteMatrixQuery routeMatrixQuery, bool? waitForResults = default(bool?), string computeTravelTime = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RequestRouteMatrixSyncWithHttpMessagesAsync(routeMatrixQuery, waitForResults, computeTravelTime, filterSectionType, arriveAt, departAt, vehicleAxleWeight, vehicleLength, vehicleHeight, vehicleWidth, vehicleMaxSpeed, vehicleWeight, windingness, inclineLevel, travelMode, avoid, useTrafficData, routeType, vehicleLoadType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns a route between an origin and a destination, passing through + /// waypoints if they are specified. The route will take into account factors + /// such as current traffic and the typical road speeds on the requested day of + /// the week and time of day. + /// + /// Information returned includes the distance, estimated travel time, and a + /// representation of the route geometry. Additional routing information such + /// as optimized waypoint order or turn by turn instructions is also available, + /// depending on the options selected. + /// + /// Routing service provides a set of parameters for a detailed description of + /// vehicle-specific Consumption Model. Please check [Consumption + /// Model](https://docs.microsoft.com/azure/azure-maps/consumption-model) for + /// detailed explanation of the concepts and parameters involved. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The Coordinates through which the route is calculated, delimited by a + /// colon. A minimum of two coordinates is required. The first one is the + /// origin and the last is the destination of the route. Optional coordinates + /// in-between act as WayPoints in the route. You can pass up to 150 + /// WayPoints. + /// + /// + /// Number of desired alternative routes to be calculated. Default: 0, minimum: + /// 0 and maximum: 5 + /// + /// + /// Controls the optimality, with respect to the given planning criteria, of + /// the calculated alternatives compared to the reference route. Possible + /// values include: 'anyRoute', 'betterRoute' + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of meters. Can only be used when reconstructing a + /// route. The minDeviationDistance parameter cannot be used in conjunction + /// with arriveAt + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of seconds. Can only be used when reconstructing a + /// route. The minDeviationTime parameter cannot be used in conjunction with + /// arriveAt. Default value is 0. Setting )minDeviationTime_ to a value greater + /// than zero has the following consequences: + /// - The origin point of the _calculateRoute_ Request must be on + /// (or very near) the input reference route. + /// - If this is not the case, an error is returned. + /// - However, the origin point does not need to be at the beginning + /// of the input reference route (it can be thought of as the current + /// vehicle position on the reference route). + /// - The reference route, returned as the first route in the _calculateRoute_ + /// Response, will start at the origin point specified in the _calculateRoute_ + /// Request. The initial part of the input reference route up until the origin + /// point will be excluded from the Response. + /// - The values of _minDeviationDistance_ and _minDeviationTime_ determine + /// how far alternative routes will be guaranteed to follow the reference + /// route from the origin point onwards. + /// - The route must use _departAt_. + /// - The _vehicleHeading_ is ignored. + /// + /// + /// If specified, guidance instructions will be returned. Note that the + /// instructionsType parameter cannot be used in conjunction with + /// routeRepresentation=none. Possible values include: 'coded', 'text', + /// 'tagged' + /// + /// + /// The language parameter determines the language of the guidance messages. + /// Proper nouns (the names of streets, plazas, etc.) are returned in the + /// specified language, or if that is not available, they are returned in an + /// available language that is close to it. Allowed values are (a subset of) + /// the IETF language tags. The currently supported languages are listed in + /// the [Supported languages + /// section](https://docs.microsoft.com/azure/azure-maps/supported-languages). + /// + /// Default value: en-GB + /// + /// + /// Re-order the route waypoints using a fast heuristic algorithm to reduce the + /// route length. Yields best results when used in conjunction with routeType + /// _shortest_. Notice that origin and destination are excluded from the + /// optimized waypoint indices. To include origin and destination in the + /// response, please increase all the indices by 1 to account for the origin, + /// and then add the destination as the final index. Possible values are true + /// or false. True computes a better order if possible, but is not allowed to + /// be used in conjunction with maxAlternatives value greater than 0 or in + /// conjunction with circle waypoints. False will use the locations in the + /// given order and not allowed to be used in conjunction with + /// routeRepresentation _none_. + /// + /// + /// Specifies the representation of the set of routes provided as response. + /// This parameter value can only be used in conjunction with + /// computeBestOrder=true. Possible values include: 'polyline', 'summaryOnly', + /// 'none' + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// The directional heading of the vehicle in degrees starting at true North + /// and continuing in clockwise direction. North is 0 degrees, east is 90 + /// degrees, south is 180 degrees, west is 270 degrees. Possible values 0-359 + /// + /// + /// Specifies which data should be reported for diagnosis purposes. The only + /// possible value is _effectiveSettings_. Reports the effective parameters or + /// data used when calling the API. In the case of defaulted parameters the + /// default will be reflected where the parameter was not specified by the + /// caller. Possible values include: 'effectiveSettings' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the Consumption + /// Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value of + /// **vehicleWeight** is non-zero, then weight restrictions are considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : + /// 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial vehicles + /// may not be allowed to drive on some roads. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is specified, + /// it must be consistent with the value of **vehicleEngineType**. Possible + /// values include: 'combustion', 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption curve. + /// Consumption rates for speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is between + /// 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion Consumption + /// Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary systems of + /// the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel in + /// megajoules (MJ). It is used in conjunction with the ***Efficiency** + /// parameters for conversions between saved or consumed energy and fuel. For + /// example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel + /// fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : + /// 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is obtained by + /// converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : + /// 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : + /// 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved (not + /// consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is obtained + /// by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : + /// 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The list + /// defines points on a consumption curve. Consumption rates for speeds not in + /// the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours (kWh) that + /// may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary systems, in + /// kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// The cancellation token. + /// + public static async Task GetRouteDirectionsAsync(this IRouteClient operations, string format, string routePoints, int? maxAlternatives = default(int?), string alternativeType = default(string), int? minDeviationDistance = default(int?), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? minDeviationTime = default(int?), string instructionsType = default(string), string language = default(string), bool? computeBestWaypointOrder = default(bool?), string routeRepresentationForBestOrder = default(string), string computeTravelTime = default(string), int? vehicleHeading = default(int?), string report = default(string), string filterSectionType = default(string), int? vehicleAxleWeight = 0, double? vehicleWidth = 0, double? vehicleHeight = 0, double? vehicleLength = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetRouteDirectionsWithHttpMessagesAsync(format, routePoints, maxAlternatives, alternativeType, minDeviationDistance, arriveAt, departAt, minDeviationTime, instructionsType, language, computeBestWaypointOrder, routeRepresentationForBestOrder, computeTravelTime, vehicleHeading, report, filterSectionType, vehicleAxleWeight, vehicleWidth, vehicleHeight, vehicleLength, vehicleMaxSpeed, vehicleWeight, isCommercialVehicle, windingness, inclineLevel, travelMode, avoid, useTrafficData, routeType, vehicleLoadType, vehicleEngineType, constantSpeedConsumptionInLitersPerHundredKm, currentFuelInLiters, auxiliaryPowerInLitersPerHour, fuelEnergyDensityInMegajoulesPerLiter, accelerationEfficiency, decelerationEfficiency, uphillEfficiency, downhillEfficiency, constantSpeedConsumptionInKwHPerHundredKm, currentChargeInKwH, maxChargeInKwH, auxiliaryPowerInKw, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns a route between an origin and a destination, passing through + /// waypoints if they are specified. The route will take into account factors + /// such as current traffic and the typical road speeds on the requested day of + /// the week and time of day. + /// + /// Information returned includes the distance, estimated travel time, and a + /// representation of the route geometry. Additional routing information such + /// as optimized waypoint order or turn by turn instructions is also available, + /// depending on the options selected. + /// + /// Routing service provides a set of parameters for a detailed description of + /// a vehicle-specific Consumption Model. Please check [Consumption + /// Model](https://docs.microsoft.com/azure/azure-maps/consumption-model) for + /// detailed explanation of the concepts and parameters involved. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The Coordinates through which the route is calculated, delimited by a + /// colon. A minimum of two coordinates is required. The first one is the + /// origin and the last is the destination of the route. Optional coordinates + /// in-between act as WayPoints in the route. You can pass up to 150 + /// WayPoints. + /// + /// + /// Used for reconstructing a route and for calculating zero or more + /// alternative routes to this reference route. The provided sequence of + /// coordinates is used as input for route reconstruction. The alternative + /// routes are calculated between the origin and destination points specified + /// in the base path parameter locations. If both minDeviationDistance and + /// minDeviationTime are set to zero, then these origin and destination points + /// are expected to be at (or very near) the beginning and end of the reference + /// route, respectively. Intermediate locations (waypoints) are not supported + /// when using supportingPoints. + /// + /// Setting at least one of minDeviationDistance or minDeviationTime to a value + /// greater than zero has the following consequences: + /// + /// * The origin point of the calculateRoute request must be on (or very near) + /// the input reference route. If this is not the case, an error is returned. + /// However, the origin point does not need to be at the beginning of the + /// input reference route (it can be thought of as the current vehicle position + /// on the reference route). + /// * The reference route, returned as the first route in the calculateRoute + /// response, will start at the origin point specified in the calculateRoute + /// request. The initial part of the input reference route up until the origin + /// point will be excluded from the response. + /// * The values of minDeviationDistance and minDeviationTime determine how + /// far alternative routes will be guaranteed to follow the reference route + /// from the origin point onwards. + /// * The route must use departAt. + /// * The vehicleHeading is ignored. + /// + /// + /// Number of desired alternative routes to be calculated. Default: 0, minimum: + /// 0 and maximum: 5 + /// + /// + /// Controls the optimality, with respect to the given planning criteria, of + /// the calculated alternatives compared to the reference route. Possible + /// values include: 'anyRoute', 'betterRoute' + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of meters. Can only be used when reconstructing a + /// route. The minDeviationDistance parameter cannot be used in conjunction + /// with arriveAt + /// + /// + /// All alternative routes returned will follow the reference route (see + /// section POST Requests) from the origin point of the calculateRoute request + /// for at least this number of seconds. Can only be used when reconstructing a + /// route. The minDeviationTime parameter cannot be used in conjunction with + /// arriveAt. Default value is 0. Setting )minDeviationTime_ to a value greater + /// than zero has the following consequences: + /// - The origin point of the _calculateRoute_ Request must be on + /// (or very near) the input reference route. + /// - If this is not the case, an error is returned. + /// - However, the origin point does not need to be at the beginning + /// of the input reference route (it can be thought of as the current + /// vehicle position on the reference route). + /// - The reference route, returned as the first route in the _calculateRoute_ + /// Response, will start at the origin point specified in the _calculateRoute_ + /// Request. The initial part of the input reference route up until the origin + /// point will be excluded from the Response. + /// - The values of _minDeviationDistance_ and _minDeviationTime_ determine + /// how far alternative routes will be guaranteed to follow the reference + /// route from the origin point onwards. + /// - The route must use _departAt_. + /// - The _vehicleHeading_ is ignored. + /// + /// + /// If specified, guidance instructions will be returned. Note that the + /// instructionsType parameter cannot be used in conjunction with + /// routeRepresentation=none. Possible values include: 'coded', 'text', + /// 'tagged' + /// + /// + /// The language parameter determines the language of the guidance messages. It + /// does not affect proper nouns (the names of streets, plazas, etc.) It has no + /// effect when instructionsType=coded. Allowed values are (a subset of) the + /// IETF language tags described + /// + /// + /// Re-order the route waypoints using a fast heuristic algorithm to reduce the + /// route length. Yields best results when used in conjunction with routeType + /// _shortest_. Notice that origin and destination are excluded from the + /// optimized waypoint indices. To include origin and destination in the + /// response, please increase all the indices by 1 to account for the origin, + /// and then add the destination as the final index. Possible values are true + /// or false. True computes a better order if possible, but is not allowed to + /// be used in conjunction with maxAlternatives value greater than 0 or in + /// conjunction with circle waypoints. False will use the locations in the + /// given order and not allowed to be used in conjunction with + /// routeRepresentation _none_. + /// + /// + /// Specifies the representation of the set of routes provided as response. + /// This parameter value can only be used in conjunction with + /// computeBestOrder=true. Possible values include: 'polyline', 'summaryOnly', + /// 'none' + /// + /// + /// Specifies whether to return additional travel times using different types + /// of traffic information (none, historic, live) as well as the default + /// best-estimate travel time. Possible values include: 'none', 'all' + /// + /// + /// The directional heading of the vehicle in degrees starting at true North + /// and continuing in clockwise direction. North is 0 degrees, east is 90 + /// degrees, south is 180 degrees, west is 270 degrees. Possible values 0-359 + /// + /// + /// Specifies which data should be reported for diagnosis purposes. The only + /// possible value is _effectiveSettings_. Reports the effective parameters or + /// data used when calling the API. In the case of defaulted parameters the + /// default will be reflected where the parameter was not specified by the + /// caller. Possible values include: 'effectiveSettings' + /// + /// + /// Specifies which of the section types is reported in the route response. + /// <br><br>For example if sectionType = pedestrian the sections + /// which are suited for pedestrians only are returned. Multiple types can be + /// used. The default sectionType refers to the travelMode input. By default + /// travelMode is set to car. Possible values include: 'CarOrTrain', 'Country', + /// 'Ferry', 'Motorway', 'Pedestrian', 'TollRoad', 'TollVignette', 'Traffic', + /// 'TravelMode', 'Tunnel', 'Carpool', 'Urban' + /// + /// + /// The date and time of arrival at the destination point. It must be specified + /// as a dateTime. When a time zone offset is not specified it will be assumed + /// to be that of the destination point. The arriveAt value must be in the + /// future. The arriveAt parameter cannot be used in conjunction with departAt, + /// minDeviationDistance or minDeviationTime. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the Consumption + /// Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value of + /// **vehicleWeight** is non-zero, then weight restrictions are considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : + /// 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial vehicles + /// may not be allowed to drive on some roads. + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is specified, + /// it must be consistent with the value of **vehicleEngineType**. Possible + /// values include: 'combustion', 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption curve. + /// Consumption rates for speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is between + /// 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion Consumption + /// Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary systems of + /// the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel in + /// megajoules (MJ). It is used in conjunction with the ***Efficiency** + /// parameters for conversions between saved or consumed energy and fuel. For + /// example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel + /// fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : + /// 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is obtained by + /// converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : + /// 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : + /// 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved (not + /// consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is obtained + /// by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : + /// 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The list + /// defines points on a consumption curve. Consumption rates for speeds not in + /// the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours (kWh) that + /// may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary systems, in + /// kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// The cancellation token. + /// + public static async Task GetRouteDirectionsWithAdditionalParametersAsync(this IRouteClient operations, string format, string routePoints, RouteDirectionParameters routeDirectionParameters, int? maxAlternatives = default(int?), string alternativeType = default(string), int? minDeviationDistance = default(int?), int? minDeviationTime = default(int?), string instructionsType = default(string), string language = default(string), bool? computeBestWaypointOrder = default(bool?), string routeRepresentationForBestOrder = default(string), string computeTravelTime = default(string), int? vehicleHeading = default(int?), string report = default(string), string filterSectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = 0, double? vehicleLength = 0, double? vehicleHeight = 0, double? vehicleWidth = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string windingness = default(string), string inclineLevel = default(string), string travelMode = default(string), IList avoid = default(IList), bool? useTrafficData = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetRouteDirectionsWithAdditionalParametersWithHttpMessagesAsync(format, routePoints, routeDirectionParameters, maxAlternatives, alternativeType, minDeviationDistance, minDeviationTime, instructionsType, language, computeBestWaypointOrder, routeRepresentationForBestOrder, computeTravelTime, vehicleHeading, report, filterSectionType, arriveAt, departAt, vehicleAxleWeight, vehicleLength, vehicleHeight, vehicleWidth, vehicleMaxSpeed, vehicleWeight, isCommercialVehicle, windingness, inclineLevel, travelMode, avoid, useTrafficData, routeType, vehicleLoadType, vehicleEngineType, constantSpeedConsumptionInLitersPerHundredKm, currentFuelInLiters, auxiliaryPowerInLitersPerHour, fuelEnergyDensityInMegajoulesPerLiter, accelerationEfficiency, decelerationEfficiency, uphillEfficiency, downhillEfficiency, constantSpeedConsumptionInKwHPerHundredKm, currentChargeInKwH, maxChargeInKwH, auxiliaryPowerInKw, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// __Route Range (Isochrone) API__ + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// This service will calculate a set of locations that can be reached from the + /// origin point based on fuel, energy, time or distance budget that is + /// specified. A polygon boundary (or Isochrone) is returned in a + /// counterclockwise orientation as well as the precise polygon center which + /// was the result of the origin point. + /// + /// The returned polygon can be used for further processing such as [Search + /// Inside + /// Geometry](https://docs.microsoft.com/rest/api/maps/search/postsearchinsidegeometry) + /// to search for POIs within the provided Isochrone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The Coordinate from which the range calculation should start. + /// + /// + /// Fuel budget in liters that determines maximal range which can be travelled + /// using the specified Combustion Consumption Model.<br> When + /// fuelBudgetInLiters is used, it is mandatory to specify a detailed + /// Combustion Consumption Model.<br> Exactly one budget + /// (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// Electric energy budget in kilowatt hours (kWh) that determines maximal + /// range which can be travelled using the specified Electric Consumption + /// Model.<br> When energyBudgetInkWh is used, it is mandatory to specify + /// a detailed Electric Consumption Model.<br> Exactly one budget + /// (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// Time budget in seconds that determines maximal range which can be travelled + /// using driving time. The Consumption Model will only affect the range when + /// routeType is eco.<br> Exactly one budget (fuelBudgetInLiters, + /// energyBudgetInkWh, timeBudgetInSec, or distanceBudgetInMeters) must be + /// used. + /// + /// + /// Distance budget in meters that determines maximal range which can be + /// travelled using driving distance. The Consumption Model will only affect + /// the range when routeType is eco.<br> Exactly one budget + /// (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + /// distanceBudgetInMeters) must be used. + /// + /// + /// The date and time of departure from the origin point. Departure times apart + /// from now must be specified as a dateTime. When a time zone offset is not + /// specified, it will be assumed to be that of the origin point. The departAt + /// value must be in the future in the date-time format + /// (1996-12-19T16:39:57-08:00). + /// + /// + /// The type of route requested. Possible values include: 'Fastest', + /// 'Shortest', 'Economy', 'Thrilling' + /// + /// + /// Possible values: + /// * true - Do consider all available traffic information during routing + /// * false - Ignore current traffic data during routing. Note that although + /// the current traffic data is ignored + /// during routing, the effect of historic traffic on effective road speeds is + /// still incorporated. + /// + /// + /// Specifies something that the route calculation should try to avoid when + /// determining the route. Can be specified multiple times in one request, for + /// example, '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In + /// calculateReachableRange requests, the value alreadyUsedRoads must not be + /// used. + /// + /// + /// The mode of travel for the requested route. If not defined, default is + /// 'car'. Note that the requested travelMode may not be available for the + /// entire route. Where the requested travelMode is not available for a + /// particular section, the travelMode element of the response for that section + /// will be "other". Note that travel modes bus, motorcycle, taxi and van are + /// BETA functionality. Full restriction data is not available in all areas. In + /// **calculateReachableRange** requests, the values bicycle and pedestrian + /// must not be used. Possible values include: 'car', 'truck', 'taxi', 'bus', + /// 'van', 'motorcycle', 'bicycle', 'pedestrian' + /// + /// + /// Degree of hilliness for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Level of turns for thrilling route. This parameter can only be used in + /// conjunction with `routeType`=thrilling. Possible values include: 'low', + /// 'normal', 'high' + /// + /// + /// Weight per axle of the vehicle in kg. A value of 0 means that weight + /// restrictions per axle are not considered. + /// + /// + /// Width of the vehicle in meters. A value of 0 means that width restrictions + /// are not considered. + /// + /// + /// Height of the vehicle in meters. A value of 0 means that height + /// restrictions are not considered. + /// + /// + /// Length of the vehicle in meters. A value of 0 means that length + /// restrictions are not considered. + /// + /// + /// Maximum speed of the vehicle in km/hour. The max speed in the vehicle + /// profile is used to check whether a vehicle is allowed on motorways. + /// + /// * A value of 0 means that an appropriate value for the vehicle will be + /// determined and applied during route planning. + /// + /// * A non-zero value may be overridden during route planning. For example, + /// the current traffic flow is 60 km/hour. If the vehicle maximum speed is + /// set to 50 km/hour, the routing engine will consider 60 km/hour as this is + /// the current situation. If the maximum speed of the vehicle is provided as + /// 80 km/hour but the current traffic flow is 60 km/hour, then routing engine + /// will again use 60 km/hour. + /// + /// + /// Weight of the vehicle in kilograms. + /// + /// * It is mandatory if any of the *Efficiency parameters are set. + /// + /// * It must be strictly positive when used in the context of the Consumption + /// Model. Weight restrictions are considered. + /// + /// * If no detailed **Consumption Model** is specified and the value of + /// **vehicleWeight** is non-zero, then weight restrictions are considered. + /// + /// * In all other cases, this parameter is ignored. + /// + /// Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : + /// 1900 + /// + /// + /// Whether the vehicle is used for commercial purposes. Commercial vehicles + /// may not be allowed to drive on some roads. + /// + /// + /// Types of cargo that may be classified as hazardous materials and restricted + /// from some roads. Available vehicleLoadType values are US Hazmat classes 1 + /// through 9, plus generic classifications for use in other countries. Values + /// beginning with USHazmat are for US routing while otherHazmat should be used + /// for all other countries. vehicleLoadType can be specified multiple times. + /// This parameter is currently only considered for travelMode=truck. Possible + /// values include: 'USHazmatClass1', 'USHazmatClass2', 'USHazmatClass3', + /// 'USHazmatClass4', 'USHazmatClass5', 'USHazmatClass6', 'USHazmatClass7', + /// 'USHazmatClass8', 'USHazmatClass9', 'otherHazmatExplosive', + /// 'otherHazmatGeneral', 'otherHazmatHarmfulToWater' + /// + /// + /// Engine type of the vehicle. When a detailed Consumption Model is specified, + /// it must be consistent with the value of **vehicleEngineType**. Possible + /// values include: 'combustion', 'electric' + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of colon-delimited speed & + /// consumption-rate pairs. The list defines points on a consumption curve. + /// Consumption rates for speeds not in the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in l/100km) is between + /// 0.01 and 100000.0. + /// + /// Sensible Values : 50,6.3:130,11.5 + /// + /// **Note** : This parameter is required for **The Combustion Consumption + /// Model**. + /// + /// + /// Specifies the current supply of fuel in liters. + /// + /// Sensible Values : 55 + /// + /// + /// Specifies the amount of fuel consumed for sustaining auxiliary systems of + /// the vehicle, in liters per hour. + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 0.2 + /// + /// + /// Specifies the amount of chemical energy stored in one liter of fuel in + /// megajoules (MJ). It is used in conjunction with the ***Efficiency** + /// parameters for conversions between saved or consumed energy and fuel. For + /// example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel + /// fuel. + /// + /// This parameter is required if any ***Efficiency** parameter is set. + /// + /// Sensible Values : 34.2 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// kinetic energy when the vehicle accelerates _(i.e. + /// KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **decelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**decelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : + /// 0.66 + /// + /// + /// Specifies the efficiency of converting kinetic energy to saved (not + /// consumed) fuel when the vehicle decelerates _(i.e. + /// ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved_ is obtained by + /// converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **accelerationEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**accelerationEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : + /// 0.91 + /// + /// + /// Specifies the efficiency of converting chemical energy stored in fuel to + /// potential energy when the vehicle gains elevation _(i.e. + /// PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed_ is + /// obtained by converting consumed fuel to chemical energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **downhillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**downhillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : + /// 0.74 + /// + /// + /// Specifies the efficiency of converting potential energy to saved (not + /// consumed) fuel when the vehicle loses elevation _(i.e. + /// ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved_ is obtained + /// by converting saved (not consumed) fuel to energy using + /// **fuelEnergyDensityInMJoulesPerLiter**. + /// + /// Must be paired with **uphillEfficiency**. + /// + /// The range of values allowed are 0.0 to 1/**uphillEfficiency**. + /// + /// Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : + /// 0.73 + /// + /// + /// Specifies the speed-dependent component of consumption. + /// + /// Provided as an unordered list of speed/consumption-rate pairs. The list + /// defines points on a consumption curve. Consumption rates for speeds not in + /// the list are found as follows: + /// + /// * by linear interpolation, if the given speed lies in between two speeds in + /// the list + /// + /// * by linear extrapolation otherwise, assuming a constant + /// (ΔConsumption/ΔSpeed) determined by the nearest two points in the list + /// + /// The list must contain between 1 and 25 points (inclusive), and may not + /// contain duplicate points for the same speed. If it only contains a single + /// point, then the consumption rate of that point is used without further + /// processing. + /// + /// Consumption specified for the largest speed must be greater than or equal + /// to that of the penultimate largest speed. This ensures that extrapolation + /// does not lead to negative consumption rates. + /// + /// Similarly, consumption values specified for the two smallest speeds in the + /// list cannot lead to a negative consumption rate for any smaller speed. + /// + /// The valid range for the consumption values(expressed in kWh/100km) is + /// between 0.01 and 100000.0. + /// + /// Sensible Values : 50,8.2:130,21.3 + /// + /// This parameter is required for **Electric consumption model**. + /// + /// + /// Specifies the current electric energy supply in kilowatt hours (kWh). + /// + /// This parameter co-exists with **maxChargeInkWh** parameter. + /// + /// The range of values allowed are 0.0 to **maxChargeInkWh**. + /// + /// Sensible Values : 43 + /// + /// + /// Specifies the maximum electric energy supply in kilowatt hours (kWh) that + /// may be stored in the vehicle's battery. + /// + /// This parameter co-exists with **currentChargeInkWh** parameter. + /// + /// Minimum value has to be greater than or equal to **currentChargeInkWh**. + /// + /// Sensible Values : 85 + /// + /// + /// Specifies the amount of power consumed for sustaining auxiliary systems, in + /// kilowatts (kW). + /// + /// It can be used to specify consumption due to devices and systems such as AC + /// systems, radio, heating, etc. + /// + /// Sensible Values : 1.7 + /// + /// + /// The cancellation token. + /// + public static async Task GetRouteRangeAsync(this IRouteClient operations, string format, IList query, double? fuelBudgetInLiters = default(double?), double? energyBudgetInKwH = default(double?), double? timeBudgetInSec = default(double?), double? distanceBudgetInMeters = default(double?), System.DateTime? departAt = default(System.DateTime?), string routeType = default(string), bool? useTrafficData = default(bool?), IList avoid = default(IList), string travelMode = default(string), string inclineLevel = default(string), string windingness = default(string), int? vehicleAxleWeight = 0, double? vehicleWidth = 0, double? vehicleHeight = 0, double? vehicleLength = 0, int? vehicleMaxSpeed = 0, int? vehicleWeight = 0, bool? isCommercialVehicle = false, string vehicleLoadType = default(string), string vehicleEngineType = default(string), string constantSpeedConsumptionInLitersPerHundredKm = default(string), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMegajoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInKwHPerHundredKm = default(string), double? currentChargeInKwH = default(double?), double? maxChargeInKwH = default(double?), double? auxiliaryPowerInKw = default(double?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetRouteRangeWithHttpMessagesAsync(format, query, fuelBudgetInLiters, energyBudgetInKwH, timeBudgetInSec, distanceBudgetInMeters, departAt, routeType, useTrafficData, avoid, travelMode, inclineLevel, windingness, vehicleAxleWeight, vehicleWidth, vehicleHeight, vehicleLength, vehicleMaxSpeed, vehicleWeight, isCommercialVehicle, vehicleLoadType, vehicleEngineType, constantSpeedConsumptionInLitersPerHundredKm, currentFuelInLiters, auxiliaryPowerInLitersPerHour, fuelEnergyDensityInMegajoulesPerLiter, accelerationEfficiency, decelerationEfficiency, uphillEfficiency, downhillEfficiency, constantSpeedConsumptionInKwHPerHundredKm, currentChargeInKwH, maxChargeInKwH, auxiliaryPowerInKw, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Route Directions Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Route Directions Batch API sends batches of queries to [Route + /// Directions + /// API](https://docs.microsoft.com/rest/api/maps/route/getroutedirections) + /// using just a single API call. You can call Route Directions Batch API to + /// run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **700** queries and sync API up to **100** + /// queries. + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex route requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **700** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Route Directions Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` GET + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0 + /// ``` + /// Note:- Please remember to add AUTH information (subscription-key/azure_auth + /// - See [Security](#security)) to the _status URI_ before running it. + /// <br> + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _route directions_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 3 _route directions_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// { "query": + /// "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" + /// }, + /// { "query": + /// "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" + /// }, + /// { "query": "?query=48.923159,-122.557362:32.621279,-116.840362" } + /// ] + /// } + /// ``` + /// + /// A _route directions_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _route directions_ [URI + /// parameters](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#uri-parameters). + /// The string values in the _route directions_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **700** queries and sync API up + /// to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of route directions queries/requests to process. The list can + /// contain a max of 700 queries for async and 100 queries for sync version and + /// must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task RequestRouteDirectionsBatchAsync(this IRouteClient operations, BatchRequestBody routeDirectionsBatchQueries, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RequestRouteDirectionsBatchWithHttpMessagesAsync(routeDirectionsBatchQueries, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The cancellation token. + /// + public static async Task GetRouteDirectionsBatchAsync(this IRouteClient operations, string batchId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetRouteDirectionsBatchWithHttpMessagesAsync(batchId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Route Directions Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Route Directions Batch API sends batches of queries to [Route + /// Directions + /// API](https://docs.microsoft.com/rest/api/maps/route/getroutedirections) + /// using just a single API call. You can call Route Directions Batch API to + /// run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **700** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`RouteDirections`](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#routedirections) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 1 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 1, + /// "totalRequests": 2 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": { + /// "routes": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "legs": [ + /// { + /// "summary": { + /// "lengthInMeters": 1758, + /// "travelTimeInSeconds": 387, + /// "trafficDelayInSeconds": 0, + /// "departureTime": "2018-07-17T00:49:56+00:00", + /// "arrivalTime": "2018-07-17T00:56:22+00:00" + /// }, + /// "points": [ + /// { + /// "latitude": 47.62094, + /// "longitude": -122.34892 + /// }, + /// { + /// "latitude": 47.62094, + /// "longitude": -122.3485 + /// }, + /// { + /// "latitude": 47.62095, + /// "longitude": -122.3476 + /// } + /// ] + /// } + /// ], + /// "sections": [ + /// { + /// "startPointIndex": 0, + /// "endPointIndex": 40, + /// "sectionType": "TRAVEL_MODE", + /// "travelMode": "bicycle" + /// } + /// ] + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of route directions queries/requests to process. The list can + /// contain a max of 700 queries for async and 100 queries for sync version + /// and must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task RequestRouteDirectionsBatchSyncAsync(this IRouteClient operations, BatchRequestBody routeDirectionsBatchQueries, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RequestRouteDirectionsBatchSyncWithHttpMessagesAsync(routeDirectionsBatchQueries, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/SdkInfo_RouteClient.cs b/sdk/maps/Azure.Maps.Route/src/Generated/SdkInfo_RouteClient.cs new file mode 100644 index 000000000000..253c737a2456 --- /dev/null +++ b/sdk/maps/Azure.Maps.Route/src/Generated/SdkInfo_RouteClient.cs @@ -0,0 +1,35 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Route +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_RouteClient + { + get + { + return new Tuple[] + { + new Tuple("RouteClient", "GetRouteDirections", "1.0"), + new Tuple("RouteClient", "GetRouteDirectionsBatch", "1.0"), + new Tuple("RouteClient", "GetRouteDirectionsWithAdditionalParameters", "1.0"), + new Tuple("RouteClient", "GetRouteMatrix", "1.0"), + new Tuple("RouteClient", "GetRouteRange", "1.0"), + new Tuple("RouteClient", "RequestRouteDirectionsBatch", "1.0"), + new Tuple("RouteClient", "RequestRouteDirectionsBatchSync", "1.0"), + new Tuple("RouteClient", "RequestRouteMatrix", "1.0"), + new Tuple("RouteClient", "RequestRouteMatrixSync", "1.0"), + }.AsEnumerable(); + } + } + } +}