28 строки
757 B
TypeScript
28 строки
757 B
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
/**
|
|
* @summary router job crud
|
|
*/
|
|
import JobRouter, {
|
|
AzureCommunicationRoutingServiceClient
|
|
} from "@azure-rest/communication-job-router";
|
|
import * as dotenv from "dotenv";
|
|
dotenv.config();
|
|
|
|
const connectionString = process.env["COMMUNICATION_CONNECTION_STRING"] || "";
|
|
|
|
// Delete router job
|
|
async function deleteRouterJob(): Promise<void> {
|
|
// Create the Router Client
|
|
const routerClient: AzureCommunicationRoutingServiceClient =
|
|
JobRouter(connectionString);
|
|
|
|
const entityId = "router-job-123";
|
|
|
|
const result = await routerClient.path("/routing/jobs/{jobId}", entityId).delete();
|
|
|
|
console.log("router job: " + result);
|
|
}
|
|
|
|
deleteRouterJob().catch(console.error);
|