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 cf5afb863e709430c8eef86bcce263690be7c43b into 08bbb7fa323c7ac24eab4e4b884148ffb8c330ad
- Loading branch information
SDKAuto
committed
Nov 10, 2023
1 parent
7850e7a
commit d1599d9
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.