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..3dc2fdb8cff7
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/IRouteClient.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
+{
+ using Microsoft.Rest;
+ using Models;
+ using Newtonsoft.Json;
+
+ ///
+ /// Azure Maps Route REST APIs
+ ///
+ public partial interface IRouteClient : System.IDisposable
+ {
+ ///
+ /// The base URI of the service.
+ ///
+
+ ///
+ /// 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 XMsClientId { get; set; }
+
+ ///
+ /// This parameter specifies where the Azure Maps Creator resource is
+ /// located. Valid values are us and eu. Possible values include:
+ /// 'us', 'eu'
+ ///
+ string Geography { get; set; }
+
+ ///
+ /// Subscription credentials which uniquely identify client
+ /// subscription.
+ ///
+ ServiceClientCredentials Credentials { get; }
+
+
+ ///
+ /// Gets the IRouteOperations.
+ ///
+ IRouteOperations Route { get; }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/IRouteOperations.cs b/sdk/maps/Azure.Maps.Route/src/Generated/IRouteOperations.cs
new file mode 100644
index 000000000000..7a5110b4737c
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/IRouteOperations.cs
@@ -0,0 +1,2627 @@
+//
+// 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 System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RouteOperations operations.
+ ///
+ public partial interface IRouteOperations
+ {
+ ///
+ ///
+ ///
+ /// **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: 'carTrain', 'country', 'ferry',
+ /// 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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', 'eco', '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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> PostRouteMatrixWithHttpMessagesAsync(PostRouteMatrixRequestBody postRouteMatrixRequestBody, bool? waitForResults = default(bool?), string computeTravelTimeFor = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = 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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetRouteMatrixWithHttpMessagesAsync(string format, 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: 'carTrain', 'country', 'ferry',
+ /// 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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', 'eco', '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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> PostRouteMatrixSyncWithHttpMessagesAsync(PostRouteMatrixRequestBody postRouteMatrixRequestBody, bool? waitForResults = default(bool?), string computeTravelTimeFor = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = 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.
+ ///
+ ///
+ /// 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: 'carTrain', 'country', 'ferry',
+ /// 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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', 'eco', '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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetRouteDirectionsWithHttpMessagesAsync(string format, string query, 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? computeBestOrder = default(bool?), string routeRepresentation = default(string), string computeTravelTimeFor = default(string), int? vehicleHeading = default(int?), string report = default(string), string sectionType = default(string), int? vehicleAxleWeight = default(int?), double? vehicleWidth = default(double?), double? vehicleHeight = default(double?), double? vehicleLength = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = 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 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. Needs two
+ /// coordinates at least. Delimited by colon. First one is the origin
+ /// and the last is the destination of the route. The coordinates are
+ /// in a lat,long format. Optional coordinates in between act as
+ /// WayPoints in the route.
+ ///
+ ///
+ /// 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.
+ ///
+ ///
+ /// 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: 'carTrain', 'country', 'ferry',
+ /// 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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', 'eco', '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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> PostRouteDirectionsWithHttpMessagesAsync(string format, string query, PostRouteDirectionsRequestBody postRouteDirectionsRequestBody, 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? computeBestOrder = default(bool?), string routeRepresentation = default(string), string computeTravelTimeFor = default(string), int? vehicleHeading = default(int?), string report = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), 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', 'eco', '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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetRouteRangeWithHttpMessagesAsync(string format, string 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? traffic = default(bool?), IList avoid = default(IList), string travelMode = default(string), string hilliness = default(string), string windingness = default(string), int? vehicleAxleWeight = default(int?), double? vehicleWidth = default(double?), double? vehicleHeight = default(double?), double? vehicleLength = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), 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/en-us/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}
+ /// ```
+ /// ### 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/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/en-us/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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> PostRouteDirectionsBatchWithHttpMessagesAsync(BatchRequestBody postRouteDirectionsBatchRequestBody, 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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetRouteDirectionsBatchWithHttpMessagesAsync(string format, 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/en-us/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}
+ /// ```
+ /// ### 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/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/en-us/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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> PostRouteDirectionsBatchSyncWithHttpMessagesAsync(BatchRequestBody postRouteDirectionsBatchRequestBody, 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/BatchRequestBody.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBody.cs
new file mode 100644
index 000000000000..756d124be70f
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBody.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.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.
+ ///
+ /// The list of queries to process.
+ public BatchRequestBody(IList batchItems = default(IList))
+ {
+ BatchItems = batchItems;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the list of queries to process.
+ ///
+ [JsonProperty(PropertyName = "batchItems")]
+ public IList BatchItems { get; set; }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBodyBatchItemsItem.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBodyBatchItemsItem.cs
new file mode 100644
index 000000000000..bd86ef594ca3
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/BatchRequestBodyBatchItemsItem.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;
+
+ ///
+ /// Batch Query object
+ ///
+ public partial class BatchRequestBodyBatchItemsItem
+ {
+ ///
+ /// Initializes a new instance of the BatchRequestBodyBatchItemsItem
+ /// class.
+ ///
+ public BatchRequestBodyBatchItemsItem()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BatchRequestBodyBatchItemsItem
+ /// class.
+ ///
+ /// Partial query string.
+ public BatchRequestBodyBatchItemsItem(string query = default(string))
+ {
+ Query = query;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets partial query string.
+ ///
+ [JsonProperty(PropertyName = "query")]
+ public string Query { 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/ComputeTravelTimeFor.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ComputeTravelTimeFor.cs
new file mode 100644
index 000000000000..7bc96caf2657
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/ComputeTravelTimeFor.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 ComputeTravelTimeFor.
+ ///
+ public static class ComputeTravelTimeFor
+ {
+ ///
+ /// 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/CoordinatesPair.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/CoordinatesPair.cs
new file mode 100644
index 000000000000..fb8a4bfab0e1
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/CoordinatesPair.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 CoordinatesPair
+ {
+ ///
+ /// Initializes a new instance of the CoordinatesPair class.
+ ///
+ public CoordinatesPair()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CoordinatesPair class.
+ ///
+ /// Latitude property
+ /// Longitude property
+ public CoordinatesPair(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/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/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..e6d690a25d02
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeature.cs
@@ -0,0 +1,121 @@
+//
+// 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(string 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 string 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 (Type == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Type");
+ }
+ 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..728c94b46706
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonFeatureCollection.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 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(string 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 string 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 (Type == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Type");
+ }
+ 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..9fd3635cad8e
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeoJsonObjectType.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
+{
+
+ ///
+ /// Defines values for GeoJsonObjectType.
+ ///
+ public static class GeoJsonObjectType
+ {
+ ///
+ /// `GeoJSON Point` geometry.
+ ///
+ public const string GeoJsonPoint = "Point";
+ ///
+ /// `GeoJSON MultiPoint` geometry.
+ ///
+ public const string GeoJsonMultiPoint = "MultiPoint";
+ ///
+ /// `GeoJSON LineString` geometry.
+ ///
+ public const string GeoJsonLineString = "LineString";
+ ///
+ /// `GeoJSON MultiLineString` geometry.
+ ///
+ public const string GeoJsonMultiLineString = "MultiLineString";
+ ///
+ /// `GeoJSON Polygon` geometry.
+ ///
+ public const string GeoJsonPolygon = "Polygon";
+ ///
+ /// `GeoJSON MultiPolygon` geometry.
+ ///
+ public const string GeoJsonMultiPolygon = "MultiPolygon";
+ ///
+ /// `GeoJSON GeometryCollection` geometry.
+ ///
+ public const string GeoJsonGeometryCollection = "GeometryCollection";
+ ///
+ /// `GeoJSON Feature` object.
+ ///
+ public const string GeoJsonFeature = "Feature";
+ ///
+ /// `GeoJSON FeatureCollection` object.
+ ///
+ public const string GeoJsonFeatureCollection = "FeatureCollection";
+ }
+}
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/GeographicResourceLocation.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeographicResourceLocation.cs
new file mode 100644
index 000000000000..f34739032caf
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GeographicResourceLocation.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 GeographicResourceLocation.
+ ///
+ public static class GeographicResourceLocation
+ {
+ ///
+ /// Used to access an Azure Maps Creator resource in the United States
+ ///
+ public const string Us = "us";
+ ///
+ /// Used to access an Azure Maps Creator resource in Europe
+ ///
+ public const string Eu = "eu";
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteRangeResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteRangeResponse.cs
new file mode 100644
index 000000000000..dfb0c3546b72
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/GetRouteRangeResponse.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 GetRouteRangeResponse
+ {
+ ///
+ /// Initializes a new instance of the GetRouteRangeResponse class.
+ ///
+ public GetRouteRangeResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the GetRouteRangeResponse class.
+ ///
+ /// Format Version property
+ public GetRouteRangeResponse(string formatVersion = default(string), RouteRange reachableRange = default(RouteRange), RouteResponseReport report = default(RouteResponseReport))
+ {
+ 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 RouteResponseReport Report { 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..064914f7b812
--- /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..eaa6ea49a03d
--- /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/HillinessDegree.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/HillinessDegree.cs
new file mode 100644
index 000000000000..2eaf05a3cdf5
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/HillinessDegree.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 HillinessDegree.
+ ///
+ public static class HillinessDegree
+ {
+ ///
+ /// 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/MagnitudeOfDelay.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/MagnitudeOfDelay.cs
new file mode 100644
index 000000000000..e508cdf7cb38
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/MagnitudeOfDelay.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 MagnitudeOfDelay.
+ ///
+ public static class MagnitudeOfDelay
+ {
+ ///
+ /// Unknown.
+ ///
+ public const string Zero = "0";
+ ///
+ /// Minor.
+ ///
+ public const string One = "1";
+ ///
+ /// Moderate.
+ ///
+ public const string Two = "2";
+ ///
+ /// Major.
+ ///
+ public const string Three = "3";
+ ///
+ /// Undefined, used for road closures and other indefinite delays.
+ ///
+ public const string Four = "4";
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/PostRouteDirectionsRequestBody.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/PostRouteDirectionsRequestBody.cs
new file mode 100644
index 000000000000..558e2e2e4ba8
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/PostRouteDirectionsRequestBody.cs
@@ -0,0 +1,160 @@
+//
+// 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 PostRouteDirectionsRequestBody
+ {
+ ///
+ /// Initializes a new instance of the PostRouteDirectionsRequestBody
+ /// class.
+ ///
+ public PostRouteDirectionsRequestBody()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PostRouteDirectionsRequestBody
+ /// 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.
+ /// 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 PostRouteDirectionsRequestBody(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
+ /// <_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.
+ ///
+ [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/PostRouteMatrixRequestBody.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/PostRouteMatrixRequestBody.cs
new file mode 100644
index 000000000000..af9be0480173
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/PostRouteMatrixRequestBody.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 PostRouteMatrixRequestBody
+ {
+ ///
+ /// Initializes a new instance of the PostRouteMatrixRequestBody class.
+ ///
+ public PostRouteMatrixRequestBody()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PostRouteMatrixRequestBody class.
+ ///
+ public PostRouteMatrixRequestBody(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/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/RouteDirectionsBatchItem.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItem.cs
new file mode 100644
index 000000000000..3f6f04e039d3
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsBatchItem.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;
+
+ ///
+ /// 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.
+ /// RouteDirectionsResponse 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. RouteDirectionsResponse 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..6b47f2b79769
--- /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. RouteDirectionsResponse 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), RouteResponseReport report = default(RouteResponseReport), 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:
+ ///
+ /// ```
+ /// <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".
+ ///
+ [JsonProperty(PropertyName = "optimizedWaypoints")]
+ public IList OptimizedWaypoints { get; private set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "report")]
+ public RouteResponseReport 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/RouteDirectionsResponse.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsResponse.cs
new file mode 100644
index 000000000000..726a3edd50f3
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsResponse.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 RouteDirectionsResponse
+ {
+ ///
+ /// Initializes a new instance of the RouteDirectionsResponse class.
+ ///
+ public RouteDirectionsResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteDirectionsResponse 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 RouteDirectionsResponse(string formatVersion = default(string), IList routes = default(IList), IList optimizedWaypoints = default(IList), RouteResponseReport report = default(RouteResponseReport))
+ {
+ 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:
+ ///
+ /// ```
+ /// <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".
+ ///
+ [JsonProperty(PropertyName = "optimizedWaypoints")]
+ public IList OptimizedWaypoints { get; private set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "report")]
+ public RouteResponseReport Report { get; set; }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsResult.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsResult.cs
new file mode 100644
index 000000000000..b25221c3dae7
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsResult.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 RouteDirectionsResult
+ {
+ ///
+ /// Initializes a new instance of the RouteDirectionsResult class.
+ ///
+ public RouteDirectionsResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteDirectionsResult class.
+ ///
+ /// Legs array
+ /// Sections array
+ public RouteDirectionsResult(RouteDirectionsSummary summary = default(RouteDirectionsSummary), IList legs = default(IList), IList sections = default(IList), RouteResultGuidance guidance = default(RouteResultGuidance))
+ {
+ 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 RouteDirectionsSummary 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 RouteResultGuidance Guidance { get; set; }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsSummary.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsSummary.cs
new file mode 100644
index 000000000000..6e41c2b03b9f
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteDirectionsSummary.cs
@@ -0,0 +1,100 @@
+//
+// 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 RouteDirectionsSummary
+ {
+ ///
+ /// Initializes a new instance of the RouteDirectionsSummary class.
+ ///
+ public RouteDirectionsSummary()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteDirectionsSummary 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.
+ /// Departure Time property
+ /// Arrival Time property
+ public RouteDirectionsSummary(int? lengthInMeters = default(int?), int? travelTimeInSeconds = default(int?), int? trafficDelayInSeconds = default(int?), string departureTime = default(string), string arrivalTime = default(string))
+ {
+ 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; }
+
+ ///
+ /// Gets departure Time property
+ ///
+ [JsonProperty(PropertyName = "departureTime")]
+ public string DepartureTime { get; private set; }
+
+ ///
+ /// Gets arrival Time property
+ ///
+ [JsonProperty(PropertyName = "arrivalTime")]
+ public string ArrivalTime { get; private set; }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGetRouteDirectionsBatchHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGetRouteDirectionsBatchHeaders.cs
new file mode 100644
index 000000000000..9840068b046d
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGetRouteDirectionsBatchHeaders.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 RouteGetRouteDirectionsBatchHeaders
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RouteGetRouteDirectionsBatchHeaders class.
+ ///
+ public RouteGetRouteDirectionsBatchHeaders()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RouteGetRouteDirectionsBatchHeaders class.
+ ///
+ /// New URL to check for the results of the long
+ /// running process.
+ public RouteGetRouteDirectionsBatchHeaders(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/RouteGetRouteMatrixHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGetRouteMatrixHeaders.cs
new file mode 100644
index 000000000000..34cd3d5c51fe
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteGetRouteMatrixHeaders.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 RouteGetRouteMatrixHeaders
+ {
+ ///
+ /// Initializes a new instance of the RouteGetRouteMatrixHeaders class.
+ ///
+ public RouteGetRouteMatrixHeaders()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteGetRouteMatrixHeaders class.
+ ///
+ /// New URL to check for the results of the long
+ /// running process.
+ public RouteGetRouteMatrixHeaders(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/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/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..fdaae5616cb5
--- /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(RouteResultLegSummary routeSummary = default(RouteResultLegSummary))
+ {
+ RouteSummary = routeSummary;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "routeSummary")]
+ public RouteResultLegSummary RouteSummary { 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/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/RoutePostRouteDirectionsBatchHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RoutePostRouteDirectionsBatchHeaders.cs
new file mode 100644
index 000000000000..09f975a9f1b5
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RoutePostRouteDirectionsBatchHeaders.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 PostRouteDirectionsBatch operation.
+ ///
+ public partial class RoutePostRouteDirectionsBatchHeaders
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RoutePostRouteDirectionsBatchHeaders class.
+ ///
+ public RoutePostRouteDirectionsBatchHeaders()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RoutePostRouteDirectionsBatchHeaders class.
+ ///
+ /// New URL to check for the results of the long
+ /// running process.
+ public RoutePostRouteDirectionsBatchHeaders(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/RoutePostRouteMatrixHeaders.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RoutePostRouteMatrixHeaders.cs
new file mode 100644
index 000000000000..64f132e8e21d
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RoutePostRouteMatrixHeaders.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 PostRouteMatrix operation.
+ ///
+ public partial class RoutePostRouteMatrixHeaders
+ {
+ ///
+ /// Initializes a new instance of the RoutePostRouteMatrixHeaders
+ /// class.
+ ///
+ public RoutePostRouteMatrixHeaders()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RoutePostRouteMatrixHeaders
+ /// class.
+ ///
+ /// New URL to check for the results of the long
+ /// running process.
+ public RoutePostRouteMatrixHeaders(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/RouteRange.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRange.cs
new file mode 100644
index 000000000000..3800abb21cee
--- /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(CoordinatesPair center = default(CoordinatesPair), 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 CoordinatesPair 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/RouteRepresentation.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRepresentation.cs
new file mode 100644
index 000000000000..5495415cab00
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteRepresentation.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 RouteRepresentation.
+ ///
+ public static class RouteRepresentation
+ {
+ ///
+ /// 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/RouteResponseReport.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResponseReport.cs
new file mode 100644
index 000000000000..28be3aad5a20
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResponseReport.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 RouteResponseReport
+ {
+ ///
+ /// Initializes a new instance of the RouteResponseReport class.
+ ///
+ public RouteResponseReport()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResponseReport class.
+ ///
+ /// Effective parameters or data used
+ /// when calling this Route API.
+ public RouteResponseReport(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/RouteResponseReportEffectiveSetting.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResponseReportEffectiveSetting.cs
new file mode 100644
index 000000000000..ebd78db3c2aa
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResponseReportEffectiveSetting.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;
+
+ ///
+ /// Effective parameter or data used when calling this Route API.
+ ///
+ public partial class RouteResponseReportEffectiveSetting
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RouteResponseReportEffectiveSetting class.
+ ///
+ public RouteResponseReportEffectiveSetting()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RouteResponseReportEffectiveSetting class.
+ ///
+ /// Name of the parameter used.
+ /// Value of the parameter used.
+ public RouteResponseReportEffectiveSetting(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/RouteResultGuidance.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultGuidance.cs
new file mode 100644
index 000000000000..925bf7e8ac1e
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultGuidance.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 RouteResultGuidance
+ {
+ ///
+ /// Initializes a new instance of the RouteResultGuidance class.
+ ///
+ public RouteResultGuidance()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultGuidance class.
+ ///
+ /// A list of instructions describing
+ /// maneuvers.
+ /// Groups a sequence of instruction
+ /// elements which are related to each other.
+ public RouteResultGuidance(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/RouteResultInstruction.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultInstruction.cs
new file mode 100644
index 000000000000..8d7e972a7704
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultInstruction.cs
@@ -0,0 +1,332 @@
+//
+// 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 RouteResultInstruction
+ {
+ ///
+ /// Initializes a new instance of the RouteResultInstruction class.
+ ///
+ public RouteResultInstruction()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultInstruction 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',
+ /// 'ROAD_CHANGE', 'LOCATION_DEPARTURE', 'LOCATION_ARRIVAL',
+ /// 'DIRECTION_INFO', 'LOCATION_WAYPOINT'
+ /// 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', 'ARRIVE_LEFT', 'ARRIVE_RIGHT', 'DEPART',
+ /// 'STRAIGHT', 'KEEP_RIGHT', 'BEAR_RIGHT', 'TURN_RIGHT',
+ /// 'SHARP_RIGHT', 'KEEP_LEFT', 'BEAR_LEFT', 'TURN_LEFT', 'SHARP_LEFT',
+ /// 'MAKE_UTURN', 'ENTER_MOTORWAY', 'ENTER_FREEWAY', 'ENTER_HIGHWAY',
+ /// 'TAKE_EXIT', 'MOTORWAY_EXIT_LEFT', 'MOTORWAY_EXIT_RIGHT',
+ /// 'TAKE_FERRY', 'ROUNDABOUT_CROSS', 'ROUNDABOUT_RIGHT',
+ /// 'ROUNDABOUT_LEFT', 'ROUNDABOUT_BACK', 'TRY_MAKE_UTURN', 'FOLLOW',
+ /// 'SWITCH_PARALLEL_ROAD', 'SWITCH_MAIN_ROAD', 'ENTRANCE_RAMP',
+ /// 'WAYPOINT_LEFT', 'WAYPOINT_RIGHT', 'WAYPOINT_REACHED'
+ /// 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 RouteResultInstruction(int? routeOffsetInMeters = default(int?), int? travelTimeInSeconds = default(int?), CoordinatesPair point = default(CoordinatesPair), 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? turnAngleInDecimalDegrees = 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;
+ TurnAngleInDecimalDegrees = turnAngleInDecimalDegrees;
+ 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 CoordinatesPair 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', 'ROAD_CHANGE',
+ /// 'LOCATION_DEPARTURE', 'LOCATION_ARRIVAL', 'DIRECTION_INFO',
+ /// 'LOCATION_WAYPOINT'
+ ///
+ [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:
+ ///
+ /// * <0 - keep left
+ /// * \>0 - keep right
+ ///
+ [JsonProperty(PropertyName = "turnAngleInDecimalDegrees")]
+ public int? TurnAngleInDecimalDegrees { 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', 'ARRIVE_LEFT', 'ARRIVE_RIGHT', 'DEPART', 'STRAIGHT',
+ /// 'KEEP_RIGHT', 'BEAR_RIGHT', 'TURN_RIGHT', 'SHARP_RIGHT',
+ /// 'KEEP_LEFT', 'BEAR_LEFT', 'TURN_LEFT', 'SHARP_LEFT', 'MAKE_UTURN',
+ /// 'ENTER_MOTORWAY', 'ENTER_FREEWAY', 'ENTER_HIGHWAY', 'TAKE_EXIT',
+ /// 'MOTORWAY_EXIT_LEFT', 'MOTORWAY_EXIT_RIGHT', 'TAKE_FERRY',
+ /// 'ROUNDABOUT_CROSS', 'ROUNDABOUT_RIGHT', 'ROUNDABOUT_LEFT',
+ /// 'ROUNDABOUT_BACK', 'TRY_MAKE_UTURN', 'FOLLOW',
+ /// 'SWITCH_PARALLEL_ROAD', 'SWITCH_MAIN_ROAD', 'ENTRANCE_RAMP',
+ /// 'WAYPOINT_LEFT', 'WAYPOINT_RIGHT', 'WAYPOINT_REACHED'
+ ///
+ [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/RouteResultInstructionGroup.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultInstructionGroup.cs
new file mode 100644
index 000000000000..005b63255323
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultInstructionGroup.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 RouteResultInstructionGroup
+ {
+ ///
+ /// Initializes a new instance of the RouteResultInstructionGroup
+ /// class.
+ ///
+ public RouteResultInstructionGroup()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultInstructionGroup
+ /// class.
+ ///
+ /// Index of the first
+ /// instruction.
+ /// Index of the last
+ /// instruction.
+ /// Length of the group.
+ /// Summary message when human-readable text
+ /// messages are requested for guidance (instructionType=text or
+ /// tagged).
+ public RouteResultInstructionGroup(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.
+ ///
+ [JsonProperty(PropertyName = "firstInstructionIndex")]
+ public int? FirstInstructionIndex { get; private set; }
+
+ ///
+ /// Gets index of the last instruction.
+ ///
+ [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/RouteResultLeg.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultLeg.cs
new file mode 100644
index 000000000000..8bfe80e4c423
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultLeg.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.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ public partial class RouteResultLeg
+ {
+ ///
+ /// Initializes a new instance of the RouteResultLeg class.
+ ///
+ public RouteResultLeg()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultLeg class.
+ ///
+ /// Points array
+ public RouteResultLeg(RouteResultLegSummary summary = default(RouteResultLegSummary), 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 RouteResultLegSummary 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/RouteResultLegSummary.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultLegSummary.cs
new file mode 100644
index 000000000000..7b73470ba6a1
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultLegSummary.cs
@@ -0,0 +1,180 @@
+//
+// 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 RouteResultLegSummary
+ {
+ ///
+ /// Initializes a new instance of the RouteResultLegSummary class.
+ ///
+ public RouteResultLegSummary()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultLegSummary 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.
+ /// Departure Time property
+ /// Arrival Time property
+ /// 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 RouteResultLegSummary(int? lengthInMeters = default(int?), int? travelTimeInSeconds = default(int?), int? trafficDelayInSeconds = default(int?), string departureTime = default(string), string arrivalTime = default(string), 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; }
+
+ ///
+ /// Gets departure Time property
+ ///
+ [JsonProperty(PropertyName = "departureTime")]
+ public string DepartureTime { get; private set; }
+
+ ///
+ /// Gets arrival Time property
+ ///
+ [JsonProperty(PropertyName = "arrivalTime")]
+ public string ArrivalTime { get; private 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/RouteResultSection.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultSection.cs
new file mode 100644
index 000000000000..6eeb7b4e4ecd
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultSection.cs
@@ -0,0 +1,124 @@
+//
+// 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;
+
+ public partial class RouteResultSection
+ {
+ ///
+ /// Initializes a new instance of the RouteResultSection class.
+ ///
+ public RouteResultSection()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultSection class.
+ ///
+ /// Start Point Index property
+ /// End Point Index property
+ /// Section Type property
+ /// Travel Mode property
+ /// Type of the incident. Can currently be
+ /// JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER. See "tec" for detailed
+ /// information.
+ /// Effective speed of the incident
+ /// in km/h, averaged over its entire length.
+ /// Delay in seconds caused by the
+ /// incident.
+ /// The magnitude of delay caused by the
+ /// incident. These values correspond to the values of the response
+ /// field ty of the [Get Traffic Incident Detail
+ /// API](https://docs.microsoft.com/rest/api/maps/traffic/gettrafficincidentdetail).
+ /// Possible values include: '0', '1', '2', '3', '4'
+ public RouteResultSection(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), RouteResultSectionTec tec = default(RouteResultSectionTec))
+ {
+ 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 start Point Index property
+ ///
+ [JsonProperty(PropertyName = "startPointIndex")]
+ public int? StartPointIndex { get; private set; }
+
+ ///
+ /// Gets end Point Index property
+ ///
+ [JsonProperty(PropertyName = "endPointIndex")]
+ public int? EndPointIndex { get; private set; }
+
+ ///
+ /// Gets section Type property
+ ///
+ [JsonProperty(PropertyName = "sectionType")]
+ public string SectionType { get; private set; }
+
+ ///
+ /// Gets travel Mode property
+ ///
+ [JsonProperty(PropertyName = "travelMode")]
+ public string TravelMode { get; private set; }
+
+ ///
+ /// Gets type of the incident. Can currently be JAM, ROAD_WORK,
+ /// ROAD_CLOSURE, or OTHER. See "tec" for detailed information.
+ ///
+ [JsonProperty(PropertyName = "simpleCategory")]
+ public string SimpleCategory { get; private 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 the magnitude of delay caused by the incident. These values
+ /// correspond to the values of the response field ty of the [Get
+ /// Traffic Incident Detail
+ /// API](https://docs.microsoft.com/rest/api/maps/traffic/gettrafficincidentdetail).
+ /// Possible values include: '0', '1', '2', '3', '4'
+ ///
+ [JsonProperty(PropertyName = "magnitudeOfDelay")]
+ public string MagnitudeOfDelay { get; private set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "tec")]
+ public RouteResultSectionTec Tec { get; set; }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultSectionTec.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultSectionTec.cs
new file mode 100644
index 000000000000..a08eb4586a65
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultSectionTec.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 RouteResultSectionTec
+ {
+ ///
+ /// Initializes a new instance of the RouteResultSectionTec class.
+ ///
+ public RouteResultSectionTec()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultSectionTec 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 RouteResultSectionTec(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/RouteResultSectionTecCause.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultSectionTecCause.cs
new file mode 100644
index 000000000000..b1257aca8c24
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteResultSectionTecCause.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 RouteResultSectionTecCause
+ {
+ ///
+ /// Initializes a new instance of the RouteResultSectionTecCause class.
+ ///
+ public RouteResultSectionTecCause()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RouteResultSectionTecCause 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 RouteResultSectionTecCause(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/RouteType.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/RouteType.cs
new file mode 100644
index 000000000000..25ed0d9a9f11
--- /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 Eco = "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..440867c30125
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/SectionType.cs
@@ -0,0 +1,60 @@
+//
+// 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
+ {
+ ///
+ /// Get sections if the route includes car trains.
+ ///
+ public const string CarTrain = "carTrain";
+ ///
+ /// Countries the route has parts in.
+ ///
+ public const string Country = "country";
+ ///
+ /// Get sections if the route includes ferries.
+ ///
+ public const string Ferry = "ferry";
+ ///
+ /// Get sections if the route includes motorways.
+ ///
+ public const string Motorway = "motorway";
+ ///
+ /// Get sections which are suited for pedestrians.
+ ///
+ public const string Pedestrian = "pedestrian";
+ ///
+ /// Get sections which require a toll to be payed.
+ ///
+ public const string TollRoad = "tollRoad";
+ ///
+ /// Get sections which require a toll vignette to be present.
+ ///
+ public const string TollVignette = "tollVignette";
+ ///
+ /// Get sections which contain traffic information.
+ ///
+ public const string Traffic = "traffic";
+ ///
+ /// Get sections in relation to the request parameter `travelMode`.
+ ///
+ public const string TravelMode = "travelMode";
+ ///
+ /// Get sections if the route includes tunnels.
+ ///
+ public const string Tunnel = "tunnel";
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/Models/TextFormat.cs b/sdk/maps/Azure.Maps.Route/src/Generated/Models/TextFormat.cs
new file mode 100644
index 000000000000..f536ea1424c9
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/Models/TextFormat.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 TextFormat.
+ ///
+ public static class TextFormat
+ {
+ ///
+ /// [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/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..18c3994cc0fb
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/RouteClient.cs
@@ -0,0 +1,233 @@
+//
+// 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;
+
+ ///
+ /// Azure Maps Route REST APIs
+ ///
+ public partial class RouteClient : ServiceClient, IRouteClient
+ {
+ ///
+ /// The base URI of the service.
+ ///
+ internal string 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 XMsClientId { get; set; }
+
+ ///
+ /// This parameter specifies where the Azure Maps Creator resource is located.
+ /// Valid values are us and eu. Possible values include: 'us', 'eu'
+ ///
+ public string Geography { get; set; }
+
+ ///
+ /// Subscription credentials which uniquely identify client subscription.
+ ///
+ public ServiceClientCredentials Credentials { get; private set; }
+
+ ///
+ /// Gets the IRouteOperations.
+ ///
+ public virtual IRouteOperations Route { 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.
+ ///
+ ///
+ /// 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);
+ }
+ }
+
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
+ ///
+ /// Initializes client properties.
+ ///
+ private void Initialize()
+ {
+ Route = new RouteOperations(this);
+ BaseUri = "https://{geography}.atlas.microsoft.com";
+ ApiVersion = "1.0";
+ Geography = "us";
+ 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();
+ }
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Route/src/Generated/RouteOperations.cs b/sdk/maps/Azure.Maps.Route/src/Generated/RouteOperations.cs
new file mode 100644
index 000000000000..c824f8098aae
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/RouteOperations.cs
@@ -0,0 +1,4887 @@
+//
+// 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.IO;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RouteOperations operations.
+ ///
+ public partial class RouteOperations : IServiceOperations, IRouteOperations
+ {
+ ///
+ /// Initializes a new instance of the RouteOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public RouteOperations(RouteClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the RouteClient
+ ///
+ public RouteClient Client { get; private set; }
+
+ ///
+ ///
+ ///
+ /// **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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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', 'eco', '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> PostRouteMatrixWithHttpMessagesAsync(PostRouteMatrixRequestBody postRouteMatrixRequestBody, bool? waitForResults = default(bool?), string computeTravelTimeFor = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (postRouteMatrixRequestBody == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "postRouteMatrixRequestBody");
+ }
+ if (postRouteMatrixRequestBody != null)
+ {
+ postRouteMatrixRequestBody.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("computeTravelTimeFor", computeTravelTimeFor);
+ tracingParameters.Add("sectionType", sectionType);
+ 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("hilliness", hilliness);
+ tracingParameters.Add("travelMode", travelMode);
+ tracingParameters.Add("avoid", avoid);
+ tracingParameters.Add("traffic", traffic);
+ tracingParameters.Add("routeType", routeType);
+ tracingParameters.Add("vehicleLoadType", vehicleLoadType);
+ tracingParameters.Add("postRouteMatrixRequestBody", postRouteMatrixRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "PostRouteMatrix", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/matrix/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (waitForResults != null)
+ {
+ _queryParameters.Add(string.Format("waitForResults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(waitForResults, Client.SerializationSettings).Trim('"'))));
+ }
+ if (computeTravelTimeFor != null)
+ {
+ _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTimeFor)));
+ }
+ if (sectionType != null)
+ {
+ _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(sectionType)));
+ }
+ if (arriveAt != null)
+ {
+ _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(arriveAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (departAt != null)
+ {
+ _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(departAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleAxleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleAxleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleLength != null)
+ {
+ _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleLength, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleHeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleHeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWidth != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWidth, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleMaxSpeed != null)
+ {
+ _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleMaxSpeed, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (windingness != null)
+ {
+ _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness)));
+ }
+ if (hilliness != null)
+ {
+ _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(hilliness)));
+ }
+ 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 (traffic != null)
+ {
+ _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(traffic, Client.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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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(postRouteMatrixRequestBody != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(postRouteMatrixRequestBody, Client.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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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(Client.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 format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (format == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "format");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("format", format);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetRouteMatrix", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/matrix/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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(Client.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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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', 'eco', '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> PostRouteMatrixSyncWithHttpMessagesAsync(PostRouteMatrixRequestBody postRouteMatrixRequestBody, bool? waitForResults = default(bool?), string computeTravelTimeFor = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (postRouteMatrixRequestBody == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "postRouteMatrixRequestBody");
+ }
+ if (postRouteMatrixRequestBody != null)
+ {
+ postRouteMatrixRequestBody.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("computeTravelTimeFor", computeTravelTimeFor);
+ tracingParameters.Add("sectionType", sectionType);
+ 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("hilliness", hilliness);
+ tracingParameters.Add("travelMode", travelMode);
+ tracingParameters.Add("avoid", avoid);
+ tracingParameters.Add("traffic", traffic);
+ tracingParameters.Add("routeType", routeType);
+ tracingParameters.Add("vehicleLoadType", vehicleLoadType);
+ tracingParameters.Add("postRouteMatrixRequestBody", postRouteMatrixRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "PostRouteMatrixSync", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/matrix/sync/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (waitForResults != null)
+ {
+ _queryParameters.Add(string.Format("waitForResults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(waitForResults, Client.SerializationSettings).Trim('"'))));
+ }
+ if (computeTravelTimeFor != null)
+ {
+ _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTimeFor)));
+ }
+ if (sectionType != null)
+ {
+ _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(sectionType)));
+ }
+ if (arriveAt != null)
+ {
+ _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(arriveAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (departAt != null)
+ {
+ _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(departAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleAxleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleAxleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleLength != null)
+ {
+ _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleLength, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleHeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleHeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWidth != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWidth, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleMaxSpeed != null)
+ {
+ _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleMaxSpeed, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (windingness != null)
+ {
+ _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness)));
+ }
+ if (hilliness != null)
+ {
+ _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(hilliness)));
+ }
+ 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 (traffic != null)
+ {
+ _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(traffic, Client.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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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(postRouteMatrixRequestBody != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(postRouteMatrixRequestBody, Client.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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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.
+ ///
+ ///
+ /// 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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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', 'eco', '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 query, 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? computeBestOrder = default(bool?), string routeRepresentation = default(string), string computeTravelTimeFor = default(string), int? vehicleHeading = default(int?), string report = default(string), string sectionType = default(string), int? vehicleAxleWeight = default(int?), double? vehicleWidth = default(double?), double? vehicleHeight = default(double?), double? vehicleLength = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (format == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "format");
+ }
+ if (query == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "query");
+ }
+ 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);
+ }
+ // 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("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("computeBestOrder", computeBestOrder);
+ tracingParameters.Add("routeRepresentation", routeRepresentation);
+ tracingParameters.Add("computeTravelTimeFor", computeTravelTimeFor);
+ tracingParameters.Add("vehicleHeading", vehicleHeading);
+ tracingParameters.Add("report", report);
+ tracingParameters.Add("sectionType", sectionType);
+ 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("vehicleCommercial", vehicleCommercial);
+ tracingParameters.Add("windingness", windingness);
+ tracingParameters.Add("hilliness", hilliness);
+ tracingParameters.Add("travelMode", travelMode);
+ tracingParameters.Add("avoid", avoid);
+ tracingParameters.Add("traffic", traffic);
+ 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("fuelEnergyDensityInMJoulesPerLiter", fuelEnergyDensityInMJoulesPerLiter);
+ 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 = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/directions/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (query != null)
+ {
+ _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query)));
+ }
+ if (maxAlternatives != null)
+ {
+ _queryParameters.Add(string.Format("maxAlternatives={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxAlternatives, Client.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(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(minDeviationDistance, Client.SerializationSettings).Trim('"'))));
+ }
+ if (arriveAt != null)
+ {
+ _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(arriveAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (departAt != null)
+ {
+ _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(departAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (minDeviationTime != null)
+ {
+ _queryParameters.Add(string.Format("minDeviationTime={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(minDeviationTime, Client.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 (computeBestOrder != null)
+ {
+ _queryParameters.Add(string.Format("computeBestOrder={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(computeBestOrder, Client.SerializationSettings).Trim('"'))));
+ }
+ if (routeRepresentation != null)
+ {
+ _queryParameters.Add(string.Format("routeRepresentation={0}", System.Uri.EscapeDataString(routeRepresentation)));
+ }
+ if (computeTravelTimeFor != null)
+ {
+ _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTimeFor)));
+ }
+ if (vehicleHeading != null)
+ {
+ _queryParameters.Add(string.Format("vehicleHeading={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleHeading, Client.SerializationSettings).Trim('"'))));
+ }
+ if (report != null)
+ {
+ _queryParameters.Add(string.Format("report={0}", System.Uri.EscapeDataString(report)));
+ }
+ if (sectionType != null)
+ {
+ _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(sectionType)));
+ }
+ if (vehicleAxleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleAxleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWidth != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWidth, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleHeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleHeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleLength != null)
+ {
+ _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleLength, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleMaxSpeed != null)
+ {
+ _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleMaxSpeed, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleCommercial != null)
+ {
+ _queryParameters.Add(string.Format("vehicleCommercial={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleCommercial, Client.SerializationSettings).Trim('"'))));
+ }
+ if (windingness != null)
+ {
+ _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness)));
+ }
+ if (hilliness != null)
+ {
+ _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(hilliness)));
+ }
+ 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 (traffic != null)
+ {
+ _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(traffic, Client.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(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(constantSpeedConsumptionInLitersPerHundredkm, Client.SerializationSettings).Trim('"'))));
+ }
+ if (currentFuelInLiters != null)
+ {
+ _queryParameters.Add(string.Format("currentFuelInLiters={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(currentFuelInLiters, Client.SerializationSettings).Trim('"'))));
+ }
+ if (auxiliaryPowerInLitersPerHour != null)
+ {
+ _queryParameters.Add(string.Format("auxiliaryPowerInLitersPerHour={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(auxiliaryPowerInLitersPerHour, Client.SerializationSettings).Trim('"'))));
+ }
+ if (fuelEnergyDensityInMJoulesPerLiter != null)
+ {
+ _queryParameters.Add(string.Format("fuelEnergyDensityInMJoulesPerLiter={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(fuelEnergyDensityInMJoulesPerLiter, Client.SerializationSettings).Trim('"'))));
+ }
+ if (accelerationEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("accelerationEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(accelerationEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (decelerationEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("decelerationEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(decelerationEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (uphillEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("uphillEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(uphillEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (downhillEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("downhillEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(downhillEfficiency, Client.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(currentChargeInkWh)));
+ }
+ if (maxChargeInkWh != null)
+ {
+ _queryParameters.Add(string.Format("maxChargeInkWh={0}", System.Uri.EscapeDataString(maxChargeInkWh)));
+ }
+ if (auxiliaryPowerInkW != null)
+ {
+ _queryParameters.Add(string.Format("auxiliaryPowerInkW={0}", System.Uri.EscapeDataString(auxiliaryPowerInkW)));
+ }
+ 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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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. Needs two
+ /// coordinates at least. Delimited by colon. First one is the origin and the
+ /// last is the destination of the route. The coordinates are in a lat,long
+ /// format. Optional coordinates in between act as WayPoints in the route.
+ ///
+ ///
+ /// 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.
+ ///
+ ///
+ /// 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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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', 'eco', '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> PostRouteDirectionsWithHttpMessagesAsync(string format, string query, PostRouteDirectionsRequestBody postRouteDirectionsRequestBody, 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? computeBestOrder = default(bool?), string routeRepresentation = default(string), string computeTravelTimeFor = default(string), int? vehicleHeading = default(int?), string report = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (format == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "format");
+ }
+ if (query == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "query");
+ }
+ 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 (postRouteDirectionsRequestBody == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "postRouteDirectionsRequestBody");
+ }
+ if (postRouteDirectionsRequestBody != null)
+ {
+ postRouteDirectionsRequestBody.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("query", query);
+ 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("computeBestOrder", computeBestOrder);
+ tracingParameters.Add("routeRepresentation", routeRepresentation);
+ tracingParameters.Add("computeTravelTimeFor", computeTravelTimeFor);
+ tracingParameters.Add("vehicleHeading", vehicleHeading);
+ tracingParameters.Add("report", report);
+ tracingParameters.Add("sectionType", sectionType);
+ 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("vehicleCommercial", vehicleCommercial);
+ tracingParameters.Add("windingness", windingness);
+ tracingParameters.Add("hilliness", hilliness);
+ tracingParameters.Add("travelMode", travelMode);
+ tracingParameters.Add("avoid", avoid);
+ tracingParameters.Add("traffic", traffic);
+ 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("fuelEnergyDensityInMJoulesPerLiter", fuelEnergyDensityInMJoulesPerLiter);
+ 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("postRouteDirectionsRequestBody", postRouteDirectionsRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "PostRouteDirections", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/directions/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (query != null)
+ {
+ _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query)));
+ }
+ if (maxAlternatives != null)
+ {
+ _queryParameters.Add(string.Format("maxAlternatives={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxAlternatives, Client.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(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(minDeviationDistance, Client.SerializationSettings).Trim('"'))));
+ }
+ if (minDeviationTime != null)
+ {
+ _queryParameters.Add(string.Format("minDeviationTime={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(minDeviationTime, Client.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 (computeBestOrder != null)
+ {
+ _queryParameters.Add(string.Format("computeBestOrder={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(computeBestOrder, Client.SerializationSettings).Trim('"'))));
+ }
+ if (routeRepresentation != null)
+ {
+ _queryParameters.Add(string.Format("routeRepresentation={0}", System.Uri.EscapeDataString(routeRepresentation)));
+ }
+ if (computeTravelTimeFor != null)
+ {
+ _queryParameters.Add(string.Format("computeTravelTimeFor={0}", System.Uri.EscapeDataString(computeTravelTimeFor)));
+ }
+ if (vehicleHeading != null)
+ {
+ _queryParameters.Add(string.Format("vehicleHeading={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleHeading, Client.SerializationSettings).Trim('"'))));
+ }
+ if (report != null)
+ {
+ _queryParameters.Add(string.Format("report={0}", System.Uri.EscapeDataString(report)));
+ }
+ if (sectionType != null)
+ {
+ _queryParameters.Add(string.Format("sectionType={0}", System.Uri.EscapeDataString(sectionType)));
+ }
+ if (arriveAt != null)
+ {
+ _queryParameters.Add(string.Format("arriveAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(arriveAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (departAt != null)
+ {
+ _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(departAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleAxleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleAxleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleAxleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleLength != null)
+ {
+ _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleLength, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleHeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleHeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWidth != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWidth, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleMaxSpeed != null)
+ {
+ _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleMaxSpeed, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleCommercial != null)
+ {
+ _queryParameters.Add(string.Format("vehicleCommercial={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleCommercial, Client.SerializationSettings).Trim('"'))));
+ }
+ if (windingness != null)
+ {
+ _queryParameters.Add(string.Format("windingness={0}", System.Uri.EscapeDataString(windingness)));
+ }
+ if (hilliness != null)
+ {
+ _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(hilliness)));
+ }
+ 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 (traffic != null)
+ {
+ _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(traffic, Client.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(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(constantSpeedConsumptionInLitersPerHundredkm, Client.SerializationSettings).Trim('"'))));
+ }
+ if (currentFuelInLiters != null)
+ {
+ _queryParameters.Add(string.Format("currentFuelInLiters={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(currentFuelInLiters, Client.SerializationSettings).Trim('"'))));
+ }
+ if (auxiliaryPowerInLitersPerHour != null)
+ {
+ _queryParameters.Add(string.Format("auxiliaryPowerInLitersPerHour={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(auxiliaryPowerInLitersPerHour, Client.SerializationSettings).Trim('"'))));
+ }
+ if (fuelEnergyDensityInMJoulesPerLiter != null)
+ {
+ _queryParameters.Add(string.Format("fuelEnergyDensityInMJoulesPerLiter={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(fuelEnergyDensityInMJoulesPerLiter, Client.SerializationSettings).Trim('"'))));
+ }
+ if (accelerationEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("accelerationEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(accelerationEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (decelerationEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("decelerationEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(decelerationEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (uphillEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("uphillEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(uphillEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (downhillEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("downhillEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(downhillEfficiency, Client.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(currentChargeInkWh)));
+ }
+ if (maxChargeInkWh != null)
+ {
+ _queryParameters.Add(string.Format("maxChargeInkWh={0}", System.Uri.EscapeDataString(maxChargeInkWh)));
+ }
+ if (auxiliaryPowerInkW != null)
+ {
+ _queryParameters.Add(string.Format("auxiliaryPowerInkW={0}", System.Uri.EscapeDataString(auxiliaryPowerInkW)));
+ }
+ 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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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(postRouteDirectionsRequestBody != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(postRouteDirectionsRequestBody, Client.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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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', 'eco', '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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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, string 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? traffic = default(bool?), IList avoid = default(IList), string travelMode = default(string), string hilliness = default(string), string windingness = default(string), int? vehicleAxleWeight = default(int?), double? vehicleWidth = default(double?), double? vehicleHeight = default(double?), double? vehicleLength = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (format == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "format");
+ }
+ if (query == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "query");
+ }
+ // 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("traffic", traffic);
+ tracingParameters.Add("avoid", avoid);
+ tracingParameters.Add("travelMode", travelMode);
+ tracingParameters.Add("hilliness", hilliness);
+ 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("vehicleCommercial", vehicleCommercial);
+ tracingParameters.Add("vehicleLoadType", vehicleLoadType);
+ tracingParameters.Add("vehicleEngineType", vehicleEngineType);
+ tracingParameters.Add("constantSpeedConsumptionInLitersPerHundredkm", constantSpeedConsumptionInLitersPerHundredkm);
+ tracingParameters.Add("currentFuelInLiters", currentFuelInLiters);
+ tracingParameters.Add("auxiliaryPowerInLitersPerHour", auxiliaryPowerInLitersPerHour);
+ tracingParameters.Add("fuelEnergyDensityInMJoulesPerLiter", fuelEnergyDensityInMJoulesPerLiter);
+ 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 = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/range/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (query != null)
+ {
+ _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query)));
+ }
+ if (fuelBudgetInLiters != null)
+ {
+ _queryParameters.Add(string.Format("fuelBudgetInLiters={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(fuelBudgetInLiters, Client.SerializationSettings).Trim('"'))));
+ }
+ if (energyBudgetInkWh != null)
+ {
+ _queryParameters.Add(string.Format("energyBudgetInkWh={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(energyBudgetInkWh, Client.SerializationSettings).Trim('"'))));
+ }
+ if (timeBudgetInSec != null)
+ {
+ _queryParameters.Add(string.Format("timeBudgetInSec={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeBudgetInSec, Client.SerializationSettings).Trim('"'))));
+ }
+ if (distanceBudgetInMeters != null)
+ {
+ _queryParameters.Add(string.Format("distanceBudgetInMeters={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(distanceBudgetInMeters, Client.SerializationSettings).Trim('"'))));
+ }
+ if (departAt != null)
+ {
+ _queryParameters.Add(string.Format("departAt={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(departAt, Client.SerializationSettings).Trim('"'))));
+ }
+ if (routeType != null)
+ {
+ _queryParameters.Add(string.Format("routeType={0}", System.Uri.EscapeDataString(routeType)));
+ }
+ if (traffic != null)
+ {
+ _queryParameters.Add(string.Format("traffic={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(traffic, Client.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 (hilliness != null)
+ {
+ _queryParameters.Add(string.Format("hilliness={0}", System.Uri.EscapeDataString(hilliness)));
+ }
+ 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(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleAxleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWidth != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWidth={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWidth, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleHeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleHeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleHeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleLength != null)
+ {
+ _queryParameters.Add(string.Format("vehicleLength={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleLength, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleMaxSpeed != null)
+ {
+ _queryParameters.Add(string.Format("vehicleMaxSpeed={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleMaxSpeed, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleWeight != null)
+ {
+ _queryParameters.Add(string.Format("vehicleWeight={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleWeight, Client.SerializationSettings).Trim('"'))));
+ }
+ if (vehicleCommercial != null)
+ {
+ _queryParameters.Add(string.Format("vehicleCommercial={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vehicleCommercial, Client.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(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(constantSpeedConsumptionInLitersPerHundredkm, Client.SerializationSettings).Trim('"'))));
+ }
+ if (currentFuelInLiters != null)
+ {
+ _queryParameters.Add(string.Format("currentFuelInLiters={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(currentFuelInLiters, Client.SerializationSettings).Trim('"'))));
+ }
+ if (auxiliaryPowerInLitersPerHour != null)
+ {
+ _queryParameters.Add(string.Format("auxiliaryPowerInLitersPerHour={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(auxiliaryPowerInLitersPerHour, Client.SerializationSettings).Trim('"'))));
+ }
+ if (fuelEnergyDensityInMJoulesPerLiter != null)
+ {
+ _queryParameters.Add(string.Format("fuelEnergyDensityInMJoulesPerLiter={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(fuelEnergyDensityInMJoulesPerLiter, Client.SerializationSettings).Trim('"'))));
+ }
+ if (accelerationEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("accelerationEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(accelerationEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (decelerationEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("decelerationEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(decelerationEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (uphillEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("uphillEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(uphillEfficiency, Client.SerializationSettings).Trim('"'))));
+ }
+ if (downhillEfficiency != null)
+ {
+ _queryParameters.Add(string.Format("downhillEfficiency={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(downhillEfficiency, Client.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(currentChargeInkWh)));
+ }
+ if (maxChargeInkWh != null)
+ {
+ _queryParameters.Add(string.Format("maxChargeInkWh={0}", System.Uri.EscapeDataString(maxChargeInkWh)));
+ }
+ if (auxiliaryPowerInkW != null)
+ {
+ _queryParameters.Add(string.Format("auxiliaryPowerInkW={0}", System.Uri.EscapeDataString(auxiliaryPowerInkW)));
+ }
+ 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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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/en-us/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}
+ /// ```
+ /// ### 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/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/en-us/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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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> PostRouteDirectionsBatchWithHttpMessagesAsync(BatchRequestBody postRouteDirectionsBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (postRouteDirectionsBatchRequestBody == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "postRouteDirectionsBatchRequestBody");
+ }
+ 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("postRouteDirectionsBatchRequestBody", postRouteDirectionsBatchRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "PostRouteDirectionsBatch", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/directions/batch/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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(postRouteDirectionsBatchRequestBody != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(postRouteDirectionsBatchRequestBody, Client.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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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(Client.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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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 format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (format == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "format");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("format", format);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetRouteDirectionsBatch", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/directions/batch/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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(Client.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/en-us/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}
+ /// ```
+ /// ### 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/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/en-us/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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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> PostRouteDirectionsBatchSyncWithHttpMessagesAsync(BatchRequestBody postRouteDirectionsBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (postRouteDirectionsBatchRequestBody == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "postRouteDirectionsBatchRequestBody");
+ }
+ 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("postRouteDirectionsBatchRequestBody", postRouteDirectionsBatchRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "PostRouteDirectionsBatchSync", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "route/directions/batch/sync/{format}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{format}", System.Uri.EscapeDataString(format));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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(postRouteDirectionsBatchRequestBody != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(postRouteDirectionsBatchRequestBody, Client.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 (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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/RouteOperationsExtensions.cs b/sdk/maps/Azure.Maps.Route/src/Generated/RouteOperationsExtensions.cs
new file mode 100644
index 000000000000..1ca34e8dba2b
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/RouteOperationsExtensions.cs
@@ -0,0 +1,2470 @@
+//
+// 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 RouteOperations.
+ ///
+ public static partial class RouteOperationsExtensions
+ {
+ ///
+ ///
+ ///
+ /// **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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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', 'eco', '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 PostRouteMatrixAsync(this IRouteOperations operations, PostRouteMatrixRequestBody postRouteMatrixRequestBody, bool? waitForResults = default(bool?), string computeTravelTimeFor = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PostRouteMatrixWithHttpMessagesAsync(postRouteMatrixRequestBody, waitForResults, computeTravelTimeFor, sectionType, arriveAt, departAt, vehicleAxleWeight, vehicleLength, vehicleHeight, vehicleWidth, vehicleMaxSpeed, vehicleWeight, windingness, hilliness, travelMode, avoid, traffic, 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 IRouteOperations operations, string format, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetRouteMatrixWithHttpMessagesAsync(format, 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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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', 'eco', '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 PostRouteMatrixSyncAsync(this IRouteOperations operations, PostRouteMatrixRequestBody postRouteMatrixRequestBody, bool? waitForResults = default(bool?), string computeTravelTimeFor = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PostRouteMatrixSyncWithHttpMessagesAsync(postRouteMatrixRequestBody, waitForResults, computeTravelTimeFor, sectionType, arriveAt, departAt, vehicleAxleWeight, vehicleLength, vehicleHeight, vehicleWidth, vehicleMaxSpeed, vehicleWeight, windingness, hilliness, travelMode, avoid, traffic, 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.
+ ///
+ ///
+ /// 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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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', 'eco', '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 IRouteOperations operations, string format, string query, 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? computeBestOrder = default(bool?), string routeRepresentation = default(string), string computeTravelTimeFor = default(string), int? vehicleHeading = default(int?), string report = default(string), string sectionType = default(string), int? vehicleAxleWeight = default(int?), double? vehicleWidth = default(double?), double? vehicleHeight = default(double?), double? vehicleLength = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetRouteDirectionsWithHttpMessagesAsync(format, query, maxAlternatives, alternativeType, minDeviationDistance, arriveAt, departAt, minDeviationTime, instructionsType, language, computeBestOrder, routeRepresentation, computeTravelTimeFor, vehicleHeading, report, sectionType, vehicleAxleWeight, vehicleWidth, vehicleHeight, vehicleLength, vehicleMaxSpeed, vehicleWeight, vehicleCommercial, windingness, hilliness, travelMode, avoid, traffic, routeType, vehicleLoadType, vehicleEngineType, constantSpeedConsumptionInLitersPerHundredkm, currentFuelInLiters, auxiliaryPowerInLitersPerHour, fuelEnergyDensityInMJoulesPerLiter, 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. Needs two
+ /// coordinates at least. Delimited by colon. First one is the origin and the
+ /// last is the destination of the route. The coordinates are in a lat,long
+ /// format. Optional coordinates in between act as WayPoints in the route.
+ ///
+ ///
+ /// 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.
+ ///
+ ///
+ /// 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: 'carTrain', 'country',
+ /// 'ferry', 'motorway', 'pedestrian', 'tollRoad', 'tollVignette', 'traffic',
+ /// 'travelMode', 'tunnel'
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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', 'eco', '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 PostRouteDirectionsAsync(this IRouteOperations operations, string format, string query, PostRouteDirectionsRequestBody postRouteDirectionsRequestBody, 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? computeBestOrder = default(bool?), string routeRepresentation = default(string), string computeTravelTimeFor = default(string), int? vehicleHeading = default(int?), string report = default(string), string sectionType = default(string), System.DateTime? arriveAt = default(System.DateTime?), System.DateTime? departAt = default(System.DateTime?), int? vehicleAxleWeight = default(int?), double? vehicleLength = default(double?), double? vehicleHeight = default(double?), double? vehicleWidth = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string windingness = default(string), string hilliness = default(string), string travelMode = default(string), IList avoid = default(IList), bool? traffic = default(bool?), string routeType = default(string), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PostRouteDirectionsWithHttpMessagesAsync(format, query, postRouteDirectionsRequestBody, maxAlternatives, alternativeType, minDeviationDistance, minDeviationTime, instructionsType, language, computeBestOrder, routeRepresentation, computeTravelTimeFor, vehicleHeading, report, sectionType, arriveAt, departAt, vehicleAxleWeight, vehicleLength, vehicleHeight, vehicleWidth, vehicleMaxSpeed, vehicleWeight, vehicleCommercial, windingness, hilliness, travelMode, avoid, traffic, routeType, vehicleLoadType, vehicleEngineType, constantSpeedConsumptionInLitersPerHundredkm, currentFuelInLiters, auxiliaryPowerInLitersPerHour, fuelEnergyDensityInMJoulesPerLiter, 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', 'eco', '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
+ ///
+ ///
+ /// Vehicle is used for commercial purposes and thus 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 IRouteOperations operations, string format, string 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? traffic = default(bool?), IList avoid = default(IList), string travelMode = default(string), string hilliness = default(string), string windingness = default(string), int? vehicleAxleWeight = default(int?), double? vehicleWidth = default(double?), double? vehicleHeight = default(double?), double? vehicleLength = default(double?), int? vehicleMaxSpeed = default(int?), int? vehicleWeight = default(int?), bool? vehicleCommercial = default(bool?), string vehicleLoadType = default(string), string vehicleEngineType = default(string), double? constantSpeedConsumptionInLitersPerHundredkm = default(double?), double? currentFuelInLiters = default(double?), double? auxiliaryPowerInLitersPerHour = default(double?), double? fuelEnergyDensityInMJoulesPerLiter = default(double?), double? accelerationEfficiency = default(double?), double? decelerationEfficiency = default(double?), double? uphillEfficiency = default(double?), double? downhillEfficiency = default(double?), string constantSpeedConsumptionInkWhPerHundredkm = default(string), string currentChargeInkWh = default(string), string maxChargeInkWh = default(string), string auxiliaryPowerInkW = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetRouteRangeWithHttpMessagesAsync(format, query, fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, distanceBudgetInMeters, departAt, routeType, traffic, avoid, travelMode, hilliness, windingness, vehicleAxleWeight, vehicleWidth, vehicleHeight, vehicleLength, vehicleMaxSpeed, vehicleWeight, vehicleCommercial, vehicleLoadType, vehicleEngineType, constantSpeedConsumptionInLitersPerHundredkm, currentFuelInLiters, auxiliaryPowerInLitersPerHour, fuelEnergyDensityInMJoulesPerLiter, 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/en-us/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}
+ /// ```
+ /// ### 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/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/en-us/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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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 PostRouteDirectionsBatchAsync(this IRouteOperations operations, BatchRequestBody postRouteDirectionsBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PostRouteDirectionsBatchWithHttpMessagesAsync(postRouteDirectionsBatchRequestBody, 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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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 IRouteOperations operations, string format, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetRouteDirectionsBatchWithHttpMessagesAsync(format, 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/en-us/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}
+ /// ```
+ /// ### 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/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/en-us/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/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:
+ ///
+ /// -
+ /// [`RouteDirectionsResponse`](https://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse)
+ /// - 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 PostRouteDirectionsBatchSyncAsync(this IRouteOperations operations, BatchRequestBody postRouteDirectionsBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PostRouteDirectionsBatchSyncWithHttpMessagesAsync(postRouteDirectionsBatchRequestBody, 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..1ef816b1f9e1
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Route/src/Generated/SdkInfo_RouteClient.cs
@@ -0,0 +1,27 @@
+
+//
+// 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", "Route", "1.0"),
+ }.AsEnumerable();
+ }
+ }
+ }
+}