From 7e39740836130de3def066cc2bd3cfd2c4241757 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Nov 2023 19:39:39 +0000 Subject: [PATCH] CodeGen from PR 26668 in Azure/azure-rest-api-specs Merge 2f475ea686491039141d7698ac86e9d033492a48 into d6d9527c628f09bc81fb1b01d938872e1a681a2d --- .../api-extractor.json | 25 +- .../package.json | 2 +- .../review/communication-job-router.api.md | 83 ++--- .../azureCommunicationRoutingServiceClient.ts | 67 +--- .../src/clientDefinitions.ts | 79 ++-- .../src/isUnexpected.ts | 69 +++- .../src/models.ts | 326 +++++++++-------- .../src/outputModels.ts | 342 +++++++++--------- .../src/paginateHelper.ts | 33 +- .../src/parameters.ts | 35 +- .../src/responses.ts | 9 +- .../tsconfig.json | 12 +- .../tsp-location.yaml | 10 +- 13 files changed, 595 insertions(+), 497 deletions(-) diff --git a/sdk/communication/communication-job-router-rest/api-extractor.json b/sdk/communication/communication-job-router-rest/api-extractor.json index 5ff7f4621cde..5e2ff3bfe2a0 100644 --- a/sdk/communication/communication-job-router-rest/api-extractor.json +++ b/sdk/communication/communication-job-router-rest/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./types/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/communication-job-router.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/communication/communication-job-router-rest/package.json b/sdk/communication/communication-job-router-rest/package.json index bdb2e6a3d446..c044020272ba 100644 --- a/sdk/communication/communication-job-router-rest/package.json +++ b/sdk/communication/communication-job-router-rest/package.json @@ -123,4 +123,4 @@ "azure-communication-services" ] } -} +} \ No newline at end of file diff --git a/sdk/communication/communication-job-router-rest/review/communication-job-router.api.md b/sdk/communication/communication-job-router-rest/review/communication-job-router.api.md index 33580971f2f3..b5413c5c728f 100644 --- a/sdk/communication/communication-job-router-rest/review/communication-job-router.api.md +++ b/sdk/communication/communication-job-router-rest/review/communication-job-router.api.md @@ -8,7 +8,6 @@ import { Client } from '@azure-rest/core-client'; import { ClientOptions } from '@azure-rest/core-client'; import { ErrorResponse } from '@azure-rest/core-client'; import { HttpResponse } from '@azure-rest/core-client'; -import { KeyCredential } from '@azure/core-auth'; import { Paged } from '@azure/core-paging'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PathUncheckedResponse } from '@azure-rest/core-client'; @@ -16,7 +15,6 @@ import { RawHttpHeaders } from '@azure/core-rest-pipeline'; import { RawHttpHeadersInput } from '@azure/core-rest-pipeline'; import { RequestParameters } from '@azure-rest/core-client'; import { StreamableMethod } from '@azure-rest/core-client'; -import { TokenCredential } from '@azure/core-auth'; // @public (undocumented) export interface Accept { @@ -63,14 +61,14 @@ export type AzureCommunicationRoutingServiceClient = Client & { // @public export interface BestWorkerMode extends DistributionModeParent { - kind: "best-worker"; + kind: "bestWorker"; scoringRule?: RouterRule; scoringRuleOptions?: ScoringRuleOptions; } // @public export interface BestWorkerModeOutput extends DistributionModeOutputParent { - kind: "best-worker"; + kind: "bestWorker"; scoringRule?: RouterRuleOutput; scoringRuleOptions?: ScoringRuleOptionsOutput; } @@ -279,10 +277,7 @@ export interface ConditionalWorkerSelectorAttachmentOutput extends WorkerSelecto } // @public -function createClient(connectionStringOrUrl: string, options: ClientOptions): AzureCommunicationRoutingServiceClient; - -// @public -function createClient(endpoint: string, credentialOrOptions?: KeyCredential | TokenCredential, options?: ClientOptions): AzureCommunicationRoutingServiceClient; +function createClient(endpoint: string, options?: ClientOptions): AzureCommunicationRoutingServiceClient; export default createClient; // @public (undocumented) @@ -476,12 +471,12 @@ export type DeleteWorkerParameters = RequestParameters; // @public export interface DirectMapRouterRule extends RouterRuleParent { - kind: "direct-map-rule"; + kind: "directMap"; } // @public export interface DirectMapRouterRuleOutput extends RouterRuleOutputParent { - kind: "direct-map-rule"; + kind: "directMap"; } // @public @@ -599,14 +594,14 @@ export interface ExceptionTriggerParent { // @public export interface ExpressionRouterRule extends RouterRuleParent { expression: string; - kind: "expression-rule"; + kind: "expression"; language?: string; } // @public export interface ExpressionRouterRuleOutput extends RouterRuleOutputParent { expression: string; - kind: "expression-rule"; + kind: "expression"; language?: string; } @@ -614,7 +609,7 @@ export interface ExpressionRouterRuleOutput extends RouterRuleOutputParent { export interface FunctionRouterRule extends RouterRuleParent { credential?: FunctionRouterRuleCredential; functionUri: string; - kind: "azure-function-rule"; + kind: "function"; } // @public @@ -635,7 +630,7 @@ export interface FunctionRouterRuleCredentialOutput { export interface FunctionRouterRuleOutput extends RouterRuleOutputParent { credential?: FunctionRouterRuleCredentialOutput; functionUri: string; - kind: "azure-function-rule"; + kind: "function"; } // @public @@ -1294,17 +1289,17 @@ export interface ListWorkersQueryParamProperties { // @public export interface LongestIdleMode extends DistributionModeParent { - kind: "longest-idle"; + kind: "longestIdle"; } // @public export interface LongestIdleModeOutput extends DistributionModeOutputParent { - kind: "longest-idle"; + kind: "longestIdle"; } // @public export interface ManualReclassifyExceptionAction extends ExceptionActionParent { - kind: "manual-reclassify"; + kind: "manualReclassify"; priority?: number; queueId?: string; workerSelectors?: Array; @@ -1312,7 +1307,7 @@ export interface ManualReclassifyExceptionAction extends ExceptionActionParent { // @public export interface ManualReclassifyExceptionActionOutput extends ExceptionActionOutputParent { - kind: "manual-reclassify"; + kind: "manualReclassify"; priority?: number; queueId?: string; workerSelectors?: Array; @@ -1366,14 +1361,14 @@ export interface PagingOptions { // @public export interface PassThroughQueueSelectorAttachment extends QueueSelectorAttachmentParent { key: string; - kind: "pass-through"; + kind: "passThrough"; labelOperator: string; } // @public export interface PassThroughQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { key: string; - kind: "pass-through"; + kind: "passThrough"; labelOperator: string; } @@ -1381,7 +1376,7 @@ export interface PassThroughQueueSelectorAttachmentOutput extends QueueSelectorA export interface PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { expiresAfterSeconds?: number; key: string; - kind: "pass-through"; + kind: "passThrough"; labelOperator: string; } @@ -1389,29 +1384,29 @@ export interface PassThroughWorkerSelectorAttachment extends WorkerSelectorAttac export interface PassThroughWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { expiresAfterSeconds?: number; key: string; - kind: "pass-through"; + kind: "passThrough"; labelOperator: string; } // @public export interface QueueAndMatchMode extends JobMatchingModeParent { - kind: "queue-and-match"; + kind: "queueAndMatch"; } // @public export interface QueueAndMatchModeOutput extends JobMatchingModeOutputParent { - kind: "queue-and-match"; + kind: "queueAndMatch"; } // @public export interface QueueLengthExceptionTrigger extends ExceptionTriggerParent { - kind: "queue-length"; + kind: "queueLength"; threshold: number; } // @public export interface QueueLengthExceptionTriggerOutput extends ExceptionTriggerOutputParent { - kind: "queue-length"; + kind: "queueLength"; threshold: number; } @@ -1505,12 +1500,12 @@ export type ReclassifyParameters = ReclassifyBodyParam & RequestParameters; // @public export interface RoundRobinMode extends DistributionModeParent { - kind: "round-robin"; + kind: "roundRobin"; } // @public export interface RoundRobinModeOutput extends DistributionModeOutputParent { - kind: "round-robin"; + kind: "roundRobin"; } // @public @@ -1779,37 +1774,37 @@ export interface Routes { // @public export interface RuleEngineQueueSelectorAttachment extends QueueSelectorAttachmentParent { - kind: "rule-engine"; + kind: "ruleEngine"; rule: RouterRule; } // @public export interface RuleEngineQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { - kind: "rule-engine"; + kind: "ruleEngine"; rule: RouterRuleOutput; } // @public export interface RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { - kind: "rule-engine"; + kind: "ruleEngine"; rule: RouterRule; } // @public export interface RuleEngineWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { - kind: "rule-engine"; + kind: "ruleEngine"; rule: RouterRuleOutput; } // @public export interface ScheduleAndSuspendMode extends JobMatchingModeParent { - kind: "schedule-and-suspend"; + kind: "scheduleAndSuspend"; scheduleAt: Date | string; } // @public export interface ScheduleAndSuspendModeOutput extends JobMatchingModeOutputParent { - kind: "schedule-and-suspend"; + kind: "scheduleAndSuspend"; scheduleAt: string; } @@ -1843,13 +1838,13 @@ export interface StaticQueueSelectorAttachmentOutput extends QueueSelectorAttach // @public export interface StaticRouterRule extends RouterRuleParent { - kind: "static-rule"; + kind: "static"; value?: unknown; } // @public export interface StaticRouterRuleOutput extends RouterRuleOutputParent { - kind: "static-rule"; + kind: "static"; value?: any; } @@ -2398,13 +2393,13 @@ export type UpsertWorkerParameters = UpsertWorkerHeaderParam & UpsertWorkerMedia // @public export interface WaitTimeExceptionTrigger extends ExceptionTriggerParent { - kind: "wait-time"; + kind: "waitTime"; thresholdSeconds: number; } // @public export interface WaitTimeExceptionTriggerOutput extends ExceptionTriggerOutputParent { - kind: "wait-time"; + kind: "waitTime"; thresholdSeconds: number; } @@ -2412,7 +2407,7 @@ export interface WaitTimeExceptionTriggerOutput extends ExceptionTriggerOutputPa export interface WebhookRouterRule extends RouterRuleParent { authorizationServerUri?: string; clientCredential?: OAuth2WebhookClientCredential; - kind: "webhook-rule"; + kind: "webhook"; webhookUri?: string; } @@ -2420,32 +2415,32 @@ export interface WebhookRouterRule extends RouterRuleParent { export interface WebhookRouterRuleOutput extends RouterRuleOutputParent { authorizationServerUri?: string; clientCredential?: OAuth2WebhookClientCredentialOutput; - kind: "webhook-rule"; + kind: "webhook"; webhookUri?: string; } // @public export interface WeightedAllocationQueueSelectorAttachment extends QueueSelectorAttachmentParent { allocations: Array; - kind: "weighted-allocation-queue-selector"; + kind: "weightedAllocation"; } // @public export interface WeightedAllocationQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { allocations: Array; - kind: "weighted-allocation-queue-selector"; + kind: "weightedAllocation"; } // @public export interface WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { allocations: Array; - kind: "weighted-allocation-worker-selector"; + kind: "weightedAllocation"; } // @public export interface WeightedAllocationWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { allocations: Array; - kind: "weighted-allocation-worker-selector"; + kind: "weightedAllocation"; } // @public diff --git a/sdk/communication/communication-job-router-rest/src/azureCommunicationRoutingServiceClient.ts b/sdk/communication/communication-job-router-rest/src/azureCommunicationRoutingServiceClient.ts index 6c2e526af107..4e9b85122be3 100644 --- a/sdk/communication/communication-job-router-rest/src/azureCommunicationRoutingServiceClient.ts +++ b/sdk/communication/communication-job-router-rest/src/azureCommunicationRoutingServiceClient.ts @@ -2,67 +2,24 @@ // Licensed under the MIT license. import { getClient, ClientOptions } from "@azure-rest/core-client"; -import { isTokenCredential, KeyCredential, TokenCredential } from "@azure/core-auth"; import { logger } from "./logger"; import { AzureCommunicationRoutingServiceClient } from "./clientDefinitions"; -import { - createCommunicationAuthPolicy, - isKeyCredential, - parseClientArguments, -} from "@azure/communication-common"; /** * Initialize a new instance of `AzureCommunicationRoutingServiceClient` - * @param connectionStringOrUrl - The connectionString or url of the Communication Services resource. - * @param options - the parameter for all optional parameters - */ -export default function createClient( - connectionStringOrUrl: string, - options: ClientOptions -): AzureCommunicationRoutingServiceClient; - -/** - * Initialize a new instance of `AzureCommunicationRoutingServiceClient` - * @param endpoint - The endpoint of the Communication Services resource. - * @param credentialOrOptions The key or token credential. + * @param endpoint - Uri of your Communication resource * @param options - the parameter for all optional parameters */ export default function createClient( endpoint: string, - credentialOrOptions?: KeyCredential | TokenCredential, - options?: ClientOptions -): AzureCommunicationRoutingServiceClient; - -// Implementation -export default function createClient( - arg1: string, - arg2?: ClientOptions | (KeyCredential | TokenCredential), - arg3?: ClientOptions + options: ClientOptions = {} ): AzureCommunicationRoutingServiceClient { - let credentialOrOptions: KeyCredential | TokenCredential | undefined; - let options: ClientOptions | undefined; - const connectionStringOrUrl = arg1; - - // Determine which constructor is being called based on the types of the arguments - if (isTokenCredential(arg2) || isKeyCredential(arg2)) { - credentialOrOptions = arg2 as KeyCredential | TokenCredential; - options = arg3 as ClientOptions; - } else { - options = arg2 as ClientOptions; - } - if (options === undefined) { - options = {}; - } - - // Rest of the function remains the same, using connectionStringOrUrl or endpoint as needed - const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions); - const baseUrl = options?.baseUrl ?? `${url}`; - options.apiVersion = options?.apiVersion ?? "2023-11-01"; - - const userAgentInfo = "azsdk-js-communication-job-router-rest/1.0.0-beta.1"; + const baseUrl = options.baseUrl ?? `${endpoint}`; + options.apiVersion = options.apiVersion ?? "2023-11-01"; + const userAgentInfo = `azsdk-js-communication-job-router-rest/1.0.0-beta.1`; const userAgentPrefix = - options?.userAgentOptions && options?.userAgentOptions.userAgentPrefix - ? `${options?.userAgentOptions.userAgentPrefix} ${userAgentInfo}` + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` : `${userAgentInfo}`; options = { ...options, @@ -70,14 +27,14 @@ export default function createClient( userAgentPrefix, }, loggingOptions: { - logger: options?.loggingOptions?.logger ?? logger.info, + logger: options.loggingOptions?.logger ?? logger.info, }, }; - const client = getClient(baseUrl, options) as AzureCommunicationRoutingServiceClient; - - const authPolicy = createCommunicationAuthPolicy(credential); - client.pipeline.addPolicy(authPolicy); + const client = getClient( + baseUrl, + options + ) as AzureCommunicationRoutingServiceClient; return client; } diff --git a/sdk/communication/communication-job-router-rest/src/clientDefinitions.ts b/sdk/communication/communication-job-router-rest/src/clientDefinitions.ts index 3eeec36514ad..83c2d75070c6 100644 --- a/sdk/communication/communication-job-router-rest/src/clientDefinitions.ts +++ b/sdk/communication/communication-job-router-rest/src/clientDefinitions.ts @@ -124,12 +124,15 @@ export interface UpsertClassificationPolicy { /** Retrieves an existing classification policy by Id. */ get( options?: GetClassificationPolicyParameters - ): StreamableMethod; + ): StreamableMethod< + GetClassificationPolicy200Response | GetClassificationPolicyDefaultResponse + >; /** Delete a classification policy by Id. */ delete( options?: DeleteClassificationPolicyParameters ): StreamableMethod< - DeleteClassificationPolicy204Response | DeleteClassificationPolicyDefaultResponse + | DeleteClassificationPolicy204Response + | DeleteClassificationPolicyDefaultResponse >; } @@ -138,7 +141,8 @@ export interface ListClassificationPolicies { get( options?: ListClassificationPoliciesParameters ): StreamableMethod< - ListClassificationPolicies200Response | ListClassificationPoliciesDefaultResponse + | ListClassificationPolicies200Response + | ListClassificationPoliciesDefaultResponse >; } @@ -154,12 +158,15 @@ export interface UpsertDistributionPolicy { /** Retrieves an existing distribution policy by Id. */ get( options?: GetDistributionPolicyParameters - ): StreamableMethod; + ): StreamableMethod< + GetDistributionPolicy200Response | GetDistributionPolicyDefaultResponse + >; /** Delete a distribution policy by Id. */ delete( options?: DeleteDistributionPolicyParameters ): StreamableMethod< - DeleteDistributionPolicy204Response | DeleteDistributionPolicyDefaultResponse + | DeleteDistributionPolicy204Response + | DeleteDistributionPolicyDefaultResponse >; } @@ -168,7 +175,8 @@ export interface ListDistributionPolicies { get( options?: ListDistributionPoliciesParameters ): StreamableMethod< - ListDistributionPolicies200Response | ListDistributionPoliciesDefaultResponse + | ListDistributionPolicies200Response + | ListDistributionPoliciesDefaultResponse >; } @@ -184,25 +192,33 @@ export interface UpsertExceptionPolicy { /** Retrieves an existing exception policy by Id. */ get( options?: GetExceptionPolicyParameters - ): StreamableMethod; + ): StreamableMethod< + GetExceptionPolicy200Response | GetExceptionPolicyDefaultResponse + >; /** Deletes a exception policy by Id. */ delete( options?: DeleteExceptionPolicyParameters - ): StreamableMethod; + ): StreamableMethod< + DeleteExceptionPolicy204Response | DeleteExceptionPolicyDefaultResponse + >; } export interface ListExceptionPolicies { /** Retrieves existing exception policies. */ get( options?: ListExceptionPoliciesParameters - ): StreamableMethod; + ): StreamableMethod< + ListExceptionPolicies200Response | ListExceptionPoliciesDefaultResponse + >; } export interface UpsertQueue { /** Creates or updates a queue. */ patch( options: UpsertQueueParameters - ): StreamableMethod; + ): StreamableMethod< + UpsertQueue200Response | UpsertQueue201Response | UpsertQueueDefaultResponse + >; /** Retrieves an existing queue by Id. */ get( options?: GetQueueParameters @@ -224,9 +240,13 @@ export interface UpsertJob { /** Creates or updates a router job. */ patch( options: UpsertJobParameters - ): StreamableMethod; + ): StreamableMethod< + UpsertJob200Response | UpsertJob201Response | UpsertJobDefaultResponse + >; /** Retrieves an existing job by Id. */ - get(options?: GetJobParameters): StreamableMethod; + get( + options?: GetJobParameters + ): StreamableMethod; /** Deletes a job and all of its traces. */ delete( options?: DeleteJobParameters @@ -242,7 +262,9 @@ export interface Reclassify { export interface Cancel { /** Submits request to cancel an existing job by Id while supplying free-form cancellation reason. */ - post(options?: CancelParameters): StreamableMethod; + post( + options?: CancelParameters + ): StreamableMethod; } export interface Complete { @@ -254,7 +276,9 @@ export interface Complete { export interface Close { /** Closes a completed job. */ - post(options?: CloseParameters): StreamableMethod; + post( + options?: CloseParameters + ): StreamableMethod; } export interface ListJobs { @@ -268,11 +292,13 @@ export interface GetInQueuePosition { /** Gets a job's position details. */ get( options?: GetInQueuePositionParameters - ): StreamableMethod; + ): StreamableMethod< + GetInQueuePosition200Response | GetInQueuePositionDefaultResponse + >; } export interface Unassign { - /** Un-assign a job. */ + /** Unassign a job. */ post( options?: UnassignParameters ): StreamableMethod; @@ -280,19 +306,25 @@ export interface Unassign { export interface Accept { /** Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already. */ - post(options?: AcceptParameters): StreamableMethod; + post( + options?: AcceptParameters + ): StreamableMethod; } export interface Decline { /** Declines an offer to work on a job. */ - post(options?: DeclineParameters): StreamableMethod; + post( + options?: DeclineParameters + ): StreamableMethod; } export interface GetQueueStatistics { /** Retrieves a queue's statistics. */ get( options?: GetQueueStatisticsParameters - ): StreamableMethod; + ): StreamableMethod< + GetQueueStatistics200Response | GetQueueStatisticsDefaultResponse + >; } export interface UpsertWorker { @@ -300,7 +332,9 @@ export interface UpsertWorker { patch( options: UpsertWorkerParameters ): StreamableMethod< - UpsertWorker200Response | UpsertWorker201Response | UpsertWorkerDefaultResponse + | UpsertWorker200Response + | UpsertWorker201Response + | UpsertWorkerDefaultResponse >; /** Retrieves an existing worker by Id. */ get( @@ -386,7 +420,10 @@ export interface Routes { offerId: string ): Decline; /** Resource for '/routing/queues/\{queueId\}/statistics' has methods for the following verbs: get */ - (path: "/routing/queues/{queueId}/statistics", queueId: string): GetQueueStatistics; + ( + path: "/routing/queues/{queueId}/statistics", + queueId: string + ): GetQueueStatistics; /** Resource for '/routing/workers/\{workerId\}' has methods for the following verbs: patch, get, delete */ (path: "/routing/workers/{workerId}", workerId: string): UpsertWorker; /** Resource for '/routing/workers' has methods for the following verbs: get */ diff --git a/sdk/communication/communication-job-router-rest/src/isUnexpected.ts b/sdk/communication/communication-job-router-rest/src/isUnexpected.ts index 681514646ad1..cb57c2000fa4 100644 --- a/sdk/communication/communication-job-router-rest/src/isUnexpected.ts +++ b/sdk/communication/communication-job-router-rest/src/isUnexpected.ts @@ -77,7 +77,10 @@ import { } from "./responses"; const responseMap: Record = { - "PATCH /routing/classificationPolicies/{classificationPolicyId}": ["200", "201"], + "PATCH /routing/classificationPolicies/{classificationPolicyId}": [ + "200", + "201", + ], "GET /routing/classificationPolicies/{classificationPolicyId}": ["200"], "DELETE /routing/classificationPolicies/{classificationPolicyId}": ["204"], "GET /routing/classificationPolicies": ["200"], @@ -119,13 +122,19 @@ export function isUnexpected( | UpsertClassificationPolicyDefaultResponse ): response is UpsertClassificationPolicyDefaultResponse; export function isUnexpected( - response: GetClassificationPolicy200Response | GetClassificationPolicyDefaultResponse + response: + | GetClassificationPolicy200Response + | GetClassificationPolicyDefaultResponse ): response is GetClassificationPolicyDefaultResponse; export function isUnexpected( - response: DeleteClassificationPolicy204Response | DeleteClassificationPolicyDefaultResponse + response: + | DeleteClassificationPolicy204Response + | DeleteClassificationPolicyDefaultResponse ): response is DeleteClassificationPolicyDefaultResponse; export function isUnexpected( - response: ListClassificationPolicies200Response | ListClassificationPoliciesDefaultResponse + response: + | ListClassificationPolicies200Response + | ListClassificationPoliciesDefaultResponse ): response is ListClassificationPoliciesDefaultResponse; export function isUnexpected( response: @@ -134,13 +143,19 @@ export function isUnexpected( | UpsertDistributionPolicyDefaultResponse ): response is UpsertDistributionPolicyDefaultResponse; export function isUnexpected( - response: GetDistributionPolicy200Response | GetDistributionPolicyDefaultResponse + response: + | GetDistributionPolicy200Response + | GetDistributionPolicyDefaultResponse ): response is GetDistributionPolicyDefaultResponse; export function isUnexpected( - response: DeleteDistributionPolicy204Response | DeleteDistributionPolicyDefaultResponse + response: + | DeleteDistributionPolicy204Response + | DeleteDistributionPolicyDefaultResponse ): response is DeleteDistributionPolicyDefaultResponse; export function isUnexpected( - response: ListDistributionPolicies200Response | ListDistributionPoliciesDefaultResponse + response: + | ListDistributionPolicies200Response + | ListDistributionPoliciesDefaultResponse ): response is ListDistributionPoliciesDefaultResponse; export function isUnexpected( response: @@ -152,13 +167,20 @@ export function isUnexpected( response: GetExceptionPolicy200Response | GetExceptionPolicyDefaultResponse ): response is GetExceptionPolicyDefaultResponse; export function isUnexpected( - response: DeleteExceptionPolicy204Response | DeleteExceptionPolicyDefaultResponse + response: + | DeleteExceptionPolicy204Response + | DeleteExceptionPolicyDefaultResponse ): response is DeleteExceptionPolicyDefaultResponse; export function isUnexpected( - response: ListExceptionPolicies200Response | ListExceptionPoliciesDefaultResponse + response: + | ListExceptionPolicies200Response + | ListExceptionPoliciesDefaultResponse ): response is ListExceptionPoliciesDefaultResponse; export function isUnexpected( - response: UpsertQueue200Response | UpsertQueue201Response | UpsertQueueDefaultResponse + response: + | UpsertQueue200Response + | UpsertQueue201Response + | UpsertQueueDefaultResponse ): response is UpsertQueueDefaultResponse; export function isUnexpected( response: GetQueue200Response | GetQueueDefaultResponse @@ -170,7 +192,10 @@ export function isUnexpected( response: ListQueues200Response | ListQueuesDefaultResponse ): response is ListQueuesDefaultResponse; export function isUnexpected( - response: UpsertJob200Response | UpsertJob201Response | UpsertJobDefaultResponse + response: + | UpsertJob200Response + | UpsertJob201Response + | UpsertJobDefaultResponse ): response is UpsertJobDefaultResponse; export function isUnexpected( response: GetJob200Response | GetJobDefaultResponse @@ -209,7 +234,10 @@ export function isUnexpected( response: GetQueueStatistics200Response | GetQueueStatisticsDefaultResponse ): response is GetQueueStatisticsDefaultResponse; export function isUnexpected( - response: UpsertWorker200Response | UpsertWorker201Response | UpsertWorkerDefaultResponse + response: + | UpsertWorker200Response + | UpsertWorker201Response + | UpsertWorkerDefaultResponse ): response is UpsertWorkerDefaultResponse; export function isUnexpected( response: GetWorker200Response | GetWorkerDefaultResponse @@ -360,17 +388,24 @@ function getParametrizedPathSuccess(method: string, path: string): string[] { // track if we have found a match to return the values found. let found = true; - for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { - if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { const start = candidateParts[i]!.indexOf("}") + 1, end = candidateParts[i]?.length; // If the current part of the candidate is a "template" part // Try to use the suffix of pattern to match the path // {guid} ==> $ // {guid}:export ==> :export$ - const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( - pathParts[j] || "" - ); + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}` + ).test(pathParts[j] || ""); if (!isMatched) { found = false; diff --git a/sdk/communication/communication-job-router-rest/src/models.ts b/sdk/communication/communication-job-router-rest/src/models.ts index d62b48561c6b..1a4834290266 100644 --- a/sdk/communication/communication-job-router-rest/src/models.ts +++ b/sdk/communication/communication-job-router-rest/src/models.ts @@ -5,28 +5,29 @@ export interface ClassificationPolicy { /** Friendly name of this policy. */ name?: string; - /** The fallback queue to select if the queue selector doesn't find a match. */ + /** Id of a fallback queue to select if queue selector attachments doesn't find a match. */ fallbackQueueId?: string; - /** The queue selector attachments used to resolve a queue for a given job. */ + /** Queue selector attachments used to resolve a queue for a job. */ queueSelectorAttachments?: Array; - /** The rule to determine a priority score for a given job. */ + /** A rule to determine a priority score for a job. */ prioritizationRule?: RouterRule; - /** The worker selector attachments used to attach worker selectors to a given job. */ + /** Worker selector attachments used to attach worker selectors to a job. */ workerSelectorAttachments?: Array; } -/** An attachment of queue selectors to resolve a queue to a job from a classification policy */ +/** An attachment of queue selectors to resolve a queue to a job from a classification policy. */ export interface QueueSelectorAttachmentParent { kind: string; } -/** Describes a set of queue selectors that will be attached if the given condition resolves to true */ -export interface ConditionalQueueSelectorAttachment extends QueueSelectorAttachmentParent { - /** The condition that must be true for the queue selectors to be attached */ +/** Describes a set of queue selectors that will be attached if the given condition resolves to true. */ +export interface ConditionalQueueSelectorAttachment + extends QueueSelectorAttachmentParent { + /** The condition that must be true for the queue selectors to be attached. */ condition: RouterRule; - /** The queue selectors to attach */ + /** The queue selectors to attach. */ queueSelectors: Array; - /** The type discriminator describing the type of queue selector attachment */ + /** The type discriminator describing the type of queue selector attachment. */ kind: "conditional"; } @@ -44,41 +45,41 @@ export interface RouterRuleParent { /** A rule that return the same labels as the input labels. */ export interface DirectMapRouterRule extends RouterRuleParent { - /** The type discriminator describing a sub-type of Rule */ - kind: "direct-map-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "directMap"; } /** A rule providing inline expression rules. */ export interface ExpressionRouterRule extends RouterRuleParent { /** - * The expression language to compile to and execute + * The expression language to compile to and execute. * * Possible values: powerFx */ language?: string; - /** The string containing the expression to evaluate. Should contain return statement with calculated values. */ + /** An expression to evaluate. Should contain return statement with calculated values. */ expression: string; - /** The type discriminator describing a sub-type of Rule */ - kind: "expression-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "expression"; } /** A rule providing a binding to an HTTP Triggered Azure Function. */ export interface FunctionRouterRule extends RouterRuleParent { - /** URL for Azure Function */ + /** URL for Azure Function. */ functionUri: string; - /** Credentials used to access Azure function rule */ + /** Credentials used to access Azure function rule. */ credential?: FunctionRouterRuleCredential; - /** The type discriminator describing a sub-type of Rule */ - kind: "azure-function-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "function"; } -/** Credentials used to access Azure function rule */ +/** Credentials used to access Azure function rule. */ export interface FunctionRouterRuleCredential { - /** Access key scoped to a particular function */ + /** Access key scoped to a particular function. */ functionKey?: string; /** Access key scoped to a Azure Function app. This key grants access to all functions under the app. */ appKey?: string; - /** Client id, when AppKey is provided In context of Azure function, this is usually the name of the key */ + /** Client id, when AppKey is provided In context of Azure function, this is usually the name of the key. */ clientId?: string; } @@ -86,8 +87,8 @@ export interface FunctionRouterRuleCredential { export interface StaticRouterRule extends RouterRuleParent { /** The static value this rule always returns. Values must be primitive values - number, string, boolean. */ value?: unknown; - /** The type discriminator describing a sub-type of Rule */ - kind: "static-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "static"; } /** A rule providing a binding to an external web server. */ @@ -98,8 +99,8 @@ export interface WebhookRouterRule extends RouterRuleParent { clientCredential?: OAuth2WebhookClientCredential; /** Uri for Contoso's Web Server. */ webhookUri?: string; - /** The type discriminator describing a sub-type of Rule */ - kind: "webhook-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "webhook"; } /** OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ */ @@ -110,12 +111,12 @@ export interface OAuth2WebhookClientCredential { clientSecret?: string; } -/** Describes a condition that must be met against a set of labels for queue selection */ +/** Describes a condition that must be met against a set of labels for queue selection. */ export interface RouterQueueSelector { - /** The label key to query against */ + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value defined on the label selector + * Describes how the value of the label is compared to the value defined on the label selector. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ @@ -124,42 +125,46 @@ export interface RouterQueueSelector { value?: unknown; } -/** Attaches a queue selector where the value is passed through from the job label with the same key */ -export interface PassThroughQueueSelectorAttachment extends QueueSelectorAttachmentParent { - /** The label key to query against */ +/** Attaches a queue selector where the value is passed through from a job's label with the same key. */ +export interface PassThroughQueueSelectorAttachment + extends QueueSelectorAttachmentParent { + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value pass through + * Describes how the value of the label is compared to the value pass through. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ labelOperator: string; - /** The type discriminator describing the type of queue selector attachment */ - kind: "pass-through"; + /** The type discriminator describing the type of queue selector attachment. */ + kind: "passThrough"; } -/** Attaches queue selectors to a job when the RouterRule is resolved */ -export interface RuleEngineQueueSelectorAttachment extends QueueSelectorAttachmentParent { - /** A RouterRule that resolves a collection of queue selectors to attach */ +/** Attaches queue selectors to a job when the RouterRule is resolved. */ +export interface RuleEngineQueueSelectorAttachment + extends QueueSelectorAttachmentParent { + /** A RouterRule that resolves a collection of queue selectors to attach. */ rule: RouterRule; - /** The type discriminator describing the type of queue selector attachment */ - kind: "rule-engine"; + /** The type discriminator describing the type of queue selector attachment. */ + kind: "ruleEngine"; } -/** Describes a queue selector that will be attached to the job */ -export interface StaticQueueSelectorAttachment extends QueueSelectorAttachmentParent { +/** Describes a queue selector that will be attached to a job. */ +export interface StaticQueueSelectorAttachment + extends QueueSelectorAttachmentParent { /** The queue selector to attach. */ queueSelector: RouterQueueSelector; - /** The type discriminator describing the type of queue selector attachment */ + /** The type discriminator describing the type of queue selector attachment. */ kind: "static"; } -/** Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting */ -export interface WeightedAllocationQueueSelectorAttachment extends QueueSelectorAttachmentParent { +/** Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting. */ +export interface WeightedAllocationQueueSelectorAttachment + extends QueueSelectorAttachmentParent { /** A collection of percentage based weighted allocations. */ allocations: Array; - /** The type discriminator describing the type of queue selector attachment */ - kind: "weighted-allocation-queue-selector"; + /** The type discriminator describing the type of queue selector attachment. */ + kind: "weightedAllocation"; } /** Contains the weight percentage and queue selectors to be applied if selected for weighted distributions. */ @@ -170,27 +175,28 @@ export interface QueueWeightedAllocation { queueSelectors: Array; } -/** An attachment which attaches worker selectors to a job */ +/** An attachment which attaches worker selectors to a job. */ export interface WorkerSelectorAttachmentParent { kind: string; } -/** Describes a set of worker selectors that will be attached if the given condition resolves to true */ -export interface ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { - /** The condition that must be true for the worker selectors to be attached */ +/** Describes a set of worker selectors that will be attached if the given condition resolves to true. */ +export interface ConditionalWorkerSelectorAttachment + extends WorkerSelectorAttachmentParent { + /** The condition that must be true for the worker selectors to be attached. */ condition: RouterRule; - /** The worker selectors to attach */ + /** The worker selectors to attach. */ workerSelectors: Array; - /** The type discriminator describing the type of worker selector attachment */ + /** The type discriminator describing the type of worker selector attachment. */ kind: "conditional"; } -/** Describes a condition that must be met against a set of labels for worker selection */ +/** Describes a condition that must be met against a set of labels for worker selection. */ export interface RouterWorkerSelector { - /** The label key to query against */ + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value defined on the label selector + * Describes how the value of the label is compared to the value defined on the worker selector. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ @@ -199,48 +205,52 @@ export interface RouterWorkerSelector { value?: unknown; /** Describes how long this label selector is valid in seconds. */ expiresAfterSeconds?: number; - /** Pushes the job to the front of the queue as long as this selector is active. */ + /** Pushes a job to the front of the queue as long as this selector is active. */ expedite?: boolean; } -/** Attaches a worker selector where the value is passed through from the job label with the same key */ -export interface PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { - /** The label key to query against */ +/** Attaches a worker selector where the value is passed through from a job's label with the same key. */ +export interface PassThroughWorkerSelectorAttachment + extends WorkerSelectorAttachmentParent { + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value pass through + * Describes how the value of the label is compared to the value pass through. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ labelOperator: string; /** Describes how long the attached label selector is valid in seconds. */ expiresAfterSeconds?: number; - /** The type discriminator describing the type of worker selector attachment */ - kind: "pass-through"; + /** The type discriminator describing the type of worker selector attachment. */ + kind: "passThrough"; } -/** Attaches worker selectors to a job when a RouterRule is resolved */ -export interface RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { - /** A RouterRule that resolves a collection of worker selectors to attach */ +/** Attaches worker selectors to a job when a RouterRule is resolved. */ +export interface RuleEngineWorkerSelectorAttachment + extends WorkerSelectorAttachmentParent { + /** A RouterRule that resolves a collection of worker selectors to attach. */ rule: RouterRule; - /** The type discriminator describing the type of worker selector attachment */ - kind: "rule-engine"; + /** The type discriminator describing the type of worker selector attachment. */ + kind: "ruleEngine"; } -/** Describes a worker selector that will be attached to the job */ -export interface StaticWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { +/** Describes a worker selector that will be attached to a job. */ +export interface StaticWorkerSelectorAttachment + extends WorkerSelectorAttachmentParent { /** The worker selector to attach. */ workerSelector: RouterWorkerSelector; - /** The type discriminator describing the type of worker selector attachment */ + /** The type discriminator describing the type of worker selector attachment. */ kind: "static"; } -/** Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting */ -export interface WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachmentParent { +/** Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting. */ +export interface WeightedAllocationWorkerSelectorAttachment + extends WorkerSelectorAttachmentParent { /** A collection of percentage based weighted allocations. */ allocations: Array; - /** The type discriminator describing the type of worker selector attachment */ - kind: "weighted-allocation-worker-selector"; + /** The type discriminator describing the type of worker selector attachment. */ + kind: "weightedAllocation"; } /** Contains the weight percentage and worker selectors to be applied if selected for weighted distributions. */ @@ -253,21 +263,21 @@ export interface WorkerWeightedAllocation { /** Policy governing how jobs are distributed to workers */ export interface DistributionPolicy { - /** The human readable name of the policy. */ + /** Friendly name of this policy. */ name?: string; - /** The number of seconds after which any offers created under this policy will be expired. */ + /** Number of seconds after which any offers created under this policy will be expired. */ offerExpiresAfterSeconds?: number; - /** Abstract base class for defining a distribution mode */ + /** Mode governing the specific distribution method. */ mode?: DistributionMode; } -/** Abstract base class for defining a distribution mode */ +/** Abstract base class for defining a distribution mode. */ export interface DistributionModeParent { /** Governs the minimum desired number of active concurrent offers a job can have. */ minConcurrentOffers?: number; /** Governs the maximum number of active concurrent offers a job can have. */ maxConcurrentOffers?: number; - /** If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false. */ + /** If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for a job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false. */ bypassSelectors?: boolean; kind: string; } @@ -279,14 +289,14 @@ export interface BestWorkerMode extends DistributionModeParent { /** Options to configure 'scoringRule'. If not set, default values are used. */ scoringRuleOptions?: ScoringRuleOptions; /** The type discriminator describing a sub-type of Mode */ - kind: "best-worker"; + kind: "bestWorker"; } -/** Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode */ +/** Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode. */ export interface ScoringRuleOptions { /** Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured. */ batchSize?: number; - /** List of extra parameters from the job that will be sent as part of the payload to scoring rule. If not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload. */ + /** List of extra parameters from a job that will be sent as part of the payload to scoring rule. If not set, a job's labels (sent in the payload as `job`) and a job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload. */ scoringParameters?: string[]; /** If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size. */ isBatchScoringEnabled?: boolean; @@ -296,19 +306,19 @@ export interface ScoringRuleOptions { /** Jobs are directed to the worker who has been idle longest. */ export interface LongestIdleMode extends DistributionModeParent { - /** The type discriminator describing a sub-type of Mode */ - kind: "longest-idle"; + /** The type discriminator describing a sub-type of Mode. */ + kind: "longestIdle"; } /** Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job. */ export interface RoundRobinMode extends DistributionModeParent { - /** The type discriminator describing a sub-type of Mode */ - kind: "round-robin"; + /** The type discriminator describing a sub-type of Mode. */ + kind: "roundRobin"; } /** A policy that defines actions to execute when exception are triggered. */ export interface ExceptionPolicy { - /** The name of the exception policy. */ + /** Friendly name of this policy. */ name?: string; /** A collection of exception rules on the exception policy. */ exceptionRules?: Array; @@ -316,49 +326,49 @@ export interface ExceptionPolicy { /** A rule that defines actions to execute upon a specific trigger. */ export interface ExceptionRule { - /** Id of the exception rule. */ + /** Id of an exception rule. */ id: string; - /** The trigger for this exception rule */ + /** The trigger for this exception rule. */ trigger: ExceptionTrigger; /** A collection of actions to perform once the exception is triggered. */ actions: Array; } -/** The trigger for this exception rule */ +/** Abstract base class for defining a trigger for exception rules. */ export interface ExceptionTriggerParent { kind: string; } -/** Trigger for an exception action on exceeding queue length */ +/** Trigger for an exception action on exceeding queue length. */ export interface QueueLengthExceptionTrigger extends ExceptionTriggerParent { /** Threshold of number of jobs ahead in the queue to for this trigger to fire. */ threshold: number; - /** The type discriminator describing a sub-type of ExceptionTrigger */ - kind: "queue-length"; + /** The type discriminator describing a sub-type of ExceptionTrigger. */ + kind: "queueLength"; } -/** Trigger for an exception action on exceeding wait time */ +/** Trigger for an exception action on exceeding wait time. */ export interface WaitTimeExceptionTrigger extends ExceptionTriggerParent { /** Threshold for wait time for this trigger. */ thresholdSeconds: number; - /** The type discriminator describing a sub-type of ExceptionTrigger */ - kind: "wait-time"; + /** The type discriminator describing a sub-type of ExceptionTrigger. */ + kind: "waitTime"; } -/** The action to take when the exception is triggered */ +/** The action to take when the exception is triggered. */ export interface ExceptionActionParent { - /** Unique Id of the exception action */ + /** Unique Id of the exception action. */ id?: string; kind: string; } -/** An action that marks a job as cancelled */ +/** An action that marks a job as cancelled. */ export interface CancelExceptionAction extends ExceptionActionParent { - /** A note that will be appended to the jobs' Notes collection with the current timestamp. */ + /** A note that will be appended to a job's notes collection with the current timestamp. */ note?: string; - /** Indicates the outcome of the job, populate this field with your own custom values. */ + /** Indicates the outcome of a job, populate this field with your own custom values. */ dispositionCode?: string; - /** The type discriminator describing a sub-type of ExceptionAction */ + /** The type discriminator describing a sub-type of ExceptionAction. */ kind: "cancel"; } @@ -370,29 +380,29 @@ export interface ManualReclassifyExceptionAction extends ExceptionActionParent { priority?: number; /** Updated WorkerSelectors. */ workerSelectors?: Array; - /** The type discriminator describing a sub-type of ExceptionAction */ - kind: "manual-reclassify"; + /** The type discriminator describing a sub-type of ExceptionAction. */ + kind: "manualReclassify"; } -/** An action that modifies labels on a job and then reclassifies it */ +/** An action that modifies labels on a job and then reclassifies it. */ export interface ReclassifyExceptionAction extends ExceptionActionParent { /** The new classification policy that will determine queue, priority and worker selectors. */ classificationPolicyId?: string; /** Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primitive values - number, string, boolean. */ labelsToUpsert?: Record; - /** The type discriminator describing a sub-type of ExceptionAction */ + /** The type discriminator describing a sub-type of ExceptionAction. */ kind: "reclassify"; } /** A queue that can contain jobs to be routed. */ export interface RouterQueue { - /** The name of this queue. */ + /** Friendly name of this queue. */ name?: string; - /** The ID of the distribution policy that will determine how a job is distributed to workers. */ + /** Id of a distribution policy that will determine how a job is distributed to workers. */ distributionPolicyId?: string; /** A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. */ labels?: Record; - /** The ID of the exception policy that determines various job escalation rules. */ + /** Id of an exception policy that determines various job escalation rules. */ exceptionPolicyId?: string; } @@ -402,35 +412,35 @@ export interface RouterJob { channelReference?: string; /** The channel identifier. eg. voice, chat, etc. */ channelId?: string; - /** The Id of the Classification policy used for classifying a job. */ + /** Id of a classification policy used for classifying this job. */ classificationPolicyId?: string; - /** The Id of the Queue that this job is queued to. */ + /** Id of a queue that this job is queued to. */ queueId?: string; - /** The priority of this job. */ + /** Priority of this job. */ priority?: number; /** Reason code for cancelled or closed jobs. */ dispositionCode?: string; - /** A collection of manually specified label selectors, which a worker must satisfy in order to process this job. */ + /** A collection of manually specified worker selectors, which a worker must satisfy in order to process this job. */ requestedWorkerSelectors?: Array; /** A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. */ labels?: Record; /** A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean. */ tags?: Record; - /** Notes attached to a job, sorted by timestamp */ + /** Notes attached to a job, sorted by timestamp. */ notes?: Array; /** If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode. */ matchingMode?: JobMatchingMode; } -/** Assignment details of a job to a worker */ +/** Assignment details of a job to a worker. */ export interface RouterJobAssignment { - /** The Id of the Worker assigned to the job. */ + /** Id of the Worker assigned to the job. */ workerId?: string; - /** The assignment time of the job in UTC. */ + /** Timestamp when the job was assigned to a worker in UTC. */ assignedAt: Date | string; - /** The time the job was marked as completed after being assigned in UTC. */ + /** Timestamp when the job was marked as completed after being assigned in UTC. */ completedAt?: Date | string; - /** The time the job was marked as closed after being completed in UTC. */ + /** Timestamp when the job was marked as closed after being completed in UTC. */ closedAt?: Date | string; } @@ -454,16 +464,16 @@ export interface JobMatchingModeParent { /** Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically. */ export interface ScheduleAndSuspendMode extends JobMatchingModeParent { - /** Scheduled time. */ + /** Requested schedule time. */ scheduleAt: Date | string; /** The type discriminator describing ScheduleAndSuspendMode */ - kind: "schedule-and-suspend"; + kind: "scheduleAndSuspend"; } /** Describes a matching mode where matching worker to a job is automatically started after job is queued successfully. */ export interface QueueAndMatchMode extends JobMatchingModeParent { /** The type discriminator describing QueueAndMatchMode */ - kind: "queue-and-match"; + kind: "queueAndMatch"; } /** Describes a matching mode where matching worker to a job is suspended. */ @@ -472,48 +482,48 @@ export interface SuspendMode extends JobMatchingModeParent { kind: "suspend"; } -/** Request payload for reclassifying jobs */ +/** Request payload for reclassifying jobs. */ export interface ReclassifyJobOptions {} -/** Request payload for deleting a job */ +/** Request payload for cancelling a job. */ export interface CancelJobOptions { - /** A note that will be appended to the jobs' Notes collection with the current timestamp. */ + /** A note that will be appended to a job's Notes collection with the current timestamp. */ note?: string; - /** Indicates the outcome of the job, populate this field with your own custom values. If not provided, default value of "Cancelled" is set. */ + /** Indicates the outcome of a job, populate this field with your own custom values. If not provided, default value of "Cancelled" is set. */ dispositionCode?: string; } -/** Request payload for completing jobs */ +/** Request payload for completing jobs. */ export interface CompleteJobOptions { - /** A note that will be appended to the jobs' Notes collection with the current timestamp. */ + /** A note that will be appended to a job's Notes collection with the current timestamp. */ note?: string; } /** Request payload for closing jobs */ export interface CloseJobOptions { - /** Indicates the outcome of the job, populate this field with your own custom values. */ + /** Indicates the outcome of a job, populate this field with your own custom values. */ dispositionCode?: string; /** If not provided, worker capacity is released immediately along with a JobClosedEvent notification. If provided, worker capacity is released along with a JobClosedEvent notification at a future time in UTC. */ closeAt?: Date | string; - /** A note that will be appended to the jobs' Notes collection with the current timestamp. */ + /** A note that will be appended to a job's Notes collection with the current timestamp. */ note?: string; } /** Request payload for unassigning a job. */ export interface UnassignJobOptions { - /** If SuspendMatching is true, then the job is not queued for re-matching with a worker. */ + /** If SuspendMatching is true, then a job is not queued for re-matching with a worker. */ suspendMatching?: boolean; } -/** Request payload for declining offers */ +/** Request payload for declining offers. */ export interface DeclineJobOfferOptions { /** If the RetryOfferAt is not provided, then this job will not be offered again to the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time is provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that declined the job will also be eligible for the job at that time. */ retryOfferAt?: Date | string; } -/** An entity for jobs to be routed to */ +/** An entity for jobs to be routed to. */ export interface RouterWorker { - /** The queue(s) that this worker can receive work from. */ + /** Collection of queue(s) that this worker can receive work from. */ queues?: string[]; /** The total capacity score this worker has to manage multiple concurrent jobs. */ capacity?: number; @@ -521,15 +531,15 @@ export interface RouterWorker { labels?: Record; /** A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean. */ tags?: Record; - /** The channel(s) this worker can handle and their impact on the workers capacity. */ + /** Collection of channel(s) this worker can handle and their impact on the workers capacity. */ channels?: Array; /** A flag indicating this worker is open to receive offers or not. */ availableForOffers?: boolean; } -/** Represents the capacity a job in this channel will consume from a worker */ +/** Represents the capacity a job in this channel will consume from a worker. */ export interface RouterChannel { - /** Id of the channel. */ + /** Id of a channel. */ channelId: string; /** The amount of capacity that an instance of a job of this channel will consume of the total worker capacity. */ capacityCostPerJob: number; @@ -537,23 +547,23 @@ export interface RouterChannel { maxNumberOfJobs?: number; } -/** An offer of a job to a worker */ +/** An offer of a job to a worker. */ export interface RouterJobOffer { - /** The Id of the job. */ + /** Id of the job. */ jobId: string; /** The capacity cost consumed by the job offer. */ capacityCost: number; - /** The time the offer was created in UTC. */ + /** Timestamp when the offer was created in UTC. */ offeredAt?: Date | string; - /** The time that the offer will expire in UTC. */ + /** Timestamp when the offer will expire in UTC. */ expiresAt?: Date | string; } -/** The assignment for a worker to a job */ +/** The assignment for a worker to a job. */ export interface RouterWorkerAssignment { - /** The Id of the assignment. */ + /** Id of the assignment. */ assignmentId: string; - /** The Id of the Job assigned. */ + /** Id of the job assigned. */ jobId: string; /** The amount of capacity this assignment has consumed on the worker. */ capacityCost: number; @@ -561,7 +571,7 @@ export interface RouterWorkerAssignment { assignedAt: Date | string; } -/** An attachment of queue selectors to resolve a queue to a job from a classification policy */ +/** An attachment of queue selectors to resolve a queue to a job from a classification policy. */ export type QueueSelectorAttachment = | ConditionalQueueSelectorAttachment | PassThroughQueueSelectorAttachment @@ -582,18 +592,23 @@ export type RouterRule = | FunctionRouterRule | StaticRouterRule | WebhookRouterRule; -/** An attachment which attaches worker selectors to a job */ +/** An attachment which attaches worker selectors to a job. */ export type WorkerSelectorAttachment = | ConditionalWorkerSelectorAttachment | PassThroughWorkerSelectorAttachment | RuleEngineWorkerSelectorAttachment | StaticWorkerSelectorAttachment | WeightedAllocationWorkerSelectorAttachment; -/** Abstract base class for defining a distribution mode */ -export type DistributionMode = BestWorkerMode | LongestIdleMode | RoundRobinMode; -/** The trigger for this exception rule */ -export type ExceptionTrigger = QueueLengthExceptionTrigger | WaitTimeExceptionTrigger; -/** The action to take when the exception is triggered */ +/** Abstract base class for defining a distribution mode. */ +export type DistributionMode = + | BestWorkerMode + | LongestIdleMode + | RoundRobinMode; +/** Abstract base class for defining a trigger for exception rules. */ +export type ExceptionTrigger = + | QueueLengthExceptionTrigger + | WaitTimeExceptionTrigger; +/** The action to take when the exception is triggered. */ export type ExceptionAction = | CancelExceptionAction | ManualReclassifyExceptionAction @@ -604,4 +619,7 @@ export type ExceptionAction = * ScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a worker to the job will not start automatically. * SuspendMode: Used when matching workers to a job needs to be suspended. */ -export type JobMatchingMode = ScheduleAndSuspendMode | QueueAndMatchMode | SuspendMode; +export type JobMatchingMode = + | ScheduleAndSuspendMode + | QueueAndMatchMode + | SuspendMode; diff --git a/sdk/communication/communication-job-router-rest/src/outputModels.ts b/sdk/communication/communication-job-router-rest/src/outputModels.ts index da68872fc720..fdbb3974976b 100644 --- a/sdk/communication/communication-job-router-rest/src/outputModels.ts +++ b/sdk/communication/communication-job-router-rest/src/outputModels.ts @@ -7,33 +7,33 @@ import { Paged } from "@azure/core-paging"; export interface ClassificationPolicyOutput { /** The entity tag for this resource. */ readonly etag: string; - /** Unique identifier of this policy. */ + /** Id of a classification policy. */ readonly id: string; /** Friendly name of this policy. */ name?: string; - /** The fallback queue to select if the queue selector doesn't find a match. */ + /** Id of a fallback queue to select if queue selector attachments doesn't find a match. */ fallbackQueueId?: string; - /** The queue selector attachments used to resolve a queue for a given job. */ + /** Queue selector attachments used to resolve a queue for a job. */ queueSelectorAttachments?: Array; - /** The rule to determine a priority score for a given job. */ + /** A rule to determine a priority score for a job. */ prioritizationRule?: RouterRuleOutput; - /** The worker selector attachments used to attach worker selectors to a given job. */ + /** Worker selector attachments used to attach worker selectors to a job. */ workerSelectorAttachments?: Array; } -/** An attachment of queue selectors to resolve a queue to a job from a classification policy */ +/** An attachment of queue selectors to resolve a queue to a job from a classification policy. */ export interface QueueSelectorAttachmentOutputParent { kind: string; } -/** Describes a set of queue selectors that will be attached if the given condition resolves to true */ +/** Describes a set of queue selectors that will be attached if the given condition resolves to true. */ export interface ConditionalQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { - /** The condition that must be true for the queue selectors to be attached */ + /** The condition that must be true for the queue selectors to be attached. */ condition: RouterRuleOutput; - /** The queue selectors to attach */ + /** The queue selectors to attach. */ queueSelectors: Array; - /** The type discriminator describing the type of queue selector attachment */ + /** The type discriminator describing the type of queue selector attachment. */ kind: "conditional"; } @@ -51,41 +51,41 @@ export interface RouterRuleOutputParent { /** A rule that return the same labels as the input labels. */ export interface DirectMapRouterRuleOutput extends RouterRuleOutputParent { - /** The type discriminator describing a sub-type of Rule */ - kind: "direct-map-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "directMap"; } /** A rule providing inline expression rules. */ export interface ExpressionRouterRuleOutput extends RouterRuleOutputParent { /** - * The expression language to compile to and execute + * The expression language to compile to and execute. * * Possible values: powerFx */ language?: string; - /** The string containing the expression to evaluate. Should contain return statement with calculated values. */ + /** An expression to evaluate. Should contain return statement with calculated values. */ expression: string; - /** The type discriminator describing a sub-type of Rule */ - kind: "expression-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "expression"; } /** A rule providing a binding to an HTTP Triggered Azure Function. */ export interface FunctionRouterRuleOutput extends RouterRuleOutputParent { - /** URL for Azure Function */ + /** URL for Azure Function. */ functionUri: string; - /** Credentials used to access Azure function rule */ + /** Credentials used to access Azure function rule. */ credential?: FunctionRouterRuleCredentialOutput; - /** The type discriminator describing a sub-type of Rule */ - kind: "azure-function-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "function"; } -/** Credentials used to access Azure function rule */ +/** Credentials used to access Azure function rule. */ export interface FunctionRouterRuleCredentialOutput { - /** Access key scoped to a particular function */ + /** Access key scoped to a particular function. */ functionKey?: string; /** Access key scoped to a Azure Function app. This key grants access to all functions under the app. */ appKey?: string; - /** Client id, when AppKey is provided In context of Azure function, this is usually the name of the key */ + /** Client id, when AppKey is provided In context of Azure function, this is usually the name of the key. */ clientId?: string; } @@ -93,8 +93,8 @@ export interface FunctionRouterRuleCredentialOutput { export interface StaticRouterRuleOutput extends RouterRuleOutputParent { /** The static value this rule always returns. Values must be primitive values - number, string, boolean. */ value?: any; - /** The type discriminator describing a sub-type of Rule */ - kind: "static-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "static"; } /** A rule providing a binding to an external web server. */ @@ -105,8 +105,8 @@ export interface WebhookRouterRuleOutput extends RouterRuleOutputParent { clientCredential?: OAuth2WebhookClientCredentialOutput; /** Uri for Contoso's Web Server. */ webhookUri?: string; - /** The type discriminator describing a sub-type of Rule */ - kind: "webhook-rule"; + /** The type discriminator describing a sub-type of Rule. */ + kind: "webhook"; } /** OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ */ @@ -117,12 +117,12 @@ export interface OAuth2WebhookClientCredentialOutput { clientSecret?: string; } -/** Describes a condition that must be met against a set of labels for queue selection */ +/** Describes a condition that must be met against a set of labels for queue selection. */ export interface RouterQueueSelectorOutput { - /** The label key to query against */ + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value defined on the label selector + * Describes how the value of the label is compared to the value defined on the label selector. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ @@ -131,45 +131,46 @@ export interface RouterQueueSelectorOutput { value?: any; } -/** Attaches a queue selector where the value is passed through from the job label with the same key */ +/** Attaches a queue selector where the value is passed through from a job's label with the same key. */ export interface PassThroughQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { - /** The label key to query against */ + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value pass through + * Describes how the value of the label is compared to the value pass through. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ labelOperator: string; - /** The type discriminator describing the type of queue selector attachment */ - kind: "pass-through"; + /** The type discriminator describing the type of queue selector attachment. */ + kind: "passThrough"; } -/** Attaches queue selectors to a job when the RouterRule is resolved */ +/** Attaches queue selectors to a job when the RouterRule is resolved. */ export interface RuleEngineQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { - /** A RouterRule that resolves a collection of queue selectors to attach */ + /** A RouterRule that resolves a collection of queue selectors to attach. */ rule: RouterRuleOutput; - /** The type discriminator describing the type of queue selector attachment */ - kind: "rule-engine"; + /** The type discriminator describing the type of queue selector attachment. */ + kind: "ruleEngine"; } -/** Describes a queue selector that will be attached to the job */ -export interface StaticQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { +/** Describes a queue selector that will be attached to a job. */ +export interface StaticQueueSelectorAttachmentOutput + extends QueueSelectorAttachmentOutputParent { /** The queue selector to attach. */ queueSelector: RouterQueueSelectorOutput; - /** The type discriminator describing the type of queue selector attachment */ + /** The type discriminator describing the type of queue selector attachment. */ kind: "static"; } -/** Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting */ +/** Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting. */ export interface WeightedAllocationQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent { /** A collection of percentage based weighted allocations. */ allocations: Array; - /** The type discriminator describing the type of queue selector attachment */ - kind: "weighted-allocation-queue-selector"; + /** The type discriminator describing the type of queue selector attachment. */ + kind: "weightedAllocation"; } /** Contains the weight percentage and queue selectors to be applied if selected for weighted distributions. */ @@ -180,28 +181,28 @@ export interface QueueWeightedAllocationOutput { queueSelectors: Array; } -/** An attachment which attaches worker selectors to a job */ +/** An attachment which attaches worker selectors to a job. */ export interface WorkerSelectorAttachmentOutputParent { kind: string; } -/** Describes a set of worker selectors that will be attached if the given condition resolves to true */ +/** Describes a set of worker selectors that will be attached if the given condition resolves to true. */ export interface ConditionalWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { - /** The condition that must be true for the worker selectors to be attached */ + /** The condition that must be true for the worker selectors to be attached. */ condition: RouterRuleOutput; - /** The worker selectors to attach */ + /** The worker selectors to attach. */ workerSelectors: Array; - /** The type discriminator describing the type of worker selector attachment */ + /** The type discriminator describing the type of worker selector attachment. */ kind: "conditional"; } -/** Describes a condition that must be met against a set of labels for worker selection */ +/** Describes a condition that must be met against a set of labels for worker selection. */ export interface RouterWorkerSelectorOutput { - /** The label key to query against */ + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value defined on the label selector + * Describes how the value of the label is compared to the value defined on the worker selector. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ @@ -210,59 +211,60 @@ export interface RouterWorkerSelectorOutput { value?: any; /** Describes how long this label selector is valid in seconds. */ expiresAfterSeconds?: number; - /** Pushes the job to the front of the queue as long as this selector is active. */ + /** Pushes a job to the front of the queue as long as this selector is active. */ expedite?: boolean; /** - * The status of the worker selector. + * Status of the worker selector. * * Possible values: active, expired */ readonly status?: string; - /** The time at which this worker selector expires in UTC */ + /** The time at which this worker selector expires in UTC. */ readonly expiresAt?: string; } -/** Attaches a worker selector where the value is passed through from the job label with the same key */ +/** Attaches a worker selector where the value is passed through from a job's label with the same key. */ export interface PassThroughWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { - /** The label key to query against */ + /** The label key to query against. */ key: string; /** - * Describes how the value of the label is compared to the value pass through + * Describes how the value of the label is compared to the value pass through. * * Possible values: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual */ labelOperator: string; /** Describes how long the attached label selector is valid in seconds. */ expiresAfterSeconds?: number; - /** The type discriminator describing the type of worker selector attachment */ - kind: "pass-through"; + /** The type discriminator describing the type of worker selector attachment. */ + kind: "passThrough"; } -/** Attaches worker selectors to a job when a RouterRule is resolved */ +/** Attaches worker selectors to a job when a RouterRule is resolved. */ export interface RuleEngineWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { - /** A RouterRule that resolves a collection of worker selectors to attach */ + /** A RouterRule that resolves a collection of worker selectors to attach. */ rule: RouterRuleOutput; - /** The type discriminator describing the type of worker selector attachment */ - kind: "rule-engine"; + /** The type discriminator describing the type of worker selector attachment. */ + kind: "ruleEngine"; } -/** Describes a worker selector that will be attached to the job */ -export interface StaticWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { +/** Describes a worker selector that will be attached to a job. */ +export interface StaticWorkerSelectorAttachmentOutput + extends WorkerSelectorAttachmentOutputParent { /** The worker selector to attach. */ workerSelector: RouterWorkerSelectorOutput; - /** The type discriminator describing the type of worker selector attachment */ + /** The type discriminator describing the type of worker selector attachment. */ kind: "static"; } -/** Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting */ +/** Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting. */ export interface WeightedAllocationWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent { /** A collection of percentage based weighted allocations. */ allocations: Array; - /** The type discriminator describing the type of worker selector attachment */ - kind: "weighted-allocation-worker-selector"; + /** The type discriminator describing the type of worker selector attachment. */ + kind: "weightedAllocation"; } /** Contains the weight percentage and worker selectors to be applied if selected for weighted distributions. */ @@ -280,23 +282,23 @@ export interface RouterConditionalRequestHeadersOutput {} export interface DistributionPolicyOutput { /** The entity tag for this resource. */ readonly etag: string; - /** The unique identifier of the policy. */ + /** Id of a distribution policy. */ readonly id: string; - /** The human readable name of the policy. */ + /** Friendly name of this policy. */ name?: string; - /** The number of seconds after which any offers created under this policy will be expired. */ + /** Number of seconds after which any offers created under this policy will be expired. */ offerExpiresAfterSeconds?: number; - /** Abstract base class for defining a distribution mode */ + /** Mode governing the specific distribution method. */ mode?: DistributionModeOutput; } -/** Abstract base class for defining a distribution mode */ +/** Abstract base class for defining a distribution mode. */ export interface DistributionModeOutputParent { /** Governs the minimum desired number of active concurrent offers a job can have. */ minConcurrentOffers?: number; /** Governs the maximum number of active concurrent offers a job can have. */ maxConcurrentOffers?: number; - /** If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false. */ + /** If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for a job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false. */ bypassSelectors?: boolean; kind: string; } @@ -308,14 +310,14 @@ export interface BestWorkerModeOutput extends DistributionModeOutputParent { /** Options to configure 'scoringRule'. If not set, default values are used. */ scoringRuleOptions?: ScoringRuleOptionsOutput; /** The type discriminator describing a sub-type of Mode */ - kind: "best-worker"; + kind: "bestWorker"; } -/** Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode */ +/** Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode. */ export interface ScoringRuleOptionsOutput { /** Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured. */ batchSize?: number; - /** List of extra parameters from the job that will be sent as part of the payload to scoring rule. If not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload. */ + /** List of extra parameters from a job that will be sent as part of the payload to scoring rule. If not set, a job's labels (sent in the payload as `job`) and a job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload. */ scoringParameters?: string[]; /** If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size. */ isBatchScoringEnabled?: boolean; @@ -325,23 +327,23 @@ export interface ScoringRuleOptionsOutput { /** Jobs are directed to the worker who has been idle longest. */ export interface LongestIdleModeOutput extends DistributionModeOutputParent { - /** The type discriminator describing a sub-type of Mode */ - kind: "longest-idle"; + /** The type discriminator describing a sub-type of Mode. */ + kind: "longestIdle"; } /** Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job. */ export interface RoundRobinModeOutput extends DistributionModeOutputParent { - /** The type discriminator describing a sub-type of Mode */ - kind: "round-robin"; + /** The type discriminator describing a sub-type of Mode. */ + kind: "roundRobin"; } /** A policy that defines actions to execute when exception are triggered. */ export interface ExceptionPolicyOutput { /** The entity tag for this resource. */ readonly etag: string; - /** The Id of the exception policy */ + /** Id of an exception policy. */ readonly id: string; - /** The name of the exception policy. */ + /** Friendly name of this policy. */ name?: string; /** A collection of exception rules on the exception policy. */ exceptionRules?: Array; @@ -349,71 +351,76 @@ export interface ExceptionPolicyOutput { /** A rule that defines actions to execute upon a specific trigger. */ export interface ExceptionRuleOutput { - /** Id of the exception rule. */ + /** Id of an exception rule. */ id: string; - /** The trigger for this exception rule */ + /** The trigger for this exception rule. */ trigger: ExceptionTriggerOutput; /** A collection of actions to perform once the exception is triggered. */ actions: Array; } -/** The trigger for this exception rule */ +/** Abstract base class for defining a trigger for exception rules. */ export interface ExceptionTriggerOutputParent { kind: string; } -/** Trigger for an exception action on exceeding queue length */ -export interface QueueLengthExceptionTriggerOutput extends ExceptionTriggerOutputParent { +/** Trigger for an exception action on exceeding queue length. */ +export interface QueueLengthExceptionTriggerOutput + extends ExceptionTriggerOutputParent { /** Threshold of number of jobs ahead in the queue to for this trigger to fire. */ threshold: number; - /** The type discriminator describing a sub-type of ExceptionTrigger */ - kind: "queue-length"; + /** The type discriminator describing a sub-type of ExceptionTrigger. */ + kind: "queueLength"; } -/** Trigger for an exception action on exceeding wait time */ -export interface WaitTimeExceptionTriggerOutput extends ExceptionTriggerOutputParent { +/** Trigger for an exception action on exceeding wait time. */ +export interface WaitTimeExceptionTriggerOutput + extends ExceptionTriggerOutputParent { /** Threshold for wait time for this trigger. */ thresholdSeconds: number; - /** The type discriminator describing a sub-type of ExceptionTrigger */ - kind: "wait-time"; + /** The type discriminator describing a sub-type of ExceptionTrigger. */ + kind: "waitTime"; } -/** The action to take when the exception is triggered */ +/** The action to take when the exception is triggered. */ export interface ExceptionActionOutputParent { - /** Unique Id of the exception action */ + /** Unique Id of the exception action. */ id?: string; kind: string; } -/** An action that marks a job as cancelled */ -export interface CancelExceptionActionOutput extends ExceptionActionOutputParent { - /** A note that will be appended to the jobs' Notes collection with the current timestamp. */ +/** An action that marks a job as cancelled. */ +export interface CancelExceptionActionOutput + extends ExceptionActionOutputParent { + /** A note that will be appended to a job's notes collection with the current timestamp. */ note?: string; - /** Indicates the outcome of the job, populate this field with your own custom values. */ + /** Indicates the outcome of a job, populate this field with your own custom values. */ dispositionCode?: string; - /** The type discriminator describing a sub-type of ExceptionAction */ + /** The type discriminator describing a sub-type of ExceptionAction. */ kind: "cancel"; } /** An action that manually reclassifies a job by providing the queue, priority and worker selectors. */ -export interface ManualReclassifyExceptionActionOutput extends ExceptionActionOutputParent { +export interface ManualReclassifyExceptionActionOutput + extends ExceptionActionOutputParent { /** Updated QueueId. */ queueId?: string; /** Updated Priority. */ priority?: number; /** Updated WorkerSelectors. */ workerSelectors?: Array; - /** The type discriminator describing a sub-type of ExceptionAction */ - kind: "manual-reclassify"; + /** The type discriminator describing a sub-type of ExceptionAction. */ + kind: "manualReclassify"; } -/** An action that modifies labels on a job and then reclassifies it */ -export interface ReclassifyExceptionActionOutput extends ExceptionActionOutputParent { +/** An action that modifies labels on a job and then reclassifies it. */ +export interface ReclassifyExceptionActionOutput + extends ExceptionActionOutputParent { /** The new classification policy that will determine queue, priority and worker selectors. */ classificationPolicyId?: string; /** Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primitive values - number, string, boolean. */ labelsToUpsert?: Record; - /** The type discriminator describing a sub-type of ExceptionAction */ + /** The type discriminator describing a sub-type of ExceptionAction. */ kind: "reclassify"; } @@ -421,15 +428,15 @@ export interface ReclassifyExceptionActionOutput extends ExceptionActionOutputPa export interface RouterQueueOutput { /** The entity tag for this resource. */ readonly etag: string; - /** The Id of this queue */ + /** Id of a queue. */ readonly id: string; - /** The name of this queue. */ + /** Friendly name of this queue. */ name?: string; - /** The ID of the distribution policy that will determine how a job is distributed to workers. */ + /** Id of a distribution policy that will determine how a job is distributed to workers. */ distributionPolicyId?: string; /** A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. */ labels?: Record; - /** The ID of the exception policy that determines various job escalation rules. */ + /** Id of an exception policy that determines various job escalation rules. */ exceptionPolicyId?: string; } @@ -437,31 +444,31 @@ export interface RouterQueueOutput { export interface RouterJobOutput { /** The entity tag for this resource. */ readonly etag: string; - /** The id of the job. */ + /** Id of a job. */ readonly id: string; /** Reference to an external parent context, eg. call ID. */ channelReference?: string; /** - * The status of the Job. + * The status of the job. * * Possible values: pendingClassification, queued, assigned, completed, closed, cancelled, classificationFailed, created, pendingSchedule, scheduled, scheduleFailed, waitingForActivation */ readonly status?: string; - /** The time a job was queued in UTC. */ + /** Timestamp a job was queued in UTC. */ readonly enqueuedAt?: string; /** The channel identifier. eg. voice, chat, etc. */ channelId?: string; - /** The Id of the Classification policy used for classifying a job. */ + /** Id of a classification policy used for classifying this job. */ classificationPolicyId?: string; - /** The Id of the Queue that this job is queued to. */ + /** Id of a queue that this job is queued to. */ queueId?: string; - /** The priority of this job. */ + /** Priority of this job. */ priority?: number; /** Reason code for cancelled or closed jobs. */ dispositionCode?: string; - /** A collection of manually specified label selectors, which a worker must satisfy in order to process this job. */ + /** A collection of manually specified worker selectors, which a worker must satisfy in order to process this job. */ requestedWorkerSelectors?: Array; - /** A collection of label selectors attached by a classification policy, which a worker must satisfy in order to process this job. */ + /** A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job. */ readonly attachedWorkerSelectors?: Array; /** A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. */ labels?: Record; @@ -469,25 +476,25 @@ export interface RouterJobOutput { readonly assignments?: Record; /** A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean. */ tags?: Record; - /** Notes attached to a job, sorted by timestamp */ + /** Notes attached to a job, sorted by timestamp. */ notes?: Array; - /** If set, job will be scheduled to be enqueued at a given time */ + /** If set, job will be scheduled to be enqueued at a given time. */ readonly scheduledAt?: string; /** If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode. */ matchingMode?: JobMatchingModeOutput; } -/** Assignment details of a job to a worker */ +/** Assignment details of a job to a worker. */ export interface RouterJobAssignmentOutput { - /** The Id of the job assignment. */ + /** Id of a job assignment. */ readonly assignmentId: string; - /** The Id of the Worker assigned to the job. */ + /** Id of the Worker assigned to the job. */ workerId?: string; - /** The assignment time of the job in UTC. */ + /** Timestamp when the job was assigned to a worker in UTC. */ assignedAt: string; - /** The time the job was marked as completed after being assigned in UTC. */ + /** Timestamp when the job was marked as completed after being assigned in UTC. */ completedAt?: string; - /** The time the job was marked as closed after being completed in UTC. */ + /** Timestamp when the job was marked as closed after being completed in UTC. */ closedAt?: string; } @@ -510,17 +517,18 @@ export interface JobMatchingModeOutputParent { } /** Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically. */ -export interface ScheduleAndSuspendModeOutput extends JobMatchingModeOutputParent { - /** Scheduled time. */ +export interface ScheduleAndSuspendModeOutput + extends JobMatchingModeOutputParent { + /** Requested schedule time. */ scheduleAt: string; /** The type discriminator describing ScheduleAndSuspendMode */ - kind: "schedule-and-suspend"; + kind: "scheduleAndSuspend"; } /** Describes a matching mode where matching worker to a job is automatically started after job is queued successfully. */ export interface QueueAndMatchModeOutput extends JobMatchingModeOutputParent { /** The type discriminator describing QueueAndMatchMode */ - kind: "queue-and-match"; + kind: "queueAndMatch"; } /** Describes a matching mode where matching worker to a job is suspended. */ @@ -529,16 +537,16 @@ export interface SuspendModeOutput extends JobMatchingModeOutputParent { kind: "suspend"; } -/** Response payload from reclassifying a job */ +/** Response payload from reclassifying a job. */ export interface ReclassifyJobResultOutput {} -/** Response payload from cancelling a job */ +/** Response payload from cancelling a job. */ export interface CancelJobResultOutput {} -/** Response payload from completing a job */ +/** Response payload from completing a job. */ export interface CompleteJobResultOutput {} -/** Response payload from closing a job */ +/** Response payload from closing a job. */ export interface CloseJobResultOutput {} /** Position and estimated wait time for a job. */ @@ -551,56 +559,56 @@ export interface RouterJobPositionDetailsOutput { queueId: string; /** Length of the queue: total number of enqueued jobs. */ queueLength: number; - /** Estimated wait time of the job rounded up to the nearest minute */ + /** Estimated wait time of the job rounded up to the nearest minute. */ estimatedWaitTimeMinutes: number; } /** Response payload after a job has been successfully unassigned. */ export interface UnassignJobResultOutput { - /** The Id of the job unassigned. */ + /** Id of an unassigned job. */ jobId: string; /** The number of times a job is unassigned. At a maximum 3. */ unassignmentCount: number; } -/** Response containing Id's for the worker, job, and assignment from an accepted offer */ +/** Response containing ids for the worker, job, and assignment from an accepted offer. */ export interface AcceptJobOfferResultOutput { - /** The assignment Id that assigns a worker that has accepted an offer to a job. */ + /** Id of job assignment that assigns a worker that has accepted an offer to a job. */ assignmentId: string; - /** The Id of the job assigned. */ + /** Id of the job assigned. */ jobId: string; - /** The Id of the worker that has been assigned this job. */ + /** Id of the worker that has been assigned this job. */ workerId: string; } -/** Response payload from declining a job */ +/** Response payload from declining a job. */ export interface DeclineJobOfferResultOutput {} -/** Statistics for the queue */ +/** Statistics for the queue. */ export interface RouterQueueStatisticsOutput { /** Id of the queue these details are about. */ queueId: string; /** Length of the queue: total number of enqueued jobs. */ length: number; - /** The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority */ + /** The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority. */ estimatedWaitTimeMinutes?: Record; /** The wait time of the job that has been enqueued in this queue for the longest. */ longestJobWaitTimeMinutes?: number; } -/** An entity for jobs to be routed to */ +/** An entity for jobs to be routed to. */ export interface RouterWorkerOutput { /** The entity tag for this resource. */ readonly etag: string; - /** Id of the worker. */ + /** Id of a worker. */ readonly id: string; /** - * The current state of the worker. + * Current state of a worker. * * Possible values: active, draining, inactive */ readonly state?: string; - /** The queue(s) that this worker can receive work from. */ + /** Collection of queue(s) that this worker can receive work from. */ queues?: string[]; /** The total capacity score this worker has to manage multiple concurrent jobs. */ capacity?: number; @@ -608,7 +616,7 @@ export interface RouterWorkerOutput { labels?: Record; /** A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean. */ tags?: Record; - /** The channel(s) this worker can handle and their impact on the workers capacity. */ + /** Collection of channel(s) this worker can handle and their impact on the workers capacity. */ channels?: Array; /** A list of active offers issued to this worker. */ readonly offers?: Array; @@ -620,9 +628,9 @@ export interface RouterWorkerOutput { availableForOffers?: boolean; } -/** Represents the capacity a job in this channel will consume from a worker */ +/** Represents the capacity a job in this channel will consume from a worker. */ export interface RouterChannelOutput { - /** Id of the channel. */ + /** Id of a channel. */ channelId: string; /** The amount of capacity that an instance of a job of this channel will consume of the total worker capacity. */ capacityCostPerJob: number; @@ -630,25 +638,25 @@ export interface RouterChannelOutput { maxNumberOfJobs?: number; } -/** An offer of a job to a worker */ +/** An offer of a job to a worker. */ export interface RouterJobOfferOutput { - /** The Id of the offer. */ + /** Id of an offer. */ readonly offerId: string; - /** The Id of the job. */ + /** Id of the job. */ jobId: string; /** The capacity cost consumed by the job offer. */ capacityCost: number; - /** The time the offer was created in UTC. */ + /** Timestamp when the offer was created in UTC. */ offeredAt?: string; - /** The time that the offer will expire in UTC. */ + /** Timestamp when the offer will expire in UTC. */ expiresAt?: string; } -/** The assignment for a worker to a job */ +/** The assignment for a worker to a job. */ export interface RouterWorkerAssignmentOutput { - /** The Id of the assignment. */ + /** Id of the assignment. */ assignmentId: string; - /** The Id of the Job assigned. */ + /** Id of the job assigned. */ jobId: string; /** The amount of capacity this assignment has consumed on the worker. */ capacityCost: number; @@ -656,7 +664,7 @@ export interface RouterWorkerAssignmentOutput { assignedAt: string; } -/** An attachment of queue selectors to resolve a queue to a job from a classification policy */ +/** An attachment of queue selectors to resolve a queue to a job from a classification policy. */ export type QueueSelectorAttachmentOutput = | ConditionalQueueSelectorAttachmentOutput | PassThroughQueueSelectorAttachmentOutput @@ -677,23 +685,23 @@ export type RouterRuleOutput = | FunctionRouterRuleOutput | StaticRouterRuleOutput | WebhookRouterRuleOutput; -/** An attachment which attaches worker selectors to a job */ +/** An attachment which attaches worker selectors to a job. */ export type WorkerSelectorAttachmentOutput = | ConditionalWorkerSelectorAttachmentOutput | PassThroughWorkerSelectorAttachmentOutput | RuleEngineWorkerSelectorAttachmentOutput | StaticWorkerSelectorAttachmentOutput | WeightedAllocationWorkerSelectorAttachmentOutput; -/** Abstract base class for defining a distribution mode */ +/** Abstract base class for defining a distribution mode. */ export type DistributionModeOutput = | BestWorkerModeOutput | LongestIdleModeOutput | RoundRobinModeOutput; -/** The trigger for this exception rule */ +/** Abstract base class for defining a trigger for exception rules. */ export type ExceptionTriggerOutput = | QueueLengthExceptionTriggerOutput | WaitTimeExceptionTriggerOutput; -/** The action to take when the exception is triggered */ +/** The action to take when the exception is triggered. */ export type ExceptionActionOutput = | CancelExceptionActionOutput | ManualReclassifyExceptionActionOutput diff --git a/sdk/communication/communication-job-router-rest/src/paginateHelper.ts b/sdk/communication/communication-job-router-rest/src/paginateHelper.ts index 477bace4a37f..1c9af35b1efd 100644 --- a/sdk/communication/communication-job-router-rest/src/paginateHelper.ts +++ b/sdk/communication/communication-job-router-rest/src/paginateHelper.ts @@ -1,8 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging"; -import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { + getPagedAsyncIterator, + PagedAsyncIterableIterator, + PagedResult, +} from "@azure/core-paging"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; /** * Helper type to extract the type of an array @@ -67,7 +75,9 @@ export function paginate( typeof customGetPage === "function" ? customGetPage : async (pageLink: string) => { - const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); firstRun = false; checkPagingRequest(result); const nextLink = getNextLink(result.body, nextLinkName); @@ -93,7 +103,9 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { const nextLink = (body as Record)[nextLinkName]; if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { - throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined` + ); } return nextLink; @@ -121,7 +133,18 @@ function getElements(body: unknown, itemName: string): T[] { * Checks if a request failed */ function checkPagingRequest(response: PathUncheckedResponse): void { - const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, diff --git a/sdk/communication/communication-job-router-rest/src/parameters.ts b/sdk/communication/communication-job-router-rest/src/parameters.ts index 7cbd94ee9036..bfe9cf135261 100644 --- a/sdk/communication/communication-job-router-rest/src/parameters.ts +++ b/sdk/communication/communication-job-router-rest/src/parameters.ts @@ -26,7 +26,8 @@ export interface UpsertClassificationPolicyHeaders { } /** The resource instance. */ -export type ClassificationPolicyResourceMergeAndPatch = Partial; +export type ClassificationPolicyResourceMergeAndPatch = + Partial; export interface UpsertClassificationPolicyBodyParam { /** The resource instance. */ @@ -42,10 +43,11 @@ export interface UpsertClassificationPolicyMediaTypesParam { contentType: "application/merge-patch+json"; } -export type UpsertClassificationPolicyParameters = UpsertClassificationPolicyHeaderParam & - UpsertClassificationPolicyMediaTypesParam & - UpsertClassificationPolicyBodyParam & - RequestParameters; +export type UpsertClassificationPolicyParameters = + UpsertClassificationPolicyHeaderParam & + UpsertClassificationPolicyMediaTypesParam & + UpsertClassificationPolicyBodyParam & + RequestParameters; export type GetClassificationPolicyParameters = RequestParameters; export type DeleteClassificationPolicyParameters = RequestParameters; @@ -58,8 +60,8 @@ export interface ListClassificationPoliciesQueryParam { queryParameters?: ListClassificationPoliciesQueryParamProperties; } -export type ListClassificationPoliciesParameters = ListClassificationPoliciesQueryParam & - RequestParameters; +export type ListClassificationPoliciesParameters = + ListClassificationPoliciesQueryParam & RequestParameters; export interface UpsertDistributionPolicyHeaders { /** The request should only proceed if an entity matches this string. */ @@ -69,7 +71,8 @@ export interface UpsertDistributionPolicyHeaders { } /** The resource instance. */ -export type DistributionPolicyResourceMergeAndPatch = Partial; +export type DistributionPolicyResourceMergeAndPatch = + Partial; export interface UpsertDistributionPolicyBodyParam { /** The resource instance. */ @@ -85,10 +88,11 @@ export interface UpsertDistributionPolicyMediaTypesParam { contentType: "application/merge-patch+json"; } -export type UpsertDistributionPolicyParameters = UpsertDistributionPolicyHeaderParam & - UpsertDistributionPolicyMediaTypesParam & - UpsertDistributionPolicyBodyParam & - RequestParameters; +export type UpsertDistributionPolicyParameters = + UpsertDistributionPolicyHeaderParam & + UpsertDistributionPolicyMediaTypesParam & + UpsertDistributionPolicyBodyParam & + RequestParameters; export type GetDistributionPolicyParameters = RequestParameters; export type DeleteDistributionPolicyParameters = RequestParameters; @@ -101,8 +105,8 @@ export interface ListDistributionPoliciesQueryParam { queryParameters?: ListDistributionPoliciesQueryParamProperties; } -export type ListDistributionPoliciesParameters = ListDistributionPoliciesQueryParam & - RequestParameters; +export type ListDistributionPoliciesParameters = + ListDistributionPoliciesQueryParam & RequestParameters; export interface UpsertExceptionPolicyHeaders { /** The request should only proceed if an entity matches this string. */ @@ -144,7 +148,8 @@ export interface ListExceptionPoliciesQueryParam { queryParameters?: ListExceptionPoliciesQueryParamProperties; } -export type ListExceptionPoliciesParameters = ListExceptionPoliciesQueryParam & RequestParameters; +export type ListExceptionPoliciesParameters = ListExceptionPoliciesQueryParam & + RequestParameters; export interface UpsertQueueHeaders { /** The request should only proceed if an entity matches this string. */ diff --git a/sdk/communication/communication-job-router-rest/src/responses.ts b/sdk/communication/communication-job-router-rest/src/responses.ts index 30419fb969e0..8ccef12cd469 100644 --- a/sdk/communication/communication-job-router-rest/src/responses.ts +++ b/sdk/communication/communication-job-router-rest/src/responses.ts @@ -60,7 +60,8 @@ export interface UpsertClassificationPolicyDefaultHeaders { "x-ms-error-code"?: string; } -export interface UpsertClassificationPolicyDefaultResponse extends HttpResponse { +export interface UpsertClassificationPolicyDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; headers: RawHttpHeaders & UpsertClassificationPolicyDefaultHeaders; @@ -101,7 +102,8 @@ export interface DeleteClassificationPolicyDefaultHeaders { "x-ms-error-code"?: string; } -export interface DeleteClassificationPolicyDefaultResponse extends HttpResponse { +export interface DeleteClassificationPolicyDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; headers: RawHttpHeaders & DeleteClassificationPolicyDefaultHeaders; @@ -118,7 +120,8 @@ export interface ListClassificationPoliciesDefaultHeaders { "x-ms-error-code"?: string; } -export interface ListClassificationPoliciesDefaultResponse extends HttpResponse { +export interface ListClassificationPoliciesDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; headers: RawHttpHeaders & ListClassificationPoliciesDefaultHeaders; diff --git a/sdk/communication/communication-job-router-rest/tsconfig.json b/sdk/communication/communication-job-router-rest/tsconfig.json index 064a66156b54..d5bf593423c9 100644 --- a/sdk/communication/communication-job-router-rest/tsconfig.json +++ b/sdk/communication/communication-job-router-rest/tsconfig.json @@ -1,5 +1,11 @@ { "extends": "../../../tsconfig.package", - "compilerOptions": { "outDir": "./dist-esm", "declarationDir": "./types" }, - "include": ["src/**/*.ts", "./test/**/*.ts"] -} + "compilerOptions": { + "outDir": "./dist-esm", + "declarationDir": "./types" + }, + "include": [ + "src/**/*.ts", + "./test/**/*.ts" + ] +} \ No newline at end of file diff --git a/sdk/communication/communication-job-router-rest/tsp-location.yaml b/sdk/communication/communication-job-router-rest/tsp-location.yaml index d1ed2308cde1..405e33faee30 100644 --- a/sdk/communication/communication-job-router-rest/tsp-location.yaml +++ b/sdk/communication/communication-job-router-rest/tsp-location.yaml @@ -1,7 +1,5 @@ -repo: - Azure/azure-rest-api-specs additionalDirectories: [] -directory: - specification/communication/Communication.JobRouter -commit: - de1ef0678497c007ddc66fcc42bbc96043fe029f \ No newline at end of file +directory: specification/communication/Communication.JobRouter +repo: Azure/azure-rest-api-specs +commit: e68088ff9efe50baf3c5d6d8711e0cf8227d73dc +