forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 26658 in Azure/azure-rest-api-specs
Merge c4458a521a2ba50f9fa500c161bff1d36ef4c7e7 into 42e2c0bcd77b0de6c523404668fa63511484d485
- Loading branch information
SDKAuto
committed
Nov 10, 2023
1 parent
99baa8c
commit 3e67a6f
Showing
32 changed files
with
3,440 additions
and
8,786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,4 +128,4 @@ | |
"ts-node": "^10.0.0", | ||
"esm": "^3.2.18" | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
sdk/communication/communication-job-router/src/azureCommunicationRoutingServiceClient.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import { getClient, ClientOptions } from "@azure-rest/core-client"; | ||
import { logger } from "./logger"; | ||
import { AzureCommunicationRoutingServiceClient } from "./clientDefinitions"; | ||
|
||
/** | ||
* Initialize a new instance of `AzureCommunicationRoutingServiceClient` | ||
* @param endpoint - A sequence of textual characters. | ||
* @param options - the parameter for all optional parameters | ||
*/ | ||
export default function createClient( | ||
endpoint: string, | ||
options: ClientOptions = {} | ||
): AzureCommunicationRoutingServiceClient { | ||
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}` | ||
: `${userAgentInfo}`; | ||
options = { | ||
...options, | ||
userAgentOptions: { | ||
userAgentPrefix, | ||
}, | ||
loggingOptions: { | ||
logger: options.loggingOptions?.logger ?? logger.info, | ||
}, | ||
}; | ||
|
||
const client = getClient( | ||
baseUrl, | ||
options | ||
) as AzureCommunicationRoutingServiceClient; | ||
|
||
return client; | ||
} |
Oops, something went wrong.