Skip to content

Commit

Permalink
format,lint,build
Browse files Browse the repository at this point in the history
  • Loading branch information
kazrael2119 committed Dec 2, 2024
1 parent cc9b362 commit 634fbea
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 254 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
```ts

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 type { Client } from '@azure-rest/core-client';
import type { ClientOptions } from '@azure-rest/core-client';
import type { ErrorResponse } from '@azure-rest/core-client';
import type { HttpResponse } from '@azure-rest/core-client';
import type { KeyCredential } from '@azure/core-auth';
import { PathUncheckedResponse } from '@azure-rest/core-client';
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 type { PathUncheckedResponse } from '@azure-rest/core-client';
import type { RawHttpHeaders } from '@azure/core-rest-pipeline';
import type { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
import type { RequestParameters } from '@azure-rest/core-client';
import type { StreamableMethod } from '@azure-rest/core-client';
import type { TokenCredential } from '@azure/core-auth';

// @public (undocumented)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { getClient, ClientOptions } from "@azure-rest/core-client";
import type { ClientOptions } from "@azure-rest/core-client";
import { getClient } from "@azure-rest/core-client";
import { logger } from "./logger.js";
import { AzureCommunicationRoutingServiceClient } from "./clientDefinitions.js";
import type { AzureCommunicationRoutingServiceClient } from "./clientDefinitions.js";

/** The optional parameters for the client */
export interface AzureCommunicationRoutingServiceClientOptions
extends ClientOptions {
export interface AzureCommunicationRoutingServiceClientOptions extends ClientOptions {
/** The api version option of the client */
apiVersion?: string;
}
Expand Down Expand Up @@ -39,10 +39,7 @@ export default function createClient(
logger: options.loggingOptions?.logger ?? logger.info,
},
};
const client = getClient(
endpointUrl,
options,
) as AzureCommunicationRoutingServiceClient;
const client = getClient(endpointUrl, options) as AzureCommunicationRoutingServiceClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
client.pipeline.addPolicy({
Expand All @@ -52,8 +49,9 @@ export default function createClient(
// Append one if there is no apiVersion and we have one at client options
const url = new URL(req.url);
if (!url.searchParams.get("api-version") && apiVersion) {
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"
}api-version=${apiVersion}`;
req.url = `${req.url}${
Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"
}api-version=${apiVersion}`;
}
return next(req);
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.


import {
import type {
UpsertClassificationPolicyParameters,
GetClassificationPolicyParameters,
DeleteClassificationPolicyParameters,
Expand Down Expand Up @@ -125,15 +124,12 @@ export interface UpsertClassificationPolicy {
/** Retrieves an existing classification policy by Id. */
get(
options?: GetClassificationPolicyParameters,
): StreamableMethod<
GetClassificationPolicy200Response | GetClassificationPolicyDefaultResponse
>;
): StreamableMethod<GetClassificationPolicy200Response | GetClassificationPolicyDefaultResponse>;
/** Delete a classification policy by Id. */
delete(
options?: DeleteClassificationPolicyParameters,
): StreamableMethod<
| DeleteClassificationPolicy204Response
| DeleteClassificationPolicyDefaultResponse
DeleteClassificationPolicy204Response | DeleteClassificationPolicyDefaultResponse
>;
}

Expand All @@ -142,8 +138,7 @@ export interface ListClassificationPolicies {
get(
options?: ListClassificationPoliciesParameters,
): StreamableMethod<
| ListClassificationPolicies200Response
| ListClassificationPoliciesDefaultResponse
ListClassificationPolicies200Response | ListClassificationPoliciesDefaultResponse
>;
}

Expand All @@ -159,15 +154,12 @@ export interface UpsertDistributionPolicy {
/** Retrieves an existing distribution policy by Id. */
get(
options?: GetDistributionPolicyParameters,
): StreamableMethod<
GetDistributionPolicy200Response | GetDistributionPolicyDefaultResponse
>;
): StreamableMethod<GetDistributionPolicy200Response | GetDistributionPolicyDefaultResponse>;
/** Delete a distribution policy by Id. */
delete(
options?: DeleteDistributionPolicyParameters,
): StreamableMethod<
| DeleteDistributionPolicy204Response
| DeleteDistributionPolicyDefaultResponse
DeleteDistributionPolicy204Response | DeleteDistributionPolicyDefaultResponse
>;
}

Expand All @@ -176,8 +168,7 @@ export interface ListDistributionPolicies {
get(
options?: ListDistributionPoliciesParameters,
): StreamableMethod<
| ListDistributionPolicies200Response
| ListDistributionPoliciesDefaultResponse
ListDistributionPolicies200Response | ListDistributionPoliciesDefaultResponse
>;
}

Expand All @@ -193,33 +184,25 @@ export interface UpsertExceptionPolicy {
/** Retrieves an existing exception policy by Id. */
get(
options?: GetExceptionPolicyParameters,
): StreamableMethod<
GetExceptionPolicy200Response | GetExceptionPolicyDefaultResponse
>;
): StreamableMethod<GetExceptionPolicy200Response | GetExceptionPolicyDefaultResponse>;
/** Deletes a exception policy by Id. */
delete(
options?: DeleteExceptionPolicyParameters,
): StreamableMethod<
DeleteExceptionPolicy204Response | DeleteExceptionPolicyDefaultResponse
>;
): StreamableMethod<DeleteExceptionPolicy204Response | DeleteExceptionPolicyDefaultResponse>;
}

export interface ListExceptionPolicies {
/** Retrieves existing exception policies. */
get(
options?: ListExceptionPoliciesParameters,
): StreamableMethod<
ListExceptionPolicies200Response | ListExceptionPoliciesDefaultResponse
>;
): StreamableMethod<ListExceptionPolicies200Response | ListExceptionPoliciesDefaultResponse>;
}

export interface UpsertQueue {
/** Creates or updates a queue. */
patch(
options: UpsertQueueParameters,
): StreamableMethod<
UpsertQueue200Response | UpsertQueue201Response | UpsertQueueDefaultResponse
>;
): StreamableMethod<UpsertQueue200Response | UpsertQueue201Response | UpsertQueueDefaultResponse>;
/** Retrieves an existing queue by Id. */
get(
options?: GetQueueParameters,
Expand All @@ -241,13 +224,9 @@ export interface UpsertJob {
/** Creates or updates a router job. */
patch(
options: UpsertJobParameters,
): StreamableMethod<
UpsertJob200Response | UpsertJob201Response | UpsertJobDefaultResponse
>;
): StreamableMethod<UpsertJob200Response | UpsertJob201Response | UpsertJobDefaultResponse>;
/** Retrieves an existing job by Id. */
get(
options?: GetJobParameters,
): StreamableMethod<GetJob200Response | GetJobDefaultResponse>;
get(options?: GetJobParameters): StreamableMethod<GetJob200Response | GetJobDefaultResponse>;
/** Deletes a job and all of its traces. */
delete(
options?: DeleteJobParameters,
Expand All @@ -263,9 +242,7 @@ 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<Cancel200Response | CancelDefaultResponse>;
post(options?: CancelParameters): StreamableMethod<Cancel200Response | CancelDefaultResponse>;
}

export interface Complete {
Expand All @@ -277,9 +254,7 @@ export interface Complete {

export interface Close {
/** Closes a completed job. */
post(
options?: CloseParameters,
): StreamableMethod<Close200Response | CloseDefaultResponse>;
post(options?: CloseParameters): StreamableMethod<Close200Response | CloseDefaultResponse>;
}

export interface ListJobs {
Expand All @@ -293,9 +268,7 @@ export interface GetInQueuePosition {
/** Gets a job's position details. */
get(
options?: GetInQueuePositionParameters,
): StreamableMethod<
GetInQueuePosition200Response | GetInQueuePositionDefaultResponse
>;
): StreamableMethod<GetInQueuePosition200Response | GetInQueuePositionDefaultResponse>;
}

export interface Unassign {
Expand All @@ -307,35 +280,27 @@ 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<Accept200Response | AcceptDefaultResponse>;
post(options?: AcceptParameters): StreamableMethod<Accept200Response | AcceptDefaultResponse>;
}

export interface Decline {
/** Declines an offer to work on a job. */
post(
options?: DeclineParameters,
): StreamableMethod<Decline200Response | DeclineDefaultResponse>;
post(options?: DeclineParameters): StreamableMethod<Decline200Response | DeclineDefaultResponse>;
}

export interface GetQueueStatistics {
/** Retrieves a queue's statistics. */
get(
options?: GetQueueStatisticsParameters,
): StreamableMethod<
GetQueueStatistics200Response | GetQueueStatisticsDefaultResponse
>;
): StreamableMethod<GetQueueStatistics200Response | GetQueueStatisticsDefaultResponse>;
}

export interface UpsertWorker {
/** Creates or updates a worker. */
patch(
options: UpsertWorkerParameters,
): StreamableMethod<
| UpsertWorker200Response
| UpsertWorker201Response
| UpsertWorkerDefaultResponse
UpsertWorker200Response | UpsertWorker201Response | UpsertWorkerDefaultResponse
>;
/** Retrieves an existing worker by Id. */
get(
Expand Down Expand Up @@ -421,10 +386,7 @@ 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 */
Expand Down
Loading

0 comments on commit 634fbea

Please sign in to comment.