Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sdk/maps/maps-route-rest/samples-dev/directions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to calculate routes.
* @summary Demonstrates the use of a MapsRoute to calculate routes.
*/

import { AzureKeyCredential } from "@azure/core-auth";
Expand Down Expand Up @@ -37,7 +37,7 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

/**
* Should provide at least two coordinates, origin and destination to the query.
Expand All @@ -56,11 +56,11 @@ async function main() {
/**
* Could also provide additional conditions to the query.
*/
vehicleWidthInMeters: 2,
vehicleHeightInMeters: 2,
vehicleWidth: 2,
vehicleHeight: 2,
vehicleLoadType: "USHazmatClass1",
travelMode: "truck",
isCommercialVehicle: true,
vehicleCommercial: true,
},
});

Expand Down
2 changes: 1 addition & 1 deletion sdk/maps/maps-route-rest/samples-dev/lro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function main() {
/** Or use Azure AD authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = new MapsRouteClient(credential, mapsClientId);
// const client = new MapsRoute(credential, mapsClientId);

const request = createRouteDirectionsBatchRequest([
{
Expand Down
10 changes: 5 additions & 5 deletions sdk/maps/maps-route-rest/samples-dev/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to retrieve a setting value.
* @summary Demonstrates the use of a MapsRoute to retrieve a setting value.
*/

import { AzureKeyCredential } from "@azure/core-auth";
Expand Down Expand Up @@ -32,19 +32,19 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

/**
* Calculate route matrix in synchronous way.
* For asynchronous way, please refer to the sample in lro.ts and resumeLro.ts
*/
const routeMatrixResult = await client.path("/route/matrix/sync/{format}", "json").post({
queryParameters: {
vehicleWidthInMeters: 2,
vehicleHeightInMeters: 2,
vehicleWidth: 2,
vehicleHeight: 2,
vehicleLoadType: "USHazmatClass1",
travelMode: "truck",
isCommercialVehicle: true,
vehicleCommercial: true,
},
body: {
origins: {
Expand Down
4 changes: 2 additions & 2 deletions sdk/maps/maps-route-rest/samples-dev/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to retrieve a route range.
* @summary Demonstrates the use of a MapsRoute to retrieve a route range.
*/

import { AzureKeyCredential } from "@azure/core-auth";
Expand Down Expand Up @@ -32,7 +32,7 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

const routeRangeResult = await client
.path("/route/range/{format}", "json")
Expand Down
2 changes: 1 addition & 1 deletion sdk/maps/maps-route-rest/samples-dev/resumeLro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function main() {
/** Or use Azure AD authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = new MapsRouteClient(credential, mapsClientId);
// const client = new MapsRoute(credential, mapsClientId);

const request = createRouteDirectionsBatchRequest([
{
Expand Down
14 changes: 7 additions & 7 deletions sdk/maps/maps-route-rest/samples/v1-beta/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ urlFragment: maps-route-javascript-beta

These sample programs show how to use the JavaScript client libraries for Azure Maps Route in some common scenarios.

| **File Name** | **Description** |
| --------------------------- | ---------------------------------------------------------------------- |
| [directions.js][directions] | Demonstrates the use of a MapsRouteClient to calculate routes. |
| [lro.js][lro] | Demonstrates how to manipulate a long running request. |
| [matrix.js][matrix] | Demonstrates the use of a MapsRouteClient to retrieve a setting value. |
| [range.js][range] | Demonstrates the use of a MapsRouteClient to retrieve a route range. |
| [resumeLro.js][resumelro] | Demonstrates how to resume a long running request. |
| **File Name** | **Description** |
| --------------------------- | ---------------------------------------------------------------- |
| [directions.js][directions] | Demonstrates the use of a MapsRoute to calculate routes. |
| [lro.js][lro] | Demonstrates how to manipulate a long running request. |
| [matrix.js][matrix] | Demonstrates the use of a MapsRoute to retrieve a setting value. |
| [range.js][range] | Demonstrates the use of a MapsRoute to retrieve a route range. |
| [resumeLro.js][resumelro] | Demonstrates how to resume a long running request. |

## Prerequisites

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to calculate routes.
* @summary Demonstrates the use of a MapsRoute to calculate routes.
*/

const { AzureKeyCredential } = require("@azure/core-auth");
Expand Down Expand Up @@ -36,7 +36,7 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

/**
* Should provide at least two coordinates, origin and destination to the query.
Expand All @@ -55,11 +55,11 @@ async function main() {
/**
* Could also provide additional conditions to the query.
*/
vehicleWidthInMeters: 2,
vehicleHeightInMeters: 2,
vehicleWidth: 2,
vehicleHeight: 2,
vehicleLoadType: "USHazmatClass1",
travelMode: "truck",
isCommercialVehicle: true,
vehicleCommercial: true,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function main() {
/** Or use Azure AD authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = new MapsRouteClient(credential, mapsClientId);
// const client = new MapsRoute(credential, mapsClientId);

const request = createRouteDirectionsBatchRequest([
{
Expand Down
10 changes: 5 additions & 5 deletions sdk/maps/maps-route-rest/samples/v1-beta/javascript/matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to retrieve a setting value.
* @summary Demonstrates the use of a MapsRoute to retrieve a setting value.
*/

const { AzureKeyCredential } = require("@azure/core-auth");
Expand Down Expand Up @@ -32,19 +32,19 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

/**
* Calculate route matrix in synchronous way.
* For asynchronous way, please refer to the sample in lro.ts and resumeLro.ts
*/
const routeMatrixResult = await client.path("/route/matrix/sync/{format}", "json").post({
queryParameters: {
vehicleWidthInMeters: 2,
vehicleHeightInMeters: 2,
vehicleWidth: 2,
vehicleHeight: 2,
vehicleLoadType: "USHazmatClass1",
travelMode: "truck",
isCommercialVehicle: true,
vehicleCommercial: true,
},
body: {
origins: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to retrieve a route range.
* @summary Demonstrates the use of a MapsRoute to retrieve a route range.
*/

const { AzureKeyCredential } = require("@azure/core-auth");
Expand Down Expand Up @@ -32,7 +32,7 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

const routeRangeResult = await client
.path("/route/range/{format}", "json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function main() {
/** Or use Azure AD authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = new MapsRouteClient(credential, mapsClientId);
// const client = new MapsRoute(credential, mapsClientId);

const request = createRouteDirectionsBatchRequest([
{
Expand Down
14 changes: 7 additions & 7 deletions sdk/maps/maps-route-rest/samples/v1-beta/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ urlFragment: maps-route-typescript-beta

These sample programs show how to use the TypeScript client libraries for Azure Maps Route in some common scenarios.

| **File Name** | **Description** |
| --------------------------- | ---------------------------------------------------------------------- |
| [directions.ts][directions] | Demonstrates the use of a MapsRouteClient to calculate routes. |
| [lro.ts][lro] | Demonstrates how to manipulate a long running request. |
| [matrix.ts][matrix] | Demonstrates the use of a MapsRouteClient to retrieve a setting value. |
| [range.ts][range] | Demonstrates the use of a MapsRouteClient to retrieve a route range. |
| [resumeLro.ts][resumelro] | Demonstrates how to resume a long running request. |
| **File Name** | **Description** |
| --------------------------- | ---------------------------------------------------------------- |
| [directions.ts][directions] | Demonstrates the use of a MapsRoute to calculate routes. |
| [lro.ts][lro] | Demonstrates how to manipulate a long running request. |
| [matrix.ts][matrix] | Demonstrates the use of a MapsRoute to retrieve a setting value. |
| [range.ts][range] | Demonstrates the use of a MapsRoute to retrieve a route range. |
| [resumeLro.ts][resumelro] | Demonstrates how to resume a long running request. |

## Prerequisites

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to calculate routes.
* @summary Demonstrates the use of a MapsRoute to calculate routes.
*/

import { AzureKeyCredential } from "@azure/core-auth";
Expand Down Expand Up @@ -37,7 +37,7 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

/**
* Should provide at least two coordinates, origin and destination to the query.
Expand All @@ -56,11 +56,11 @@ async function main() {
/**
* Could also provide additional conditions to the query.
*/
vehicleWidthInMeters: 2,
vehicleHeightInMeters: 2,
vehicleWidth: 2,
vehicleHeight: 2,
vehicleLoadType: "USHazmatClass1",
travelMode: "truck",
isCommercialVehicle: true,
vehicleCommercial: true,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function main() {
/** Or use Azure AD authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = new MapsRouteClient(credential, mapsClientId);
// const client = new MapsRoute(credential, mapsClientId);

const request = createRouteDirectionsBatchRequest([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to retrieve a setting value.
* @summary Demonstrates the use of a MapsRoute to retrieve a setting value.
*/

import { AzureKeyCredential } from "@azure/core-auth";
Expand Down Expand Up @@ -32,19 +32,19 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

/**
* Calculate route matrix in synchronous way.
* For asynchronous way, please refer to the sample in lro.ts and resumeLro.ts
*/
const routeMatrixResult = await client.path("/route/matrix/sync/{format}", "json").post({
queryParameters: {
vehicleWidthInMeters: 2,
vehicleHeightInMeters: 2,
vehicleWidth: 2,
vehicleHeight: 2,
vehicleLoadType: "USHazmatClass1",
travelMode: "truck",
isCommercialVehicle: true,
vehicleCommercial: true,
},
body: {
origins: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* @summary Demonstrates the use of a MapsRouteClient to retrieve a route range.
* @summary Demonstrates the use of a MapsRoute to retrieve a route range.
*/

import { AzureKeyCredential } from "@azure/core-auth";
Expand Down Expand Up @@ -32,7 +32,7 @@ async function main() {
/** Azure Active Directory (Azure AD) authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = createMapsRouteClient(credential, mapsClientId);
// const client = MapsRoute(credential, mapsClientId);

const routeRangeResult = await client
.path("/route/range/{format}", "json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function main() {
/** Or use Azure AD authentication */
// const credential = new DefaultAzureCredential();
// const mapsClientId = process.env.MAPS_CLIENT_ID || "";
// const client = new MapsRouteClient(credential, mapsClientId);
// const client = new MapsRoute(credential, mapsClientId);

const request = createRouteDirectionsBatchRequest([
{
Expand Down
10 changes: 5 additions & 5 deletions sdk/maps/maps-route-rest/src/mapsRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
*
* @example
* ```ts
* import { createMapsRouteClient } from "@azure-rest/maps-route";
* import MapsRoute from "@azure-rest/maps-route";
* import { AzureKeyCredential } from "@azure/core-auth";
*
* const credential = new AzureKeyCredential("<subscription-key>");
* const client = createMapsRouteClient(credential);
* const client = MapsRoute(credential);
*```
*
* @param credential - An AzureKeyCredential instance used to authenticate requests to the service
Expand All @@ -28,15 +28,15 @@ export default function MapsRoute(
options?: ClientOptions
): MapsRouteClient;
/**
* Creates an instance of MapsRouteClient from an Azure Identity `TokenCredential`.
* Creates an instance of MapsRoute from an Azure Identity `TokenCredential`.
*
* @example
* ```ts
* import { MapsRouteClient } from "@azure/maps-route";
* import MapsRoute from "@azure/maps-route";
* import { DefaultAzureCredential } from "@azure/identity";
*
* const credential = new DefaultAzureCredential();
* const client = createMapsRouteClient(credential, "<maps-account-client-id>");
* const client = MapsRoute(credential, "<maps-account-client-id>");
*```
*
* @param credential - An TokenCredential instance used to authenticate requests to the service
Expand Down