diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index effaa47f703e..8c9c933239b8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1021,9 +1021,6 @@ importers: '@rush-temp/iot-modelsrepository': specifier: file:./projects/iot-modelsrepository.tgz version: file:projects/iot-modelsrepository.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) - '@rush-temp/mcp-server': - specifier: file:./projects/mcp-server.tgz - version: file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1) '@rush-temp/keyvault-admin': specifier: file:./projects/keyvault-admin.tgz version: file:projects/keyvault-admin.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) @@ -1063,6 +1060,9 @@ importers: '@rush-temp/maps-timezone': specifier: file:./projects/maps-timezone.tgz version: file:projects/maps-timezone.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) + '@rush-temp/mcp-server': + specifier: file:./projects/mcp-server.tgz + version: file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1) '@rush-temp/microsoft-playwright-testing': specifier: file:./projects/microsoft-playwright-testing.tgz version: file:projects/microsoft-playwright-testing.tgz(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) @@ -2518,7 +2518,7 @@ packages: version: 0.0.0 '@rush-temp/arm-botservice@file:projects/arm-botservice.tgz': - resolution: {integrity: sha512-YIUUfPGypJK6aJisahOMLAoSvjltTNMxT1t4mL2NkgSkE3jGj9lkAbmbwBUU1F52q87NjszDVw9nwRcucSo0ZA==, tarball: file:projects/arm-botservice.tgz} + resolution: {integrity: sha512-ub8JTDK6NJ3iaFInjkFiB7VIy1jOh+7IK4kHYcVeCWrtQxnRzFQ/D6d/Pbt2E24Heq/8NCNAIdq4v+D8Lb8nLQ==, tarball: file:projects/arm-botservice.tgz} version: 0.0.0 '@rush-temp/arm-carbonoptimization@file:projects/arm-carbonoptimization.tgz': @@ -3669,10 +3669,6 @@ packages: resolution: {integrity: sha512-nVEawKXIhltEp1Zvua0E46Gdg0Hs5JJDFD7WPgqFBycYtQjRVsw60x49ZTi8ZxYXPJGQBJC2xLvj1fg/A5uhyQ==, tarball: file:projects/iot-modelsrepository.tgz} version: 0.0.0 - '@rush-temp/mcp-server@file:projects/mcp-server.tgz': - resolution: {integrity: sha512-DuCikdWUz6hleAR8EjUp7JD4VAGR1YMfNRAshvzJ7W20qAMV10dscYCo2wq8Eqt5TtEwLOrJFFfnbHwGIhNTZQ==, tarball: file:projects/mcp-server.tgz} - version: 0.0.0 - '@rush-temp/keyvault-admin@file:projects/keyvault-admin.tgz': resolution: {integrity: sha512-+pLp6hMMbEHRNWIWBJHEb3ovy65MoQthJRuwfDYdXDDYMYgiazL7j3CLleRz+WpDlI5kJ8gyD24pIqCoVZvQqg==, tarball: file:projects/keyvault-admin.tgz} version: 0.0.0 @@ -3725,6 +3721,10 @@ packages: resolution: {integrity: sha512-LLoNu/hOKIZ5/eLQ0io6I6kDPrnkiI1C3rDtG0DEQlP097B9CoeeaQ2E+qbGYUAPvvyo6QththExkcmgUENgEg==, tarball: file:projects/maps-timezone.tgz} version: 0.0.0 + '@rush-temp/mcp-server@file:projects/mcp-server.tgz': + resolution: {integrity: sha512-xVj0UA/iOcFZso/cQiQ1Ug5juexp+mJOhFwNBANfNb0bzXo9BRrgR2/0DxaTIIS0lest23qzU0nMQUiZPPetpA==, tarball: file:projects/mcp-server.tgz} + version: 0.0.0 + '@rush-temp/microsoft-playwright-testing@file:projects/microsoft-playwright-testing.tgz': resolution: {integrity: sha512-sVU4AhYy8i4VhihEGOHMZLmUggC15w2JvBfGUC+i+q7nxmE3sIbO+EzicltK811tg0QQML6lAzKonojrK4FO6g==, tarball: file:projects/microsoft-playwright-testing.tgz} version: 0.0.0 @@ -10287,11 +10287,11 @@ snapshots: '@rush-temp/arm-botservice@file:projects/arm-botservice.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1)': dependencies: - '@azure/core-lro': 2.7.2 '@types/node': 18.19.87 '@vitest/browser': 3.1.2(playwright@1.52.0)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(vitest@3.1.2) '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) dotenv: 16.5.0 + eslint: 9.26.0 playwright: 1.52.0 tslib: 2.8.1 typescript: 5.8.3 @@ -20462,37 +20462,6 @@ snapshots: - webdriverio - yaml - '@rush-temp/mcp-server@file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1)': - dependencies: - '@modelcontextprotocol/sdk': 1.11.0 - '@types/node': 18.19.87 - '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) - '@vitest/expect': 3.1.2 - dotenv: 16.5.0 - eslint: 9.26.0 - tsx: 4.19.3 - typescript: 5.8.3 - vitest: 3.1.2(@types/debug@4.1.12)(@types/node@18.19.87)(@vitest/browser@3.1.2)(tsx@4.19.3)(yaml@2.7.1) - zod: 3.24.4 - transitivePeerDependencies: - - '@edge-runtime/vm' - - '@types/debug' - - '@vitest/browser' - - '@vitest/ui' - - happy-dom - - jiti - - jsdom - - less - - lightningcss - - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - yaml - '@rush-temp/keyvault-admin@file:projects/keyvault-admin.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1)': dependencies: '@azure/keyvault-keys': 4.9.0 @@ -20962,6 +20931,37 @@ snapshots: - webdriverio - yaml + '@rush-temp/mcp-server@file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1)': + dependencies: + '@modelcontextprotocol/sdk': 1.11.0 + '@types/node': 18.19.87 + '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) + '@vitest/expect': 3.1.2 + dotenv: 16.5.0 + eslint: 9.26.0 + tsx: 4.19.3 + typescript: 5.8.3 + vitest: 3.1.2(@types/debug@4.1.12)(@types/node@18.19.87)(@vitest/browser@3.1.2)(tsx@4.19.3)(yaml@2.7.1) + zod: 3.24.4 + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@types/debug' + - '@vitest/browser' + - '@vitest/ui' + - happy-dom + - jiti + - jsdom + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - yaml + '@rush-temp/microsoft-playwright-testing@file:projects/microsoft-playwright-testing.tgz(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1)': dependencies: '@playwright/test': 1.52.0 diff --git a/sdk/botservice/arm-botservice/CHANGELOG.md b/sdk/botservice/arm-botservice/CHANGELOG.md index 61b58b5db40c..3a780c3e3f56 100644 --- a/sdk/botservice/arm-botservice/CHANGELOG.md +++ b/sdk/botservice/arm-botservice/CHANGELOG.md @@ -1,15 +1,162 @@ # Release History - -## 4.0.1 (Unreleased) - + +## 5.0.0-beta.1 (2025-05-11) +Compared with version 4.0.0 + ### Features Added -### Breaking Changes + - Added operation group BotChannelsOperations + - Added operation group BotConnectionOperationGroupOperations + - Added operation group BotsOperationGroupOperations + - Added operation group ConnectionSettingsOperations + - Added operation group HostSettingsOperationGroupOperations + - Added operation group NetworkSecurityPerimeterConfigurationsOperations + - Added operation group OperationResultsOperationGroupOperations + - Added operation group QnAMakerEndpointKeysOperationGroupOperations + - Added operation BotsOperations.createSignInUrl + - Added operation BotsOperations.listByBotResource + - Added Interface BotChannelsCreateOptionalParams + - Added Interface BotChannelsDeleteOptionalParams + - Added Interface BotChannelsGetOptionalParams + - Added Interface BotChannelsListByResourceGroupOptionalParams + - Added Interface BotChannelsListWithKeysOptionalParams + - Added Interface BotChannelsRegenerateKeysOptionalParams + - Added Interface BotChannelsUpdateOptionalParams + - Added Interface BotConnectionOperationGroupListServiceProvidersOptionalParams + - Added Interface BotsCreateSignInUrlOptionalParams + - Added Interface BotServiceClientOptionalParams + - Added Interface BotsListByBotResourceOptionalParams + - Added Interface BotsOperationGroupGetCheckNameAvailabilityOptionalParams + - Added Interface ConnectionSettingsCreateOptionalParams + - Added Interface ConnectionSettingsDeleteOptionalParams + - Added Interface ConnectionSettingsGetOptionalParams + - Added Interface ConnectionSettingsListByBotServiceOptionalParams + - Added Interface ConnectionSettingsListWithSecretsOptionalParams + - Added Interface ConnectionSettingsUpdateOptionalParams + - Added Interface HostSettingsOperationGroupGetOptionalParams + - Added Interface NetworkSecurityPerimeter + - Added Interface NetworkSecurityPerimeterConfiguration + - Added Interface NetworkSecurityPerimeterConfigurationProperties + - Added Interface NetworkSecurityPerimeterConfigurationsGetOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsListOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + - Added Interface NspAccessRule + - Added Interface NspAccessRuleProperties + - Added Interface NspAccessRulePropertiesSubscriptionsItem + - Added Interface OperationResultsOperationGroupGetOptionalParams + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings + - Added Interface PrivateEndpointConnectionProperties + - Added Interface PrivateLinkResourceProperties + - Added Interface Profile + - Added Interface ProvisioningIssue + - Added Interface ProvisioningIssueProperties + - Added Interface ProxyResource + - Added Interface QnAMakerEndpointKeysOperationGroupGetOptionalParams + - Added Interface ResourceAssociation + - Added Interface RestorePollerOptions + - Added Interface SystemData + - Added Interface TrackedResource + - Added Class BotServiceClient + - Added Type Alias AccessMode + - Added Type Alias ContinuablePage + - Added Type Alias CreatedByType + - Added Type Alias NspAccessRuleDirection + - Added Type Alias ProvisioningState + - Added Type Alias Severity + - Interface Bot has a new optional parameter etag + - Interface Bot has a new optional parameter kind + - Interface Bot has a new optional parameter sku + - Interface Bot has a new optional parameter zones + - Interface BotChannel has a new optional parameter etag + - Interface BotChannel has a new optional parameter kind + - Interface BotChannel has a new optional parameter sku + - Interface BotChannel has a new optional parameter zones + - Interface BotProperties has a new optional parameter networkSecurityPerimeterConfigurations + - Interface ConnectionSetting has a new optional parameter etag + - Interface ConnectionSetting has a new optional parameter kind + - Interface ConnectionSetting has a new optional parameter sku + - Interface ConnectionSetting has a new optional parameter zones + - Interface ConnectionSettingProperties has a new optional parameter id + - Interface ConnectionSettingProperties has a new optional parameter name + - Interface PrivateEndpointConnection has a new optional parameter properties + - Interface PrivateLinkResource has a new optional parameter properties + - Interface Resource has a new optional parameter systemData + - Type of parameter schemaTransformationVersion of interface BotProperties is changed from string to string | null + - Type of parameter etag of interface Channel is changed from string to string | null + - Type of parameter value of interface ConnectionSettingParameter is changed from string to string | null + - Type of parameter cognitiveServiceRegion of interface DirectLineSpeechChannelProperties is changed from string to string | null + - Type of parameter cognitiveServiceSubscriptionKey of interface DirectLineSpeechChannelProperties is changed from string to string | null + - Type of parameter acceptedTerms of interface MsTeamsChannelProperties is changed from boolean to boolean | null + - Type of parameter isBlockUserUploadEnabled of interface Site is changed from boolean to boolean | null + - Type of parameter cognitiveServiceRegion of interface TelephonyChannelProperties is changed from string to string | null + - Type of parameter cognitiveServiceSubscriptionKey of interface TelephonyChannelProperties is changed from string to string | null + - Type of parameter defaultLocale of interface TelephonyChannelProperties is changed from string to string | null + - Type of parameter premiumSKU of interface TelephonyChannelProperties is changed from string to string | null + - Type of parameter cognitiveServiceRegion of interface TelephonyChannelResourceApiConfiguration is changed from string to string | null + - Type of parameter cognitiveServiceResourceId of interface TelephonyChannelResourceApiConfiguration is changed from string to string | null + - Type of parameter cognitiveServiceSubscriptionKey of interface TelephonyChannelResourceApiConfiguration is changed from string to string | null + - Type of parameter defaultLocale of interface TelephonyChannelResourceApiConfiguration is changed from string to string | null + - Type of parameter providerName of interface TelephonyChannelResourceApiConfiguration is changed from string to string | null + - Type of parameter acsEndpoint of interface TelephonyPhoneNumbers is changed from string to string | null + - Type of parameter acsResourceId of interface TelephonyPhoneNumbers is changed from string to string | null + - Type of parameter acsSecret of interface TelephonyPhoneNumbers is changed from string to string | null + - Type of parameter cognitiveServiceRegion of interface TelephonyPhoneNumbers is changed from string to string | null + - Type of parameter cognitiveServiceResourceId of interface TelephonyPhoneNumbers is changed from string to string | null + - Type of parameter cognitiveServiceSubscriptionKey of interface TelephonyPhoneNumbers is changed from string to string | null + - Type of parameter defaultLocale of interface TelephonyPhoneNumbers is changed from string to string | null + - Type of parameter offerType of interface TelephonyPhoneNumbers is changed from string to string | null + - Added Enum KnownAccessMode + - Added Enum KnownCreatedByType + - Added Enum KnownNspAccessRuleDirection + - Added Enum KnownProvisioningState + - Added Enum KnownSeverity + - Added Enum KnownVersions + - Enum KnownPublicNetworkAccess has a new value SecuredByPerimeter + - Added function restorePoller -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Removed operation group BotConnection + - Removed operation group Channels + - Removed operation group DirectLine + - Removed operation group Email + - Removed operation group HostSettings + - Removed operation group OperationResults + - Removed operation group PrivateLinkResources + - Removed operation group QnAMakerEndpointKeys + - Removed operation Bots.getCheckNameAvailability + - Deleted Class AzureBotService + - Interface BotsUpdateOptionalParams no longer has parameter etag + - Interface BotsUpdateOptionalParams no longer has parameter kind + - Interface BotsUpdateOptionalParams no longer has parameter location + - Interface BotsUpdateOptionalParams no longer has parameter properties + - Interface BotsUpdateOptionalParams no longer has parameter sku + - Interface BotsUpdateOptionalParams no longer has parameter tags + - Interface PrivateEndpointConnection no longer has parameter groupIds + - Interface PrivateEndpointConnection no longer has parameter privateEndpoint + - Interface PrivateEndpointConnection no longer has parameter privateLinkServiceConnectionState + - Interface PrivateEndpointConnection no longer has parameter provisioningState + - Interface PrivateLinkResource no longer has parameter groupId + - Interface PrivateLinkResource no longer has parameter requiredMembers + - Interface PrivateLinkResource no longer has parameter requiredZoneNames + - Interface Resource no longer has parameter etag + - Interface Resource no longer has parameter kind + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter sku + - Interface Resource no longer has parameter tags + - Interface Resource no longer has parameter zones + - Type of parameter allSettings of interface BotProperties is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter parameters of interface BotProperties is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter channelName of interface Channel is changed from "AlexaChannel" | "FacebookChannel" | "EmailChannel" | "OutlookChannel" | "MsTeamsChannel" | "SkypeChannel" | "KikChannel" | "WebChatChannel" | "DirectLineChannel" | "TelegramChannel" | "SmsChannel" | "SlackChannel" | "LineChannel" | "DirectLineSpeechChannel" | "Omnichannel" | "TelephonyChannel" | "AcsChatChannel" | "SearchAssistant" | "M365Extensions" to string + - Type of parameter properties of interface OperationEntity is changed from Record to any + - Removed function getContinuationToken + + ## 4.0.0 (2023-01-16) The package of @azure/arm-botservice is using our next generation design principles since version 4.0.0, which contains breaking changes. @@ -18,4 +165,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/botservice/arm-botservice/LICENSE b/sdk/botservice/arm-botservice/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/botservice/arm-botservice/LICENSE +++ b/sdk/botservice/arm-botservice/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/botservice/arm-botservice/README.md b/sdk/botservice/arm-botservice/README.md index 145bde0abd21..ae6d1c859d85 100644 --- a/sdk/botservice/arm-botservice/README.md +++ b/sdk/botservice/arm-botservice/README.md @@ -1,13 +1,15 @@ -# Azure Bot client library for JavaScript +# Azure BotService client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Bot client. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure BotService client. Azure Bot Service is a platform for creating smart conversational agents. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-botservice) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-botservice) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-botservice) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-botservice?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice/samples) ## Getting started @@ -24,16 +26,16 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP ### Install the `@azure/arm-botservice` package -Install the Azure Bot client library for JavaScript with `npm`: +Install the Azure BotService client library for JavaScript with `npm`: ```bash npm install @azure/arm-botservice ``` -### Create and authenticate a `AzureBotService` +### Create and authenticate a `BotServiceClient` -To create a client object to access the Azure Bot API, you will need the `endpoint` of your Azure Bot resource and a `credential`. The Azure Bot client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Bot resource in the [Azure Portal][azure_portal]. +To create a client object to access the Azure BotService API, you will need the `endpoint` of your Azure BotService resource and a `credential`. The Azure BotService client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure BotService resource in the [Azure Portal][azure_portal]. You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). @@ -43,44 +45,42 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below npm install @azure/identity ``` -You will also need to **register a new AAD application and grant access to Azure Bot** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. +You will also need to **register a new AAD application and grant access to Azure BotService** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. ```ts snippet:ReadmeSampleCreateClient_Node -import { AzureBotService } from "@azure/arm-botservice"; +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureBotService(new DefaultAzureCredential(), subscriptionId); +const client = new BotServiceClient(new DefaultAzureCredential(), subscriptionId); ``` For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. ```ts snippet:ReadmeSampleCreateClient_Browser import { InteractiveBrowserCredential } from "@azure/identity"; -import { AzureBotService } from "@azure/arm-botservice"; +import { BotServiceClient } from "@azure/arm-botservice"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); -const client = new AzureBotService(credential, subscriptionId); + clientId: "" + }); +const client = new BotServiceClient(credential, subscriptionId); ``` -### JavaScript Bundle +### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts -### AzureBotService +### BotServiceClient -`AzureBotService` is the primary interface for developers using the Azure Bot client library. Explore the methods on this client object to understand the different features of the Azure Bot service that you can access. +`BotServiceClient` is the primary interface for developers using the Azure BotService client library. Explore the methods on this client object to understand the different features of the Azure BotService service that you can access. ## Troubleshooting @@ -98,7 +98,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice/samples) directory for detailed examples on how to use this library. ## Contributing @@ -108,10 +108,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - - -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/botservice/arm-botservice/_meta.json b/sdk/botservice/arm-botservice/_meta.json deleted file mode 100644 index 5f4183a3e861..000000000000 --- a/sdk/botservice/arm-botservice/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "4359ee079cc0f0d7c596cafeb8b363466d2d95f6", - "readme": "specification/botservice/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\botservice\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.7" -} \ No newline at end of file diff --git a/sdk/botservice/arm-botservice/assets.json b/sdk/botservice/arm-botservice/assets.json deleted file mode 100644 index 0b4435725ea8..000000000000 --- a/sdk/botservice/arm-botservice/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/botservice/arm-botservice", - "Tag": "js/botservice/arm-botservice_a657bb423a" -} diff --git a/sdk/botservice/arm-botservice/eslint.config.mjs b/sdk/botservice/arm-botservice/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/botservice/arm-botservice/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]); diff --git a/sdk/botservice/arm-botservice/package.json b/sdk/botservice/arm-botservice/package.json index b33d92c3df3f..d4ae39e426bd 100644 --- a/sdk/botservice/arm-botservice/package.json +++ b/sdk/botservice/arm-botservice/package.json @@ -1,112 +1,134 @@ { "name": "@azure/arm-botservice", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", - "description": "A generated SDK for AzureBotService.", - "version": "4.0.1", + "version": "5.0.0-beta.1", + "description": "A generated SDK for BotServiceClient.", "engines": { "node": ">=18.0.0" }, - "dependencies": { - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-lro": "^2.7.2", - "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.0", - "tslib": "^2.8.1" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/operationResultsOperationGroup": "./src/api/operationResultsOperationGroup/index.ts", + "./api/hostSettingsOperationGroup": "./src/api/hostSettingsOperationGroup/index.ts", + "./api/qnAMakerEndpointKeysOperationGroup": "./src/api/qnAMakerEndpointKeysOperationGroup/index.ts", + "./api/botConnectionOperationGroup": "./src/api/botConnectionOperationGroup/index.ts", + "./api/botsOperationGroup": "./src/api/botsOperationGroup/index.ts", + "./api/networkSecurityPerimeterConfigurations": "./src/api/networkSecurityPerimeterConfigurations/index.ts", + "./api/privateEndpointConnections": "./src/api/privateEndpointConnections/index.ts", + "./api/connectionSettings": "./src/api/connectionSettings/index.ts", + "./api/botChannels": "./src/api/botChannels/index.ts", + "./api/bots": "./src/api/bots/index.ts", + "./api/operations": "./src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "./tsconfig.src.json" }, + "type": "module", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/commonjs/index.d.ts", + "files": [ + "dist/", + "README.md", + "LICENSE", + "review/", + "CHANGELOG.md" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/botServiceContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/core-util": "^1.12.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.5.0", - "@azure/logger": "^1.1.4", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/identity": "^4.9.1", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.49.1", + "eslint": "^9.9.0", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "repository": "github:Azure/azure-sdk-for-js", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "files": [ - "dist/", - "README.md", - "LICENSE", - "review/", - "CHANGELOG.md" - ], "scripts": { "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", - "build:samples": "echo skipped.", - "check-format": "echo skipped", + "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", - "format": "echo skipped", - "lint": "echo skipped", + "execute:samples": "dev-tool samples run samples-dev", + "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", - "prepack": "npm run build", - "test": "npm run test:node && npm run test:browser", + "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", "test:browser": "echo skipped", "test:node": "dev-tool run test:vitest", - "test:node:esm": "dev-tool run test:vitest --esm", - "update-snippets": "dev-tool run update-snippets" + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "update-snippets": "dev-tool run update-snippets", + "test:node:esm": "dev-tool run test:vitest --esm" }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/azureBotService.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice", "//sampleConfiguration": { - "productName": "", + "productName": "@azure/arm-botservice", "productSlugs": [ "azure" ], "disableDocsMs": true, "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-botservice?view=azure-node-preview" }, - "type": "module", - "tshy": { - "project": "./tsconfig.src.json", - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - }, - "dialects": [ - "esm", - "commonjs" - ], - "esmDialects": [ - "browser", - "react-native" - ], - "selfLink": false - }, "browser": "./dist/browser/index.js", "react-native": "./dist/react-native/index.js", "exports": { @@ -128,6 +150,243 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/operationResultsOperationGroup": { + "browser": { + "types": "./dist/browser/api/operationResultsOperationGroup/index.d.ts", + "default": "./dist/browser/api/operationResultsOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operationResultsOperationGroup/index.d.ts", + "default": "./dist/react-native/api/operationResultsOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/operationResultsOperationGroup/index.d.ts", + "default": "./dist/esm/api/operationResultsOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operationResultsOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/operationResultsOperationGroup/index.js" + } + }, + "./api/hostSettingsOperationGroup": { + "browser": { + "types": "./dist/browser/api/hostSettingsOperationGroup/index.d.ts", + "default": "./dist/browser/api/hostSettingsOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/hostSettingsOperationGroup/index.d.ts", + "default": "./dist/react-native/api/hostSettingsOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/hostSettingsOperationGroup/index.d.ts", + "default": "./dist/esm/api/hostSettingsOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/hostSettingsOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/hostSettingsOperationGroup/index.js" + } + }, + "./api/qnAMakerEndpointKeysOperationGroup": { + "browser": { + "types": "./dist/browser/api/qnAMakerEndpointKeysOperationGroup/index.d.ts", + "default": "./dist/browser/api/qnAMakerEndpointKeysOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/qnAMakerEndpointKeysOperationGroup/index.d.ts", + "default": "./dist/react-native/api/qnAMakerEndpointKeysOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/qnAMakerEndpointKeysOperationGroup/index.d.ts", + "default": "./dist/esm/api/qnAMakerEndpointKeysOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/qnAMakerEndpointKeysOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/qnAMakerEndpointKeysOperationGroup/index.js" + } + }, + "./api/botConnectionOperationGroup": { + "browser": { + "types": "./dist/browser/api/botConnectionOperationGroup/index.d.ts", + "default": "./dist/browser/api/botConnectionOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/botConnectionOperationGroup/index.d.ts", + "default": "./dist/react-native/api/botConnectionOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/botConnectionOperationGroup/index.d.ts", + "default": "./dist/esm/api/botConnectionOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/botConnectionOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/botConnectionOperationGroup/index.js" + } + }, + "./api/botsOperationGroup": { + "browser": { + "types": "./dist/browser/api/botsOperationGroup/index.d.ts", + "default": "./dist/browser/api/botsOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/botsOperationGroup/index.d.ts", + "default": "./dist/react-native/api/botsOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/botsOperationGroup/index.d.ts", + "default": "./dist/esm/api/botsOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/botsOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/botsOperationGroup/index.js" + } + }, + "./api/networkSecurityPerimeterConfigurations": { + "browser": { + "types": "./dist/browser/api/networkSecurityPerimeterConfigurations/index.d.ts", + "default": "./dist/browser/api/networkSecurityPerimeterConfigurations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkSecurityPerimeterConfigurations/index.d.ts", + "default": "./dist/react-native/api/networkSecurityPerimeterConfigurations/index.js" + }, + "import": { + "types": "./dist/esm/api/networkSecurityPerimeterConfigurations/index.d.ts", + "default": "./dist/esm/api/networkSecurityPerimeterConfigurations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkSecurityPerimeterConfigurations/index.d.ts", + "default": "./dist/commonjs/api/networkSecurityPerimeterConfigurations/index.js" + } + }, + "./api/privateEndpointConnections": { + "browser": { + "types": "./dist/browser/api/privateEndpointConnections/index.d.ts", + "default": "./dist/browser/api/privateEndpointConnections/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/privateEndpointConnections/index.d.ts", + "default": "./dist/react-native/api/privateEndpointConnections/index.js" + }, + "import": { + "types": "./dist/esm/api/privateEndpointConnections/index.d.ts", + "default": "./dist/esm/api/privateEndpointConnections/index.js" + }, + "require": { + "types": "./dist/commonjs/api/privateEndpointConnections/index.d.ts", + "default": "./dist/commonjs/api/privateEndpointConnections/index.js" + } + }, + "./api/connectionSettings": { + "browser": { + "types": "./dist/browser/api/connectionSettings/index.d.ts", + "default": "./dist/browser/api/connectionSettings/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/connectionSettings/index.d.ts", + "default": "./dist/react-native/api/connectionSettings/index.js" + }, + "import": { + "types": "./dist/esm/api/connectionSettings/index.d.ts", + "default": "./dist/esm/api/connectionSettings/index.js" + }, + "require": { + "types": "./dist/commonjs/api/connectionSettings/index.d.ts", + "default": "./dist/commonjs/api/connectionSettings/index.js" + } + }, + "./api/botChannels": { + "browser": { + "types": "./dist/browser/api/botChannels/index.d.ts", + "default": "./dist/browser/api/botChannels/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/botChannels/index.d.ts", + "default": "./dist/react-native/api/botChannels/index.js" + }, + "import": { + "types": "./dist/esm/api/botChannels/index.d.ts", + "default": "./dist/esm/api/botChannels/index.js" + }, + "require": { + "types": "./dist/commonjs/api/botChannels/index.d.ts", + "default": "./dist/commonjs/api/botChannels/index.js" + } + }, + "./api/bots": { + "browser": { + "types": "./dist/browser/api/bots/index.d.ts", + "default": "./dist/browser/api/bots/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/bots/index.d.ts", + "default": "./dist/react-native/api/bots/index.js" + }, + "import": { + "types": "./dist/esm/api/bots/index.d.ts", + "default": "./dist/esm/api/bots/index.js" + }, + "require": { + "types": "./dist/commonjs/api/bots/index.d.ts", + "default": "./dist/commonjs/api/bots/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } } - } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" } diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-botChannels.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-botChannels.api.md new file mode 100644 index 000000000000..42dd4b235352 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-botChannels.api.md @@ -0,0 +1,61 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function $delete(context: BotServiceContext, resourceGroupName: string, resourceName: string, channelName: string, options?: BotChannelsDeleteOptionalParams): Promise; + +// @public +export interface BotChannelsCreateOptionalParams extends OperationOptions { +} + +// @public +export interface BotChannelsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface BotChannelsGetOptionalParams extends OperationOptions { +} + +// @public +export interface BotChannelsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface BotChannelsListWithKeysOptionalParams extends OperationOptions { +} + +// @public +export interface BotChannelsRegenerateKeysOptionalParams extends OperationOptions { +} + +// @public +export interface BotChannelsUpdateOptionalParams extends OperationOptions { +} + +// @public +export function create(context: BotServiceContext, resourceGroupName: string, resourceName: string, channelName: string, parameters: BotChannel, options?: BotChannelsCreateOptionalParams): Promise; + +// @public +export function get(context: BotServiceContext, resourceGroupName: string, resourceName: string, channelName: string, options?: BotChannelsGetOptionalParams): Promise; + +// @public +export function listByResourceGroup(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: BotChannelsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listWithKeys(context: BotServiceContext, resourceGroupName: string, resourceName: string, channelName: string, options?: BotChannelsListWithKeysOptionalParams): Promise; + +// @public +export function regenerateKeys(context: BotServiceContext, resourceGroupName: string, resourceName: string, channelName: string, parameters: SiteInfo, options?: BotChannelsRegenerateKeysOptionalParams): Promise; + +// @public +export function update(context: BotServiceContext, resourceGroupName: string, resourceName: string, channelName: string, parameters: BotChannel, options?: BotChannelsUpdateOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-botConnectionOperationGroup.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-botConnectionOperationGroup.api.md new file mode 100644 index 000000000000..185083973d26 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-botConnectionOperationGroup.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export interface BotConnectionOperationGroupListServiceProvidersOptionalParams extends OperationOptions { +} + +// @public +export function listServiceProviders(context: BotServiceContext, options?: BotConnectionOperationGroupListServiceProvidersOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-bots.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-bots.api.md new file mode 100644 index 000000000000..5b3537a08308 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-bots.api.md @@ -0,0 +1,68 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function $delete(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: BotsDeleteOptionalParams): Promise; + +// @public +export interface BotsCreateOptionalParams extends OperationOptions { +} + +// @public +export interface BotsCreateSignInUrlOptionalParams extends OperationOptions { +} + +// @public +export interface BotsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface BotsGetOptionalParams extends OperationOptions { +} + +// @public +export interface BotsListByBotResourceOptionalParams extends OperationOptions { +} + +// @public +export interface BotsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface BotsListOptionalParams extends OperationOptions { +} + +// @public +export interface BotsUpdateOptionalParams extends OperationOptions { +} + +// @public +export function create(context: BotServiceContext, resourceGroupName: string, resourceName: string, parameters: Bot, options?: BotsCreateOptionalParams): Promise; + +// @public +export function createSignInUrl(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: BotsCreateSignInUrlOptionalParams): Promise; + +// @public +export function get(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: BotsGetOptionalParams): Promise; + +// @public +export function list(context: BotServiceContext, options?: BotsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByBotResource(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: BotsListByBotResourceOptionalParams): Promise; + +// @public +export function listByResourceGroup(context: BotServiceContext, resourceGroupName: string, options?: BotsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: BotServiceContext, resourceGroupName: string, resourceName: string, parameters: Bot, options?: BotsUpdateOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-botsOperationGroup.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-botsOperationGroup.api.md new file mode 100644 index 000000000000..b8ebe1c3d589 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-botsOperationGroup.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export interface BotsOperationGroupGetCheckNameAvailabilityOptionalParams extends OperationOptions { +} + +// @public +export function getCheckNameAvailability(context: BotServiceContext, parameters: CheckNameAvailabilityRequestBody, options?: BotsOperationGroupGetCheckNameAvailabilityOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-connectionSettings.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-connectionSettings.api.md new file mode 100644 index 000000000000..9d06bdd759f6 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-connectionSettings.api.md @@ -0,0 +1,54 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function $delete(context: BotServiceContext, resourceGroupName: string, resourceName: string, connectionName: string, options?: ConnectionSettingsDeleteOptionalParams): Promise; + +// @public +export interface ConnectionSettingsCreateOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsListByBotServiceOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsListWithSecretsOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsUpdateOptionalParams extends OperationOptions { +} + +// @public +export function create(context: BotServiceContext, resourceGroupName: string, resourceName: string, connectionName: string, parameters: ConnectionSetting, options?: ConnectionSettingsCreateOptionalParams): Promise; + +// @public +export function get(context: BotServiceContext, resourceGroupName: string, resourceName: string, connectionName: string, options?: ConnectionSettingsGetOptionalParams): Promise; + +// @public +export function listByBotService(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: ConnectionSettingsListByBotServiceOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listWithSecrets(context: BotServiceContext, resourceGroupName: string, resourceName: string, connectionName: string, options?: ConnectionSettingsListWithSecretsOptionalParams): Promise; + +// @public +export function update(context: BotServiceContext, resourceGroupName: string, resourceName: string, connectionName: string, parameters: ConnectionSetting, options?: ConnectionSettingsUpdateOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-hostSettingsOperationGroup.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-hostSettingsOperationGroup.api.md new file mode 100644 index 000000000000..907e369d86a3 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-hostSettingsOperationGroup.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function get(context: BotServiceContext, options?: HostSettingsOperationGroupGetOptionalParams): Promise; + +// @public +export interface HostSettingsOperationGroupGetOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-networkSecurityPerimeterConfigurations.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-networkSecurityPerimeterConfigurations.api.md new file mode 100644 index 000000000000..2bc6c154c5e0 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-networkSecurityPerimeterConfigurations.api.md @@ -0,0 +1,36 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function get(context: BotServiceContext, resourceGroupName: string, resourceName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams): Promise; + +// @public +export function list(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: NetworkSecurityPerimeterConfigurationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsListOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function reconcile(context: BotServiceContext, resourceGroupName: string, resourceName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams): PollerLike, NetworkSecurityPerimeterConfiguration>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-operationResultsOperationGroup.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-operationResultsOperationGroup.api.md new file mode 100644 index 000000000000..4f3ea01f124e --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-operationResultsOperationGroup.api.md @@ -0,0 +1,22 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function get(context: BotServiceContext, operationResultId: string, options?: OperationResultsOperationGroupGetOptionalParams): PollerLike, OperationResultsDescription>; + +// @public +export interface OperationResultsOperationGroupGetOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-operations.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-operations.api.md new file mode 100644 index 000000000000..5543b2d0540a --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-operations.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: BotServiceContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-privateEndpointConnections.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-privateEndpointConnections.api.md new file mode 100644 index 000000000000..82ee9a87ecb2 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-privateEndpointConnections.api.md @@ -0,0 +1,40 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function $delete(context: BotServiceContext, resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + +// @public +export function create(context: BotServiceContext, resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; + +// @public +export function get(context: BotServiceContext, resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + +// @public +export function list(context: BotServiceContext, resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api-qnAMakerEndpointKeysOperationGroup.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api-qnAMakerEndpointKeysOperationGroup.api.md new file mode 100644 index 000000000000..7d2eecc3b3e0 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api-qnAMakerEndpointKeysOperationGroup.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function get(context: BotServiceContext, parameters: QnAMakerEndpointKeysRequestBody, options?: QnAMakerEndpointKeysOperationGroupGetOptionalParams): Promise; + +// @public +export interface QnAMakerEndpointKeysOperationGroupGetOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-api.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-api.api.md new file mode 100644 index 000000000000..930a690604ca --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-api.api.md @@ -0,0 +1,27 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export interface BotServiceClientOptionalParams extends ClientOptions { + apiVersion?: string; +} + +// @public +export interface BotServiceContext extends Client { + apiVersion: string; + subscriptionId: string; +} + +// @public +export function createBotService(credential: TokenCredential, subscriptionId: string, options?: BotServiceClientOptionalParams): BotServiceContext; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice-models.api.md b/sdk/botservice/arm-botservice/review/arm-botservice-models.api.md new file mode 100644 index 000000000000..a69a00b61b58 --- /dev/null +++ b/sdk/botservice/arm-botservice/review/arm-botservice-models.api.md @@ -0,0 +1,917 @@ +## API Report File for "@azure/arm-botservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type AccessMode = string; + +// @public +export interface AcsChatChannel extends Channel { + channelName: "AcsChatChannel"; +} + +// @public +export interface AlexaChannel extends Channel { + channelName: "AlexaChannel"; + properties?: AlexaChannelProperties; +} + +// @public +export interface AlexaChannelProperties { + alexaSkillId: string; + isEnabled: boolean; + readonly serviceEndpointUri?: string; + readonly urlFragment?: string; +} + +// @public +export interface Bot extends TrackedResource { + etag?: string; + kind?: Kind; + properties?: BotProperties; + sku?: Sku; + readonly zones?: string[]; +} + +// @public +export interface BotChannel extends TrackedResource { + etag?: string; + kind?: Kind; + properties?: ChannelUnion; + sku?: Sku; + readonly zones?: string[]; +} + +// @public +export interface BotProperties { + allSettings?: Record; + appPasswordHint?: string; + readonly cmekEncryptionStatus?: string; + cmekKeyVaultUrl?: string; + readonly configuredChannels?: string[]; + description?: string; + developerAppInsightKey?: string; + developerAppInsightsApiKey?: string; + developerAppInsightsApplicationId?: string; + disableLocalAuth?: boolean; + displayName: string; + readonly enabledChannels?: string[]; + endpoint: string | null; + readonly endpointVersion?: string; + iconUrl?: string; + isCmekEnabled?: boolean; + readonly isDeveloperAppInsightsApiKeySet?: boolean; + isStreamingSupported?: boolean; + luisAppIds?: string[]; + luisKey?: string; + manifestUrl?: string; + readonly migrationToken?: string; + msaAppId: string; + msaAppMSIResourceId?: string; + msaAppTenantId?: string; + msaAppType?: MsaAppType; + readonly networkSecurityPerimeterConfigurations?: NetworkSecurityPerimeterConfiguration[]; + openWithHint?: string; + parameters?: Record; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + publishingCredentials?: string; + schemaTransformationVersion?: string | null; + storageResourceId?: string; + tenantId?: string; +} + +// @public +export interface Channel { + channelName: string; + etag?: string | null; + location?: string; + readonly provisioningState?: string; +} + +// @public +export interface ChannelSettings { + botIconUrl?: string; + botId?: string; + channelDisplayName?: string; + channelId?: string; + disableLocalAuth?: boolean; + extensionKey1?: string; + extensionKey2?: string; + isEnabled?: boolean; + requireTermsAgreement?: boolean; + sites?: Site[]; +} + +// @public +export type ChannelUnion = AlexaChannel | FacebookChannel | EmailChannel | OutlookChannel | MsTeamsChannel | SkypeChannel | KikChannel | WebChatChannel | DirectLineChannel | TelegramChannel | SmsChannel | SlackChannel | LineChannel | DirectLineSpeechChannel | Omnichannel | TelephonyChannel | AcsChatChannel | SearchAssistant | M365Extensions | Channel; + +// @public +export interface CheckNameAvailabilityRequestBody { + name?: string; + type?: string; +} + +// @public +export interface CheckNameAvailabilityResponseBody { + absCode?: string; + message?: string; + valid?: boolean; +} + +// @public +export interface ConnectionSetting extends TrackedResource { + etag?: string; + kind?: Kind; + properties?: ConnectionSettingProperties; + sku?: Sku; + readonly zones?: string[]; +} + +// @public +export interface ConnectionSettingParameter { + key?: string; + value?: string | null; +} + +// @public +export interface ConnectionSettingProperties { + clientId?: string; + clientSecret?: string; + id?: string; + name?: string; + parameters?: ConnectionSettingParameter[]; + provisioningState?: string; + scopes?: string; + serviceProviderDisplayName?: string; + serviceProviderId?: string; + readonly settingId?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface CreateEmailSignInUrlResponse { + readonly id?: string; + location?: string; + properties?: CreateEmailSignInUrlResponseProperties; +} + +// @public +export interface CreateEmailSignInUrlResponseProperties { + url?: string; +} + +// @public +export interface DirectLineChannel extends Channel { + channelName: "DirectLineChannel"; + properties?: DirectLineChannelProperties; +} + +// @public +export interface DirectLineChannelProperties { + directLineEmbedCode?: string; + extensionKey1?: string; + extensionKey2?: string; + sites?: DirectLineSite[]; +} + +// @public +export interface DirectLineSite extends Site { +} + +// @public +export interface DirectLineSpeechChannel extends Channel { + channelName: "DirectLineSpeechChannel"; + properties?: DirectLineSpeechChannelProperties; +} + +// @public +export interface DirectLineSpeechChannelProperties { + cognitiveServiceRegion?: string | null; + cognitiveServiceResourceId?: string; + cognitiveServiceSubscriptionKey?: string | null; + customSpeechModelId?: string; + customVoiceDeploymentId?: string; + isDefaultBotForCogSvcAccount?: boolean; + isEnabled?: boolean; +} + +// @public +export interface EmailChannel extends Channel { + channelName: "EmailChannel"; + properties?: EmailChannelProperties; +} + +// @public +export type EmailChannelAuthMethod = 0 | 1; + +// @public +export interface EmailChannelProperties { + authMethod?: EmailChannelAuthMethod; + emailAddress: string; + isEnabled: boolean; + magicCode?: string; + password?: string; +} + +// @public +export interface ErrorBody { + code: string; + message: string; +} + +// @public +export interface ErrorModel { + error?: ErrorBody; +} + +// @public +export interface FacebookChannel extends Channel { + channelName: "FacebookChannel"; + properties?: FacebookChannelProperties; +} + +// @public +export interface FacebookChannelProperties { + appId: string; + appSecret?: string; + readonly callbackUrl?: string; + isEnabled: boolean; + pages?: FacebookPage[]; + readonly verifyToken?: string; +} + +// @public +export interface FacebookPage { + accessToken?: string; + id: string; +} + +// @public +export interface HostSettingsResponse { + botOpenIdMetadata?: string; + oAuthUrl?: string; + toBotFromChannelOpenIdMetadataUrl?: string; + toBotFromChannelTokenIssuer?: string; + toBotFromEmulatorOpenIdMetadataUrl?: string; + toChannelFromBotLoginUrl?: string; + toChannelFromBotOAuthScope?: string; + validateAuthority?: boolean; +} + +// @public +export type Key = "key1" | "key2"; + +// @public +export interface KikChannel extends Channel { + channelName: "KikChannel"; + properties?: KikChannelProperties; +} + +// @public +export interface KikChannelProperties { + apiKey?: string; + isEnabled: boolean; + isValidated?: boolean; + userName: string; +} + +// @public +export type Kind = string; + +// @public +export enum KnownAccessMode { + // (undocumented) + Audit = "Audit", + // (undocumented) + Enforced = "Enforced", + // (undocumented) + Learning = "Learning" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownKind { + // (undocumented) + Azurebot = "azurebot", + // (undocumented) + Bot = "bot", + // (undocumented) + Designer = "designer", + // (undocumented) + Function = "function", + // (undocumented) + Sdk = "sdk" +} + +// @public +export enum KnownMsaAppType { + // (undocumented) + MultiTenant = "MultiTenant", + // (undocumented) + SingleTenant = "SingleTenant", + // (undocumented) + UserAssignedMSI = "UserAssignedMSI" +} + +// @public +export enum KnownNspAccessRuleDirection { + // (undocumented) + Inbound = "Inbound", + // (undocumented) + Outbound = "Outbound" +} + +// @public +export enum KnownOperationResultStatus { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Failed = "Failed", + // (undocumented) + Requested = "Requested", + // (undocumented) + Running = "Running", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownPublicNetworkAccess { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled", + // (undocumented) + SecuredByPerimeter = "SecuredByPerimeter" +} + +// @public +export enum KnownSeverity { + // (undocumented) + Error = "Error", + // (undocumented) + Warning = "Warning" +} + +// @public +export enum KnownSkuName { + // (undocumented) + F0 = "F0", + // (undocumented) + S1 = "S1" +} + +// @public +export enum KnownSkuTier { + // (undocumented) + Free = "Free", + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownVersions { + V20230915Preview = "2023-09-15-preview" +} + +// @public +export interface LineChannel extends Channel { + channelName: "LineChannel"; + properties?: LineChannelProperties; +} + +// @public +export interface LineChannelProperties { + readonly callbackUrl?: string; + readonly isValidated?: boolean; + lineRegistrations: LineRegistration[]; +} + +// @public +export interface LineRegistration { + channelAccessToken?: string; + channelSecret?: string; + readonly generatedId?: string; +} + +// @public +export interface ListChannelWithKeysResponse extends BotChannel { + changedTime?: string; + entityTag?: string; + provisioningState?: string; + resource?: ChannelUnion; + setting?: ChannelSettings; +} + +// @public +export interface M365Extensions extends Channel { + channelName: "M365Extensions"; +} + +// @public +export type MsaAppType = string; + +// @public +export interface MsTeamsChannel extends Channel { + channelName: "MsTeamsChannel"; + properties?: MsTeamsChannelProperties; +} + +// @public +export interface MsTeamsChannelProperties { + acceptedTerms?: boolean | null; + callingWebhook?: string; + deploymentEnvironment?: string; + enableCalling?: boolean; + incomingCallRoute?: string; + isEnabled: boolean; +} + +// @public +export interface NetworkSecurityPerimeter { + readonly id?: string; + location?: string; + perimeterGuid?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationProperties { + readonly networkSecurityPerimeter?: NetworkSecurityPerimeter; + readonly profile?: Profile; + provisioningIssues?: ProvisioningIssue[]; + // (undocumented) + provisioningState?: ProvisioningState; + readonly resourceAssociation?: ResourceAssociation; +} + +// @public +export interface NspAccessRule { + name?: string; + readonly properties?: NspAccessRuleProperties; +} + +// @public +export type NspAccessRuleDirection = string; + +// @public +export interface NspAccessRuleProperties { + addressPrefixes?: string[]; + direction?: NspAccessRuleDirection; + readonly emailAddresses?: string[]; + readonly fullyQualifiedDomainNames?: string[]; + readonly networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + readonly phoneNumbers?: string[]; + subscriptions?: NspAccessRulePropertiesSubscriptionsItem[]; +} + +// @public +export interface NspAccessRulePropertiesSubscriptionsItem { + id?: string; +} + +// @public +export interface Omnichannel extends Channel { + channelName: "Omnichannel"; +} + +// @public +export interface OperationDisplayInfo { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationEntity { + display?: OperationDisplayInfo; + name?: string; + origin?: string; + properties?: any; +} + +// @public +export interface OperationResultsDescription { + readonly id?: string; + readonly name?: string; + readonly startTime?: Date; + readonly status?: OperationResultStatus; +} + +// @public +export type OperationResultStatus = string; + +// @public +export interface OutlookChannel extends Channel { + channelName: "OutlookChannel"; +} + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends ProxyResource { + properties?: PrivateEndpointConnectionProperties; +} + +// @public +export interface PrivateEndpointConnectionProperties { + groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends PrivateLinkResourceBase { + properties?: PrivateLinkResourceProperties; +} + +// @public +export interface PrivateLinkResourceBase { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface PrivateLinkResourceListResult { + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export interface Profile { + accessRules?: NspAccessRule[]; + accessRulesVersion?: number; + diagnosticSettingsVersion?: number; + readonly enabledLogCategories?: string[]; + name?: string; +} + +// @public +export interface ProvisioningIssue { + name?: string; + readonly properties?: ProvisioningIssueProperties; +} + +// @public +export interface ProvisioningIssueProperties { + description?: string; + issueType?: string; + severity?: Severity; + suggestedAccessRules?: NspAccessRule[]; + readonly suggestedResourceIds?: string[]; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface QnAMakerEndpointKeysRequestBody { + authkey?: string; + hostname?: string; +} + +// @public +export interface QnAMakerEndpointKeysResponse { + installedVersion?: string; + lastStableVersion?: string; + primaryEndpointKey?: string; + secondaryEndpointKey?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceAssociation { + accessMode?: AccessMode; + name?: string; +} + +// @public +export interface SearchAssistant extends Channel { + channelName: "SearchAssistant"; +} + +// @public +export interface ServiceProvider { + properties?: ServiceProviderProperties; +} + +// @public +export interface ServiceProviderParameter { + readonly default?: string; + readonly description?: string; + readonly displayName?: string; + readonly helpUrl?: string; + readonly metadata?: ServiceProviderParameterMetadata; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ServiceProviderParameterMetadata { + constraints?: ServiceProviderParameterMetadataConstraints; +} + +// @public +export interface ServiceProviderParameterMetadataConstraints { + required?: boolean; +} + +// @public +export interface ServiceProviderProperties { + readonly devPortalUrl?: string; + readonly displayName?: string; + iconUrl?: string; + readonly id?: string; + parameters?: ServiceProviderParameter[]; + readonly serviceProviderName?: string; +} + +// @public +export interface ServiceProviderResponseList { + nextLink?: string; + readonly value?: ServiceProvider[]; +} + +// @public +export type Severity = string; + +// @public +export interface Site { + appId?: string; + eTag?: string; + isBlockUserUploadEnabled?: boolean | null; + isDetailedLoggingEnabled?: boolean; + isEnabled: boolean; + isEndpointParametersEnabled?: boolean; + isNoStorageEnabled?: boolean; + isSecureSiteEnabled?: boolean; + readonly isTokenEnabled?: boolean; + isV1Enabled?: boolean; + isV3Enabled?: boolean; + isWebchatPreviewEnabled?: boolean; + isWebChatSpeechEnabled?: boolean; + readonly key?: string; + readonly key2?: string; + readonly siteId?: string; + siteName: string; + tenantId?: string; + trustedOrigins?: string[]; +} + +// @public +export interface SiteInfo { + key: Key; + siteName: string; +} + +// @public +export interface Sku { + name: SkuName; + readonly tier?: SkuTier; +} + +// @public +export type SkuName = string; + +// @public +export type SkuTier = string; + +// @public +export interface SkypeChannel extends Channel { + channelName: "SkypeChannel"; + properties?: SkypeChannelProperties; +} + +// @public +export interface SkypeChannelProperties { + callingWebHook?: string; + enableCalling?: boolean; + enableGroups?: boolean; + enableMediaCards?: boolean; + enableMessaging?: boolean; + enableScreenSharing?: boolean; + enableVideo?: boolean; + groupsMode?: string; + incomingCallRoute?: string; + isEnabled: boolean; +} + +// @public +export interface SlackChannel extends Channel { + channelName: "SlackChannel"; + properties?: SlackChannelProperties; +} + +// @public +export interface SlackChannelProperties { + clientId?: string; + clientSecret?: string; + isEnabled: boolean; + readonly isValidated?: boolean; + landingPageUrl?: string; + readonly lastSubmissionId?: string; + readonly redirectAction?: string; + registerBeforeOAuthFlow?: boolean; + scopes?: string; + signingSecret?: string; + verificationToken?: string; +} + +// @public +export interface SmsChannel extends Channel { + channelName: "SmsChannel"; + properties?: SmsChannelProperties; +} + +// @public +export interface SmsChannelProperties { + accountSID: string; + authToken?: string; + isEnabled: boolean; + isValidated?: boolean; + phone: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TelegramChannel extends Channel { + channelName: "TelegramChannel"; + properties?: TelegramChannelProperties; +} + +// @public +export interface TelegramChannelProperties { + accessToken?: string; + isEnabled: boolean; + isValidated?: boolean; +} + +// @public +export interface TelephonyChannel extends Channel { + channelName: "TelephonyChannel"; + properties?: TelephonyChannelProperties; +} + +// @public +export interface TelephonyChannelProperties { + apiConfigurations?: TelephonyChannelResourceApiConfiguration[]; + cognitiveServiceRegion?: string | null; + cognitiveServiceSubscriptionKey?: string | null; + defaultLocale?: string | null; + isEnabled?: boolean; + phoneNumbers?: TelephonyPhoneNumbers[]; + premiumSKU?: string | null; +} + +// @public +export interface TelephonyChannelResourceApiConfiguration { + cognitiveServiceRegion?: string | null; + cognitiveServiceResourceId?: string | null; + cognitiveServiceSubscriptionKey?: string | null; + defaultLocale?: string | null; + id?: string; + providerName?: string | null; +} + +// @public +export interface TelephonyPhoneNumbers { + acsEndpoint?: string | null; + acsResourceId?: string | null; + acsSecret?: string | null; + cognitiveServiceRegion?: string | null; + cognitiveServiceResourceId?: string | null; + cognitiveServiceSubscriptionKey?: string | null; + defaultLocale?: string | null; + id?: string; + offerType?: string | null; + phoneNumber?: string; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface WebChatChannel extends Channel { + channelName: "WebChatChannel"; + properties?: WebChatChannelProperties; +} + +// @public +export interface WebChatChannelProperties { + sites?: WebChatSite[]; + readonly webChatEmbedCode?: string; +} + +// @public +export interface WebChatSite extends Site { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/botservice/arm-botservice/review/arm-botservice.api.md b/sdk/botservice/arm-botservice/review/arm-botservice.api.md index a3d98757957e..11974bc7b264 100644 --- a/sdk/botservice/arm-botservice/review/arm-botservice.api.md +++ b/sdk/botservice/arm-botservice/review/arm-botservice.api.md @@ -4,11 +4,17 @@ ```ts -import * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { AbortSignalLike } from '@azure/abort-controller'; +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export type AccessMode = string; // @public export interface AcsChatChannel extends Channel { @@ -29,125 +35,75 @@ export interface AlexaChannelProperties { readonly urlFragment?: string; } -// @public (undocumented) -export class AzureBotService extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureBotServiceOptionalParams); - // (undocumented) - apiVersion: string; - // (undocumented) - botConnection: BotConnection; - // (undocumented) - bots: Bots; - // (undocumented) - channels: Channels; - // (undocumented) - directLine: DirectLine; - // (undocumented) - email: Email; - // (undocumented) - hostSettings: HostSettings; - // (undocumented) - operationResults: OperationResults; - // (undocumented) - operations: Operations; - // (undocumented) - privateEndpointConnections: PrivateEndpointConnections; - // (undocumented) - privateLinkResources: PrivateLinkResources; - // (undocumented) - qnAMakerEndpointKeys: QnAMakerEndpointKeys; - // (undocumented) - subscriptionId: string; -} - -// @public -export interface AzureBotServiceOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; - endpoint?: string; -} - // @public -export interface Bot extends Resource { +export interface Bot extends TrackedResource { + etag?: string; + kind?: Kind; properties?: BotProperties; + sku?: Sku; + readonly zones?: string[]; } // @public -export interface BotChannel extends Resource { +export interface BotChannel extends TrackedResource { + etag?: string; + kind?: Kind; properties?: ChannelUnion; + sku?: Sku; + readonly zones?: string[]; } // @public -export interface BotConnection { - create(resourceGroupName: string, resourceName: string, connectionName: string, parameters: ConnectionSetting, options?: BotConnectionCreateOptionalParams): Promise; - delete(resourceGroupName: string, resourceName: string, connectionName: string, options?: BotConnectionDeleteOptionalParams): Promise; - get(resourceGroupName: string, resourceName: string, connectionName: string, options?: BotConnectionGetOptionalParams): Promise; - listByBotService(resourceGroupName: string, resourceName: string, options?: BotConnectionListByBotServiceOptionalParams): PagedAsyncIterableIterator; - listServiceProviders(options?: BotConnectionListServiceProvidersOptionalParams): Promise; - listWithSecrets(resourceGroupName: string, resourceName: string, connectionName: string, options?: BotConnectionListWithSecretsOptionalParams): Promise; - update(resourceGroupName: string, resourceName: string, connectionName: string, parameters: ConnectionSetting, options?: BotConnectionUpdateOptionalParams): Promise; +export interface BotChannelsCreateOptionalParams extends OperationOptions { } // @public -export interface BotConnectionCreateOptionalParams extends coreClient.OperationOptions { +export interface BotChannelsDeleteOptionalParams extends OperationOptions { } // @public -export type BotConnectionCreateResponse = ConnectionSetting; - -// @public -export interface BotConnectionDeleteOptionalParams extends coreClient.OperationOptions { +export interface BotChannelsGetOptionalParams extends OperationOptions { } // @public -export interface BotConnectionGetOptionalParams extends coreClient.OperationOptions { +export interface BotChannelsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type BotConnectionGetResponse = ConnectionSetting; - -// @public -export interface BotConnectionListByBotServiceNextOptionalParams extends coreClient.OperationOptions { +export interface BotChannelsListWithKeysOptionalParams extends OperationOptions { } // @public -export type BotConnectionListByBotServiceNextResponse = ConnectionSettingResponseList; - -// @public -export interface BotConnectionListByBotServiceOptionalParams extends coreClient.OperationOptions { +export interface BotChannelsOperations { + create: (resourceGroupName: string, resourceName: string, channelName: string, parameters: BotChannel, options?: BotChannelsCreateOptionalParams) => Promise; + delete: (resourceGroupName: string, resourceName: string, channelName: string, options?: BotChannelsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, resourceName: string, channelName: string, options?: BotChannelsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, resourceName: string, options?: BotChannelsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listWithKeys: (resourceGroupName: string, resourceName: string, channelName: string, options?: BotChannelsListWithKeysOptionalParams) => Promise; + regenerateKeys: (resourceGroupName: string, resourceName: string, channelName: string, parameters: SiteInfo, options?: BotChannelsRegenerateKeysOptionalParams) => Promise; + update: (resourceGroupName: string, resourceName: string, channelName: string, parameters: BotChannel, options?: BotChannelsUpdateOptionalParams) => Promise; } // @public -export type BotConnectionListByBotServiceResponse = ConnectionSettingResponseList; - -// @public -export interface BotConnectionListServiceProvidersOptionalParams extends coreClient.OperationOptions { +export interface BotChannelsRegenerateKeysOptionalParams extends OperationOptions { } // @public -export type BotConnectionListServiceProvidersResponse = ServiceProviderResponseList; - -// @public -export interface BotConnectionListWithSecretsOptionalParams extends coreClient.OperationOptions { +export interface BotChannelsUpdateOptionalParams extends OperationOptions { } // @public -export type BotConnectionListWithSecretsResponse = ConnectionSetting; - -// @public -export interface BotConnectionUpdateOptionalParams extends coreClient.OperationOptions { +export interface BotConnectionOperationGroupListServiceProvidersOptionalParams extends OperationOptions { } // @public -export type BotConnectionUpdateResponse = ConnectionSetting; +export interface BotConnectionOperationGroupOperations { + listServiceProviders: (options?: BotConnectionOperationGroupListServiceProvidersOptionalParams) => Promise; +} // @public export interface BotProperties { - allSettings?: { - [propertyName: string]: string; - }; + allSettings?: Record; appPasswordHint?: string; readonly cmekEncryptionStatus?: string; cmekKeyVaultUrl?: string; @@ -173,142 +129,101 @@ export interface BotProperties { msaAppMSIResourceId?: string; msaAppTenantId?: string; msaAppType?: MsaAppType; + readonly networkSecurityPerimeterConfigurations?: NetworkSecurityPerimeterConfiguration[]; openWithHint?: string; - parameters?: { - [propertyName: string]: string; - }; + parameters?: Record; readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: string; publicNetworkAccess?: PublicNetworkAccess; publishingCredentials?: string; - schemaTransformationVersion?: string; + schemaTransformationVersion?: string | null; storageResourceId?: string; tenantId?: string; } // @public -export interface BotResponseList { - nextLink?: string; - readonly value?: Bot[]; +export interface BotsCreateOptionalParams extends OperationOptions { } // @public -export interface Bots { - create(resourceGroupName: string, resourceName: string, parameters: Bot, options?: BotsCreateOptionalParams): Promise; - delete(resourceGroupName: string, resourceName: string, options?: BotsDeleteOptionalParams): Promise; - get(resourceGroupName: string, resourceName: string, options?: BotsGetOptionalParams): Promise; - getCheckNameAvailability(parameters: CheckNameAvailabilityRequestBody, options?: BotsGetCheckNameAvailabilityOptionalParams): Promise; - list(options?: BotsListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: BotsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, resourceName: string, options?: BotsUpdateOptionalParams): Promise; +export interface BotsCreateSignInUrlOptionalParams extends OperationOptions { } // @public -export interface BotsCreateOptionalParams extends coreClient.OperationOptions { +export interface BotsDeleteOptionalParams extends OperationOptions { } -// @public -export type BotsCreateResponse = Bot; - -// @public -export interface BotsDeleteOptionalParams extends coreClient.OperationOptions { +// @public (undocumented) +export class BotServiceClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: BotServiceClientOptionalParams); + readonly botChannels: BotChannelsOperations; + readonly botConnectionOperationGroup: BotConnectionOperationGroupOperations; + readonly bots: BotsOperations; + readonly botsOperationGroup: BotsOperationGroupOperations; + readonly connectionSettings: ConnectionSettingsOperations; + readonly hostSettingsOperationGroup: HostSettingsOperationGroupOperations; + readonly networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurationsOperations; + readonly operationResultsOperationGroup: OperationResultsOperationGroupOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; + readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + readonly qnAMakerEndpointKeysOperationGroup: QnAMakerEndpointKeysOperationGroupOperations; +} + +// @public +export interface BotServiceClientOptionalParams extends ClientOptions { + apiVersion?: string; } // @public -export interface BotsGetCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +export interface BotsGetOptionalParams extends OperationOptions { } // @public -export type BotsGetCheckNameAvailabilityResponse = CheckNameAvailabilityResponseBody; - -// @public -export interface BotsGetOptionalParams extends coreClient.OperationOptions { +export interface BotsListByBotResourceOptionalParams extends OperationOptions { } // @public -export type BotsGetResponse = Bot; - -// @public -export interface BotsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface BotsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type BotsListByResourceGroupNextResponse = BotResponseList; - -// @public -export interface BotsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface BotsListOptionalParams extends OperationOptions { } // @public -export type BotsListByResourceGroupResponse = BotResponseList; - -// @public -export interface BotsListNextOptionalParams extends coreClient.OperationOptions { +export interface BotsOperationGroupGetCheckNameAvailabilityOptionalParams extends OperationOptions { } // @public -export type BotsListNextResponse = BotResponseList; - -// @public -export interface BotsListOptionalParams extends coreClient.OperationOptions { +export interface BotsOperationGroupOperations { + getCheckNameAvailability: (parameters: CheckNameAvailabilityRequestBody, options?: BotsOperationGroupGetCheckNameAvailabilityOptionalParams) => Promise; } // @public -export type BotsListResponse = BotResponseList; - -// @public -export interface BotsUpdateOptionalParams extends coreClient.OperationOptions { - etag?: string; - kind?: Kind; - location?: string; - properties?: BotProperties; - sku?: Sku; - tags?: { - [propertyName: string]: string; - }; +export interface BotsOperations { + create: (resourceGroupName: string, resourceName: string, parameters: Bot, options?: BotsCreateOptionalParams) => Promise; + createSignInUrl: (resourceGroupName: string, resourceName: string, options?: BotsCreateSignInUrlOptionalParams) => Promise; + delete: (resourceGroupName: string, resourceName: string, options?: BotsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, resourceName: string, options?: BotsGetOptionalParams) => Promise; + list: (options?: BotsListOptionalParams) => PagedAsyncIterableIterator; + listByBotResource: (resourceGroupName: string, resourceName: string, options?: BotsListByBotResourceOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: BotsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, resourceName: string, parameters: Bot, options?: BotsUpdateOptionalParams) => Promise; } // @public -export type BotsUpdateResponse = Bot; +export interface BotsUpdateOptionalParams extends OperationOptions { +} // @public export interface Channel { - channelName: "AlexaChannel" | "FacebookChannel" | "EmailChannel" | "OutlookChannel" | "MsTeamsChannel" | "SkypeChannel" | "KikChannel" | "WebChatChannel" | "DirectLineChannel" | "TelegramChannel" | "SmsChannel" | "SlackChannel" | "LineChannel" | "DirectLineSpeechChannel" | "Omnichannel" | "TelephonyChannel" | "AcsChatChannel" | "SearchAssistant" | "M365Extensions"; - etag?: string; + channelName: string; + etag?: string | null; location?: string; readonly provisioningState?: string; } -// @public -export type ChannelName = "AlexaChannel" | "FacebookChannel" | "EmailChannel" | "KikChannel" | "TelegramChannel" | "SlackChannel" | "MsTeamsChannel" | "SkypeChannel" | "WebChatChannel" | "DirectLineChannel" | "SmsChannel" | "LineChannel" | "DirectLineSpeechChannel" | "OutlookChannel" | "Omnichannel" | "TelephonyChannel" | "AcsChatChannel" | "SearchAssistant" | "M365Extensions"; - -// @public -export interface ChannelResponseList { - nextLink?: string; - readonly value?: BotChannel[]; -} - -// @public -export interface Channels { - create(resourceGroupName: string, resourceName: string, channelName: ChannelName, parameters: BotChannel, options?: ChannelsCreateOptionalParams): Promise; - delete(resourceGroupName: string, resourceName: string, channelName: string, options?: ChannelsDeleteOptionalParams): Promise; - get(resourceGroupName: string, resourceName: string, channelName: string, options?: ChannelsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, resourceName: string, options?: ChannelsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listWithKeys(resourceGroupName: string, resourceName: string, channelName: ChannelName, options?: ChannelsListWithKeysOptionalParams): Promise; - update(resourceGroupName: string, resourceName: string, channelName: ChannelName, options?: ChannelsUpdateOptionalParams): Promise; -} - -// @public -export interface ChannelsCreateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ChannelsCreateResponse = BotChannel; - -// @public -export interface ChannelsDeleteOptionalParams extends coreClient.OperationOptions { -} - // @public export interface ChannelSettings { botIconUrl?: string; @@ -324,50 +239,7 @@ export interface ChannelSettings { } // @public -export interface ChannelsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ChannelsGetResponse = BotChannel; - -// @public -export interface ChannelsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ChannelsListByResourceGroupNextResponse = ChannelResponseList; - -// @public -export interface ChannelsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ChannelsListByResourceGroupResponse = ChannelResponseList; - -// @public -export interface ChannelsListWithKeysOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ChannelsListWithKeysResponse = ListChannelWithKeysResponse; - -// @public -export interface ChannelsUpdateOptionalParams extends coreClient.OperationOptions { - etag?: string; - kind?: Kind; - location?: string; - properties?: ChannelUnion; - sku?: Sku; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export type ChannelsUpdateResponse = BotChannel; - -// @public (undocumented) -export type ChannelUnion = Channel | AlexaChannel | FacebookChannel | EmailChannel | OutlookChannel | MsTeamsChannel | SkypeChannel | KikChannel | WebChatChannel | DirectLineChannel | TelegramChannel | SmsChannel | SlackChannel | LineChannel | DirectLineSpeechChannel | Omnichannel | TelephonyChannel | AcsChatChannel | SearchAssistant | M365Extensions; +export type ChannelUnion = AlexaChannel | FacebookChannel | EmailChannel | OutlookChannel | MsTeamsChannel | SkypeChannel | KikChannel | WebChatChannel | DirectLineChannel | TelegramChannel | SmsChannel | SlackChannel | LineChannel | DirectLineSpeechChannel | Omnichannel | TelephonyChannel | AcsChatChannel | SearchAssistant | M365Extensions | Channel; // @public export interface CheckNameAvailabilityRequestBody { @@ -383,25 +255,26 @@ export interface CheckNameAvailabilityResponseBody { } // @public -export interface ConnectionItemName { - readonly name?: string; -} - -// @public -export interface ConnectionSetting extends Resource { +export interface ConnectionSetting extends TrackedResource { + etag?: string; + kind?: Kind; properties?: ConnectionSettingProperties; + sku?: Sku; + readonly zones?: string[]; } // @public export interface ConnectionSettingParameter { key?: string; - value?: string; + value?: string | null; } // @public export interface ConnectionSettingProperties { clientId?: string; clientSecret?: string; + id?: string; + name?: string; parameters?: ConnectionSettingParameter[]; provisioningState?: string; scopes?: string; @@ -411,11 +284,47 @@ export interface ConnectionSettingProperties { } // @public -export interface ConnectionSettingResponseList { - nextLink?: string; - readonly value?: ConnectionSetting[]; +export interface ConnectionSettingsCreateOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsDeleteOptionalParams extends OperationOptions { } +// @public +export interface ConnectionSettingsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsListByBotServiceOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsListWithSecretsOptionalParams extends OperationOptions { +} + +// @public +export interface ConnectionSettingsOperations { + create: (resourceGroupName: string, resourceName: string, connectionName: string, parameters: ConnectionSetting, options?: ConnectionSettingsCreateOptionalParams) => Promise; + delete: (resourceGroupName: string, resourceName: string, connectionName: string, options?: ConnectionSettingsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, resourceName: string, connectionName: string, options?: ConnectionSettingsGetOptionalParams) => Promise; + listByBotService: (resourceGroupName: string, resourceName: string, options?: ConnectionSettingsListByBotServiceOptionalParams) => PagedAsyncIterableIterator; + listWithSecrets: (resourceGroupName: string, resourceName: string, connectionName: string, options?: ConnectionSettingsListWithSecretsOptionalParams) => Promise; + update: (resourceGroupName: string, resourceName: string, connectionName: string, parameters: ConnectionSetting, options?: ConnectionSettingsUpdateOptionalParams) => Promise; +} + +// @public +export interface ConnectionSettingsUpdateOptionalParams extends OperationOptions { +} + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; + // @public export interface CreateEmailSignInUrlResponse { readonly id?: string; @@ -428,11 +337,6 @@ export interface CreateEmailSignInUrlResponseProperties { url?: string; } -// @public -export interface DirectLine { - regenerateKeys(resourceGroupName: string, resourceName: string, channelName: RegenerateKeysChannelName, parameters: SiteInfo, options?: DirectLineRegenerateKeysOptionalParams): Promise; -} - // @public export interface DirectLineChannel extends Channel { channelName: "DirectLineChannel"; @@ -447,13 +351,6 @@ export interface DirectLineChannelProperties { sites?: DirectLineSite[]; } -// @public -export interface DirectLineRegenerateKeysOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DirectLineRegenerateKeysResponse = BotChannel; - // @public export interface DirectLineSite extends Site { } @@ -466,20 +363,15 @@ export interface DirectLineSpeechChannel extends Channel { // @public export interface DirectLineSpeechChannelProperties { - cognitiveServiceRegion?: string; + cognitiveServiceRegion?: string | null; cognitiveServiceResourceId?: string; - cognitiveServiceSubscriptionKey?: string; + cognitiveServiceSubscriptionKey?: string | null; customSpeechModelId?: string; customVoiceDeploymentId?: string; isDefaultBotForCogSvcAccount?: boolean; isEnabled?: boolean; } -// @public -export interface Email { - createSignInUrl(resourceGroupName: string, resourceName: string, options?: EmailCreateSignInUrlOptionalParams): Promise; -} - // @public export interface EmailChannel extends Channel { channelName: "EmailChannel"; @@ -498,13 +390,6 @@ export interface EmailChannelProperties { password?: string; } -// @public -export interface EmailCreateSignInUrlOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type EmailCreateSignInUrlResponse = CreateEmailSignInUrlResponse; - // @public export interface ErrorBody { code: string; @@ -539,20 +424,14 @@ export interface FacebookPage { } // @public -export function getContinuationToken(page: unknown): string | undefined; - -// @public -export interface HostSettings { - get(options?: HostSettingsGetOptionalParams): Promise; +export interface HostSettingsOperationGroupGetOptionalParams extends OperationOptions { } // @public -export interface HostSettingsGetOptionalParams extends coreClient.OperationOptions { +export interface HostSettingsOperationGroupOperations { + get: (options?: HostSettingsOperationGroupGetOptionalParams) => Promise; } -// @public -export type HostSettingsGetResponse = HostSettingsResponse; - // @public export interface HostSettingsResponse { botOpenIdMetadata?: string; @@ -585,64 +464,147 @@ export interface KikChannelProperties { // @public export type Kind = string; +// @public +export enum KnownAccessMode { + // (undocumented) + Audit = "Audit", + // (undocumented) + Enforced = "Enforced", + // (undocumented) + Learning = "Learning" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + // @public export enum KnownKind { + // (undocumented) Azurebot = "azurebot", + // (undocumented) Bot = "bot", + // (undocumented) Designer = "designer", + // (undocumented) Function = "function", + // (undocumented) Sdk = "sdk" } // @public export enum KnownMsaAppType { + // (undocumented) MultiTenant = "MultiTenant", + // (undocumented) SingleTenant = "SingleTenant", + // (undocumented) UserAssignedMSI = "UserAssignedMSI" } +// @public +export enum KnownNspAccessRuleDirection { + // (undocumented) + Inbound = "Inbound", + // (undocumented) + Outbound = "Outbound" +} + // @public export enum KnownOperationResultStatus { + // (undocumented) Canceled = "Canceled", + // (undocumented) Failed = "Failed", + // (undocumented) Requested = "Requested", + // (undocumented) Running = "Running", + // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownPrivateEndpointConnectionProvisioningState { + // (undocumented) Creating = "Creating", + // (undocumented) Deleting = "Deleting", + // (undocumented) Failed = "Failed", + // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownPrivateEndpointServiceConnectionStatus { + // (undocumented) Approved = "Approved", + // (undocumented) Pending = "Pending", + // (undocumented) Rejected = "Rejected" } +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + // @public export enum KnownPublicNetworkAccess { + // (undocumented) Disabled = "Disabled", - Enabled = "Enabled" + // (undocumented) + Enabled = "Enabled", + // (undocumented) + SecuredByPerimeter = "SecuredByPerimeter" +} + +// @public +export enum KnownSeverity { + // (undocumented) + Error = "Error", + // (undocumented) + Warning = "Warning" } // @public export enum KnownSkuName { + // (undocumented) F0 = "F0", + // (undocumented) S1 = "S1" } // @public export enum KnownSkuTier { + // (undocumented) Free = "Free", + // (undocumented) Standard = "Standard" } +// @public +export enum KnownVersions { + V20230915Preview = "2023-09-15-preview" +} + // @public export interface LineChannel extends Channel { channelName: "LineChannel"; @@ -688,7 +650,7 @@ export interface MsTeamsChannel extends Channel { // @public export interface MsTeamsChannelProperties { - acceptedTerms?: boolean; + acceptedTerms?: boolean | null; callingWebhook?: string; deploymentEnvironment?: string; enableCalling?: boolean; @@ -696,6 +658,73 @@ export interface MsTeamsChannelProperties { isEnabled: boolean; } +// @public +export interface NetworkSecurityPerimeter { + readonly id?: string; + location?: string; + perimeterGuid?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationProperties { + readonly networkSecurityPerimeter?: NetworkSecurityPerimeter; + readonly profile?: Profile; + provisioningIssues?: ProvisioningIssue[]; + // (undocumented) + provisioningState?: ProvisioningState; + readonly resourceAssociation?: ResourceAssociation; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsListOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsOperations { + get: (resourceGroupName: string, resourceName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams) => Promise; + list: (resourceGroupName: string, resourceName: string, options?: NetworkSecurityPerimeterConfigurationsListOptionalParams) => PagedAsyncIterableIterator; + reconcile: (resourceGroupName: string, resourceName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams) => PollerLike, NetworkSecurityPerimeterConfiguration>; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NspAccessRule { + name?: string; + readonly properties?: NspAccessRuleProperties; +} + +// @public +export type NspAccessRuleDirection = string; + +// @public +export interface NspAccessRuleProperties { + addressPrefixes?: string[]; + direction?: NspAccessRuleDirection; + readonly emailAddresses?: string[]; + readonly fullyQualifiedDomainNames?: string[]; + readonly networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + readonly phoneNumbers?: string[]; + subscriptions?: NspAccessRulePropertiesSubscriptionsItem[]; +} + +// @public +export interface NspAccessRulePropertiesSubscriptionsItem { + id?: string; +} + // @public export interface Omnichannel extends Channel { channelName: "Omnichannel"; @@ -714,19 +743,7 @@ export interface OperationEntity { display?: OperationDisplayInfo; name?: string; origin?: string; - properties?: Record; -} - -// @public -export interface OperationEntityListResult { - nextLink?: string; - value?: OperationEntity[]; -} - -// @public -export interface OperationResults { - beginGet(operationResultId: string, options?: OperationResultsGetOptionalParams): Promise, OperationResultsGetResponse>>; - beginGetAndWait(operationResultId: string, options?: OperationResultsGetOptionalParams): Promise; + properties?: any; } // @public @@ -738,39 +755,42 @@ export interface OperationResultsDescription { } // @public -export interface OperationResultsGetOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface OperationResultsOperationGroupGetOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type OperationResultsGetResponse = OperationResultsDescription; +export interface OperationResultsOperationGroupOperations { + get: (operationResultId: string, options?: OperationResultsOperationGroupGetOptionalParams) => PollerLike, OperationResultsDescription>; +} // @public export type OperationResultStatus = string; // @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +export interface OperationsListOptionalParams extends OperationOptions { } // @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } // @public -export type OperationsListNextResponse = OperationEntityListResult; - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface OutlookChannel extends Channel { + channelName: "OutlookChannel"; } // @public -export type OperationsListResponse = OperationEntityListResult; +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} // @public -export interface OutlookChannel extends Channel { - channelName: "OutlookChannel"; +export interface PageSettings { + continuationToken?: string; } // @public @@ -779,62 +799,51 @@ export interface PrivateEndpoint { } // @public -export interface PrivateEndpointConnection extends PrivateLinkResourceBase { - groupIds?: string[]; - privateEndpoint?: PrivateEndpoint; - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +export interface PrivateEndpointConnection extends ProxyResource { + properties?: PrivateEndpointConnectionProperties; } // @public -export interface PrivateEndpointConnectionListResult { - value?: PrivateEndpointConnection[]; +export interface PrivateEndpointConnectionProperties { + groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; } // @public export type PrivateEndpointConnectionProvisioningState = string; // @public -export interface PrivateEndpointConnections { - create(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; - delete(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; - get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; - list(resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { } // @public -export interface PrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { } // @public -export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { } // @public -export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { } // @public -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsOperations { + create: (resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams) => Promise; + delete: (resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; - // @public export type PrivateEndpointServiceConnectionStatus = string; // @public export interface PrivateLinkResource extends PrivateLinkResourceBase { - readonly groupId?: string; - readonly requiredMembers?: string[]; - requiredZoneNames?: string[]; + properties?: PrivateLinkResourceProperties; } // @public @@ -850,38 +859,61 @@ export interface PrivateLinkResourceListResult { } // @public -export interface PrivateLinkResources { - listByBotResource(resourceGroupName: string, resourceName: string, options?: PrivateLinkResourcesListByBotResourceOptionalParams): Promise; +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; } // @public -export interface PrivateLinkResourcesListByBotResourceOptionalParams extends coreClient.OperationOptions { +export interface Profile { + accessRules?: NspAccessRule[]; + accessRulesVersion?: number; + diagnosticSettingsVersion?: number; + readonly enabledLogCategories?: string[]; + name?: string; } // @public -export type PrivateLinkResourcesListByBotResourceResponse = PrivateLinkResourceListResult; +export interface ProvisioningIssue { + name?: string; + readonly properties?: ProvisioningIssueProperties; +} // @public -export interface PrivateLinkServiceConnectionState { - actionsRequired?: string; +export interface ProvisioningIssueProperties { description?: string; - status?: PrivateEndpointServiceConnectionStatus; + issueType?: string; + severity?: Severity; + suggestedAccessRules?: NspAccessRule[]; + readonly suggestedResourceIds?: string[]; } // @public -export type PublicNetworkAccess = string; +export type ProvisioningState = string; // @public -export interface QnAMakerEndpointKeys { - get(parameters: QnAMakerEndpointKeysRequestBody, options?: QnAMakerEndpointKeysGetOptionalParams): Promise; +export interface ProxyResource extends Resource { } // @public -export interface QnAMakerEndpointKeysGetOptionalParams extends coreClient.OperationOptions { +export type PublicNetworkAccess = string; + +// @public +export interface QnAMakerEndpointKeysOperationGroupGetOptionalParams extends OperationOptions { } // @public -export type QnAMakerEndpointKeysGetResponse = QnAMakerEndpointKeysResponse; +export interface QnAMakerEndpointKeysOperationGroupOperations { + get: (parameters: QnAMakerEndpointKeysRequestBody, options?: QnAMakerEndpointKeysOperationGroupGetOptionalParams) => Promise; +} // @public export interface QnAMakerEndpointKeysRequestBody { @@ -897,22 +929,28 @@ export interface QnAMakerEndpointKeysResponse { secondaryEndpointKey?: string; } -// @public -export type RegenerateKeysChannelName = "WebChatChannel" | "DirectLineChannel"; - // @public export interface Resource { - etag?: string; readonly id?: string; - kind?: Kind; - location?: string; readonly name?: string; - sku?: Sku; - tags?: { - [propertyName: string]: string; - }; + readonly systemData?: SystemData; readonly type?: string; - readonly zones?: string[]; +} + +// @public +export interface ResourceAssociation { + accessMode?: AccessMode; + name?: string; +} + +// @public +export function restorePoller(client: BotServiceClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; } // @public @@ -962,11 +1000,14 @@ export interface ServiceProviderResponseList { readonly value?: ServiceProvider[]; } +// @public +export type Severity = string; + // @public export interface Site { appId?: string; eTag?: string; - isBlockUserUploadEnabled?: boolean; + isBlockUserUploadEnabled?: boolean | null; isDetailedLoggingEnabled?: boolean; isEnabled: boolean; isEndpointParametersEnabled?: boolean; @@ -1059,6 +1100,16 @@ export interface SmsChannelProperties { phone: string; } +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + // @public export interface TelegramChannel extends Channel { channelName: "TelegramChannel"; @@ -1081,38 +1132,44 @@ export interface TelephonyChannel extends Channel { // @public export interface TelephonyChannelProperties { apiConfigurations?: TelephonyChannelResourceApiConfiguration[]; - cognitiveServiceRegion?: string; - cognitiveServiceSubscriptionKey?: string; - defaultLocale?: string; + cognitiveServiceRegion?: string | null; + cognitiveServiceSubscriptionKey?: string | null; + defaultLocale?: string | null; isEnabled?: boolean; phoneNumbers?: TelephonyPhoneNumbers[]; - premiumSKU?: string; + premiumSKU?: string | null; } // @public export interface TelephonyChannelResourceApiConfiguration { - cognitiveServiceRegion?: string; - cognitiveServiceResourceId?: string; - cognitiveServiceSubscriptionKey?: string; - defaultLocale?: string; + cognitiveServiceRegion?: string | null; + cognitiveServiceResourceId?: string | null; + cognitiveServiceSubscriptionKey?: string | null; + defaultLocale?: string | null; id?: string; - providerName?: string; + providerName?: string | null; } // @public export interface TelephonyPhoneNumbers { - acsEndpoint?: string; - acsResourceId?: string; - acsSecret?: string; - cognitiveServiceRegion?: string; - cognitiveServiceResourceId?: string; - cognitiveServiceSubscriptionKey?: string; - defaultLocale?: string; + acsEndpoint?: string | null; + acsResourceId?: string | null; + acsSecret?: string | null; + cognitiveServiceRegion?: string | null; + cognitiveServiceResourceId?: string | null; + cognitiveServiceSubscriptionKey?: string | null; + defaultLocale?: string | null; id?: string; - offerType?: string; + offerType?: string | null; phoneNumber?: string; } +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + // @public export interface WebChatChannel extends Channel { channelName: "WebChatChannel"; diff --git a/sdk/botservice/arm-botservice/sample.env b/sdk/botservice/arm-botservice/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/botservice/arm-botservice/sample.env +++ b/sdk/botservice/arm-botservice/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/botservice/arm-botservice/samples-dev/botChannelsCreateSample.ts b/sdk/botservice/arm-botservice/samples-dev/botChannelsCreateSample.ts new file mode 100644 index 000000000000..179078cb1382 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botChannelsCreateSample.ts @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates a Channel registration for a Bot Service + * + * @summary creates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/PutAlexaChannel.json + */ +async function createAlexaChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.create( + "OneResourceGroupName", + "samplebotname", + "AlexaChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates a Channel registration for a Bot Service + * + * @summary creates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/PutChannel.json + */ +async function createChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.create( + "OneResourceGroupName", + "samplebotname", + "EmailChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates a Channel registration for a Bot Service + * + * @summary creates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/PutDirectLineSpeechChannel.json + */ +async function createDirectLineSpeechChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.create( + "OneResourceGroupName", + "samplebotname", + "DirectLineSpeechChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates a Channel registration for a Bot Service + * + * @summary creates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/PutEmailChannel.json + */ +async function createEmailChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.create( + "OneResourceGroupName", + "samplebotname", + "EmailChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates a Channel registration for a Bot Service + * + * @summary creates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/PutLineChannel.json + */ +async function createLineChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.create( + "OneResourceGroupName", + "samplebotname", + "LineChannel", + ); + console.log(result); +} + +async function main(): Promise { + await createAlexaChannel(); + await createChannel(); + await createDirectLineSpeechChannel(); + await createEmailChannel(); + await createLineChannel(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botChannelsDeleteSample.ts b/sdk/botservice/arm-botservice/samples-dev/botChannelsDeleteSample.ts new file mode 100644 index 000000000000..00054f760e1c --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botChannelsDeleteSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Channel registration from a Bot Service + * + * @summary deletes a Channel registration from a Bot Service + * x-ms-original-file: 2023-09-15-preview/DeleteChannel.json + */ +async function deleteChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + await client.botChannels.delete("OneResourceGroupName", "samplebotname", "EmailChannel"); +} + +/** + * This sample demonstrates how to deletes a Channel registration from a Bot Service + * + * @summary deletes a Channel registration from a Bot Service + * x-ms-original-file: 2023-09-15-preview/DeleteDirectLineSpeechChannel.json + */ +async function deleteDirectLineSpeechChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + await client.botChannels.delete( + "OneResourceGroupName", + "samplebotname", + "DirectLineSpeechChannel", + ); +} + +async function main(): Promise { + await deleteChannel(); + await deleteDirectLineSpeechChannel(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botChannelsGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/botChannelsGetSample.ts new file mode 100644 index 000000000000..a46c31bb597c --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botChannelsGetSample.ts @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns a BotService Channel registration specified by the parameters. + * + * @summary returns a BotService Channel registration specified by the parameters. + * x-ms-original-file: 2023-09-15-preview/GetAlexaChannel.json + */ +async function getAlexaChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.get( + "OneResourceGroupName", + "samplebotname", + "AlexaChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to returns a BotService Channel registration specified by the parameters. + * + * @summary returns a BotService Channel registration specified by the parameters. + * x-ms-original-file: 2023-09-15-preview/GetChannel.json + */ +async function getChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.get( + "OneResourceGroupName", + "samplebotname", + "EmailChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to returns a BotService Channel registration specified by the parameters. + * + * @summary returns a BotService Channel registration specified by the parameters. + * x-ms-original-file: 2023-09-15-preview/GetDirectLineSpeechChannel.json + */ +async function getDirectLineSpeechChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.get( + "OneResourceGroupName", + "samplebotname", + "DirectLineSpeechChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to returns a BotService Channel registration specified by the parameters. + * + * @summary returns a BotService Channel registration specified by the parameters. + * x-ms-original-file: 2023-09-15-preview/GetLineChannel.json + */ +async function getLineChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.get( + "OneResourceGroupName", + "samplebotname", + "LineChannel", + ); + console.log(result); +} + +async function main(): Promise { + await getAlexaChannel(); + await getChannel(); + await getDirectLineSpeechChannel(); + await getLineChannel(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botChannelsListByResourceGroupSample.ts b/sdk/botservice/arm-botservice/samples-dev/botChannelsListByResourceGroupSample.ts new file mode 100644 index 000000000000..c68b1eeaf2d2 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botChannelsListByResourceGroupSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns all the Channel registrations of a particular BotService resource + * + * @summary returns all the Channel registrations of a particular BotService resource + * x-ms-original-file: 2023-09-15-preview/ListChannelsByBotService.json + */ +async function listChannelsByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.botChannels.listByResourceGroup( + "OneResourceGroupName", + "samplebotname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listChannelsByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botChannelsListWithKeysSample.ts b/sdk/botservice/arm-botservice/samples-dev/botChannelsListWithKeysSample.ts new file mode 100644 index 000000000000..b3c86bc8b748 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botChannelsListWithKeysSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists a Channel registration for a Bot Service including secrets + * + * @summary lists a Channel registration for a Bot Service including secrets + * x-ms-original-file: 2023-09-15-preview/ListChannel.json + */ +async function listChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.listWithKeys( + "OneResourceGroupName", + "samplebotname", + "EmailChannel", + ); + console.log(result); +} + +async function main(): Promise { + await listChannel(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botChannelsRegenerateKeysSample.ts b/sdk/botservice/arm-botservice/samples-dev/botChannelsRegenerateKeysSample.ts new file mode 100644 index 000000000000..151ce4b9dcf0 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botChannelsRegenerateKeysSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + * + * @summary regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + * x-ms-original-file: 2023-09-15-preview/DirectlineRegenerateKeys.json + */ +async function regenerateKeysForDirectLineChannelSite(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.regenerateKeys( + "OneResourceGroupName", + "samplebotname", + "DirectLineChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + * + * @summary regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + * x-ms-original-file: 2023-09-15-preview/WebChatRegenerateKeys.json + */ +async function regenerateKeysForWebChatChannelSite(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.regenerateKeys( + "OneResourceGroupName", + "samplebotname", + "WebChatChannel", + ); + console.log(result); +} + +async function main(): Promise { + await regenerateKeysForDirectLineChannelSite(); + await regenerateKeysForWebChatChannelSite(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botChannelsUpdateSample.ts b/sdk/botservice/arm-botservice/samples-dev/botChannelsUpdateSample.ts new file mode 100644 index 000000000000..0fb65b27f46f --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botChannelsUpdateSample.ts @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a Channel registration for a Bot Service + * + * @summary updates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/UpdateAlexaChannel.json + */ +async function updateAlexaChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.update( + "OneResourceGroupName", + "samplebotname", + "AlexaChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to updates a Channel registration for a Bot Service + * + * @summary updates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/UpdateChannel.json + */ +async function updateChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.update( + "OneResourceGroupName", + "samplebotname", + "EmailChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to updates a Channel registration for a Bot Service + * + * @summary updates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/UpdateDirectLineSpeechChannel.json + */ +async function updateDirectLineSpeechChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.update( + "OneResourceGroupName", + "samplebotname", + "DirectLineSpeechChannel", + ); + console.log(result); +} + +/** + * This sample demonstrates how to updates a Channel registration for a Bot Service + * + * @summary updates a Channel registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/UpdateLineChannel.json + */ +async function updateLineChannel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botChannels.update( + "OneResourceGroupName", + "samplebotname", + "LineChannel", + ); + console.log(result); +} + +async function main(): Promise { + await updateAlexaChannel(); + await updateChannel(); + await updateDirectLineSpeechChannel(); + await updateLineChannel(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionCreateSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionCreateSample.ts deleted file mode 100644 index 57b13334dbae..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botConnectionCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { ConnectionSetting } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Register a new Auth Connection for a Bot Service - * - * @summary Register a new Auth Connection for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutConnection.json - */ -async function createConnectionSetting(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const parameters: ConnectionSetting = { - etag: "etag1", - location: "West US", - properties: { - clientId: "sampleclientid", - clientSecret: "samplesecret", - parameters: [ - { key: "key1", value: "value1" }, - { key: "key2", value: "value2" }, - ], - scopes: "samplescope", - serviceProviderId: "serviceproviderid", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.create( - resourceGroupName, - resourceName, - connectionName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionDeleteSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionDeleteSample.ts deleted file mode 100644 index 4187ef8534b5..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botConnectionDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Connection Setting registration for a Bot Service - * - * @summary Deletes a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteConnection.json - */ -async function deleteConnectionSetting(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.delete(resourceGroupName, resourceName, connectionName); - console.log(result); -} - -async function main(): Promise { - await deleteConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionGetSample.ts deleted file mode 100644 index 2c5ee861424c..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botConnectionGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a Connection Setting registration for a Bot Service - * - * @summary Get a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json - */ -async function getConnectionSetting(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.get(resourceGroupName, resourceName, connectionName); - console.log(result); -} - -async function main(): Promise { - await getConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionListByBotServiceSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionListByBotServiceSample.ts deleted file mode 100644 index 0bf042a0e055..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botConnectionListByBotServiceSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns all the Connection Settings registered to a particular BotService resource - * - * @summary Returns all the Connection Settings registered to a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListConnectionsByBotService.json - */ -async function listConnectionSettings(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.botConnection.listByBotService(resourceGroupName, resourceName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listConnectionSettings(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionListServiceProvidersSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionListServiceProvidersSample.ts deleted file mode 100644 index d1d47619551b..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botConnectionListServiceProvidersSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the available Service Providers for creating Connection Settings - * - * @summary Lists the available Service Providers for creating Connection Settings - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListServiceProviders.json - */ -async function listAuthServiceProviders(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.listServiceProviders(); - console.log(result); -} - -async function main(): Promise { - await listAuthServiceProviders(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionListWithSecretsSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionListWithSecretsSample.ts deleted file mode 100644 index 58b897a646fe..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botConnectionListWithSecretsSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a Connection Setting registration for a Bot Service - * - * @summary Get a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json - */ -async function listConnectionSettingWithSecrets(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.listWithSecrets( - resourceGroupName, - resourceName, - connectionName, - ); - console.log(result); -} - -async function main(): Promise { - await listConnectionSettingWithSecrets(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionOperationGroupListServiceProvidersSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionOperationGroupListServiceProvidersSample.ts new file mode 100644 index 000000000000..2366f5c00635 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botConnectionOperationGroupListServiceProvidersSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists the available Service Providers for creating Connection Settings + * + * @summary lists the available Service Providers for creating Connection Settings + * x-ms-original-file: 2023-09-15-preview/ListServiceProviders.json + */ +async function listAuthServiceProviders(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botConnectionOperationGroup.listServiceProviders(); + console.log(result); +} + +async function main(): Promise { + await listAuthServiceProviders(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botConnectionUpdateSample.ts b/sdk/botservice/arm-botservice/samples-dev/botConnectionUpdateSample.ts deleted file mode 100644 index 5214c829717b..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botConnectionUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { ConnectionSetting } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a Connection Setting registration for a Bot Service - * - * @summary Updates a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateConnection.json - */ -async function updateConnectionSetting(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const parameters: ConnectionSetting = { - etag: "etag1", - location: "global", - properties: { - clientId: "sampleclientid", - clientSecret: "samplesecret", - parameters: [ - { key: "key1", value: "value1" }, - { key: "key2", value: "value2" }, - ], - scopes: "samplescope", - serviceProviderDisplayName: "serviceProviderDisplayName", - serviceProviderId: "serviceproviderid", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.update( - resourceGroupName, - resourceName, - connectionName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await updateConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botsCreateSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsCreateSample.ts index 66dd0b734ea1..ed1d6d649ecc 100644 --- a/sdk/botservice/arm-botservice/samples-dev/botsCreateSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/botsCreateSample.ts @@ -1,56 +1,20 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { Bot } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Creates a Bot Service. Bot Service is a resource group wide resource type. + * This sample demonstrates how to creates a Bot Service. Bot Service is a resource group wide resource type. * - * @summary Creates a Bot Service. Bot Service is a resource group wide resource type. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateBot.json + * @summary creates a Bot Service. Bot Service is a resource group wide resource type. + * x-ms-original-file: 2023-09-15-preview/CreateBot.json */ async function createBot(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const parameters: Bot = { - etag: "etag1", - kind: "sdk", - location: "West US", - properties: { - description: "The description of the bot", - cmekKeyVaultUrl: "https://myCmekKey", - developerAppInsightKey: "appinsightskey", - developerAppInsightsApiKey: "appinsightsapikey", - developerAppInsightsApplicationId: "appinsightsappid", - disableLocalAuth: true, - displayName: "The Name of the bot", - endpoint: "http://mybot.coffee", - iconUrl: "http://myicon", - isCmekEnabled: true, - luisAppIds: ["luisappid1", "luisappid2"], - luisKey: "luiskey", - msaAppId: "exampleappid", - msaAppMSIResourceId: - "/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId", - msaAppTenantId: "exampleapptenantid", - msaAppType: "UserAssignedMSI", - publicNetworkAccess: "Enabled", - schemaTransformationVersion: "1.0", - }, - sku: { name: "S1" }, - tags: { tag1: "value1", tag2: "value2" }, - }; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.create(resourceGroupName, resourceName, parameters); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.bots.create("OneResourceGroupName", "samplebotname"); console.log(result); } diff --git a/sdk/botservice/arm-botservice/samples-dev/botsCreateSignInUrlSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsCreateSignInUrlSample.ts new file mode 100644 index 000000000000..6c6405845bf0 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botsCreateSignInUrlSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates an email channel sign in url for a Bot Service + * + * @summary creates an email channel sign in url for a Bot Service + * x-ms-original-file: 2023-09-15-preview/CreateEmailSignInUrl.json + */ +async function createUrl(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.bots.createSignInUrl("OneResourceGroupName", "samplebotname"); + console.log(result); +} + +async function main(): Promise { + await createUrl(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botsDeleteSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsDeleteSample.ts index 652b3b791c6e..7c5074d80497 100644 --- a/sdk/botservice/arm-botservice/samples-dev/botsDeleteSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/botsDeleteSample.ts @@ -1,28 +1,20 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes a Bot Service from the resource group. + * This sample demonstrates how to deletes a Bot Service from the resource group. * - * @summary Deletes a Bot Service from the resource group. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteBot.json + * @summary deletes a Bot Service from the resource group. + * x-ms-original-file: 2023-09-15-preview/DeleteBot.json */ async function deleteBot(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.delete(resourceGroupName, resourceName); - console.log(result); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + await client.bots.delete("OneResourceGroupName", "samplebotname"); } async function main(): Promise { diff --git a/sdk/botservice/arm-botservice/samples-dev/botsGetCheckNameAvailabilitySample.ts b/sdk/botservice/arm-botservice/samples-dev/botsGetCheckNameAvailabilitySample.ts deleted file mode 100644 index 5f123e20c37b..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/botsGetCheckNameAvailabilitySample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { CheckNameAvailabilityRequestBody } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Check whether a bot name is available. - * - * @summary Check whether a bot name is available. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json - */ -async function checkNameAvailability(): Promise { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const parameters: CheckNameAvailabilityRequestBody = { - name: "testbotname", - type: "string", - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.getCheckNameAvailability(parameters); - console.log(result); -} - -async function main(): Promise { - await checkNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botsGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsGetSample.ts index 8df0fff4c5fa..892e720b5430 100644 --- a/sdk/botservice/arm-botservice/samples-dev/botsGetSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/botsGetSample.ts @@ -1,27 +1,20 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Returns a BotService specified by the parameters. + * This sample demonstrates how to returns a BotService specified by the parameters. * - * @summary Returns a BotService specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json + * @summary returns a BotService specified by the parameters. + * x-ms-original-file: 2023-09-15-preview/GetBot.json */ async function getBot(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.get(resourceGroupName, resourceName); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.bots.get("OneResourceGroupName", "samplebotname"); console.log(result); } diff --git a/sdk/botservice/arm-botservice/samples-dev/botsListByBotResourceSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsListByBotResourceSample.ts new file mode 100644 index 000000000000..3f6c854029a8 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botsListByBotResourceSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a Bot. + * + * @summary gets the private link resources that need to be created for a Bot. + * x-ms-original-file: 2023-09-15-preview/ListPrivateLinkResources.json + */ +async function listPrivateLinkResources(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.bots.listByBotResource("res6977", "sto2527"); + console.log(result); +} + +async function main(): Promise { + await listPrivateLinkResources(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botsListByResourceGroupSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsListByResourceGroupSample.ts index b334f40e8708..fbdde192defc 100644 --- a/sdk/botservice/arm-botservice/samples-dev/botsListByResourceGroupSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/botsListByResourceGroupSample.ts @@ -1,29 +1,24 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Returns all the resources of a particular type belonging to a resource group + * This sample demonstrates how to returns all the resources of a particular type belonging to a resource group * - * @summary Returns all the resources of a particular type belonging to a resource group - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsByResourceGroup.json + * @summary returns all the resources of a particular type belonging to a resource group + * x-ms-original-file: 2023-09-15-preview/ListBotsByResourceGroup.json */ async function listBotsByResourceGroup(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.bots.listByResourceGroup(resourceGroupName)) { + for await (const item of client.bots.listByResourceGroup("OneResourceGroupName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/botservice/arm-botservice/samples-dev/botsListSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsListSample.ts index 5ada4af46f93..dfc33e9f8ddb 100644 --- a/sdk/botservice/arm-botservice/samples-dev/botsListSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/botsListSample.ts @@ -1,28 +1,24 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Returns all the resources of a particular type belonging to a subscription. + * This sample demonstrates how to returns all the resources of a particular type belonging to a subscription. * - * @summary Returns all the resources of a particular type belonging to a subscription. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsBySubscription.json + * @summary returns all the resources of a particular type belonging to a subscription. + * x-ms-original-file: 2023-09-15-preview/ListBotsBySubscription.json */ async function listBotsBySubscription(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.bots.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/botservice/arm-botservice/samples-dev/botsOperationGroupGetCheckNameAvailabilitySample.ts b/sdk/botservice/arm-botservice/samples-dev/botsOperationGroupGetCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..c230940327be --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/botsOperationGroupGetCheckNameAvailabilitySample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to check whether a bot name is available. + * + * @summary check whether a bot name is available. + * x-ms-original-file: 2023-09-15-preview/CheckNameAvailability.json + */ +async function checkNameAvailability(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.botsOperationGroup.getCheckNameAvailability(); + console.log(result); +} + +async function main(): Promise { + await checkNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/botsUpdateSample.ts b/sdk/botservice/arm-botservice/samples-dev/botsUpdateSample.ts index 9f70c325b21c..62e12d04311b 100644 --- a/sdk/botservice/arm-botservice/samples-dev/botsUpdateSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/botsUpdateSample.ts @@ -1,62 +1,20 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { BotsUpdateOptionalParams } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Updates a Bot Service + * This sample demonstrates how to updates a Bot Service * - * @summary Updates a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateBot.json + * @summary updates a Bot Service + * x-ms-original-file: 2023-09-15-preview/UpdateBot.json */ async function updateBot(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const location = "West US"; - const tags = { tag1: "value1", tag2: "value2" }; - const sku = { name: "S1" }; - const kind = "sdk"; - const etag = "etag1"; - const properties = { - description: "The description of the bot", - cmekKeyVaultUrl: "https://myCmekKey", - developerAppInsightKey: "appinsightskey", - developerAppInsightsApiKey: "appinsightsapikey", - developerAppInsightsApplicationId: "appinsightsappid", - disableLocalAuth: true, - displayName: "The Name of the bot", - endpoint: "http://mybot.coffee", - iconUrl: "http://myicon", - isCmekEnabled: true, - luisAppIds: ["luisappid1", "luisappid2"], - luisKey: "luiskey", - msaAppId: "msaappid", - msaAppMSIResourceId: - "/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId", - msaAppTenantId: "msaapptenantid", - msaAppType: "UserAssignedMSI", - publicNetworkAccess: "Enabled", - schemaTransformationVersion: "1.0", - }; - const options: BotsUpdateOptionalParams = { - location, - tags, - sku, - kind, - etag, - properties, - }; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.update(resourceGroupName, resourceName, options); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.bots.update("OneResourceGroupName", "samplebotname"); console.log(result); } diff --git a/sdk/botservice/arm-botservice/samples-dev/channelsCreateSample.ts b/sdk/botservice/arm-botservice/samples-dev/channelsCreateSample.ts deleted file mode 100644 index 889676857826..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/channelsCreateSample.ts +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { BotChannel } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutAlexaChannel.json - */ -async function createAlexaChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "AlexaChannel", - properties: { alexaSkillId: "XAlexaSkillIdX", isEnabled: true }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutChannel.json - */ -async function createChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "EmailChannel", - properties: { emailAddress: "a@b.com", isEnabled: true, password: "pwd" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutDirectLineSpeechChannel.json - */ -async function createDirectLineSpeechChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "DirectLineSpeechChannel", - properties: { - cognitiveServiceRegion: "XcognitiveServiceRegionX", - cognitiveServiceSubscriptionKey: "XcognitiveServiceSubscriptionKeyX", - isEnabled: true, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutEmailChannel.json - */ -async function createEmailChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "EmailChannel", - properties: { - authMethod: 1, - emailAddress: "a@b.com", - isEnabled: true, - magicCode: "000000", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutLineChannel.json - */ -async function createLineChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "LineChannel", - properties: { - lineRegistrations: [ - { - channelAccessToken: "channelAccessToken", - channelSecret: "channelSecret", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createAlexaChannel(); - await createChannel(); - await createDirectLineSpeechChannel(); - await createEmailChannel(); - await createLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/channelsDeleteSample.ts b/sdk/botservice/arm-botservice/samples-dev/channelsDeleteSample.ts deleted file mode 100644 index 190f489a7ba1..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/channelsDeleteSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Channel registration from a Bot Service - * - * @summary Deletes a Channel registration from a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteChannel.json - */ -async function deleteChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.delete(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes a Channel registration from a Bot Service - * - * @summary Deletes a Channel registration from a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteDirectLineSpeechChannel.json - */ -async function deleteDirectLineSpeechChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.delete(resourceGroupName, resourceName, channelName); - console.log(result); -} - -async function main(): Promise { - await deleteChannel(); - await deleteDirectLineSpeechChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/channelsGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/channelsGetSample.ts deleted file mode 100644 index 891ce2f1d232..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/channelsGetSample.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json - */ -async function getAlexaChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json - */ -async function getChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json - */ -async function getDirectLineSpeechChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json - */ -async function getLineChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -async function main(): Promise { - await getAlexaChannel(); - await getChannel(); - await getDirectLineSpeechChannel(); - await getLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/channelsListByResourceGroupSample.ts b/sdk/botservice/arm-botservice/samples-dev/channelsListByResourceGroupSample.ts deleted file mode 100644 index cf0d9298d8e0..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/channelsListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns all the Channel registrations of a particular BotService resource - * - * @summary Returns all the Channel registrations of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannelsByBotService.json - */ -async function listChannelsByResourceGroup(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.channels.listByResourceGroup(resourceGroupName, resourceName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listChannelsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/channelsListWithKeysSample.ts b/sdk/botservice/arm-botservice/samples-dev/channelsListWithKeysSample.ts deleted file mode 100644 index 5e4cade0f8d0..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/channelsListWithKeysSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists a Channel registration for a Bot Service including secrets - * - * @summary Lists a Channel registration for a Bot Service including secrets - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json - */ -async function listChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.listWithKeys(resourceGroupName, resourceName, channelName); - console.log(result); -} - -async function main(): Promise { - await listChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/channelsUpdateSample.ts b/sdk/botservice/arm-botservice/samples-dev/channelsUpdateSample.ts deleted file mode 100644 index 888f26321a29..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/channelsUpdateSample.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { - ChannelsUpdateOptionalParams, - EmailChannel, - AlexaChannel, - LineChannel, - DirectLineSpeechChannel, -} from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateAlexaChannel.json - */ -async function updateAlexaChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const location = "global"; - const properties: AlexaChannel = { - channelName: "AlexaChannel", - properties: { alexaSkillId: "XAlexaSkillIdX", isEnabled: true }, - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateChannel.json - */ -async function updateChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const location = "global"; - const properties: EmailChannel = { - channelName: "EmailChannel", - properties: { emailAddress: "a@b.com", isEnabled: true, password: "pwd" }, - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateDirectLineSpeechChannel.json - */ -async function updateDirectLineSpeechChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const location = "global"; - const properties: DirectLineSpeechChannel = { - channelName: "DirectLineSpeechChannel", - properties: { - cognitiveServiceRegion: "XcognitiveServiceRegionX", - cognitiveServiceSubscriptionKey: "XcognitiveServiceSubscriptionKeyX", - isEnabled: true, - }, - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateLineChannel.json - */ -async function updateLineChannel(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const location = "global"; - const properties: LineChannel = { - channelName: "LineChannel", - properties: { - lineRegistrations: [ - { - channelAccessToken: "channelAccessToken", - channelSecret: "channelSecret", - }, - ], - }, - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await updateAlexaChannel(); - await updateChannel(); - await updateDirectLineSpeechChannel(); - await updateLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/connectionSettingsCreateSample.ts b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsCreateSample.ts new file mode 100644 index 000000000000..a8bb7e92caad --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsCreateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to register a new Auth Connection for a Bot Service + * + * @summary register a new Auth Connection for a Bot Service + * x-ms-original-file: 2023-09-15-preview/PutConnection.json + */ +async function createConnectionSetting(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.connectionSettings.create( + "OneResourceGroupName", + "samplebotname", + "sampleConnection", + ); + console.log(result); +} + +async function main(): Promise { + await createConnectionSetting(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/connectionSettingsDeleteSample.ts b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsDeleteSample.ts new file mode 100644 index 000000000000..1e7f05bcc143 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Connection Setting registration for a Bot Service + * + * @summary deletes a Connection Setting registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/DeleteConnection.json + */ +async function deleteConnectionSetting(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + await client.connectionSettings.delete( + "OneResourceGroupName", + "samplebotname", + "sampleConnection", + ); +} + +async function main(): Promise { + await deleteConnectionSetting(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/connectionSettingsListByBotServiceSample.ts b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsListByBotServiceSample.ts new file mode 100644 index 000000000000..47dac2e1aa0c --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsListByBotServiceSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns all the Connection Settings registered to a particular BotService resource + * + * @summary returns all the Connection Settings registered to a particular BotService resource + * x-ms-original-file: 2023-09-15-preview/ListConnectionsByBotService.json + */ +async function listConnectionSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.connectionSettings.listByBotService( + "OneResourceGroupName", + "samplebotname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listConnectionSettings(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/connectionSettingsListWithSecretsSample.ts b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsListWithSecretsSample.ts new file mode 100644 index 000000000000..33610e044cd7 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsListWithSecretsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a Connection Setting registration for a Bot Service + * + * @summary get a Connection Setting registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/GetConnection.json + */ +async function listConnectionSettingWithSecrets(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.connectionSettings.listWithSecrets( + "OneResourceGroupName", + "samplebotname", + "sampleConnection", + ); + console.log(result); +} + +async function main(): Promise { + await listConnectionSettingWithSecrets(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/connectionSettingsUpdateSample.ts b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsUpdateSample.ts new file mode 100644 index 000000000000..904aa4d35da4 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/connectionSettingsUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a Connection Setting registration for a Bot Service + * + * @summary updates a Connection Setting registration for a Bot Service + * x-ms-original-file: 2023-09-15-preview/UpdateConnection.json + */ +async function updateConnectionSetting(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.connectionSettings.update( + "OneResourceGroupName", + "samplebotname", + "sampleConnection", + ); + console.log(result); +} + +async function main(): Promise { + await updateConnectionSetting(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/directLineRegenerateKeysSample.ts b/sdk/botservice/arm-botservice/samples-dev/directLineRegenerateKeysSample.ts deleted file mode 100644 index 6648bd13803e..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/directLineRegenerateKeysSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { SiteInfo } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * - * @summary Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DirectlineRegenerateKeys.json - */ -async function regenerateKeysForDirectLineChannelSite(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineChannel"; - const parameters: SiteInfo = { key: "key1", siteName: "testSiteName" }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.directLine.regenerateKeys( - resourceGroupName, - resourceName, - channelName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * - * @summary Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/WebChatRegenerateKeys.json - */ -async function regenerateKeysForWebChatChannelSite(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "WebChatChannel"; - const parameters: SiteInfo = { key: "key1", siteName: "testSiteName" }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.directLine.regenerateKeys( - resourceGroupName, - resourceName, - channelName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await regenerateKeysForDirectLineChannelSite(); - await regenerateKeysForWebChatChannelSite(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/emailCreateSignInUrlSample.ts b/sdk/botservice/arm-botservice/samples-dev/emailCreateSignInUrlSample.ts deleted file mode 100644 index e4fbdf9f6787..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/emailCreateSignInUrlSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates an email channel sign in url for a Bot Service - * - * @summary Creates an email channel sign in url for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json - */ -async function createUrl(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.email.createSignInUrl(resourceGroupName, resourceName); - console.log(result); -} - -async function main(): Promise { - await createUrl(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/hostSettingsGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/hostSettingsGetSample.ts deleted file mode 100644 index 3808390e5f34..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/hostSettingsGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get per subscription settings needed to host bot in compute resource such as Azure App Service - * - * @summary Get per subscription settings needed to host bot in compute resource such as Azure App Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetHostSettings.json - */ -async function getBotHostSettings(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.hostSettings.get(); - console.log(result); -} - -async function main(): Promise { - await getBotHostSettings(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/hostSettingsOperationGroupGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/hostSettingsOperationGroupGetSample.ts new file mode 100644 index 000000000000..86d727df9f3f --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/hostSettingsOperationGroupGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get per subscription settings needed to host bot in compute resource such as Azure App Service + * + * @summary get per subscription settings needed to host bot in compute resource such as Azure App Service + * x-ms-original-file: 2023-09-15-preview/GetHostSettings.json + */ +async function getBotHostSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.hostSettingsOperationGroup.get(); + console.log(result); +} + +async function main(): Promise { + await getBotHostSettings(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts new file mode 100644 index 000000000000..3aa10bbbf41c --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified Network Security Perimeter configuration associated with the Bot. + * + * @summary gets the specified Network Security Perimeter configuration associated with the Bot. + * x-ms-original-file: 2023-09-15-preview/GetNetworkSecurityPerimeterConfiguration.json + */ +async function getNetworkSecurityPerimeterConfiguration(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subId"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.get( + "rgName", + "botId", + "00000000-0000-0000-0000-000000000000.associationName", + ); + console.log(result); +} + +async function main(): Promise { + await getNetworkSecurityPerimeterConfiguration(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsListSample.ts b/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsListSample.ts new file mode 100644 index 000000000000..4c3a9bb3dcb7 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list Network Security Perimeter configurations associated with the Bot. + * + * @summary list Network Security Perimeter configurations associated with the Bot. + * x-ms-original-file: 2023-09-15-preview/ListNetworkSecurityPerimeterConfigurations.json + */ +async function listNetworkSecurityPerimeterConfigurations(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subId"; + const client = new BotServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkSecurityPerimeterConfigurations.list("rgName", "botId")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkSecurityPerimeterConfigurations(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts b/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts new file mode 100644 index 000000000000..5d97ab92c61b --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to reconcile the specified Network Security Perimeter configuration associated with the Bot. + * + * @summary reconcile the specified Network Security Perimeter configuration associated with the Bot. + * x-ms-original-file: 2023-09-15-preview/ReconcileNetworkSecurityPerimeterConfiguration.json + */ +async function reconcileNetworkSecurityPerimeterConfiguration(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subId"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.reconcile( + "rgName", + "botId", + "00000000-0000-0000-0000-000000000000.associationName", + ); + console.log(result); +} + +async function main(): Promise { + await reconcileNetworkSecurityPerimeterConfiguration(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/operationResultsGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/operationResultsGetSample.ts deleted file mode 100644 index 4c7b1dc2f31a..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/operationResultsGetSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the operation result for a long running operation. - * - * @summary Get the operation result for a long running operation. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/OperationResultsGet.json - */ -async function getOperationResult(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subid"; - const operationResultId = "exampleid"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.operationResults.beginGetAndWait(operationResultId); - console.log(result); -} - -async function main(): Promise { - await getOperationResult(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/operationResultsOperationGroupGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/operationResultsOperationGroupGetSample.ts new file mode 100644 index 000000000000..a5c0823a5db1 --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/operationResultsOperationGroupGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get the operation result for a long running operation. + * + * @summary get the operation result for a long running operation. + * x-ms-original-file: 2023-09-15-preview/OperationResultsGet.json + */ +async function getOperationResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.operationResultsOperationGroup.get("exampleid"); + console.log(result); +} + +async function main(): Promise { + await getOperationResult(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/operationsListSample.ts b/sdk/botservice/arm-botservice/samples-dev/operationsListSample.ts index 20332ec604bb..6ebacaca5ae3 100644 --- a/sdk/botservice/arm-botservice/samples-dev/operationsListSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/operationsListSample.ts @@ -1,29 +1,24 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the available BotService operations. + * This sample demonstrates how to list the operations for the provider * - * @summary Lists all the available BotService operations. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetOperations.json + * @summary list the operations for the provider + * x-ms-original-file: 2023-09-15-preview/GetOperations.json */ async function getOperations(): Promise { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new BotServiceClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsCreateSample.ts b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsCreateSample.ts index fa372bcb9370..ea48c4819337 100644 --- a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsCreateSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsCreateSample.ts @@ -1,39 +1,23 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { PrivateEndpointConnection } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Bot. + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Bot. * - * @summary Update the state of specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json + * @summary update the state of specified private endpoint connection associated with the Bot. + * x-ms-original-file: 2023-09-15-preview/PutPrivateEndpointConnection.json */ async function putPrivateEndpointConnection(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res7687"; - const resourceName = "sto9699"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; - const properties: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Auto-Approved", - status: "Approved", - }, - }; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); + const subscriptionId = "{subscription-id}"; + const client = new BotServiceClient(credential, subscriptionId); const result = await client.privateEndpointConnections.create( - resourceGroupName, - resourceName, - privateEndpointConnectionName, - properties, + "res7687", + "sto9699", + "{privateEndpointConnectionName}", ); console.log(result); } diff --git a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsDeleteSample.ts index 3eae94d1df78..b2b8ba96e24d 100644 --- a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -1,33 +1,24 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Bot. + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Bot. * - * @summary Deletes the specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeletePrivateEndpointConnection.json + * @summary deletes the specified private endpoint connection associated with the Bot. + * x-ms-original-file: 2023-09-15-preview/DeletePrivateEndpointConnection.json */ async function deletePrivateEndpointConnection(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateEndpointConnections.delete( - resourceGroupName, - resourceName, - privateEndpointConnectionName, + const subscriptionId = "{subscription-id}"; + const client = new BotServiceClient(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "res6977", + "sto2527", + "{privateEndpointConnectionName}", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsGetSample.ts index ec17233e2c36..223ec45f1731 100644 --- a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsGetSample.ts @@ -1,31 +1,23 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Bot. + * This sample demonstrates how to gets the specified private endpoint connection associated with the Bot. * - * @summary Gets the specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json + * @summary gets the specified private endpoint connection associated with the Bot. + * x-ms-original-file: 2023-09-15-preview/GetPrivateEndpointConnection.json */ async function getPrivateEndpointConnection(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); + const subscriptionId = "{subscription-id}"; + const client = new BotServiceClient(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - resourceGroupName, - resourceName, - privateEndpointConnectionName, + "res6977", + "sto2527", + "{privateEndpointConnectionName}", ); console.log(result); } diff --git a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsListSample.ts index 2a11ecbd623d..d2a2acf6c7bb 100644 --- a/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/botservice/arm-botservice/samples-dev/privateEndpointConnectionsListSample.ts @@ -1,33 +1,24 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List all the private endpoint connections associated with the Bot. + * This sample demonstrates how to list all the private endpoint connections associated with the Bot. * - * @summary List all the private endpoint connections associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateEndpointConnections.json + * @summary list all the private endpoint connections associated with the Bot. + * x-ms-original-file: 2023-09-15-preview/ListPrivateEndpointConnections.json */ async function listPrivateEndpointConnections(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); + const subscriptionId = "{subscription-id}"; + const client = new BotServiceClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - resourceName, - )) { + for await (const item of client.privateEndpointConnections.list("res6977", "sto2527")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/botservice/arm-botservice/samples-dev/privateLinkResourcesListByBotResourceSample.ts b/sdk/botservice/arm-botservice/samples-dev/privateLinkResourcesListByBotResourceSample.ts deleted file mode 100644 index a7e583f7dfcb..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/privateLinkResourcesListByBotResourceSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Bot. - * - * @summary Gets the private link resources that need to be created for a Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json - */ -async function listPrivateLinkResources(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateLinkResources.listByBotResource( - resourceGroupName, - resourceName, - ); - console.log(result); -} - -async function main(): Promise { - await listPrivateLinkResources(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/qnAMakerEndpointKeysGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/qnAMakerEndpointKeysGetSample.ts deleted file mode 100644 index 56f941874326..000000000000 --- a/sdk/botservice/arm-botservice/samples-dev/qnAMakerEndpointKeysGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { QnAMakerEndpointKeysRequestBody } from "@azure/arm-botservice"; -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the QnA Maker endpoint keys - * - * @summary Lists the QnA Maker endpoint keys - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListQnAMakerEndpointKeys.json - */ -async function listQnAMakerEndpointKeys(): Promise { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const parameters: QnAMakerEndpointKeysRequestBody = { - authkey: "testAuthKey", - hostname: "https://xxx.cognitiveservices.azure.com/", - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.qnAMakerEndpointKeys.get(parameters); - console.log(result); -} - -async function main(): Promise { - await listQnAMakerEndpointKeys(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples-dev/qnAMakerEndpointKeysOperationGroupGetSample.ts b/sdk/botservice/arm-botservice/samples-dev/qnAMakerEndpointKeysOperationGroupGetSample.ts new file mode 100644 index 000000000000..bebbcd03e5ba --- /dev/null +++ b/sdk/botservice/arm-botservice/samples-dev/qnAMakerEndpointKeysOperationGroupGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "@azure/arm-botservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists the QnA Maker endpoint keys + * + * @summary lists the QnA Maker endpoint keys + * x-ms-original-file: 2023-09-15-preview/ListQnAMakerEndpointKeys.json + */ +async function listQnAMakerEndpointKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscription-id"; + const client = new BotServiceClient(credential, subscriptionId); + const result = await client.qnAMakerEndpointKeysOperationGroup.get(); + console.log(result); +} + +async function main(): Promise { + await listQnAMakerEndpointKeys(); +} + +main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/README.md b/sdk/botservice/arm-botservice/samples/v4/javascript/README.md deleted file mode 100644 index 5c9b67560235..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [botConnectionCreateSample.js][botconnectioncreatesample] | Register a new Auth Connection for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutConnection.json | -| [botConnectionDeleteSample.js][botconnectiondeletesample] | Deletes a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteConnection.json | -| [botConnectionGetSample.js][botconnectiongetsample] | Get a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json | -| [botConnectionListByBotServiceSample.js][botconnectionlistbybotservicesample] | Returns all the Connection Settings registered to a particular BotService resource x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListConnectionsByBotService.json | -| [botConnectionListServiceProvidersSample.js][botconnectionlistserviceproviderssample] | Lists the available Service Providers for creating Connection Settings x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListServiceProviders.json | -| [botConnectionListWithSecretsSample.js][botconnectionlistwithsecretssample] | Get a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json | -| [botConnectionUpdateSample.js][botconnectionupdatesample] | Updates a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateConnection.json | -| [botsCreateSample.js][botscreatesample] | Creates a Bot Service. Bot Service is a resource group wide resource type. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateBot.json | -| [botsDeleteSample.js][botsdeletesample] | Deletes a Bot Service from the resource group. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteBot.json | -| [botsGetCheckNameAvailabilitySample.js][botsgetchecknameavailabilitysample] | Check whether a bot name is available. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json | -| [botsGetSample.js][botsgetsample] | Returns a BotService specified by the parameters. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json | -| [botsListByResourceGroupSample.js][botslistbyresourcegroupsample] | Returns all the resources of a particular type belonging to a resource group x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsByResourceGroup.json | -| [botsListSample.js][botslistsample] | Returns all the resources of a particular type belonging to a subscription. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsBySubscription.json | -| [botsUpdateSample.js][botsupdatesample] | Updates a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateBot.json | -| [channelsCreateSample.js][channelscreatesample] | Creates a Channel registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutAlexaChannel.json | -| [channelsDeleteSample.js][channelsdeletesample] | Deletes a Channel registration from a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteChannel.json | -| [channelsGetSample.js][channelsgetsample] | Returns a BotService Channel registration specified by the parameters. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json | -| [channelsListByResourceGroupSample.js][channelslistbyresourcegroupsample] | Returns all the Channel registrations of a particular BotService resource x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannelsByBotService.json | -| [channelsListWithKeysSample.js][channelslistwithkeyssample] | Lists a Channel registration for a Bot Service including secrets x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json | -| [channelsUpdateSample.js][channelsupdatesample] | Updates a Channel registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateAlexaChannel.json | -| [directLineRegenerateKeysSample.js][directlineregeneratekeyssample] | Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DirectlineRegenerateKeys.json | -| [emailCreateSignInUrlSample.js][emailcreatesigninurlsample] | Creates an email channel sign in url for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json | -| [hostSettingsGetSample.js][hostsettingsgetsample] | Get per subscription settings needed to host bot in compute resource such as Azure App Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetHostSettings.json | -| [operationResultsGetSample.js][operationresultsgetsample] | Get the operation result for a long running operation. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/OperationResultsGet.json | -| [operationsListSample.js][operationslistsample] | Lists all the available BotService operations. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetOperations.json | -| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeletePrivateEndpointConnection.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json | -| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all the private endpoint connections associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateEndpointConnections.json | -| [privateLinkResourcesListByBotResourceSample.js][privatelinkresourceslistbybotresourcesample] | Gets the private link resources that need to be created for a Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json | -| [qnAMakerEndpointKeysGetSample.js][qnamakerendpointkeysgetsample] | Lists the QnA Maker endpoint keys x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListQnAMakerEndpointKeys.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node botConnectionCreateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env BOTSERVICE_SUBSCRIPTION_ID="" BOTSERVICE_RESOURCE_GROUP="" node botConnectionCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[botconnectioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionCreateSample.js -[botconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionDeleteSample.js -[botconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionGetSample.js -[botconnectionlistbybotservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListByBotServiceSample.js -[botconnectionlistserviceproviderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListServiceProvidersSample.js -[botconnectionlistwithsecretssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListWithSecretsSample.js -[botconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionUpdateSample.js -[botscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botsCreateSample.js -[botsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botsDeleteSample.js -[botsgetchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetCheckNameAvailabilitySample.js -[botsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetSample.js -[botslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botsListByResourceGroupSample.js -[botslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botsListSample.js -[botsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/botsUpdateSample.js -[channelscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/channelsCreateSample.js -[channelsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/channelsDeleteSample.js -[channelsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/channelsGetSample.js -[channelslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListByResourceGroupSample.js -[channelslistwithkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListWithKeysSample.js -[channelsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/channelsUpdateSample.js -[directlineregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/directLineRegenerateKeysSample.js -[emailcreatesigninurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/emailCreateSignInUrlSample.js -[hostsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/hostSettingsGetSample.js -[operationresultsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/operationResultsGetSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/operationsListSample.js -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsCreateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsListSample.js -[privatelinkresourceslistbybotresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/privateLinkResourcesListByBotResourceSample.js -[qnamakerendpointkeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/javascript/qnAMakerEndpointKeysGetSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-botservice?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice/README.md diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionCreateSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionCreateSample.js deleted file mode 100644 index b1213f7206dd..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionCreateSample.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Register a new Auth Connection for a Bot Service - * - * @summary Register a new Auth Connection for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutConnection.json - */ -async function createConnectionSetting() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const parameters = { - etag: "etag1", - location: "West US", - properties: { - clientId: "sampleclientid", - clientSecret: "samplesecret", - parameters: [ - { key: "key1", value: "value1" }, - { key: "key2", value: "value2" }, - ], - scopes: "samplescope", - serviceProviderId: "serviceproviderid", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.create( - resourceGroupName, - resourceName, - connectionName, - parameters - ); - console.log(result); -} - -async function main() { - createConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionDeleteSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionDeleteSample.js deleted file mode 100644 index cbcc157c2f7d..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Connection Setting registration for a Bot Service - * - * @summary Deletes a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteConnection.json - */ -async function deleteConnectionSetting() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.delete(resourceGroupName, resourceName, connectionName); - console.log(result); -} - -async function main() { - deleteConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionGetSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionGetSample.js deleted file mode 100644 index e24e621578d5..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Connection Setting registration for a Bot Service - * - * @summary Get a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json - */ -async function getConnectionSetting() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.get(resourceGroupName, resourceName, connectionName); - console.log(result); -} - -async function main() { - getConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListByBotServiceSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListByBotServiceSample.js deleted file mode 100644 index 57a0734309ea..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListByBotServiceSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns all the Connection Settings registered to a particular BotService resource - * - * @summary Returns all the Connection Settings registered to a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListConnectionsByBotService.json - */ -async function listConnectionSettings() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.botConnection.listByBotService(resourceGroupName, resourceName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listConnectionSettings(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListServiceProvidersSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListServiceProvidersSample.js deleted file mode 100644 index 553394c5817f..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListServiceProvidersSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the available Service Providers for creating Connection Settings - * - * @summary Lists the available Service Providers for creating Connection Settings - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListServiceProviders.json - */ -async function listAuthServiceProviders() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.listServiceProviders(); - console.log(result); -} - -async function main() { - listAuthServiceProviders(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListWithSecretsSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListWithSecretsSample.js deleted file mode 100644 index f128f6f5b387..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionListWithSecretsSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Connection Setting registration for a Bot Service - * - * @summary Get a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json - */ -async function listConnectionSettingWithSecrets() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.listWithSecrets( - resourceGroupName, - resourceName, - connectionName - ); - console.log(result); -} - -async function main() { - listConnectionSettingWithSecrets(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionUpdateSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionUpdateSample.js deleted file mode 100644 index e6b373e59f2b..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botConnectionUpdateSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates a Connection Setting registration for a Bot Service - * - * @summary Updates a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateConnection.json - */ -async function updateConnectionSetting() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const parameters = { - etag: "etag1", - location: "global", - properties: { - clientId: "sampleclientid", - clientSecret: "samplesecret", - parameters: [ - { key: "key1", value: "value1" }, - { key: "key2", value: "value2" }, - ], - scopes: "samplescope", - serviceProviderDisplayName: "serviceProviderDisplayName", - serviceProviderId: "serviceproviderid", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.update( - resourceGroupName, - resourceName, - connectionName, - parameters - ); - console.log(result); -} - -async function main() { - updateConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botsCreateSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botsCreateSample.js deleted file mode 100644 index be4eff2f3485..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botsCreateSample.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a Bot Service. Bot Service is a resource group wide resource type. - * - * @summary Creates a Bot Service. Bot Service is a resource group wide resource type. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateBot.json - */ -async function createBot() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const parameters = { - etag: "etag1", - kind: "sdk", - location: "West US", - properties: { - description: "The description of the bot", - cmekKeyVaultUrl: "https://myCmekKey", - developerAppInsightKey: "appinsightskey", - developerAppInsightsApiKey: "appinsightsapikey", - developerAppInsightsApplicationId: "appinsightsappid", - disableLocalAuth: true, - displayName: "The Name of the bot", - endpoint: "http://mybot.coffee", - iconUrl: "http://myicon", - isCmekEnabled: true, - luisAppIds: ["luisappid1", "luisappid2"], - luisKey: "luiskey", - msaAppId: "exampleappid", - msaAppMSIResourceId: - "/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId", - msaAppTenantId: "exampleapptenantid", - msaAppType: "UserAssignedMSI", - publicNetworkAccess: "Enabled", - schemaTransformationVersion: "1.0", - }, - sku: { name: "S1" }, - tags: { tag1: "value1", tag2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.create(resourceGroupName, resourceName, parameters); - console.log(result); -} - -async function main() { - createBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botsDeleteSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botsDeleteSample.js deleted file mode 100644 index 7e510a04c2e1..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Bot Service from the resource group. - * - * @summary Deletes a Bot Service from the resource group. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteBot.json - */ -async function deleteBot() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.delete(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - deleteBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetCheckNameAvailabilitySample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetCheckNameAvailabilitySample.js deleted file mode 100644 index 01b19a823e7f..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetCheckNameAvailabilitySample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Check whether a bot name is available. - * - * @summary Check whether a bot name is available. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json - */ -async function checkNameAvailability() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const parameters = { - name: "testbotname", - type: "string", - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.getCheckNameAvailability(parameters); - console.log(result); -} - -async function main() { - checkNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetSample.js deleted file mode 100644 index e7e7a38212d5..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns a BotService specified by the parameters. - * - * @summary Returns a BotService specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json - */ -async function getBot() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botsListByResourceGroupSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botsListByResourceGroupSample.js deleted file mode 100644 index b54381caf840..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botsListByResourceGroupSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns all the resources of a particular type belonging to a resource group - * - * @summary Returns all the resources of a particular type belonging to a resource group - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsByResourceGroup.json - */ -async function listBotsByResourceGroup() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.bots.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listBotsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botsListSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botsListSample.js deleted file mode 100644 index 710972c99cce..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botsListSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns all the resources of a particular type belonging to a subscription. - * - * @summary Returns all the resources of a particular type belonging to a subscription. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsBySubscription.json - */ -async function listBotsBySubscription() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.bots.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listBotsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/botsUpdateSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/botsUpdateSample.js deleted file mode 100644 index 0b8a704a357b..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/botsUpdateSample.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates a Bot Service - * - * @summary Updates a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateBot.json - */ -async function updateBot() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const location = "West US"; - const tags = { tag1: "value1", tag2: "value2" }; - const sku = { name: "S1" }; - const kind = "sdk"; - const etag = "etag1"; - const properties = { - description: "The description of the bot", - cmekKeyVaultUrl: "https://myCmekKey", - developerAppInsightKey: "appinsightskey", - developerAppInsightsApiKey: "appinsightsapikey", - developerAppInsightsApplicationId: "appinsightsappid", - disableLocalAuth: true, - displayName: "The Name of the bot", - endpoint: "http://mybot.coffee", - iconUrl: "http://myicon", - isCmekEnabled: true, - luisAppIds: ["luisappid1", "luisappid2"], - luisKey: "luiskey", - msaAppId: "msaappid", - msaAppMSIResourceId: - "/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId", - msaAppTenantId: "msaapptenantid", - msaAppType: "UserAssignedMSI", - publicNetworkAccess: "Enabled", - schemaTransformationVersion: "1.0", - }; - const options = { - location, - tags, - sku, - kind, - etag, - properties, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.update(resourceGroupName, resourceName, options); - console.log(result); -} - -async function main() { - updateBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsCreateSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/channelsCreateSample.js deleted file mode 100644 index 410865b46a67..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsCreateSample.js +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutAlexaChannel.json - */ -async function createAlexaChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const parameters = { - location: "global", - properties: { - channelName: "AlexaChannel", - properties: { alexaSkillId: "XAlexaSkillIdX", isEnabled: true }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutChannel.json - */ -async function createChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const parameters = { - location: "global", - properties: { - channelName: "EmailChannel", - properties: { emailAddress: "a@b.com", isEnabled: true, password: "pwd" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutDirectLineSpeechChannel.json - */ -async function createDirectLineSpeechChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const parameters = { - location: "global", - properties: { - channelName: "DirectLineSpeechChannel", - properties: { - cognitiveServiceRegion: "XcognitiveServiceRegionX", - cognitiveServiceSubscriptionKey: "XcognitiveServiceSubscriptionKeyX", - isEnabled: true, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutEmailChannel.json - */ -async function createEmailChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const parameters = { - location: "global", - properties: { - channelName: "EmailChannel", - properties: { - authMethod: 1, - emailAddress: "a@b.com", - isEnabled: true, - magicCode: "000000", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutLineChannel.json - */ -async function createLineChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const parameters = { - location: "global", - properties: { - channelName: "LineChannel", - properties: { - lineRegistrations: [ - { - channelAccessToken: "channelAccessToken", - channelSecret: "channelSecret", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -async function main() { - createAlexaChannel(); - createChannel(); - createDirectLineSpeechChannel(); - createEmailChannel(); - createLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsDeleteSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/channelsDeleteSample.js deleted file mode 100644 index 35699483ec8d..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsDeleteSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Channel registration from a Bot Service - * - * @summary Deletes a Channel registration from a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteChannel.json - */ -async function deleteChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.delete(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes a Channel registration from a Bot Service - * - * @summary Deletes a Channel registration from a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteDirectLineSpeechChannel.json - */ -async function deleteDirectLineSpeechChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.delete(resourceGroupName, resourceName, channelName); - console.log(result); -} - -async function main() { - deleteChannel(); - deleteDirectLineSpeechChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsGetSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/channelsGetSample.js deleted file mode 100644 index af39baefb9c5..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsGetSample.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json - */ -async function getAlexaChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json - */ -async function getChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json - */ -async function getDirectLineSpeechChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json - */ -async function getLineChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get(resourceGroupName, resourceName, channelName); - console.log(result); -} - -async function main() { - getAlexaChannel(); - getChannel(); - getDirectLineSpeechChannel(); - getLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListByResourceGroupSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListByResourceGroupSample.js deleted file mode 100644 index 7b0af7d6b93c..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns all the Channel registrations of a particular BotService resource - * - * @summary Returns all the Channel registrations of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannelsByBotService.json - */ -async function listChannelsByResourceGroup() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.channels.listByResourceGroup(resourceGroupName, resourceName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listChannelsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListWithKeysSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListWithKeysSample.js deleted file mode 100644 index a63ec3a4e261..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsListWithKeysSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists a Channel registration for a Bot Service including secrets - * - * @summary Lists a Channel registration for a Bot Service including secrets - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json - */ -async function listChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.listWithKeys(resourceGroupName, resourceName, channelName); - console.log(result); -} - -async function main() { - listChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsUpdateSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/channelsUpdateSample.js deleted file mode 100644 index 68a6d948f1ad..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/channelsUpdateSample.js +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateAlexaChannel.json - */ -async function updateAlexaChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const location = "global"; - const properties = { - channelName: "AlexaChannel", - properties: { alexaSkillId: "XAlexaSkillIdX", isEnabled: true }, - }; - const options = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateChannel.json - */ -async function updateChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const location = "global"; - const properties = { - channelName: "EmailChannel", - properties: { emailAddress: "a@b.com", isEnabled: true, password: "pwd" }, - }; - const options = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateDirectLineSpeechChannel.json - */ -async function updateDirectLineSpeechChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const location = "global"; - const properties = { - channelName: "DirectLineSpeechChannel", - properties: { - cognitiveServiceRegion: "XcognitiveServiceRegionX", - cognitiveServiceSubscriptionKey: "XcognitiveServiceSubscriptionKeyX", - isEnabled: true, - }, - }; - const options = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateLineChannel.json - */ -async function updateLineChannel() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const location = "global"; - const properties = { - channelName: "LineChannel", - properties: { - lineRegistrations: [ - { - channelAccessToken: "channelAccessToken", - channelSecret: "channelSecret", - }, - ], - }, - }; - const options = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -async function main() { - updateAlexaChannel(); - updateChannel(); - updateDirectLineSpeechChannel(); - updateLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/directLineRegenerateKeysSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/directLineRegenerateKeysSample.js deleted file mode 100644 index d4f7c8280da9..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/directLineRegenerateKeysSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * - * @summary Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DirectlineRegenerateKeys.json - */ -async function regenerateKeysForDirectLineChannelSite() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineChannel"; - const parameters = { key: "key1", siteName: "testSiteName" }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.directLine.regenerateKeys( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * - * @summary Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/WebChatRegenerateKeys.json - */ -async function regenerateKeysForWebChatChannelSite() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "WebChatChannel"; - const parameters = { key: "key1", siteName: "testSiteName" }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.directLine.regenerateKeys( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -async function main() { - regenerateKeysForDirectLineChannelSite(); - regenerateKeysForWebChatChannelSite(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/emailCreateSignInUrlSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/emailCreateSignInUrlSample.js deleted file mode 100644 index 26824d8cc52f..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/emailCreateSignInUrlSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates an email channel sign in url for a Bot Service - * - * @summary Creates an email channel sign in url for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json - */ -async function createUrl() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.email.createSignInUrl(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - createUrl(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/hostSettingsGetSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/hostSettingsGetSample.js deleted file mode 100644 index 71df44b7a5d8..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/hostSettingsGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get per subscription settings needed to host bot in compute resource such as Azure App Service - * - * @summary Get per subscription settings needed to host bot in compute resource such as Azure App Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetHostSettings.json - */ -async function getBotHostSettings() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.hostSettings.get(); - console.log(result); -} - -async function main() { - getBotHostSettings(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/operationResultsGetSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/operationResultsGetSample.js deleted file mode 100644 index 620de9276de0..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/operationResultsGetSample.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the operation result for a long running operation. - * - * @summary Get the operation result for a long running operation. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/OperationResultsGet.json - */ -async function getOperationResult() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subid"; - const operationResultId = "exampleid"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.operationResults.beginGetAndWait(operationResultId); - console.log(result); -} - -async function main() { - getOperationResult(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/operationsListSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/operationsListSample.js deleted file mode 100644 index 6844586f3321..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all the available BotService operations. - * - * @summary Lists all the available BotService operations. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetOperations.json - */ -async function getOperations() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperations(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/package.json b/sdk/botservice/arm-botservice/samples/v4/javascript/package.json deleted file mode 100644 index ebd89b0f03ef..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-botservice-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/botservice/arm-botservice" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice", - "dependencies": { - "@azure/arm-botservice": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsCreateSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsCreateSample.js deleted file mode 100644 index 503f1b0721fe..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsCreateSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Bot. - * - * @summary Update the state of specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json - */ -async function putPrivateEndpointConnection() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res7687"; - const resourceName = "sto9699"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; - const properties = { - privateLinkServiceConnectionState: { - description: "Auto-Approved", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - resourceGroupName, - resourceName, - privateEndpointConnectionName, - properties - ); - console.log(result); -} - -async function main() { - putPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index 431c3fe651f3..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Bot. - * - * @summary Deletes the specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeletePrivateEndpointConnection.json - */ -async function deletePrivateEndpointConnection() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateEndpointConnections.delete( - resourceGroupName, - resourceName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletePrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsGetSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index 773cf74980e0..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Bot. - * - * @summary Gets the specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json - */ -async function getPrivateEndpointConnection() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - resourceName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsListSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsListSample.js deleted file mode 100644 index 3b623b0d998e..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/privateEndpointConnectionsListSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List all the private endpoint connections associated with the Bot. - * - * @summary List all the private endpoint connections associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateEndpointConnections.json - */ -async function listPrivateEndpointConnections() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list(resourceGroupName, resourceName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPrivateEndpointConnections(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/privateLinkResourcesListByBotResourceSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/privateLinkResourcesListByBotResourceSample.js deleted file mode 100644 index b92eaafebbbb..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/privateLinkResourcesListByBotResourceSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Bot. - * - * @summary Gets the private link resources that need to be created for a Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json - */ -async function listPrivateLinkResources() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateLinkResources.listByBotResource( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - listPrivateLinkResources(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/qnAMakerEndpointKeysGetSample.js b/sdk/botservice/arm-botservice/samples/v4/javascript/qnAMakerEndpointKeysGetSample.js deleted file mode 100644 index 8d96883adf79..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/qnAMakerEndpointKeysGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the QnA Maker endpoint keys - * - * @summary Lists the QnA Maker endpoint keys - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListQnAMakerEndpointKeys.json - */ -async function listQnAMakerEndpointKeys() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const parameters = { - authkey: "testAuthKey", - hostname: "https://xxx.cognitiveservices.azure.com/", - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.qnAMakerEndpointKeys.get(parameters); - console.log(result); -} - -async function main() { - listQnAMakerEndpointKeys(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/javascript/sample.env b/sdk/botservice/arm-botservice/samples/v4/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/README.md b/sdk/botservice/arm-botservice/samples/v4/typescript/README.md deleted file mode 100644 index 36954050a68b..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [botConnectionCreateSample.ts][botconnectioncreatesample] | Register a new Auth Connection for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutConnection.json | -| [botConnectionDeleteSample.ts][botconnectiondeletesample] | Deletes a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteConnection.json | -| [botConnectionGetSample.ts][botconnectiongetsample] | Get a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json | -| [botConnectionListByBotServiceSample.ts][botconnectionlistbybotservicesample] | Returns all the Connection Settings registered to a particular BotService resource x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListConnectionsByBotService.json | -| [botConnectionListServiceProvidersSample.ts][botconnectionlistserviceproviderssample] | Lists the available Service Providers for creating Connection Settings x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListServiceProviders.json | -| [botConnectionListWithSecretsSample.ts][botconnectionlistwithsecretssample] | Get a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json | -| [botConnectionUpdateSample.ts][botconnectionupdatesample] | Updates a Connection Setting registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateConnection.json | -| [botsCreateSample.ts][botscreatesample] | Creates a Bot Service. Bot Service is a resource group wide resource type. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateBot.json | -| [botsDeleteSample.ts][botsdeletesample] | Deletes a Bot Service from the resource group. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteBot.json | -| [botsGetCheckNameAvailabilitySample.ts][botsgetchecknameavailabilitysample] | Check whether a bot name is available. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json | -| [botsGetSample.ts][botsgetsample] | Returns a BotService specified by the parameters. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json | -| [botsListByResourceGroupSample.ts][botslistbyresourcegroupsample] | Returns all the resources of a particular type belonging to a resource group x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsByResourceGroup.json | -| [botsListSample.ts][botslistsample] | Returns all the resources of a particular type belonging to a subscription. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsBySubscription.json | -| [botsUpdateSample.ts][botsupdatesample] | Updates a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateBot.json | -| [channelsCreateSample.ts][channelscreatesample] | Creates a Channel registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutAlexaChannel.json | -| [channelsDeleteSample.ts][channelsdeletesample] | Deletes a Channel registration from a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteChannel.json | -| [channelsGetSample.ts][channelsgetsample] | Returns a BotService Channel registration specified by the parameters. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json | -| [channelsListByResourceGroupSample.ts][channelslistbyresourcegroupsample] | Returns all the Channel registrations of a particular BotService resource x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannelsByBotService.json | -| [channelsListWithKeysSample.ts][channelslistwithkeyssample] | Lists a Channel registration for a Bot Service including secrets x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json | -| [channelsUpdateSample.ts][channelsupdatesample] | Updates a Channel registration for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateAlexaChannel.json | -| [directLineRegenerateKeysSample.ts][directlineregeneratekeyssample] | Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DirectlineRegenerateKeys.json | -| [emailCreateSignInUrlSample.ts][emailcreatesigninurlsample] | Creates an email channel sign in url for a Bot Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json | -| [hostSettingsGetSample.ts][hostsettingsgetsample] | Get per subscription settings needed to host bot in compute resource such as Azure App Service x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetHostSettings.json | -| [operationResultsGetSample.ts][operationresultsgetsample] | Get the operation result for a long running operation. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/OperationResultsGet.json | -| [operationsListSample.ts][operationslistsample] | Lists all the available BotService operations. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetOperations.json | -| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeletePrivateEndpointConnection.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json | -| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all the private endpoint connections associated with the Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateEndpointConnections.json | -| [privateLinkResourcesListByBotResourceSample.ts][privatelinkresourceslistbybotresourcesample] | Gets the private link resources that need to be created for a Bot. x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json | -| [qnAMakerEndpointKeysGetSample.ts][qnamakerendpointkeysgetsample] | Lists the QnA Maker endpoint keys x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListQnAMakerEndpointKeys.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/botConnectionCreateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env BOTSERVICE_SUBSCRIPTION_ID="" BOTSERVICE_RESOURCE_GROUP="" node dist/botConnectionCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[botconnectioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionCreateSample.ts -[botconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionDeleteSample.ts -[botconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionGetSample.ts -[botconnectionlistbybotservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListByBotServiceSample.ts -[botconnectionlistserviceproviderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListServiceProvidersSample.ts -[botconnectionlistwithsecretssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListWithSecretsSample.ts -[botconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionUpdateSample.ts -[botscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsCreateSample.ts -[botsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsDeleteSample.ts -[botsgetchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetCheckNameAvailabilitySample.ts -[botsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetSample.ts -[botslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListByResourceGroupSample.ts -[botslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListSample.ts -[botsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsUpdateSample.ts -[channelscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsCreateSample.ts -[channelsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsDeleteSample.ts -[channelsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsGetSample.ts -[channelslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListByResourceGroupSample.ts -[channelslistwithkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListWithKeysSample.ts -[channelsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsUpdateSample.ts -[directlineregeneratekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/directLineRegenerateKeysSample.ts -[emailcreatesigninurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/emailCreateSignInUrlSample.ts -[hostsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/hostSettingsGetSample.ts -[operationresultsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationResultsGetSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationsListSample.ts -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsCreateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsListSample.ts -[privatelinkresourceslistbybotresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateLinkResourcesListByBotResourceSample.ts -[qnamakerendpointkeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/botservice/arm-botservice/samples/v4/typescript/src/qnAMakerEndpointKeysGetSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-botservice?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/package.json b/sdk/botservice/arm-botservice/samples/v4/typescript/package.json deleted file mode 100644 index c0ccbba18700..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-botservice-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/botservice/arm-botservice" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice", - "dependencies": { - "@azure/arm-botservice": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" - } -} diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/sample.env b/sdk/botservice/arm-botservice/samples/v4/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionCreateSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionCreateSample.ts deleted file mode 100644 index 7b3d22727ebf..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionCreateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { ConnectionSetting, AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Register a new Auth Connection for a Bot Service - * - * @summary Register a new Auth Connection for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutConnection.json - */ -async function createConnectionSetting() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const parameters: ConnectionSetting = { - etag: "etag1", - location: "West US", - properties: { - clientId: "sampleclientid", - clientSecret: "samplesecret", - parameters: [ - { key: "key1", value: "value1" }, - { key: "key2", value: "value2" } - ], - scopes: "samplescope", - serviceProviderId: "serviceproviderid" - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.create( - resourceGroupName, - resourceName, - connectionName, - parameters - ); - console.log(result); -} - -async function main() { - createConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionDeleteSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionDeleteSample.ts deleted file mode 100644 index e87993d76293..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionDeleteSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Connection Setting registration for a Bot Service - * - * @summary Deletes a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteConnection.json - */ -async function deleteConnectionSetting() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.delete( - resourceGroupName, - resourceName, - connectionName - ); - console.log(result); -} - -async function main() { - deleteConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionGetSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionGetSample.ts deleted file mode 100644 index 012cf2401994..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionGetSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a Connection Setting registration for a Bot Service - * - * @summary Get a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json - */ -async function getConnectionSetting() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.get( - resourceGroupName, - resourceName, - connectionName - ); - console.log(result); -} - -async function main() { - getConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListByBotServiceSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListByBotServiceSample.ts deleted file mode 100644 index f673d17fe8a1..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListByBotServiceSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns all the Connection Settings registered to a particular BotService resource - * - * @summary Returns all the Connection Settings registered to a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListConnectionsByBotService.json - */ -async function listConnectionSettings() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.botConnection.listByBotService( - resourceGroupName, - resourceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listConnectionSettings(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListServiceProvidersSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListServiceProvidersSample.ts deleted file mode 100644 index 65fe35dab348..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListServiceProvidersSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the available Service Providers for creating Connection Settings - * - * @summary Lists the available Service Providers for creating Connection Settings - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListServiceProviders.json - */ -async function listAuthServiceProviders() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.listServiceProviders(); - console.log(result); -} - -async function main() { - listAuthServiceProviders(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListWithSecretsSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListWithSecretsSample.ts deleted file mode 100644 index 02338bc894d6..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionListWithSecretsSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a Connection Setting registration for a Bot Service - * - * @summary Get a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json - */ -async function listConnectionSettingWithSecrets() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.listWithSecrets( - resourceGroupName, - resourceName, - connectionName - ); - console.log(result); -} - -async function main() { - listConnectionSettingWithSecrets(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionUpdateSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionUpdateSample.ts deleted file mode 100644 index d5a78d232310..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botConnectionUpdateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { ConnectionSetting, AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a Connection Setting registration for a Bot Service - * - * @summary Updates a Connection Setting registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateConnection.json - */ -async function updateConnectionSetting() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const connectionName = "sampleConnection"; - const parameters: ConnectionSetting = { - etag: "etag1", - location: "global", - properties: { - clientId: "sampleclientid", - clientSecret: "samplesecret", - parameters: [ - { key: "key1", value: "value1" }, - { key: "key2", value: "value2" } - ], - scopes: "samplescope", - serviceProviderDisplayName: "serviceProviderDisplayName", - serviceProviderId: "serviceproviderid" - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.botConnection.update( - resourceGroupName, - resourceName, - connectionName, - parameters - ); - console.log(result); -} - -async function main() { - updateConnectionSetting(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsCreateSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsCreateSample.ts deleted file mode 100644 index 71ce893af935..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsCreateSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { Bot, AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a Bot Service. Bot Service is a resource group wide resource type. - * - * @summary Creates a Bot Service. Bot Service is a resource group wide resource type. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateBot.json - */ -async function createBot() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const parameters: Bot = { - etag: "etag1", - kind: "sdk", - location: "West US", - properties: { - description: "The description of the bot", - cmekKeyVaultUrl: "https://myCmekKey", - developerAppInsightKey: "appinsightskey", - developerAppInsightsApiKey: "appinsightsapikey", - developerAppInsightsApplicationId: "appinsightsappid", - disableLocalAuth: true, - displayName: "The Name of the bot", - endpoint: "http://mybot.coffee", - iconUrl: "http://myicon", - isCmekEnabled: true, - luisAppIds: ["luisappid1", "luisappid2"], - luisKey: "luiskey", - msaAppId: "exampleappid", - msaAppMSIResourceId: - "/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId", - msaAppTenantId: "exampleapptenantid", - msaAppType: "UserAssignedMSI", - publicNetworkAccess: "Enabled", - schemaTransformationVersion: "1.0" - }, - sku: { name: "S1" }, - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.create( - resourceGroupName, - resourceName, - parameters - ); - console.log(result); -} - -async function main() { - createBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsDeleteSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsDeleteSample.ts deleted file mode 100644 index b120a0c9cde1..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsDeleteSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Bot Service from the resource group. - * - * @summary Deletes a Bot Service from the resource group. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteBot.json - */ -async function deleteBot() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.delete(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - deleteBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetCheckNameAvailabilitySample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetCheckNameAvailabilitySample.ts deleted file mode 100644 index cc1de7dafef2..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetCheckNameAvailabilitySample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - CheckNameAvailabilityRequestBody, - AzureBotService -} from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Check whether a bot name is available. - * - * @summary Check whether a bot name is available. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json - */ -async function checkNameAvailability() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const parameters: CheckNameAvailabilityRequestBody = { - name: "testbotname", - type: "string" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.getCheckNameAvailability(parameters); - console.log(result); -} - -async function main() { - checkNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetSample.ts deleted file mode 100644 index b4a3c637b471..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsGetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns a BotService specified by the parameters. - * - * @summary Returns a BotService specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json - */ -async function getBot() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListByResourceGroupSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListByResourceGroupSample.ts deleted file mode 100644 index 41f509ba878c..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListByResourceGroupSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns all the resources of a particular type belonging to a resource group - * - * @summary Returns all the resources of a particular type belonging to a resource group - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsByResourceGroup.json - */ -async function listBotsByResourceGroup() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.bots.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listBotsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListSample.ts deleted file mode 100644 index 0baae323e409..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns all the resources of a particular type belonging to a subscription. - * - * @summary Returns all the resources of a particular type belonging to a subscription. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsBySubscription.json - */ -async function listBotsBySubscription() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.bots.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listBotsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsUpdateSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsUpdateSample.ts deleted file mode 100644 index bb8d85cd5e75..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/botsUpdateSample.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - BotsUpdateOptionalParams, - AzureBotService -} from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a Bot Service - * - * @summary Updates a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateBot.json - */ -async function updateBot() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const location = "West US"; - const tags = { tag1: "value1", tag2: "value2" }; - const sku = { name: "S1" }; - const kind = "sdk"; - const etag = "etag1"; - const properties = { - description: "The description of the bot", - cmekKeyVaultUrl: "https://myCmekKey", - developerAppInsightKey: "appinsightskey", - developerAppInsightsApiKey: "appinsightsapikey", - developerAppInsightsApplicationId: "appinsightsappid", - disableLocalAuth: true, - displayName: "The Name of the bot", - endpoint: "http://mybot.coffee", - iconUrl: "http://myicon", - isCmekEnabled: true, - luisAppIds: ["luisappid1", "luisappid2"], - luisKey: "luiskey", - msaAppId: "msaappid", - msaAppMSIResourceId: - "/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId", - msaAppTenantId: "msaapptenantid", - msaAppType: "UserAssignedMSI", - publicNetworkAccess: "Enabled", - schemaTransformationVersion: "1.0" - }; - const options: BotsUpdateOptionalParams = { - location, - tags, - sku, - kind, - etag, - properties - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.bots.update( - resourceGroupName, - resourceName, - options - ); - console.log(result); -} - -async function main() { - updateBot(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsCreateSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsCreateSample.ts deleted file mode 100644 index d271fcef0f4f..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsCreateSample.ts +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BotChannel, AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutAlexaChannel.json - */ -async function createAlexaChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "AlexaChannel", - properties: { alexaSkillId: "XAlexaSkillIdX", isEnabled: true } - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutChannel.json - */ -async function createChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "EmailChannel", - properties: { emailAddress: "a@b.com", isEnabled: true, password: "pwd" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutDirectLineSpeechChannel.json - */ -async function createDirectLineSpeechChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "DirectLineSpeechChannel", - properties: { - cognitiveServiceRegion: "XcognitiveServiceRegionX", - cognitiveServiceSubscriptionKey: "XcognitiveServiceSubscriptionKeyX", - isEnabled: true - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutEmailChannel.json - */ -async function createEmailChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "EmailChannel", - properties: { - authMethod: 1, - emailAddress: "a@b.com", - isEnabled: true, - magicCode: "000000" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Channel registration for a Bot Service - * - * @summary Creates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutLineChannel.json - */ -async function createLineChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const parameters: BotChannel = { - location: "global", - properties: { - channelName: "LineChannel", - properties: { - lineRegistrations: [ - { - channelAccessToken: "channelAccessToken", - channelSecret: "channelSecret" - } - ] - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.create( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -async function main() { - createAlexaChannel(); - createChannel(); - createDirectLineSpeechChannel(); - createEmailChannel(); - createLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsDeleteSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsDeleteSample.ts deleted file mode 100644 index f4b95ce5a74e..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsDeleteSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Channel registration from a Bot Service - * - * @summary Deletes a Channel registration from a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteChannel.json - */ -async function deleteChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.delete( - resourceGroupName, - resourceName, - channelName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes a Channel registration from a Bot Service - * - * @summary Deletes a Channel registration from a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteDirectLineSpeechChannel.json - */ -async function deleteDirectLineSpeechChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.delete( - resourceGroupName, - resourceName, - channelName - ); - console.log(result); -} - -async function main() { - deleteChannel(); - deleteDirectLineSpeechChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsGetSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsGetSample.ts deleted file mode 100644 index 0ffe0075d08b..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsGetSample.ts +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json - */ -async function getAlexaChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get( - resourceGroupName, - resourceName, - channelName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json - */ -async function getChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get( - resourceGroupName, - resourceName, - channelName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json - */ -async function getDirectLineSpeechChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get( - resourceGroupName, - resourceName, - channelName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Returns a BotService Channel registration specified by the parameters. - * - * @summary Returns a BotService Channel registration specified by the parameters. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json - */ -async function getLineChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.get( - resourceGroupName, - resourceName, - channelName - ); - console.log(result); -} - -async function main() { - getAlexaChannel(); - getChannel(); - getDirectLineSpeechChannel(); - getLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListByResourceGroupSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListByResourceGroupSample.ts deleted file mode 100644 index 6fcf7d475dc6..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListByResourceGroupSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns all the Channel registrations of a particular BotService resource - * - * @summary Returns all the Channel registrations of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannelsByBotService.json - */ -async function listChannelsByResourceGroup() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.channels.listByResourceGroup( - resourceGroupName, - resourceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listChannelsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListWithKeysSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListWithKeysSample.ts deleted file mode 100644 index bb7046b8010b..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsListWithKeysSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists a Channel registration for a Bot Service including secrets - * - * @summary Lists a Channel registration for a Bot Service including secrets - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json - */ -async function listChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.listWithKeys( - resourceGroupName, - resourceName, - channelName - ); - console.log(result); -} - -async function main() { - listChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsUpdateSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsUpdateSample.ts deleted file mode 100644 index 37196502d97f..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/channelsUpdateSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - ChannelsUpdateOptionalParams, - AzureBotService, - EmailChannel, - AlexaChannel, - LineChannel, - DirectLineSpeechChannel -} from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateAlexaChannel.json - */ -async function updateAlexaChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "AlexaChannel"; - const location = "global"; - const properties: AlexaChannel = { - channelName: "AlexaChannel", - properties: { alexaSkillId: "XAlexaSkillIdX", isEnabled: true } - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateChannel.json - */ -async function updateChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "EmailChannel"; - const location = "global"; - const properties: EmailChannel = { - channelName: "EmailChannel", - properties: { emailAddress: "a@b.com", isEnabled: true, password: "pwd" } - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateDirectLineSpeechChannel.json - */ -async function updateDirectLineSpeechChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineSpeechChannel"; - const location = "global"; - const properties: DirectLineSpeechChannel = { - channelName: "DirectLineSpeechChannel", - properties: { - cognitiveServiceRegion: "XcognitiveServiceRegionX", - cognitiveServiceSubscriptionKey: "XcognitiveServiceSubscriptionKeyX", - isEnabled: true - } - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a Channel registration for a Bot Service - * - * @summary Updates a Channel registration for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateLineChannel.json - */ -async function updateLineChannel() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "LineChannel"; - const location = "global"; - const properties: LineChannel = { - channelName: "LineChannel", - properties: { - lineRegistrations: [ - { - channelAccessToken: "channelAccessToken", - channelSecret: "channelSecret" - } - ] - } - }; - const options: ChannelsUpdateOptionalParams = { location, properties }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.channels.update( - resourceGroupName, - resourceName, - channelName, - options - ); - console.log(result); -} - -async function main() { - updateAlexaChannel(); - updateChannel(); - updateDirectLineSpeechChannel(); - updateLineChannel(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/directLineRegenerateKeysSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/directLineRegenerateKeysSample.ts deleted file mode 100644 index 06a0c1320409..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/directLineRegenerateKeysSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { SiteInfo, AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * - * @summary Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DirectlineRegenerateKeys.json - */ -async function regenerateKeysForDirectLineChannelSite() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "DirectLineChannel"; - const parameters: SiteInfo = { key: "key1", siteName: "testSiteName" }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.directLine.regenerateKeys( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * - * @summary Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/WebChatRegenerateKeys.json - */ -async function regenerateKeysForWebChatChannelSite() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const channelName = "WebChatChannel"; - const parameters: SiteInfo = { key: "key1", siteName: "testSiteName" }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.directLine.regenerateKeys( - resourceGroupName, - resourceName, - channelName, - parameters - ); - console.log(result); -} - -async function main() { - regenerateKeysForDirectLineChannelSite(); - regenerateKeysForWebChatChannelSite(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/emailCreateSignInUrlSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/emailCreateSignInUrlSample.ts deleted file mode 100644 index 3159a3f3ca10..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/emailCreateSignInUrlSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates an email channel sign in url for a Bot Service - * - * @summary Creates an email channel sign in url for a Bot Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json - */ -async function createUrl() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "OneResourceGroupName"; - const resourceName = "samplebotname"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.email.createSignInUrl( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - createUrl(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/hostSettingsGetSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/hostSettingsGetSample.ts deleted file mode 100644 index cfb0da7695c5..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/hostSettingsGetSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get per subscription settings needed to host bot in compute resource such as Azure App Service - * - * @summary Get per subscription settings needed to host bot in compute resource such as Azure App Service - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetHostSettings.json - */ -async function getBotHostSettings() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.hostSettings.get(); - console.log(result); -} - -async function main() { - getBotHostSettings(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationResultsGetSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationResultsGetSample.ts deleted file mode 100644 index 156874263655..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationResultsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the operation result for a long running operation. - * - * @summary Get the operation result for a long running operation. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/OperationResultsGet.json - */ -async function getOperationResult() { - const subscriptionId = process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subid"; - const operationResultId = "exampleid"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.operationResults.beginGetAndWait( - operationResultId - ); - console.log(result); -} - -async function main() { - getOperationResult(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationsListSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationsListSample.ts deleted file mode 100644 index 1125c2565d80..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all the available BotService operations. - * - * @summary Lists all the available BotService operations. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetOperations.json - */ -async function getOperations() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperations(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsCreateSample.ts deleted file mode 100644 index 54f57a145e55..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsCreateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - PrivateEndpointConnection, - AzureBotService -} from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Bot. - * - * @summary Update the state of specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json - */ -async function putPrivateEndpointConnection() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "res7687"; - const resourceName = "sto9699"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; - const properties: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Auto-Approved", - status: "Approved" - } - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - resourceGroupName, - resourceName, - privateEndpointConnectionName, - properties - ); - console.log(result); -} - -async function main() { - putPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index afbcaa7635d4..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Bot. - * - * @summary Deletes the specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeletePrivateEndpointConnection.json - */ -async function deletePrivateEndpointConnection() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateEndpointConnections.delete( - resourceGroupName, - resourceName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletePrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index e3994ad249e5..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Bot. - * - * @summary Gets the specified private endpoint connection associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json - */ -async function getPrivateEndpointConnection() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const privateEndpointConnectionName = "{privateEndpointConnectionName}"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - resourceName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsListSample.ts deleted file mode 100644 index 32b5eac22fdf..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateEndpointConnectionsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List all the private endpoint connections associated with the Bot. - * - * @summary List all the private endpoint connections associated with the Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateEndpointConnections.json - */ -async function listPrivateEndpointConnections() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list( - resourceGroupName, - resourceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPrivateEndpointConnections(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateLinkResourcesListByBotResourceSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateLinkResourcesListByBotResourceSample.ts deleted file mode 100644 index 80d7232ce5f5..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/privateLinkResourcesListByBotResourceSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AzureBotService } from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Bot. - * - * @summary Gets the private link resources that need to be created for a Bot. - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json - */ -async function listPrivateLinkResources() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["BOTSERVICE_RESOURCE_GROUP"] || "res6977"; - const resourceName = "sto2527"; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.privateLinkResources.listByBotResource( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - listPrivateLinkResources(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/src/qnAMakerEndpointKeysGetSample.ts b/sdk/botservice/arm-botservice/samples/v4/typescript/src/qnAMakerEndpointKeysGetSample.ts deleted file mode 100644 index 15f757817182..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/src/qnAMakerEndpointKeysGetSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - QnAMakerEndpointKeysRequestBody, - AzureBotService -} from "@azure/arm-botservice"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the QnA Maker endpoint keys - * - * @summary Lists the QnA Maker endpoint keys - * x-ms-original-file: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListQnAMakerEndpointKeys.json - */ -async function listQnAMakerEndpointKeys() { - const subscriptionId = - process.env["BOTSERVICE_SUBSCRIPTION_ID"] || "subscription-id"; - const parameters: QnAMakerEndpointKeysRequestBody = { - authkey: "testAuthKey", - hostname: "https://xxx.cognitiveservices.azure.com/" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureBotService(credential, subscriptionId); - const result = await client.qnAMakerEndpointKeys.get(parameters); - console.log(result); -} - -async function main() { - listQnAMakerEndpointKeys(); -} - -main().catch(console.error); diff --git a/sdk/botservice/arm-botservice/samples/v4/typescript/tsconfig.json b/sdk/botservice/arm-botservice/samples/v4/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/botservice/arm-botservice/samples/v4/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/botservice/arm-botservice/src/api/botChannels/index.ts b/sdk/botservice/arm-botservice/src/api/botChannels/index.ts new file mode 100644 index 000000000000..5bb662784f6c --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botChannels/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + regenerateKeys, + listWithKeys, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + BotChannelsRegenerateKeysOptionalParams, + BotChannelsListWithKeysOptionalParams, + BotChannelsListByResourceGroupOptionalParams, + BotChannelsDeleteOptionalParams, + BotChannelsUpdateOptionalParams, + BotChannelsCreateOptionalParams, + BotChannelsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/botChannels/operations.ts b/sdk/botservice/arm-botservice/src/api/botChannels/operations.ts new file mode 100644 index 000000000000..53d7fb8b1505 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botChannels/operations.ts @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + BotChannel, + botChannelSerializer, + botChannelDeserializer, + _ChannelResponseList, + _channelResponseListDeserializer, + ListChannelWithKeysResponse, + listChannelWithKeysResponseDeserializer, + SiteInfo, + siteInfoSerializer, +} from "../../models/models.js"; +import { + BotChannelsRegenerateKeysOptionalParams, + BotChannelsListWithKeysOptionalParams, + BotChannelsListByResourceGroupOptionalParams, + BotChannelsDeleteOptionalParams, + BotChannelsUpdateOptionalParams, + BotChannelsCreateOptionalParams, + BotChannelsGetOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _regenerateKeysSend( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: SiteInfo, + options: BotChannelsRegenerateKeysOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + channelName: channelName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: siteInfoSerializer(parameters), + }); +} + +export async function _regenerateKeysDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return botChannelDeserializer(result.body); +} + +/** Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource */ +export async function regenerateKeys( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: SiteInfo, + options: BotChannelsRegenerateKeysOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _regenerateKeysSend( + context, + resourceGroupName, + resourceName, + channelName, + parameters, + options, + ); + return _regenerateKeysDeserialize(result); +} + +export function _listWithKeysSend( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + options: BotChannelsListWithKeysOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/listChannelWithKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + channelName: channelName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listWithKeysDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return listChannelWithKeysResponseDeserializer(result.body); +} + +/** Lists a Channel registration for a Bot Service including secrets */ +export async function listWithKeys( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + options: BotChannelsListWithKeysOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listWithKeysSend( + context, + resourceGroupName, + resourceName, + channelName, + options, + ); + return _listWithKeysDeserialize(result); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotChannelsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_ChannelResponseList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return _channelResponseListDeserializer(result.body); +} + +/** Returns all the Channel registrations of a particular BotService resource */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotChannelsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, resourceName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + options: BotChannelsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + channelName: channelName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Channel registration from a Bot Service */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + options: BotChannelsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, resourceGroupName, resourceName, channelName, options); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options: BotChannelsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + channelName: channelName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: botChannelSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return botChannelDeserializer(result.body); +} + +/** Updates a Channel registration for a Bot Service */ +export async function update( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options: BotChannelsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + resourceName, + channelName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options: BotChannelsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + channelName: channelName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: botChannelSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return botChannelDeserializer(result.body); +} + +/** Creates a Channel registration for a Bot Service */ +export async function create( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options: BotChannelsCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSend( + context, + resourceGroupName, + resourceName, + channelName, + parameters, + options, + ); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + options: BotChannelsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + channelName: channelName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return botChannelDeserializer(result.body); +} + +/** Returns a BotService Channel registration specified by the parameters. */ +export async function get( + context: Client, + resourceGroupName: string, + resourceName: string, + channelName: string, + options: BotChannelsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, resourceName, channelName, options); + return _getDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/botChannels/options.ts b/sdk/botservice/arm-botservice/src/api/botChannels/options.ts new file mode 100644 index 000000000000..35f9180b4c75 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botChannels/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface BotChannelsRegenerateKeysOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotChannelsListWithKeysOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotChannelsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotChannelsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotChannelsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotChannelsCreateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotChannelsGetOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/index.ts new file mode 100644 index 000000000000..1f6d21e6a318 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listServiceProviders } from "./operations.js"; +export { BotConnectionOperationGroupListServiceProvidersOptionalParams } from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/operations.ts b/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/operations.ts new file mode 100644 index 000000000000..a0afe8659c33 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/operations.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + ServiceProviderResponseList, + serviceProviderResponseListDeserializer, +} from "../../models/models.js"; +import { BotConnectionOperationGroupListServiceProvidersOptionalParams } from "./options.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listServiceProvidersSend( + context: Client, + options: BotConnectionOperationGroupListServiceProvidersOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listServiceProvidersDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return serviceProviderResponseListDeserializer(result.body); +} + +/** Lists the available Service Providers for creating Connection Settings */ +export async function listServiceProviders( + context: Client, + options: BotConnectionOperationGroupListServiceProvidersOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _listServiceProvidersSend(context, options); + return _listServiceProvidersDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/options.ts b/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/options.ts new file mode 100644 index 000000000000..3f607b9e6c86 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botConnectionOperationGroup/options.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface BotConnectionOperationGroupListServiceProvidersOptionalParams + extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/botServiceContext.ts b/sdk/botservice/arm-botservice/src/api/botServiceContext.ts new file mode 100644 index 000000000000..36836b84cf28 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botServiceContext.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +/** Azure Bot Service is a platform for creating smart conversational agents. */ +export interface BotServiceContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface BotServiceClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +/** Azure Bot Service is a platform for creating smart conversational agents. */ +export function createBotService( + credential: TokenCredential, + subscriptionId: string, + options: BotServiceClientOptionalParams = {}, +): BotServiceContext { + const endpointUrl = options.endpoint ?? options.baseUrl ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-botservice/5.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2023-09-15-preview"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // 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")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { ...clientContext, apiVersion, subscriptionId } as BotServiceContext; +} diff --git a/sdk/botservice/arm-botservice/src/api/bots/index.ts b/sdk/botservice/arm-botservice/src/api/bots/index.ts new file mode 100644 index 000000000000..4c0fbfa6d674 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/bots/index.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listByBotResource, + createSignInUrl, + list, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + BotsListByBotResourceOptionalParams, + BotsCreateSignInUrlOptionalParams, + BotsListOptionalParams, + BotsListByResourceGroupOptionalParams, + BotsDeleteOptionalParams, + BotsUpdateOptionalParams, + BotsCreateOptionalParams, + BotsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/bots/operations.ts b/sdk/botservice/arm-botservice/src/api/bots/operations.ts new file mode 100644 index 000000000000..e6ba947c7c34 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/bots/operations.ts @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + Bot, + botSerializer, + botDeserializer, + _BotResponseList, + _botResponseListDeserializer, + CreateEmailSignInUrlResponse, + createEmailSignInUrlResponseDeserializer, + PrivateLinkResourceListResult, + privateLinkResourceListResultDeserializer, +} from "../../models/models.js"; +import { + BotsListByBotResourceOptionalParams, + BotsCreateSignInUrlOptionalParams, + BotsListOptionalParams, + BotsListByResourceGroupOptionalParams, + BotsDeleteOptionalParams, + BotsUpdateOptionalParams, + BotsCreateOptionalParams, + BotsGetOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listByBotResourceSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsListByBotResourceOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByBotResourceDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return privateLinkResourceListResultDeserializer(result.body); +} + +/** Gets the private link resources that need to be created for a Bot. */ +export async function listByBotResource( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsListByBotResourceOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listByBotResourceSend(context, resourceGroupName, resourceName, options); + return _listByBotResourceDeserialize(result); +} + +export function _createSignInUrlSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsCreateSignInUrlOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/createEmailSignInUrl{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _createSignInUrlDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return createEmailSignInUrlResponseDeserializer(result.body); +} + +/** Creates an email channel sign in url for a Bot Service */ +export async function createSignInUrl( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsCreateSignInUrlOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSignInUrlSend(context, resourceGroupName, resourceName, options); + return _createSignInUrlDeserialize(result); +} + +export function _listSend( + context: Client, + options: BotsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize(result: PathUncheckedResponse): Promise<_BotResponseList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return _botResponseListDeserializer(result.body); +} + +/** Returns all the resources of a particular type belonging to a subscription. */ +export function list( + context: Client, + options: BotsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: BotsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_BotResponseList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return _botResponseListDeserializer(result.body); +} + +/** Returns all the resources of a particular type belonging to a resource group */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: BotsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Bot Service from the resource group. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, resourceGroupName, resourceName, options); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options: BotsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: botSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return botDeserializer(result.body); +} + +/** Updates a Bot Service */ +export async function update( + context: Client, + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options: BotsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend(context, resourceGroupName, resourceName, parameters, options); + return _updateDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options: BotsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: botSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return botDeserializer(result.body); +} + +/** Creates a Bot Service. Bot Service is a resource group wide resource type. */ +export async function create( + context: Client, + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options: BotsCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSend(context, resourceGroupName, resourceName, parameters, options); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return botDeserializer(result.body); +} + +/** Returns a BotService specified by the parameters. */ +export async function get( + context: Client, + resourceGroupName: string, + resourceName: string, + options: BotsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, resourceName, options); + return _getDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/bots/options.ts b/sdk/botservice/arm-botservice/src/api/bots/options.ts new file mode 100644 index 000000000000..50bc14ec6688 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/bots/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface BotsListByBotResourceOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotsCreateSignInUrlOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotsCreateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BotsGetOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/botsOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/api/botsOperationGroup/index.ts new file mode 100644 index 000000000000..e70709621234 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botsOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { getCheckNameAvailability } from "./operations.js"; +export { BotsOperationGroupGetCheckNameAvailabilityOptionalParams } from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/botsOperationGroup/operations.ts b/sdk/botservice/arm-botservice/src/api/botsOperationGroup/operations.ts new file mode 100644 index 000000000000..ef873a481de2 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botsOperationGroup/operations.ts @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + CheckNameAvailabilityRequestBody, + checkNameAvailabilityRequestBodySerializer, + CheckNameAvailabilityResponseBody, + checkNameAvailabilityResponseBodyDeserializer, +} from "../../models/models.js"; +import { BotsOperationGroupGetCheckNameAvailabilityOptionalParams } from "./options.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _getCheckNameAvailabilitySend( + context: Client, + parameters: CheckNameAvailabilityRequestBody, + options: BotsOperationGroupGetCheckNameAvailabilityOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.BotService/checkNameAvailability{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: checkNameAvailabilityRequestBodySerializer(parameters), + }); +} + +export async function _getCheckNameAvailabilityDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return checkNameAvailabilityResponseBodyDeserializer(result.body); +} + +/** Check whether a bot name is available. */ +export async function getCheckNameAvailability( + context: Client, + parameters: CheckNameAvailabilityRequestBody, + options: BotsOperationGroupGetCheckNameAvailabilityOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _getCheckNameAvailabilitySend(context, parameters, options); + return _getCheckNameAvailabilityDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/botsOperationGroup/options.ts b/sdk/botservice/arm-botservice/src/api/botsOperationGroup/options.ts new file mode 100644 index 000000000000..df1b5c783883 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/botsOperationGroup/options.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface BotsOperationGroupGetCheckNameAvailabilityOptionalParams + extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/connectionSettings/index.ts b/sdk/botservice/arm-botservice/src/api/connectionSettings/index.ts new file mode 100644 index 000000000000..b92f437606dc --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/connectionSettings/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listWithSecrets, listByBotService, $delete, update, create, get } from "./operations.js"; +export { + ConnectionSettingsListWithSecretsOptionalParams, + ConnectionSettingsListByBotServiceOptionalParams, + ConnectionSettingsDeleteOptionalParams, + ConnectionSettingsUpdateOptionalParams, + ConnectionSettingsCreateOptionalParams, + ConnectionSettingsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/connectionSettings/operations.ts b/sdk/botservice/arm-botservice/src/api/connectionSettings/operations.ts new file mode 100644 index 000000000000..97557d9e029f --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/connectionSettings/operations.ts @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + ConnectionSetting, + connectionSettingSerializer, + connectionSettingDeserializer, + _ConnectionSettingResponseList, + _connectionSettingResponseListDeserializer, +} from "../../models/models.js"; +import { + ConnectionSettingsListWithSecretsOptionalParams, + ConnectionSettingsListByBotServiceOptionalParams, + ConnectionSettingsDeleteOptionalParams, + ConnectionSettingsUpdateOptionalParams, + ConnectionSettingsCreateOptionalParams, + ConnectionSettingsGetOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listWithSecretsSend( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + options: ConnectionSettingsListWithSecretsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + connectionName: connectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listWithSecretsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return connectionSettingDeserializer(result.body); +} + +/** Get a Connection Setting registration for a Bot Service */ +export async function listWithSecrets( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + options: ConnectionSettingsListWithSecretsOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _listWithSecretsSend( + context, + resourceGroupName, + resourceName, + connectionName, + options, + ); + return _listWithSecretsDeserialize(result); +} + +export function _listByBotServiceSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: ConnectionSettingsListByBotServiceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByBotServiceDeserialize( + result: PathUncheckedResponse, +): Promise<_ConnectionSettingResponseList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return _connectionSettingResponseListDeserializer(result.body); +} + +/** Returns all the Connection Settings registered to a particular BotService resource */ +export function listByBotService( + context: Client, + resourceGroupName: string, + resourceName: string, + options: ConnectionSettingsListByBotServiceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByBotServiceSend(context, resourceGroupName, resourceName, options), + _listByBotServiceDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + options: ConnectionSettingsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + connectionName: connectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Connection Setting registration for a Bot Service */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + options: ConnectionSettingsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + resourceName, + connectionName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options: ConnectionSettingsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + connectionName: connectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: connectionSettingSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return connectionSettingDeserializer(result.body); +} + +/** Updates a Connection Setting registration for a Bot Service */ +export async function update( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options: ConnectionSettingsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + resourceName, + connectionName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options: ConnectionSettingsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + connectionName: connectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: connectionSettingSerializer(parameters), + }); +} + +export async function _createDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return connectionSettingDeserializer(result.body); +} + +/** Register a new Auth Connection for a Bot Service */ +export async function create( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options: ConnectionSettingsCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSend( + context, + resourceGroupName, + resourceName, + connectionName, + parameters, + options, + ); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + options: ConnectionSettingsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + connectionName: connectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return connectionSettingDeserializer(result.body); +} + +/** Get a Connection Setting registration for a Bot Service */ +export async function get( + context: Client, + resourceGroupName: string, + resourceName: string, + connectionName: string, + options: ConnectionSettingsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, resourceName, connectionName, options); + return _getDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/connectionSettings/options.ts b/sdk/botservice/arm-botservice/src/api/connectionSettings/options.ts new file mode 100644 index 000000000000..34652c2d367c --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/connectionSettings/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ConnectionSettingsListWithSecretsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConnectionSettingsListByBotServiceOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConnectionSettingsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConnectionSettingsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConnectionSettingsCreateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConnectionSettingsGetOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/index.ts new file mode 100644 index 000000000000..c50b2cacedfe --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export { HostSettingsOperationGroupGetOptionalParams } from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/operations.ts b/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/operations.ts new file mode 100644 index 000000000000..b25396c06d07 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/operations.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + HostSettingsResponse, + hostSettingsResponseDeserializer, +} from "../../models/models.js"; +import { HostSettingsOperationGroupGetOptionalParams } from "./options.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + options: HostSettingsOperationGroupGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return hostSettingsResponseDeserializer(result.body); +} + +/** Get per subscription settings needed to host bot in compute resource such as Azure App Service */ +export async function get( + context: Client, + options: HostSettingsOperationGroupGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, options); + return _getDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/options.ts b/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/options.ts new file mode 100644 index 000000000000..2520ff1efab0 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/hostSettingsOperationGroup/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface HostSettingsOperationGroupGetOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/index.ts b/sdk/botservice/arm-botservice/src/api/index.ts new file mode 100644 index 000000000000..16a32a6f0b3c --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createBotService, + BotServiceContext, + BotServiceClientOptionalParams, +} from "./botServiceContext.js"; diff --git a/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/index.ts b/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/index.ts new file mode 100644 index 000000000000..9b6f465df41c --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { reconcile, list, get } from "./operations.js"; +export { + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/operations.ts b/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/operations.ts new file mode 100644 index 000000000000..bea47716526a --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/operations.ts @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + NetworkSecurityPerimeterConfiguration, + networkSecurityPerimeterConfigurationDeserializer, + _NetworkSecurityPerimeterConfigurationList, + _networkSecurityPerimeterConfigurationListDeserializer, +} from "../../models/models.js"; +import { + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _reconcileSend( + context: Client, + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + networkSecurityPerimeterConfigurationName: networkSecurityPerimeterConfigurationName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _reconcileDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return networkSecurityPerimeterConfigurationDeserializer(result.body); +} + +/** Reconcile the specified Network Security Perimeter configuration associated with the Bot. */ +export function reconcile( + context: Client, + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams = { + requestOptions: {}, + }, +): PollerLike< + OperationState, + NetworkSecurityPerimeterConfiguration +> { + return getLongRunningPoller(context, _reconcileDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _reconcileSend( + context, + resourceGroupName, + resourceName, + networkSecurityPerimeterConfigurationName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike< + OperationState, + NetworkSecurityPerimeterConfiguration + >; +} + +export function _listSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: NetworkSecurityPerimeterConfigurationsListOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkSecurityPerimeterConfigurationList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return _networkSecurityPerimeterConfigurationListDeserializer(result.body); +} + +/** List Network Security Perimeter configurations associated with the Bot. */ +export function list( + context: Client, + resourceGroupName: string, + resourceName: string, + options: NetworkSecurityPerimeterConfigurationsListOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, resourceName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterConfigurationsGetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + networkSecurityPerimeterConfigurationName: networkSecurityPerimeterConfigurationName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return networkSecurityPerimeterConfigurationDeserializer(result.body); +} + +/** Gets the specified Network Security Perimeter configuration associated with the Bot. */ +export async function get( + context: Client, + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterConfigurationsGetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + resourceName, + networkSecurityPerimeterConfigurationName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/options.ts b/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/options.ts new file mode 100644 index 000000000000..2c3be379933c --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/networkSecurityPerimeterConfigurations/options.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsListOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/index.ts new file mode 100644 index 000000000000..b71d16a45bad --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export { OperationResultsOperationGroupGetOptionalParams } from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/operations.ts b/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/operations.ts new file mode 100644 index 000000000000..07de23d87bce --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/operations.ts @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + OperationResultsDescription, + operationResultsDescriptionDeserializer, +} from "../../models/models.js"; +import { OperationResultsOperationGroupGetOptionalParams } from "./options.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _getSend( + context: Client, + operationResultId: string, + options: OperationResultsOperationGroupGetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + operationResultId: operationResultId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return operationResultsDescriptionDeserializer(result.body); +} + +/** Get the operation result for a long running operation. */ +export function get( + context: Client, + operationResultId: string, + options: OperationResultsOperationGroupGetOptionalParams = { + requestOptions: {}, + }, +): PollerLike, OperationResultsDescription> { + return getLongRunningPoller(context, _getDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _getSend(context, operationResultId, options), + resourceLocationConfig: "location", + }) as PollerLike, OperationResultsDescription>; +} diff --git a/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/options.ts b/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/options.ts new file mode 100644 index 000000000000..e36feaf0705e --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/operationResultsOperationGroup/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationResultsOperationGroupGetOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} diff --git a/sdk/botservice/arm-botservice/src/api/operations/index.ts b/sdk/botservice/arm-botservice/src/api/operations/index.ts new file mode 100644 index 000000000000..24a804d14fcf --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/operations/operations.ts b/sdk/botservice/arm-botservice/src/api/operations/operations.ts new file mode 100644 index 000000000000..79fd66d511d8 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/operations/operations.ts @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + _OperationEntityListResult, + _operationEntityListResultDeserializer, + OperationEntity, + errorDeserializer, +} from "../../models/models.js"; +import { OperationsListOptionalParams } from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.BotService/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationEntityListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return _operationEntityListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/botservice/arm-botservice/src/api/operations/options.ts b/sdk/botservice/arm-botservice/src/api/operations/options.ts new file mode 100644 index 000000000000..c461016ad1c5 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/index.ts b/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..c7afff4982ae --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, create, get } from "./operations.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/operations.ts b/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/operations.ts new file mode 100644 index 000000000000..63aeb7d09c8f --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/operations.ts @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + PrivateEndpointConnection, + privateEndpointConnectionSerializer, + privateEndpointConnectionDeserializer, + _PrivateEndpointConnectionListResult, + _privateEndpointConnectionListResultDeserializer, +} from "../../models/models.js"; +import { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + resourceGroupName: string, + resourceName: string, + options: PrivateEndpointConnectionsListOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_PrivateEndpointConnectionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return _privateEndpointConnectionListResultDeserializer(result.body); +} + +/** List all the private endpoint connections associated with the Bot. */ +export function list( + context: Client, + resourceGroupName: string, + resourceName: string, + options: PrivateEndpointConnectionsListOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, resourceName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified private endpoint connection associated with the Bot. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + resourceName, + privateEndpointConnectionName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options: PrivateEndpointConnectionsCreateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: privateEndpointConnectionSerializer(properties), + }); +} + +export async function _createDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Update the state of specified private endpoint connection associated with the Bot. */ +export async function create( + context: Client, + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options: PrivateEndpointConnectionsCreateOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _createSend( + context, + resourceGroupName, + resourceName, + privateEndpointConnectionName, + properties, + options, + ); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + resourceName: resourceName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Gets the specified private endpoint connection associated with the Bot. */ +export async function get( + context: Client, + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + resourceName, + privateEndpointConnectionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/options.ts b/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/options.ts new file mode 100644 index 000000000000..3275aa7f90a9 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/privateEndpointConnections/options.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/index.ts new file mode 100644 index 000000000000..fc09507dd67a --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export { QnAMakerEndpointKeysOperationGroupGetOptionalParams } from "./options.js"; diff --git a/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/operations.ts b/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/operations.ts new file mode 100644 index 000000000000..72667d96563e --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/operations.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext as Client } from "../index.js"; +import { + errorDeserializer, + QnAMakerEndpointKeysRequestBody, + qnAMakerEndpointKeysRequestBodySerializer, + QnAMakerEndpointKeysResponse, + qnAMakerEndpointKeysResponseDeserializer, +} from "../../models/models.js"; +import { QnAMakerEndpointKeysOperationGroupGetOptionalParams } from "./options.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + parameters: QnAMakerEndpointKeysRequestBody, + options: QnAMakerEndpointKeysOperationGroupGetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: qnAMakerEndpointKeysRequestBodySerializer(parameters), + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorDeserializer(result.body); + throw error; + } + + return qnAMakerEndpointKeysResponseDeserializer(result.body); +} + +/** Lists the QnA Maker endpoint keys */ +export async function get( + context: Client, + parameters: QnAMakerEndpointKeysRequestBody, + options: QnAMakerEndpointKeysOperationGroupGetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _getSend(context, parameters, options); + return _getDeserialize(result); +} diff --git a/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/options.ts b/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/options.ts new file mode 100644 index 000000000000..a4346017ac51 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/api/qnAMakerEndpointKeysOperationGroup/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface QnAMakerEndpointKeysOperationGroupGetOptionalParams extends OperationOptions {} diff --git a/sdk/botservice/arm-botservice/src/azureBotService.ts b/sdk/botservice/arm-botservice/src/azureBotService.ts deleted file mode 100644 index c66fe7004982..000000000000 --- a/sdk/botservice/arm-botservice/src/azureBotService.ts +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest -} from "@azure/core-rest-pipeline"; -import * as coreAuth from "@azure/core-auth"; -import { - BotsImpl, - ChannelsImpl, - DirectLineImpl, - EmailImpl, - OperationsImpl, - BotConnectionImpl, - QnAMakerEndpointKeysImpl, - HostSettingsImpl, - OperationResultsImpl, - PrivateEndpointConnectionsImpl, - PrivateLinkResourcesImpl -} from "./operations/index.js"; -import { - Bots, - Channels, - DirectLine, - Email, - Operations, - BotConnection, - QnAMakerEndpointKeys, - HostSettings, - OperationResults, - PrivateEndpointConnections, - PrivateLinkResources -} from "./operationsInterfaces/index.js"; -import { AzureBotServiceOptionalParams } from "./models/index.js"; - -export class AzureBotService extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the AzureBotService class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId Azure Subscription ID. - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: AzureBotServiceOptionalParams - ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AzureBotServiceOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-arm-botservice/4.0.1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-09-15"; - this.bots = new BotsImpl(this); - this.channels = new ChannelsImpl(this); - this.directLine = new DirectLineImpl(this); - this.email = new EmailImpl(this); - this.operations = new OperationsImpl(this); - this.botConnection = new BotConnectionImpl(this); - this.qnAMakerEndpointKeys = new QnAMakerEndpointKeysImpl(this); - this.hostSettings = new HostSettingsImpl(this); - this.operationResults = new OperationResultsImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); - this.privateLinkResources = new PrivateLinkResourcesImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - } - }; - this.pipeline.addPolicy(apiVersionPolicy); - } - - bots: Bots; - channels: Channels; - directLine: DirectLine; - email: Email; - operations: Operations; - botConnection: BotConnection; - qnAMakerEndpointKeys: QnAMakerEndpointKeys; - hostSettings: HostSettings; - operationResults: OperationResults; - privateEndpointConnections: PrivateEndpointConnections; - privateLinkResources: PrivateLinkResources; -} diff --git a/sdk/botservice/arm-botservice/src/botServiceClient.ts b/sdk/botservice/arm-botservice/src/botServiceClient.ts new file mode 100644 index 000000000000..c67773a9b4ad --- /dev/null +++ b/sdk/botservice/arm-botservice/src/botServiceClient.ts @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + createBotService, + BotServiceContext, + BotServiceClientOptionalParams, +} from "./api/index.js"; +import { + OperationResultsOperationGroupOperations, + _getOperationResultsOperationGroupOperations, +} from "./classic/operationResultsOperationGroup/index.js"; +import { + HostSettingsOperationGroupOperations, + _getHostSettingsOperationGroupOperations, +} from "./classic/hostSettingsOperationGroup/index.js"; +import { + QnAMakerEndpointKeysOperationGroupOperations, + _getQnAMakerEndpointKeysOperationGroupOperations, +} from "./classic/qnAMakerEndpointKeysOperationGroup/index.js"; +import { + BotConnectionOperationGroupOperations, + _getBotConnectionOperationGroupOperations, +} from "./classic/botConnectionOperationGroup/index.js"; +import { + BotsOperationGroupOperations, + _getBotsOperationGroupOperations, +} from "./classic/botsOperationGroup/index.js"; +import { + NetworkSecurityPerimeterConfigurationsOperations, + _getNetworkSecurityPerimeterConfigurationsOperations, +} from "./classic/networkSecurityPerimeterConfigurations/index.js"; +import { + PrivateEndpointConnectionsOperations, + _getPrivateEndpointConnectionsOperations, +} from "./classic/privateEndpointConnections/index.js"; +import { + ConnectionSettingsOperations, + _getConnectionSettingsOperations, +} from "./classic/connectionSettings/index.js"; +import { BotChannelsOperations, _getBotChannelsOperations } from "./classic/botChannels/index.js"; +import { BotsOperations, _getBotsOperations } from "./classic/bots/index.js"; +import { OperationsOperations, _getOperationsOperations } from "./classic/operations/index.js"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { TokenCredential } from "@azure/core-auth"; + +export { BotServiceClientOptionalParams } from "./api/botServiceContext.js"; + +export class BotServiceClient { + private _client: BotServiceContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** Azure Bot Service is a platform for creating smart conversational agents. */ + constructor( + credential: TokenCredential, + subscriptionId: string, + options: BotServiceClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createBotService(credential, subscriptionId, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.operationResultsOperationGroup = _getOperationResultsOperationGroupOperations( + this._client, + ); + this.hostSettingsOperationGroup = _getHostSettingsOperationGroupOperations(this._client); + this.qnAMakerEndpointKeysOperationGroup = _getQnAMakerEndpointKeysOperationGroupOperations( + this._client, + ); + this.botConnectionOperationGroup = _getBotConnectionOperationGroupOperations(this._client); + this.botsOperationGroup = _getBotsOperationGroupOperations(this._client); + this.networkSecurityPerimeterConfigurations = + _getNetworkSecurityPerimeterConfigurationsOperations(this._client); + this.privateEndpointConnections = _getPrivateEndpointConnectionsOperations(this._client); + this.connectionSettings = _getConnectionSettingsOperations(this._client); + this.botChannels = _getBotChannelsOperations(this._client); + this.bots = _getBotsOperations(this._client); + this.operations = _getOperationsOperations(this._client); + } + + /** The operation groups for operationResultsOperationGroup */ + public readonly operationResultsOperationGroup: OperationResultsOperationGroupOperations; + /** The operation groups for hostSettingsOperationGroup */ + public readonly hostSettingsOperationGroup: HostSettingsOperationGroupOperations; + /** The operation groups for qnAMakerEndpointKeysOperationGroup */ + public readonly qnAMakerEndpointKeysOperationGroup: QnAMakerEndpointKeysOperationGroupOperations; + /** The operation groups for botConnectionOperationGroup */ + public readonly botConnectionOperationGroup: BotConnectionOperationGroupOperations; + /** The operation groups for botsOperationGroup */ + public readonly botsOperationGroup: BotsOperationGroupOperations; + /** The operation groups for networkSecurityPerimeterConfigurations */ + public readonly networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurationsOperations; + /** The operation groups for privateEndpointConnections */ + public readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + /** The operation groups for connectionSettings */ + public readonly connectionSettings: ConnectionSettingsOperations; + /** The operation groups for botChannels */ + public readonly botChannels: BotChannelsOperations; + /** The operation groups for bots */ + public readonly bots: BotsOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; +} diff --git a/sdk/botservice/arm-botservice/src/classic/botChannels/index.ts b/sdk/botservice/arm-botservice/src/classic/botChannels/index.ts new file mode 100644 index 000000000000..ea27701c900a --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/botChannels/index.ts @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { BotChannel, ListChannelWithKeysResponse, SiteInfo } from "../../models/models.js"; +import { + BotChannelsRegenerateKeysOptionalParams, + BotChannelsListWithKeysOptionalParams, + BotChannelsListByResourceGroupOptionalParams, + BotChannelsDeleteOptionalParams, + BotChannelsUpdateOptionalParams, + BotChannelsCreateOptionalParams, + BotChannelsGetOptionalParams, +} from "../../api/botChannels/options.js"; +import { + regenerateKeys, + listWithKeys, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/botChannels/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a BotChannels operations. */ +export interface BotChannelsOperations { + /** Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource */ + regenerateKeys: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: SiteInfo, + options?: BotChannelsRegenerateKeysOptionalParams, + ) => Promise; + /** Lists a Channel registration for a Bot Service including secrets */ + listWithKeys: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + options?: BotChannelsListWithKeysOptionalParams, + ) => Promise; + /** Returns all the Channel registrations of a particular BotService resource */ + listByResourceGroup: ( + resourceGroupName: string, + resourceName: string, + options?: BotChannelsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a Channel registration from a Bot Service */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + options?: BotChannelsDeleteOptionalParams, + ) => Promise; + /** Updates a Channel registration for a Bot Service */ + update: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options?: BotChannelsUpdateOptionalParams, + ) => Promise; + /** Creates a Channel registration for a Bot Service */ + create: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options?: BotChannelsCreateOptionalParams, + ) => Promise; + /** Returns a BotService Channel registration specified by the parameters. */ + get: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + options?: BotChannelsGetOptionalParams, + ) => Promise; +} + +function _getBotChannels(context: BotServiceContext) { + return { + regenerateKeys: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: SiteInfo, + options?: BotChannelsRegenerateKeysOptionalParams, + ) => regenerateKeys(context, resourceGroupName, resourceName, channelName, parameters, options), + listWithKeys: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + options?: BotChannelsListWithKeysOptionalParams, + ) => listWithKeys(context, resourceGroupName, resourceName, channelName, options), + listByResourceGroup: ( + resourceGroupName: string, + resourceName: string, + options?: BotChannelsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, resourceName, options), + delete: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + options?: BotChannelsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, resourceName, channelName, options), + update: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options?: BotChannelsUpdateOptionalParams, + ) => update(context, resourceGroupName, resourceName, channelName, parameters, options), + create: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + parameters: BotChannel, + options?: BotChannelsCreateOptionalParams, + ) => create(context, resourceGroupName, resourceName, channelName, parameters, options), + get: ( + resourceGroupName: string, + resourceName: string, + channelName: string, + options?: BotChannelsGetOptionalParams, + ) => get(context, resourceGroupName, resourceName, channelName, options), + }; +} + +export function _getBotChannelsOperations(context: BotServiceContext): BotChannelsOperations { + return { + ..._getBotChannels(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/botConnectionOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/classic/botConnectionOperationGroup/index.ts new file mode 100644 index 000000000000..174cfaf6de21 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/botConnectionOperationGroup/index.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { ServiceProviderResponseList } from "../../models/models.js"; +import { BotConnectionOperationGroupListServiceProvidersOptionalParams } from "../../api/botConnectionOperationGroup/options.js"; +import { listServiceProviders } from "../../api/botConnectionOperationGroup/operations.js"; + +/** Interface representing a BotConnectionOperationGroup operations. */ +export interface BotConnectionOperationGroupOperations { + /** Lists the available Service Providers for creating Connection Settings */ + listServiceProviders: ( + options?: BotConnectionOperationGroupListServiceProvidersOptionalParams, + ) => Promise; +} + +function _getBotConnectionOperationGroup(context: BotServiceContext) { + return { + listServiceProviders: ( + options?: BotConnectionOperationGroupListServiceProvidersOptionalParams, + ) => listServiceProviders(context, options), + }; +} + +export function _getBotConnectionOperationGroupOperations( + context: BotServiceContext, +): BotConnectionOperationGroupOperations { + return { + ..._getBotConnectionOperationGroup(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/bots/index.ts b/sdk/botservice/arm-botservice/src/classic/bots/index.ts new file mode 100644 index 000000000000..1b4ac4d0842f --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/bots/index.ts @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { + Bot, + CreateEmailSignInUrlResponse, + PrivateLinkResourceListResult, +} from "../../models/models.js"; +import { + BotsListByBotResourceOptionalParams, + BotsCreateSignInUrlOptionalParams, + BotsListOptionalParams, + BotsListByResourceGroupOptionalParams, + BotsDeleteOptionalParams, + BotsUpdateOptionalParams, + BotsCreateOptionalParams, + BotsGetOptionalParams, +} from "../../api/bots/options.js"; +import { + listByBotResource, + createSignInUrl, + list, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/bots/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Bots operations. */ +export interface BotsOperations { + /** Gets the private link resources that need to be created for a Bot. */ + listByBotResource: ( + resourceGroupName: string, + resourceName: string, + options?: BotsListByBotResourceOptionalParams, + ) => Promise; + /** Creates an email channel sign in url for a Bot Service */ + createSignInUrl: ( + resourceGroupName: string, + resourceName: string, + options?: BotsCreateSignInUrlOptionalParams, + ) => Promise; + /** Returns all the resources of a particular type belonging to a subscription. */ + list: (options?: BotsListOptionalParams) => PagedAsyncIterableIterator; + /** Returns all the resources of a particular type belonging to a resource group */ + listByResourceGroup: ( + resourceGroupName: string, + options?: BotsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a Bot Service from the resource group. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + resourceName: string, + options?: BotsDeleteOptionalParams, + ) => Promise; + /** Updates a Bot Service */ + update: ( + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options?: BotsUpdateOptionalParams, + ) => Promise; + /** Creates a Bot Service. Bot Service is a resource group wide resource type. */ + create: ( + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options?: BotsCreateOptionalParams, + ) => Promise; + /** Returns a BotService specified by the parameters. */ + get: ( + resourceGroupName: string, + resourceName: string, + options?: BotsGetOptionalParams, + ) => Promise; +} + +function _getBots(context: BotServiceContext) { + return { + listByBotResource: ( + resourceGroupName: string, + resourceName: string, + options?: BotsListByBotResourceOptionalParams, + ) => listByBotResource(context, resourceGroupName, resourceName, options), + createSignInUrl: ( + resourceGroupName: string, + resourceName: string, + options?: BotsCreateSignInUrlOptionalParams, + ) => createSignInUrl(context, resourceGroupName, resourceName, options), + list: (options?: BotsListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: BotsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: (resourceGroupName: string, resourceName: string, options?: BotsDeleteOptionalParams) => + $delete(context, resourceGroupName, resourceName, options), + update: ( + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options?: BotsUpdateOptionalParams, + ) => update(context, resourceGroupName, resourceName, parameters, options), + create: ( + resourceGroupName: string, + resourceName: string, + parameters: Bot, + options?: BotsCreateOptionalParams, + ) => create(context, resourceGroupName, resourceName, parameters, options), + get: (resourceGroupName: string, resourceName: string, options?: BotsGetOptionalParams) => + get(context, resourceGroupName, resourceName, options), + }; +} + +export function _getBotsOperations(context: BotServiceContext): BotsOperations { + return { + ..._getBots(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/botsOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/classic/botsOperationGroup/index.ts new file mode 100644 index 000000000000..60f636fffbc6 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/botsOperationGroup/index.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { + CheckNameAvailabilityRequestBody, + CheckNameAvailabilityResponseBody, +} from "../../models/models.js"; +import { BotsOperationGroupGetCheckNameAvailabilityOptionalParams } from "../../api/botsOperationGroup/options.js"; +import { getCheckNameAvailability } from "../../api/botsOperationGroup/operations.js"; + +/** Interface representing a BotsOperationGroup operations. */ +export interface BotsOperationGroupOperations { + /** Check whether a bot name is available. */ + getCheckNameAvailability: ( + parameters: CheckNameAvailabilityRequestBody, + options?: BotsOperationGroupGetCheckNameAvailabilityOptionalParams, + ) => Promise; +} + +function _getBotsOperationGroup(context: BotServiceContext) { + return { + getCheckNameAvailability: ( + parameters: CheckNameAvailabilityRequestBody, + options?: BotsOperationGroupGetCheckNameAvailabilityOptionalParams, + ) => getCheckNameAvailability(context, parameters, options), + }; +} + +export function _getBotsOperationGroupOperations( + context: BotServiceContext, +): BotsOperationGroupOperations { + return { + ..._getBotsOperationGroup(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/connectionSettings/index.ts b/sdk/botservice/arm-botservice/src/classic/connectionSettings/index.ts new file mode 100644 index 000000000000..ffc8dbfbf226 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/connectionSettings/index.ts @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { ConnectionSetting } from "../../models/models.js"; +import { + ConnectionSettingsListWithSecretsOptionalParams, + ConnectionSettingsListByBotServiceOptionalParams, + ConnectionSettingsDeleteOptionalParams, + ConnectionSettingsUpdateOptionalParams, + ConnectionSettingsCreateOptionalParams, + ConnectionSettingsGetOptionalParams, +} from "../../api/connectionSettings/options.js"; +import { + listWithSecrets, + listByBotService, + $delete, + update, + create, + get, +} from "../../api/connectionSettings/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ConnectionSettings operations. */ +export interface ConnectionSettingsOperations { + /** Get a Connection Setting registration for a Bot Service */ + listWithSecrets: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + options?: ConnectionSettingsListWithSecretsOptionalParams, + ) => Promise; + /** Returns all the Connection Settings registered to a particular BotService resource */ + listByBotService: ( + resourceGroupName: string, + resourceName: string, + options?: ConnectionSettingsListByBotServiceOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a Connection Setting registration for a Bot Service */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + options?: ConnectionSettingsDeleteOptionalParams, + ) => Promise; + /** Updates a Connection Setting registration for a Bot Service */ + update: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options?: ConnectionSettingsUpdateOptionalParams, + ) => Promise; + /** Register a new Auth Connection for a Bot Service */ + create: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options?: ConnectionSettingsCreateOptionalParams, + ) => Promise; + /** Get a Connection Setting registration for a Bot Service */ + get: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + options?: ConnectionSettingsGetOptionalParams, + ) => Promise; +} + +function _getConnectionSettings(context: BotServiceContext) { + return { + listWithSecrets: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + options?: ConnectionSettingsListWithSecretsOptionalParams, + ) => listWithSecrets(context, resourceGroupName, resourceName, connectionName, options), + listByBotService: ( + resourceGroupName: string, + resourceName: string, + options?: ConnectionSettingsListByBotServiceOptionalParams, + ) => listByBotService(context, resourceGroupName, resourceName, options), + delete: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + options?: ConnectionSettingsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, resourceName, connectionName, options), + update: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options?: ConnectionSettingsUpdateOptionalParams, + ) => update(context, resourceGroupName, resourceName, connectionName, parameters, options), + create: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + parameters: ConnectionSetting, + options?: ConnectionSettingsCreateOptionalParams, + ) => create(context, resourceGroupName, resourceName, connectionName, parameters, options), + get: ( + resourceGroupName: string, + resourceName: string, + connectionName: string, + options?: ConnectionSettingsGetOptionalParams, + ) => get(context, resourceGroupName, resourceName, connectionName, options), + }; +} + +export function _getConnectionSettingsOperations( + context: BotServiceContext, +): ConnectionSettingsOperations { + return { + ..._getConnectionSettings(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/hostSettingsOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/classic/hostSettingsOperationGroup/index.ts new file mode 100644 index 000000000000..5598ec8853cc --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/hostSettingsOperationGroup/index.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { HostSettingsResponse } from "../../models/models.js"; +import { HostSettingsOperationGroupGetOptionalParams } from "../../api/hostSettingsOperationGroup/options.js"; +import { get } from "../../api/hostSettingsOperationGroup/operations.js"; + +/** Interface representing a HostSettingsOperationGroup operations. */ +export interface HostSettingsOperationGroupOperations { + /** Get per subscription settings needed to host bot in compute resource such as Azure App Service */ + get: (options?: HostSettingsOperationGroupGetOptionalParams) => Promise; +} + +function _getHostSettingsOperationGroup(context: BotServiceContext) { + return { + get: (options?: HostSettingsOperationGroupGetOptionalParams) => get(context, options), + }; +} + +export function _getHostSettingsOperationGroupOperations( + context: BotServiceContext, +): HostSettingsOperationGroupOperations { + return { + ..._getHostSettingsOperationGroup(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/index.ts b/sdk/botservice/arm-botservice/src/classic/index.ts new file mode 100644 index 000000000000..70cd648c2540 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/index.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { BotChannelsOperations } from "./botChannels/index.js"; +export { BotConnectionOperationGroupOperations } from "./botConnectionOperationGroup/index.js"; +export { BotsOperations } from "./bots/index.js"; +export { BotsOperationGroupOperations } from "./botsOperationGroup/index.js"; +export { ConnectionSettingsOperations } from "./connectionSettings/index.js"; +export { HostSettingsOperationGroupOperations } from "./hostSettingsOperationGroup/index.js"; +export { NetworkSecurityPerimeterConfigurationsOperations } from "./networkSecurityPerimeterConfigurations/index.js"; +export { OperationResultsOperationGroupOperations } from "./operationResultsOperationGroup/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { PrivateEndpointConnectionsOperations } from "./privateEndpointConnections/index.js"; +export { QnAMakerEndpointKeysOperationGroupOperations } from "./qnAMakerEndpointKeysOperationGroup/index.js"; diff --git a/sdk/botservice/arm-botservice/src/classic/networkSecurityPerimeterConfigurations/index.ts b/sdk/botservice/arm-botservice/src/classic/networkSecurityPerimeterConfigurations/index.ts new file mode 100644 index 000000000000..a14c6cdca7ba --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/networkSecurityPerimeterConfigurations/index.ts @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { NetworkSecurityPerimeterConfiguration } from "../../models/models.js"; +import { + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, +} from "../../api/networkSecurityPerimeterConfigurations/options.js"; +import { + reconcile, + list, + get, +} from "../../api/networkSecurityPerimeterConfigurations/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkSecurityPerimeterConfigurations operations. */ +export interface NetworkSecurityPerimeterConfigurationsOperations { + /** Reconcile the specified Network Security Perimeter configuration associated with the Bot. */ + reconcile: ( + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ) => PollerLike< + OperationState, + NetworkSecurityPerimeterConfiguration + >; + /** List Network Security Perimeter configurations associated with the Bot. */ + list: ( + resourceGroupName: string, + resourceName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the specified Network Security Perimeter configuration associated with the Bot. */ + get: ( + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ) => Promise; +} + +function _getNetworkSecurityPerimeterConfigurations(context: BotServiceContext) { + return { + reconcile: ( + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ) => + reconcile( + context, + resourceGroupName, + resourceName, + networkSecurityPerimeterConfigurationName, + options, + ), + list: ( + resourceGroupName: string, + resourceName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ) => list(context, resourceGroupName, resourceName, options), + get: ( + resourceGroupName: string, + resourceName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + resourceName, + networkSecurityPerimeterConfigurationName, + options, + ), + }; +} + +export function _getNetworkSecurityPerimeterConfigurationsOperations( + context: BotServiceContext, +): NetworkSecurityPerimeterConfigurationsOperations { + return { + ..._getNetworkSecurityPerimeterConfigurations(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/operationResultsOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/classic/operationResultsOperationGroup/index.ts new file mode 100644 index 000000000000..34af112f0908 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/operationResultsOperationGroup/index.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { OperationResultsDescription } from "../../models/models.js"; +import { OperationResultsOperationGroupGetOptionalParams } from "../../api/operationResultsOperationGroup/options.js"; +import { get } from "../../api/operationResultsOperationGroup/operations.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a OperationResultsOperationGroup operations. */ +export interface OperationResultsOperationGroupOperations { + /** Get the operation result for a long running operation. */ + get: ( + operationResultId: string, + options?: OperationResultsOperationGroupGetOptionalParams, + ) => PollerLike, OperationResultsDescription>; +} + +function _getOperationResultsOperationGroup(context: BotServiceContext) { + return { + get: (operationResultId: string, options?: OperationResultsOperationGroupGetOptionalParams) => + get(context, operationResultId, options), + }; +} + +export function _getOperationResultsOperationGroupOperations( + context: BotServiceContext, +): OperationResultsOperationGroupOperations { + return { + ..._getOperationResultsOperationGroup(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/operations/index.ts b/sdk/botservice/arm-botservice/src/classic/operations/index.ts new file mode 100644 index 000000000000..23c59f448990 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { OperationEntity } from "../../models/models.js"; +import { OperationsListOptionalParams } from "../../api/operations/options.js"; +import { list } from "../../api/operations/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: BotServiceContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: BotServiceContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/privateEndpointConnections/index.ts b/sdk/botservice/arm-botservice/src/classic/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..9c568f5f3269 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/privateEndpointConnections/index.ts @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { PrivateEndpointConnection } from "../../models/models.js"; +import { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "../../api/privateEndpointConnections/options.js"; +import { list, $delete, create, get } from "../../api/privateEndpointConnections/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a PrivateEndpointConnections operations. */ +export interface PrivateEndpointConnectionsOperations { + /** List all the private endpoint connections associated with the Bot. */ + list: ( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified private endpoint connection associated with the Bot. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => Promise; + /** Update the state of specified private endpoint connection associated with the Bot. */ + create: ( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => Promise; + /** Gets the specified private endpoint connection associated with the Bot. */ + get: ( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => Promise; +} + +function _getPrivateEndpointConnections(context: BotServiceContext) { + return { + list: ( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => list(context, resourceGroupName, resourceName, options), + delete: ( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, resourceName, privateEndpointConnectionName, options), + create: ( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + resourceName, + privateEndpointConnectionName, + properties, + options, + ), + get: ( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => get(context, resourceGroupName, resourceName, privateEndpointConnectionName, options), + }; +} + +export function _getPrivateEndpointConnectionsOperations( + context: BotServiceContext, +): PrivateEndpointConnectionsOperations { + return { + ..._getPrivateEndpointConnections(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/classic/qnAMakerEndpointKeysOperationGroup/index.ts b/sdk/botservice/arm-botservice/src/classic/qnAMakerEndpointKeysOperationGroup/index.ts new file mode 100644 index 000000000000..92538be7e923 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/classic/qnAMakerEndpointKeysOperationGroup/index.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceContext } from "../../api/botServiceContext.js"; +import { + QnAMakerEndpointKeysRequestBody, + QnAMakerEndpointKeysResponse, +} from "../../models/models.js"; +import { QnAMakerEndpointKeysOperationGroupGetOptionalParams } from "../../api/qnAMakerEndpointKeysOperationGroup/options.js"; +import { get } from "../../api/qnAMakerEndpointKeysOperationGroup/operations.js"; + +/** Interface representing a QnAMakerEndpointKeysOperationGroup operations. */ +export interface QnAMakerEndpointKeysOperationGroupOperations { + /** Lists the QnA Maker endpoint keys */ + get: ( + parameters: QnAMakerEndpointKeysRequestBody, + options?: QnAMakerEndpointKeysOperationGroupGetOptionalParams, + ) => Promise; +} + +function _getQnAMakerEndpointKeysOperationGroup(context: BotServiceContext) { + return { + get: ( + parameters: QnAMakerEndpointKeysRequestBody, + options?: QnAMakerEndpointKeysOperationGroupGetOptionalParams, + ) => get(context, parameters, options), + }; +} + +export function _getQnAMakerEndpointKeysOperationGroupOperations( + context: BotServiceContext, +): QnAMakerEndpointKeysOperationGroupOperations { + return { + ..._getQnAMakerEndpointKeysOperationGroup(context), + }; +} diff --git a/sdk/botservice/arm-botservice/src/index.ts b/sdk/botservice/arm-botservice/src/index.ts index 6542030138f6..a0ce471d18d2 100644 --- a/sdk/botservice/arm-botservice/src/index.ts +++ b/sdk/botservice/arm-botservice/src/index.ts @@ -1,13 +1,193 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -/// -export { getContinuationToken } from "./pagingHelper.js"; -export * from "./models/index.js"; -export { AzureBotService } from "./azureBotService.js"; -export * from "./operationsInterfaces/index.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { BotServiceClient } from "./botServiceClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + OperationEntity, + OperationDisplayInfo, + ErrorModel, + ErrorBody, + Bot, + BotProperties, + KnownMsaAppType, + MsaAppType, + KnownPublicNetworkAccess, + PublicNetworkAccess, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPrivateEndpointConnectionProvisioningState, + PrivateEndpointConnectionProvisioningState, + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationProperties, + KnownProvisioningState, + ProvisioningState, + ProvisioningIssue, + ProvisioningIssueProperties, + KnownSeverity, + Severity, + NspAccessRule, + NspAccessRuleProperties, + KnownNspAccessRuleDirection, + NspAccessRuleDirection, + NspAccessRulePropertiesSubscriptionsItem, + NetworkSecurityPerimeter, + ResourceAssociation, + KnownAccessMode, + AccessMode, + Profile, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + KnownKind, + Kind, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TrackedResource, + CreateEmailSignInUrlResponse, + CreateEmailSignInUrlResponseProperties, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + PrivateLinkResourceBase, + BotChannel, + Channel, + ChannelUnion, + AlexaChannel, + AlexaChannelProperties, + FacebookChannel, + FacebookChannelProperties, + FacebookPage, + EmailChannel, + EmailChannelProperties, + EmailChannelAuthMethod, + OutlookChannel, + MsTeamsChannel, + MsTeamsChannelProperties, + SkypeChannel, + SkypeChannelProperties, + KikChannel, + KikChannelProperties, + WebChatChannel, + WebChatChannelProperties, + WebChatSite, + DirectLineChannel, + DirectLineChannelProperties, + DirectLineSite, + TelegramChannel, + TelegramChannelProperties, + SmsChannel, + SmsChannelProperties, + SlackChannel, + SlackChannelProperties, + LineChannel, + LineChannelProperties, + LineRegistration, + DirectLineSpeechChannel, + DirectLineSpeechChannelProperties, + Omnichannel, + TelephonyChannel, + TelephonyChannelProperties, + TelephonyPhoneNumbers, + TelephonyChannelResourceApiConfiguration, + AcsChatChannel, + SearchAssistant, + M365Extensions, + Site, + ListChannelWithKeysResponse, + ChannelSettings, + SiteInfo, + Key, + ConnectionSetting, + ConnectionSettingProperties, + ConnectionSettingParameter, + CheckNameAvailabilityRequestBody, + CheckNameAvailabilityResponseBody, + ServiceProviderResponseList, + ServiceProvider, + ServiceProviderProperties, + ServiceProviderParameter, + ServiceProviderParameterMetadata, + ServiceProviderParameterMetadataConstraints, + QnAMakerEndpointKeysRequestBody, + QnAMakerEndpointKeysResponse, + HostSettingsResponse, + OperationResultsDescription, + KnownOperationResultStatus, + OperationResultStatus, + KnownVersions, +} from "./models/index.js"; +export { BotServiceClientOptionalParams } from "./api/index.js"; +export { + BotChannelsRegenerateKeysOptionalParams, + BotChannelsListWithKeysOptionalParams, + BotChannelsListByResourceGroupOptionalParams, + BotChannelsDeleteOptionalParams, + BotChannelsUpdateOptionalParams, + BotChannelsCreateOptionalParams, + BotChannelsGetOptionalParams, +} from "./api/botChannels/index.js"; +export { BotConnectionOperationGroupListServiceProvidersOptionalParams } from "./api/botConnectionOperationGroup/index.js"; +export { + BotsListByBotResourceOptionalParams, + BotsCreateSignInUrlOptionalParams, + BotsListOptionalParams, + BotsListByResourceGroupOptionalParams, + BotsDeleteOptionalParams, + BotsUpdateOptionalParams, + BotsCreateOptionalParams, + BotsGetOptionalParams, +} from "./api/bots/index.js"; +export { BotsOperationGroupGetCheckNameAvailabilityOptionalParams } from "./api/botsOperationGroup/index.js"; +export { + ConnectionSettingsListWithSecretsOptionalParams, + ConnectionSettingsListByBotServiceOptionalParams, + ConnectionSettingsDeleteOptionalParams, + ConnectionSettingsUpdateOptionalParams, + ConnectionSettingsCreateOptionalParams, + ConnectionSettingsGetOptionalParams, +} from "./api/connectionSettings/index.js"; +export { HostSettingsOperationGroupGetOptionalParams } from "./api/hostSettingsOperationGroup/index.js"; +export { + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, +} from "./api/networkSecurityPerimeterConfigurations/index.js"; +export { OperationResultsOperationGroupGetOptionalParams } from "./api/operationResultsOperationGroup/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./api/privateEndpointConnections/index.js"; +export { QnAMakerEndpointKeysOperationGroupGetOptionalParams } from "./api/qnAMakerEndpointKeysOperationGroup/index.js"; +export { + BotChannelsOperations, + BotConnectionOperationGroupOperations, + BotsOperations, + BotsOperationGroupOperations, + ConnectionSettingsOperations, + HostSettingsOperationGroupOperations, + NetworkSecurityPerimeterConfigurationsOperations, + OperationResultsOperationGroupOperations, + OperationsOperations, + PrivateEndpointConnectionsOperations, + QnAMakerEndpointKeysOperationGroupOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; diff --git a/sdk/botservice/arm-botservice/src/logger.ts b/sdk/botservice/arm-botservice/src/logger.ts new file mode 100644 index 000000000000..ce23bdbad72e --- /dev/null +++ b/sdk/botservice/arm-botservice/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-botservice"); diff --git a/sdk/botservice/arm-botservice/src/lroImpl.ts b/sdk/botservice/arm-botservice/src/lroImpl.ts deleted file mode 100644 index 518d5f053b4e..000000000000 --- a/sdk/botservice/arm-botservice/src/lroImpl.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } -} diff --git a/sdk/botservice/arm-botservice/src/models/index.ts b/sdk/botservice/arm-botservice/src/models/index.ts index 977a6761503b..2e8f20e2c431 100644 --- a/sdk/botservice/arm-botservice/src/models/index.ts +++ b/sdk/botservice/arm-botservice/src/models/index.ts @@ -1,1650 +1,126 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -export type ChannelUnion = - | Channel - | AlexaChannel - | FacebookChannel - | EmailChannel - | OutlookChannel - | MsTeamsChannel - | SkypeChannel - | KikChannel - | WebChatChannel - | DirectLineChannel - | TelegramChannel - | SmsChannel - | SlackChannel - | LineChannel - | DirectLineSpeechChannel - | Omnichannel - | TelephonyChannel - | AcsChatChannel - | SearchAssistant - | M365Extensions; - -/** The parameters to provide for the Bot. */ -export interface BotProperties { - /** The Name of the bot */ - displayName: string; - /** The description of the bot */ - description?: string; - /** The Icon Url of the bot */ - iconUrl?: string; - /** The bot's endpoint */ - endpoint: string | null; - /** - * The bot's endpoint version - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly endpointVersion?: string; - /** Contains resource all settings defined as key/value pairs. */ - allSettings?: { [propertyName: string]: string }; - /** Contains resource parameters defined as key/value pairs. */ - parameters?: { [propertyName: string]: string }; - /** The bot's manifest url */ - manifestUrl?: string; - /** Microsoft App Type for the bot */ - msaAppType?: MsaAppType; - /** Microsoft App Id for the bot */ - msaAppId: string; - /** Microsoft App Tenant Id for the bot */ - msaAppTenantId?: string; - /** Microsoft App Managed Identity Resource Id for the bot */ - msaAppMSIResourceId?: string; - /** - * Collection of channels for which the bot is configured - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly configuredChannels?: string[]; - /** - * Collection of channels for which the bot is enabled - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly enabledChannels?: string[]; - /** The Application Insights key */ - developerAppInsightKey?: string; - /** The Application Insights Api Key */ - developerAppInsightsApiKey?: string; - /** The Application Insights App Id */ - developerAppInsightsApplicationId?: string; - /** Collection of LUIS App Ids */ - luisAppIds?: string[]; - /** The LUIS Key */ - luisKey?: string; - /** Whether Cmek is enabled */ - isCmekEnabled?: boolean; - /** The CMK Url */ - cmekKeyVaultUrl?: string; - /** - * The CMK encryption status - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly cmekEncryptionStatus?: string; - /** The Tenant Id for the bot */ - tenantId?: string; - /** Whether the bot is in an isolated network */ - publicNetworkAccess?: PublicNetworkAccess; - /** Whether the bot is streaming supported */ - isStreamingSupported?: boolean; - /** - * Whether the bot is developerAppInsightsApiKey set - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDeveloperAppInsightsApiKeySet?: boolean; - /** - * Token used to migrate non Azure bot to azure subscription - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly migrationToken?: string; - /** Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ - disableLocalAuth?: boolean; - /** The channel schema transformation version for the bot */ - schemaTransformationVersion?: string; - /** The storage resourceId for the bot */ - storageResourceId?: string; - /** - * List of Private Endpoint Connections configured for the bot - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** The hint to browser (e.g. protocol handler) on how to open the bot for authoring */ - openWithHint?: string; - /** The hint (e.g. keyVault secret resourceId) on how to fetch the app secret */ - appPasswordHint?: string; - /** - * Provisioning state of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Publishing credentials of the resource */ - publishingCredentials?: string; -} - -/** The Private Endpoint resource. */ -export interface PrivateEndpoint { - /** - * The ARM identifier for Private Endpoint - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** A collection of information about the state of the connection between service consumer and provider. */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - -/** Common fields that are returned in the response for all BotService Private Link Resources */ -export interface PrivateLinkResourceBase { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; -} - -/** Azure resource */ -export interface Resource { - /** - * Specifies the resource ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Specifies the name of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** Specifies the location of the resource. */ - location?: string; - /** - * Specifies the type of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Contains resource tags defined as key/value pairs. */ - tags?: { [propertyName: string]: string }; - /** Gets or sets the SKU of the resource. */ - sku?: Sku; - /** Required. Gets or sets the Kind of the resource. */ - kind?: Kind; - /** Entity Tag */ - etag?: string; - /** - * Entity zones - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zones?: string[]; -} - -/** The SKU of the cognitive services account. */ -export interface Sku { - /** The sku name */ - name: SkuName; - /** - * Gets the sku tier. This is based on the SKU name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tier?: SkuTier; -} - -/** Bot Service error object. */ -export interface ErrorModel { - /** The error body. */ - error?: ErrorBody; -} - -/** Bot Service error body. */ -export interface ErrorBody { - /** error code */ - code: string; - /** error message */ - message: string; -} - -/** The list of bot service operation response. */ -export interface BotResponseList { - /** The link used to get the next page of bot service resources. */ - nextLink?: string; - /** - * Gets the list of bot service results and their properties. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Bot[]; -} - -/** Channel definition */ -export interface Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: - | "AlexaChannel" - | "FacebookChannel" - | "EmailChannel" - | "OutlookChannel" - | "MsTeamsChannel" - | "SkypeChannel" - | "KikChannel" - | "WebChatChannel" - | "DirectLineChannel" - | "TelegramChannel" - | "SmsChannel" - | "SlackChannel" - | "LineChannel" - | "DirectLineSpeechChannel" - | "Omnichannel" - | "TelephonyChannel" - | "AcsChatChannel" - | "SearchAssistant" - | "M365Extensions"; - /** Entity Tag of the resource */ - etag?: string; - /** - * Provisioning state of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Specifies the location of the resource. */ - location?: string; -} - -/** Channel settings definition */ -export interface ChannelSettings { - /** The extensionKey1 */ - extensionKey1?: string; - /** The extensionKey2 */ - extensionKey2?: string; - /** The list of sites */ - sites?: Site[]; - /** The channel id */ - channelId?: string; - /** The channel display name */ - channelDisplayName?: string; - /** The bot id */ - botId?: string; - /** The bot icon url */ - botIconUrl?: string; - /** Whether this channel is enabled for the bot */ - isEnabled?: boolean; - /** Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ - disableLocalAuth?: boolean; - /** Whether customer needs to agree to new terms. */ - requireTermsAgreement?: boolean; -} - -/** A site for the channel */ -export interface Site { - /** Tenant Id */ - tenantId?: string; - /** - * Site Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly siteId?: string; - /** Site name */ - siteName: string; - /** - * Primary key. Value only returned through POST to the action Channel List API, otherwise empty. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly key?: string; - /** - * Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly key2?: string; - /** Whether this site is enabled for DirectLine channel */ - isEnabled: boolean; - /** - * Whether this site is token enabled for channel - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isTokenEnabled?: boolean; - /** Whether this site is EndpointParameters enabled for channel */ - isEndpointParametersEnabled?: boolean; - /** Whether this site is disabled detailed logging for */ - isDetailedLoggingEnabled?: boolean; - /** Whether this site is enabled for block user upload. */ - isBlockUserUploadEnabled?: boolean; - /** Whether this no-storage site is disabled detailed logging for */ - isNoStorageEnabled?: boolean; - /** Entity Tag */ - eTag?: string; - /** DirectLine application id */ - appId?: string; - /** Whether this site is enabled for Bot Framework V1 protocol. */ - isV1Enabled?: boolean; - /** Whether this site is enabled for Bot Framework V3 protocol. */ - isV3Enabled?: boolean; - /** Whether this site is enabled for authentication with Bot Framework. */ - isSecureSiteEnabled?: boolean; - /** List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. */ - trustedOrigins?: string[]; - /** Whether this site is enabled for Webchat Speech */ - isWebChatSpeechEnabled?: boolean; - /** Whether this site is enabled for preview versions of Webchat */ - isWebchatPreviewEnabled?: boolean; -} - -/** The list of bot service channel operation response. */ -export interface ChannelResponseList { - /** The link used to get the next page of bot service channel resources. */ - nextLink?: string; - /** - * Gets the list of bot service channel results and their properties. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: BotChannel[]; -} - -/** Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. */ -export interface SiteInfo { - /** The site name */ - siteName: string; - /** Determines which key is to be regenerated */ - key: Key; -} - -/** The ARM create email sign in url operation response. */ -export interface CreateEmailSignInUrlResponse { - /** - * Specifies the resource ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** Specifies the location of the resource. */ - location?: string; - /** The set of properties specific to sign in url */ - properties?: CreateEmailSignInUrlResponseProperties; -} - -/** The set of properties specific to sign in url */ -export interface CreateEmailSignInUrlResponseProperties { - /** Sign in url. */ - url?: string; -} - -/** The request body for a request to Bot Service Management to check availability of a bot name. */ -export interface CheckNameAvailabilityRequestBody { - /** the name of the bot for which availability needs to be checked. */ - name?: string; - /** the type of the bot for which availability needs to be checked */ - type?: string; -} - -/** The response body returned for a request to Bot Service Management to check availability of a bot name. */ -export interface CheckNameAvailabilityResponseBody { - /** indicates if the bot name is valid. */ - valid?: boolean; - /** additional message from the bot management api showing why a bot name is not available */ - message?: string; - /** response code from ABS */ - absCode?: string; -} - -/** The list of bot service operation response. */ -export interface OperationEntityListResult { - /** The link used to get the next page of operations. */ - nextLink?: string; - /** The list of operations. */ - value?: OperationEntity[]; -} - -/** The operations supported by Bot Service Management. */ -export interface OperationEntity { - /** Operation name: {provider}/{resource}/{operation}. */ - name?: string; - /** The operation supported by Bot Service Management. */ - display?: OperationDisplayInfo; - /** The origin of the operation. */ - origin?: string; - /** Additional properties. */ - properties?: Record; -} - -/** The operation supported by Bot Service Management. */ -export interface OperationDisplayInfo { - /** The description of the operation. */ - description?: string; - /** The action that users can perform, based on their permission level. */ - operation?: string; - /** Service provider: Microsoft Bot Service. */ - provider?: string; - /** Resource on which the operation is performed. */ - resource?: string; -} - -/** The list of bot service providers response. */ -export interface ServiceProviderResponseList { - /** The link used to get the next page of bot service providers. */ - nextLink?: string; - /** - * Gets the list of bot service providers and their properties. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: ServiceProvider[]; -} - -/** Service Provider Definition */ -export interface ServiceProvider { - /** The Properties of a Service Provider Object */ - properties?: ServiceProviderProperties; -} - -/** The Object used to describe a Service Provider supported by Bot Service */ -export interface ServiceProviderProperties { - /** - * Id for Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Display Name of the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly displayName?: string; - /** - * Name of the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly serviceProviderName?: string; - /** - * URL of Dev Portal - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly devPortalUrl?: string; - /** The URL of icon */ - iconUrl?: string; - /** The list of parameters for the Service Provider */ - parameters?: ServiceProviderParameter[]; -} - -/** Extra Parameters specific to each Service Provider */ -export interface ServiceProviderParameter { - /** - * Name of the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Type of the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Display Name of the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly displayName?: string; - /** - * Description of the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; - /** - * Help Url for the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly helpUrl?: string; - /** - * Default Name for the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly default?: string; - /** - * Meta data for the Service Provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: ServiceProviderParameterMetadata; -} - -/** Meta data for the Service Provider */ -export interface ServiceProviderParameterMetadata { - /** the constraints of the bot meta data. */ - constraints?: ServiceProviderParameterMetadataConstraints; -} - -/** the constraints of the bot meta data. */ -export interface ServiceProviderParameterMetadataConstraints { - /** Whether required the constraints of the bot meta data. */ - required?: boolean; -} - -/** The request body for a request to Bot Service Management to list QnA Maker endpoint keys. */ -export interface QnAMakerEndpointKeysRequestBody { - /** the host name of the QnA Maker endpoint */ - hostname?: string; - /** Subscription key which provides access to this API. */ - authkey?: string; -} - -/** Schema for EndpointKeys generate/refresh operations. */ -export interface QnAMakerEndpointKeysResponse { - /** Primary Access Key. */ - primaryEndpointKey?: string; - /** Secondary Access Key. */ - secondaryEndpointKey?: string; - /** Current version of runtime. */ - installedVersion?: string; - /** Latest version of runtime. */ - lastStableVersion?: string; -} - -/** Properties for a Connection Setting Item */ -export interface ConnectionSettingProperties { - /** Client Id associated with the Connection Setting. */ - clientId?: string; - /** - * Setting Id set by the service for the Connection Setting. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly settingId?: string; - /** Client Secret associated with the Connection Setting */ - clientSecret?: string; - /** Scopes associated with the Connection Setting */ - scopes?: string; - /** Service Provider Id associated with the Connection Setting */ - serviceProviderId?: string; - /** Service Provider Display Name associated with the Connection Setting */ - serviceProviderDisplayName?: string; - /** Service Provider Parameters associated with the Connection Setting */ - parameters?: ConnectionSettingParameter[]; - /** Provisioning state of the resource */ - provisioningState?: string; -} - -/** Extra Parameter in a Connection Setting Properties to indicate service provider specific properties */ -export interface ConnectionSettingParameter { - /** Key for the Connection Setting Parameter. */ - key?: string; - /** Value associated with the Connection Setting Parameter. */ - value?: string; -} - -/** The list of bot service connection settings response. */ -export interface ConnectionSettingResponseList { - /** The link used to get the next page of bot service connection setting resources. */ - nextLink?: string; - /** - * Gets the list of bot service connection settings and their properties. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: ConnectionSetting[]; -} - -/** The response body returned for a request to Bot Service Management to check per subscription hostSettings */ -export interface HostSettingsResponse { - /** For in-conversation bot user authentication */ - oAuthUrl?: string; - /** For verifying incoming tokens from the channels */ - toBotFromChannelOpenIdMetadataUrl?: string; - /** For verifying incoming tokens from the channels */ - toBotFromChannelTokenIssuer?: string; - /** For verifying incoming tokens from bot emulator */ - toBotFromEmulatorOpenIdMetadataUrl?: string; - /** For getting access token to channels from bot host */ - toChannelFromBotLoginUrl?: string; - /** For getting access token to channels from bot host */ - toChannelFromBotOAuthScope?: string; - /** Per cloud OAuth setting on whether authority is validated */ - validateAuthority?: boolean; - /** Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12 */ - botOpenIdMetadata?: string; -} - -/** The properties indicating the operation result of an operation on a service. */ -export interface OperationResultsDescription { - /** - * The ID of the operation returned. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the operation result. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The status of the operation being performed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: OperationResultStatus; - /** - * The time that the operation was started. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startTime?: Date; -} - -/** List of private endpoint connection associated with the specified storage account */ -export interface PrivateEndpointConnectionListResult { - /** Array of private endpoint connections */ - value?: PrivateEndpointConnection[]; -} - -/** A list of private link resources */ -export interface PrivateLinkResourceListResult { - /** Array of private link resources */ - value?: PrivateLinkResource[]; -} - -/** The parameters to provide for the Alexa channel. */ -export interface AlexaChannelProperties { - /** The Alexa skill Id */ - alexaSkillId: string; - /** - * Url fragment used in part of the Uri configured in Alexa - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly urlFragment?: string; - /** - * Full Uri used to configured the skill in Alexa - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly serviceEndpointUri?: string; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** The parameters to provide for the Facebook channel. */ -export interface FacebookChannelProperties { - /** - * Verify token. Value only returned through POST to the action Channel List API, otherwise empty. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly verifyToken?: string; - /** The list of Facebook pages */ - pages?: FacebookPage[]; - /** Facebook application id */ - appId: string; - /** Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty. */ - appSecret?: string; - /** - * Callback Url - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly callbackUrl?: string; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** A Facebook page for Facebook channel registration */ -export interface FacebookPage { - /** Page id */ - id: string; - /** Facebook application access token. Value only returned through POST to the action Channel List API, otherwise empty. */ - accessToken?: string; -} - -/** The parameters to provide for the Email channel. */ -export interface EmailChannelProperties { - /** The email address */ - emailAddress: string; - /** Email channel auth method. 0 Password (Default); 1 Graph. */ - authMethod?: EmailChannelAuthMethod; - /** The password for the email address. Value only returned through POST to the action Channel List API, otherwise empty. */ - password?: string; - /** The magic code for setting up the modern authentication. */ - magicCode?: string; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** The parameters to provide for the Microsoft Teams channel. */ -export interface MsTeamsChannelProperties { - /** Enable calling for Microsoft Teams channel */ - enableCalling?: boolean; - /** Webhook for Microsoft Teams channel calls */ - callingWebhook?: string; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; - /** Webhook for Microsoft Teams channel calls */ - incomingCallRoute?: string; - /** Deployment environment for Microsoft Teams channel calls */ - deploymentEnvironment?: string; - /** Whether this channel accepted terms */ - acceptedTerms?: boolean; -} - -/** The parameters to provide for the Microsoft Teams channel. */ -export interface SkypeChannelProperties { - /** Enable messaging for Skype channel */ - enableMessaging?: boolean; - /** Enable media cards for Skype channel */ - enableMediaCards?: boolean; - /** Enable video for Skype channel */ - enableVideo?: boolean; - /** Enable calling for Skype channel */ - enableCalling?: boolean; - /** Enable screen sharing for Skype channel */ - enableScreenSharing?: boolean; - /** Enable groups for Skype channel */ - enableGroups?: boolean; - /** Group mode for Skype channel */ - groupsMode?: string; - /** Calling web hook for Skype channel */ - callingWebHook?: string; - /** Incoming call route for Skype channel */ - incomingCallRoute?: string; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** The parameters to provide for the Kik channel. */ -export interface KikChannelProperties { - /** The Kik user name */ - userName: string; - /** Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. */ - apiKey?: string; - /** Whether this channel is validated for the bot */ - isValidated?: boolean; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** The parameters to provide for the Web Chat channel. */ -export interface WebChatChannelProperties { - /** - * Web chat control embed code - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly webChatEmbedCode?: string; - /** The list of Web Chat sites */ - sites?: WebChatSite[]; -} - -/** The parameters to provide for the Direct Line channel. */ -export interface DirectLineChannelProperties { - /** The list of Direct Line sites */ - sites?: DirectLineSite[]; - /** The extensionKey1 */ - extensionKey1?: string; - /** The extensionKey2 */ - extensionKey2?: string; - /** Direct Line embed code of the resource */ - directLineEmbedCode?: string; -} - -/** The parameters to provide for the Telegram channel. */ -export interface TelegramChannelProperties { - /** The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty. */ - accessToken?: string; - /** Whether this channel is validated for the bot */ - isValidated?: boolean; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** The parameters to provide for the Sms channel. */ -export interface SmsChannelProperties { - /** The Sms phone */ - phone: string; - /** The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. */ - accountSID: string; - /** The Sms auth token. Value only returned through POST to the action Channel List API, otherwise empty. */ - authToken?: string; - /** Whether this channel is validated for the bot */ - isValidated?: boolean; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** The parameters to provide for the Slack channel. */ -export interface SlackChannelProperties { - /** The Slack client id */ - clientId?: string; - /** The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty. */ - clientSecret?: string; - /** The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty. */ - verificationToken?: string; - /** The Slack permission scopes. */ - scopes?: string; - /** The Slack landing page Url */ - landingPageUrl?: string; - /** - * The Slack redirect action - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly redirectAction?: string; - /** - * The Sms auth token - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastSubmissionId?: string; - /** Whether to register the settings before OAuth validation is performed. Recommended to True. */ - registerBeforeOAuthFlow?: boolean; - /** - * Whether this channel is validated for the bot - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isValidated?: boolean; - /** The Slack signing secret. */ - signingSecret?: string; - /** Whether this channel is enabled for the bot */ - isEnabled: boolean; -} - -/** The parameters to provide for the Line channel. */ -export interface LineChannelProperties { - /** The list of line channel registrations */ - lineRegistrations: LineRegistration[]; - /** - * Callback Url to enter in line registration. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly callbackUrl?: string; - /** - * Whether this channel is validated for the bot - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isValidated?: boolean; -} - -/** The properties corresponding to a line channel registration */ -export interface LineRegistration { - /** - * Id generated for the line channel registration - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly generatedId?: string; - /** Secret for the line channel registration */ - channelSecret?: string; - /** Access token for the line channel registration */ - channelAccessToken?: string; -} - -/** The parameters to provide for the DirectLine Speech channel. */ -export interface DirectLineSpeechChannelProperties { - /** The cognitive service id with this channel registration. */ - cognitiveServiceResourceId?: string; - /** The cognitive service region with this channel registration. */ - cognitiveServiceRegion?: string; - /** The cognitive service subscription key to use with this channel registration. */ - cognitiveServiceSubscriptionKey?: string; - /** Whether this channel is enabled or not. */ - isEnabled?: boolean; - /** Custom speech model id (optional). */ - customVoiceDeploymentId?: string; - /** Custom voice deployment id (optional). */ - customSpeechModelId?: string; - /** Make this a default bot for chosen cognitive service account. */ - isDefaultBotForCogSvcAccount?: boolean; -} - -/** The parameters to provide for the Direct Line channel. */ -export interface TelephonyChannelProperties { - /** The list of Telephony phone numbers */ - phoneNumbers?: TelephonyPhoneNumbers[]; - /** The list of Telephony api configuration */ - apiConfigurations?: TelephonyChannelResourceApiConfiguration[]; - /** The extensionKey1 */ - cognitiveServiceSubscriptionKey?: string; - /** The extensionKey2 */ - cognitiveServiceRegion?: string; - /** The default locale of the channel */ - defaultLocale?: string; - /** The premium SKU applied to the channel */ - premiumSKU?: string; - /** Whether the channel is enabled */ - isEnabled?: boolean; -} - -/** A telephone number for the Telephony channel */ -export interface TelephonyPhoneNumbers { - /** The element id. */ - id?: string; - /** The phone number. */ - phoneNumber?: string; - /** The endpoint of ACS. */ - acsEndpoint?: string; - /** The secret of ACS. */ - acsSecret?: string; - /** The resource id of ACS. */ - acsResourceId?: string; - /** The subscription key of cognitive service. */ - cognitiveServiceSubscriptionKey?: string; - /** The service region of cognitive service. */ - cognitiveServiceRegion?: string; - /** The resource id of cognitive service. */ - cognitiveServiceResourceId?: string; - /** The default locale of the phone number. */ - defaultLocale?: string; - /** Optional Property that will determine the offering type of the phone. */ - offerType?: string; -} - -/** A resource Api configuration for the Telephony channel */ -export interface TelephonyChannelResourceApiConfiguration { - /** The id of config. */ - id?: string; - /** The provider name. */ - providerName?: string; - /** The cognitive service subscription key. */ - cognitiveServiceSubscriptionKey?: string; - /** The cognitive service region. */ - cognitiveServiceRegion?: string; - /** The cognitive service resourceId. */ - cognitiveServiceResourceId?: string; - /** The default locale. */ - defaultLocale?: string; -} - -/** The display name of a connection Item Setting registered with the Bot */ -export interface ConnectionItemName { - /** - * Connection Item name that has been added in the API - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; -} - -/** The Private Endpoint Connection resource. */ -export interface PrivateEndpointConnection extends PrivateLinkResourceBase { - /** The resource of private end point. */ - privateEndpoint?: PrivateEndpoint; - /** A collection of information about the state of the connection between service consumer and provider. */ - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - /** - * The provisioning state of the private endpoint connection resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; - /** Group ids */ - groupIds?: string[]; -} - -/** A private link resource */ -export interface PrivateLinkResource extends PrivateLinkResourceBase { - /** - * The private link resource group id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredMembers?: string[]; - /** The private link resource Private link DNS zone name. */ - requiredZoneNames?: string[]; -} - -/** Bot resource definition */ -export interface Bot extends Resource { - /** The set of properties specific to bot resource */ - properties?: BotProperties; -} - -/** Bot channel resource definition */ -export interface BotChannel extends Resource { - /** The set of properties specific to bot channel resource */ - properties?: ChannelUnion; -} - -/** Bot channel resource definition */ -export interface ConnectionSetting extends Resource { - /** The set of properties specific to bot channel resource */ - properties?: ConnectionSettingProperties; -} - -/** Alexa channel definition */ -export interface AlexaChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "AlexaChannel"; - /** The set of properties specific to Alexa channel resource */ - properties?: AlexaChannelProperties; -} - -/** Facebook channel definition */ -export interface FacebookChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "FacebookChannel"; - /** The set of properties specific to bot facebook channel */ - properties?: FacebookChannelProperties; -} - -/** Email channel definition */ -export interface EmailChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "EmailChannel"; - /** The set of properties specific to email channel resource */ - properties?: EmailChannelProperties; -} - -/** Outlook channel definition */ -export interface OutlookChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "OutlookChannel"; -} - -/** Microsoft Teams channel definition */ -export interface MsTeamsChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "MsTeamsChannel"; - /** The set of properties specific to Microsoft Teams channel resource */ - properties?: MsTeamsChannelProperties; -} - -/** Skype channel definition */ -export interface SkypeChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "SkypeChannel"; - /** The set of properties specific to Skype channel resource */ - properties?: SkypeChannelProperties; -} - -/** Kik channel definition */ -export interface KikChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "KikChannel"; - /** The set of properties specific to Kik channel resource */ - properties?: KikChannelProperties; -} - -/** Web Chat channel definition */ -export interface WebChatChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "WebChatChannel"; - /** The set of properties specific to Web Chat channel resource */ - properties?: WebChatChannelProperties; -} - -/** Direct Line channel definition */ -export interface DirectLineChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "DirectLineChannel"; - /** The set of properties specific to Direct Line channel resource */ - properties?: DirectLineChannelProperties; -} - -/** Telegram channel definition */ -export interface TelegramChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "TelegramChannel"; - /** The set of properties specific to Telegram channel resource */ - properties?: TelegramChannelProperties; -} - -/** Sms channel definition */ -export interface SmsChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "SmsChannel"; - /** The set of properties specific to Sms channel resource */ - properties?: SmsChannelProperties; -} - -/** Slack channel definition */ -export interface SlackChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "SlackChannel"; - /** The set of properties specific to Slack channel resource */ - properties?: SlackChannelProperties; -} - -/** Line channel definition */ -export interface LineChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "LineChannel"; - /** The set of properties specific to line channel resource */ - properties?: LineChannelProperties; -} - -/** DirectLine Speech channel definition */ -export interface DirectLineSpeechChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "DirectLineSpeechChannel"; - /** The set of properties specific to DirectLine Speech channel resource */ - properties?: DirectLineSpeechChannelProperties; -} - -/** Omnichannel channel definition */ -export interface Omnichannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "Omnichannel"; -} - -/** Telephony channel definition */ -export interface TelephonyChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "TelephonyChannel"; - /** The set of properties specific to Telephony channel resource */ - properties?: TelephonyChannelProperties; -} - -/** AcsChat channel definition */ -export interface AcsChatChannel extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "AcsChatChannel"; -} - -/** SearchAssistant definition */ -export interface SearchAssistant extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "SearchAssistant"; -} - -/** M365 Extensions definition */ -export interface M365Extensions extends Channel { - /** Polymorphic discriminator, which specifies the different types this object can be */ - channelName: "M365Extensions"; -} - -/** A site for the Webchat channel */ -export interface WebChatSite extends Site {} - -/** A site for the Direct Line channel */ -export interface DirectLineSite extends Site {} - -/** The ARM channel of list channel with keys operation response. */ -export interface ListChannelWithKeysResponse extends BotChannel { - /** The set of properties specific to bot channel resource */ - resource?: ChannelUnion; - /** Channel settings */ - setting?: ChannelSettings; - /** Provisioning state of the resource */ - provisioningState?: string; - /** Entity tag of the resource */ - entityTag?: string; - /** Changed time of the resource */ - changedTime?: string; -} - -/** Known values of {@link MsaAppType} that the service accepts. */ -export enum KnownMsaAppType { - /** UserAssignedMSI */ - UserAssignedMSI = "UserAssignedMSI", - /** SingleTenant */ - SingleTenant = "SingleTenant", - /** MultiTenant */ - MultiTenant = "MultiTenant" -} - -/** - * Defines values for MsaAppType. \ - * {@link KnownMsaAppType} can be used interchangeably with MsaAppType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **UserAssignedMSI** \ - * **SingleTenant** \ - * **MultiTenant** - */ -export type MsaAppType = string; - -/** Known values of {@link PublicNetworkAccess} that the service accepts. */ -export enum KnownPublicNetworkAccess { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled" -} - -/** - * Defines values for PublicNetworkAccess. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** - */ -export type PublicNetworkAccess = string; - -/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Rejected */ - Rejected = "Rejected" -} - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ -export enum KnownPrivateEndpointConnectionProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Creating */ - Creating = "Creating", - /** Deleting */ - Deleting = "Deleting", - /** Failed */ - Failed = "Failed" -} - -/** - * Defines values for PrivateEndpointConnectionProvisioningState. \ - * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Creating** \ - * **Deleting** \ - * **Failed** - */ -export type PrivateEndpointConnectionProvisioningState = string; - -/** Known values of {@link SkuName} that the service accepts. */ -export enum KnownSkuName { - /** F0 */ - F0 = "F0", - /** S1 */ - S1 = "S1" -} - -/** - * Defines values for SkuName. \ - * {@link KnownSkuName} can be used interchangeably with SkuName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **F0** \ - * **S1** - */ -export type SkuName = string; - -/** Known values of {@link SkuTier} that the service accepts. */ -export enum KnownSkuTier { - /** Free */ - Free = "Free", - /** Standard */ - Standard = "Standard" -} - -/** - * Defines values for SkuTier. \ - * {@link KnownSkuTier} can be used interchangeably with SkuTier, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Free** \ - * **Standard** - */ -export type SkuTier = string; - -/** Known values of {@link Kind} that the service accepts. */ -export enum KnownKind { - /** Sdk */ - Sdk = "sdk", - /** Designer */ - Designer = "designer", - /** Bot */ - Bot = "bot", - /** Function */ - Function = "function", - /** Azurebot */ - Azurebot = "azurebot" -} - -/** - * Defines values for Kind. \ - * {@link KnownKind} can be used interchangeably with Kind, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **sdk** \ - * **designer** \ - * **bot** \ - * **function** \ - * **azurebot** - */ -export type Kind = string; - -/** Known values of {@link OperationResultStatus} that the service accepts. */ -export enum KnownOperationResultStatus { - /** Canceled */ - Canceled = "Canceled", - /** Succeeded */ - Succeeded = "Succeeded", - /** Failed */ - Failed = "Failed", - /** Requested */ - Requested = "Requested", - /** Running */ - Running = "Running" -} - -/** - * Defines values for OperationResultStatus. \ - * {@link KnownOperationResultStatus} can be used interchangeably with OperationResultStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Canceled** \ - * **Succeeded** \ - * **Failed** \ - * **Requested** \ - * **Running** - */ -export type OperationResultStatus = string; -/** Defines values for ChannelName. */ -export type ChannelName = - | "AlexaChannel" - | "FacebookChannel" - | "EmailChannel" - | "KikChannel" - | "TelegramChannel" - | "SlackChannel" - | "MsTeamsChannel" - | "SkypeChannel" - | "WebChatChannel" - | "DirectLineChannel" - | "SmsChannel" - | "LineChannel" - | "DirectLineSpeechChannel" - | "OutlookChannel" - | "Omnichannel" - | "TelephonyChannel" - | "AcsChatChannel" - | "SearchAssistant" - | "M365Extensions"; -/** Defines values for RegenerateKeysChannelName. */ -export type RegenerateKeysChannelName = "WebChatChannel" | "DirectLineChannel"; -/** Defines values for Key. */ -export type Key = "key1" | "key2"; -/** Defines values for EmailChannelAuthMethod. */ -export type EmailChannelAuthMethod = 0 | 1; - -/** Optional parameters. */ -export interface BotsCreateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type BotsCreateResponse = Bot; - -/** Optional parameters. */ -export interface BotsUpdateOptionalParams extends coreClient.OperationOptions { - /** Specifies the location of the resource. */ - location?: string; - /** Contains resource tags defined as key/value pairs. */ - tags?: { [propertyName: string]: string }; - /** Gets or sets the SKU of the resource. */ - sku?: Sku; - /** Required. Gets or sets the Kind of the resource. */ - kind?: Kind; - /** Entity Tag */ - etag?: string; - /** The set of properties specific to bot resource */ - properties?: BotProperties; -} - -/** Contains response data for the update operation. */ -export type BotsUpdateResponse = Bot; - -/** Optional parameters. */ -export interface BotsDeleteOptionalParams extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface BotsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type BotsGetResponse = Bot; - -/** Optional parameters. */ -export interface BotsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type BotsListByResourceGroupResponse = BotResponseList; - -/** Optional parameters. */ -export interface BotsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type BotsListResponse = BotResponseList; - -/** Optional parameters. */ -export interface BotsGetCheckNameAvailabilityOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getCheckNameAvailability operation. */ -export type BotsGetCheckNameAvailabilityResponse = CheckNameAvailabilityResponseBody; - -/** Optional parameters. */ -export interface BotsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type BotsListByResourceGroupNextResponse = BotResponseList; - -/** Optional parameters. */ -export interface BotsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type BotsListNextResponse = BotResponseList; - -/** Optional parameters. */ -export interface ChannelsCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type ChannelsCreateResponse = BotChannel; - -/** Optional parameters. */ -export interface ChannelsUpdateOptionalParams - extends coreClient.OperationOptions { - /** Specifies the location of the resource. */ - location?: string; - /** Contains resource tags defined as key/value pairs. */ - tags?: { [propertyName: string]: string }; - /** Gets or sets the SKU of the resource. */ - sku?: Sku; - /** Required. Gets or sets the Kind of the resource. */ - kind?: Kind; - /** Entity Tag */ - etag?: string; - /** The set of properties specific to bot channel resource */ - properties?: ChannelUnion; -} - -/** Contains response data for the update operation. */ -export type ChannelsUpdateResponse = BotChannel; - -/** Optional parameters. */ -export interface ChannelsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface ChannelsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ChannelsGetResponse = BotChannel; - -/** Optional parameters. */ -export interface ChannelsListWithKeysOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listWithKeys operation. */ -export type ChannelsListWithKeysResponse = ListChannelWithKeysResponse; - -/** Optional parameters. */ -export interface ChannelsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ChannelsListByResourceGroupResponse = ChannelResponseList; - -/** Optional parameters. */ -export interface ChannelsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ChannelsListByResourceGroupNextResponse = ChannelResponseList; - -/** Optional parameters. */ -export interface DirectLineRegenerateKeysOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the regenerateKeys operation. */ -export type DirectLineRegenerateKeysResponse = BotChannel; - -/** Optional parameters. */ -export interface EmailCreateSignInUrlOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createSignInUrl operation. */ -export type EmailCreateSignInUrlResponse = CreateEmailSignInUrlResponse; - -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationEntityListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationEntityListResult; - -/** Optional parameters. */ -export interface BotConnectionListServiceProvidersOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listServiceProviders operation. */ -export type BotConnectionListServiceProvidersResponse = ServiceProviderResponseList; - -/** Optional parameters. */ -export interface BotConnectionListWithSecretsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listWithSecrets operation. */ -export type BotConnectionListWithSecretsResponse = ConnectionSetting; - -/** Optional parameters. */ -export interface BotConnectionCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type BotConnectionCreateResponse = ConnectionSetting; - -/** Optional parameters. */ -export interface BotConnectionUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type BotConnectionUpdateResponse = ConnectionSetting; - -/** Optional parameters. */ -export interface BotConnectionGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type BotConnectionGetResponse = ConnectionSetting; - -/** Optional parameters. */ -export interface BotConnectionDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface BotConnectionListByBotServiceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBotService operation. */ -export type BotConnectionListByBotServiceResponse = ConnectionSettingResponseList; - -/** Optional parameters. */ -export interface BotConnectionListByBotServiceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBotServiceNext operation. */ -export type BotConnectionListByBotServiceNextResponse = ConnectionSettingResponseList; - -/** Optional parameters. */ -export interface QnAMakerEndpointKeysGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type QnAMakerEndpointKeysGetResponse = QnAMakerEndpointKeysResponse; - -/** Optional parameters. */ -export interface HostSettingsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type HostSettingsGetResponse = HostSettingsResponse; - -/** Optional parameters. */ -export interface OperationResultsGetOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the get operation. */ -export type OperationResultsGetResponse = OperationResultsDescription; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface PrivateLinkResourcesListByBotResourceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBotResource operation. */ -export type PrivateLinkResourcesListByBotResourceResponse = PrivateLinkResourceListResult; - -/** Optional parameters. */ -export interface AzureBotServiceOptionalParams - extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + OperationEntity, + OperationDisplayInfo, + ErrorModel, + ErrorBody, + Bot, + BotProperties, + KnownMsaAppType, + MsaAppType, + KnownPublicNetworkAccess, + PublicNetworkAccess, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPrivateEndpointConnectionProvisioningState, + PrivateEndpointConnectionProvisioningState, + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationProperties, + KnownProvisioningState, + ProvisioningState, + ProvisioningIssue, + ProvisioningIssueProperties, + KnownSeverity, + Severity, + NspAccessRule, + NspAccessRuleProperties, + KnownNspAccessRuleDirection, + NspAccessRuleDirection, + NspAccessRulePropertiesSubscriptionsItem, + NetworkSecurityPerimeter, + ResourceAssociation, + KnownAccessMode, + AccessMode, + Profile, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + KnownKind, + Kind, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TrackedResource, + CreateEmailSignInUrlResponse, + CreateEmailSignInUrlResponseProperties, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + PrivateLinkResourceBase, + BotChannel, + Channel, + ChannelUnion, + AlexaChannel, + AlexaChannelProperties, + FacebookChannel, + FacebookChannelProperties, + FacebookPage, + EmailChannel, + EmailChannelProperties, + EmailChannelAuthMethod, + OutlookChannel, + MsTeamsChannel, + MsTeamsChannelProperties, + SkypeChannel, + SkypeChannelProperties, + KikChannel, + KikChannelProperties, + WebChatChannel, + WebChatChannelProperties, + WebChatSite, + DirectLineChannel, + DirectLineChannelProperties, + DirectLineSite, + TelegramChannel, + TelegramChannelProperties, + SmsChannel, + SmsChannelProperties, + SlackChannel, + SlackChannelProperties, + LineChannel, + LineChannelProperties, + LineRegistration, + DirectLineSpeechChannel, + DirectLineSpeechChannelProperties, + Omnichannel, + TelephonyChannel, + TelephonyChannelProperties, + TelephonyPhoneNumbers, + TelephonyChannelResourceApiConfiguration, + AcsChatChannel, + SearchAssistant, + M365Extensions, + Site, + ListChannelWithKeysResponse, + ChannelSettings, + SiteInfo, + Key, + ConnectionSetting, + ConnectionSettingProperties, + ConnectionSettingParameter, + CheckNameAvailabilityRequestBody, + CheckNameAvailabilityResponseBody, + ServiceProviderResponseList, + ServiceProvider, + ServiceProviderProperties, + ServiceProviderParameter, + ServiceProviderParameterMetadata, + ServiceProviderParameterMetadataConstraints, + QnAMakerEndpointKeysRequestBody, + QnAMakerEndpointKeysResponse, + HostSettingsResponse, + OperationResultsDescription, + KnownOperationResultStatus, + OperationResultStatus, + KnownVersions, +} from "./models.js"; diff --git a/sdk/botservice/arm-botservice/src/models/mappers.ts b/sdk/botservice/arm-botservice/src/models/mappers.ts deleted file mode 100644 index e3db1d8c234b..000000000000 --- a/sdk/botservice/arm-botservice/src/models/mappers.ts +++ /dev/null @@ -1,2914 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -export const BotProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BotProperties", - modelProperties: { - displayName: { - serializedName: "displayName", - required: true, - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - iconUrl: { - defaultValue: "", - serializedName: "iconUrl", - type: { - name: "String" - } - }, - endpoint: { - serializedName: "endpoint", - required: true, - nullable: true, - type: { - name: "String" - } - }, - endpointVersion: { - serializedName: "endpointVersion", - readOnly: true, - type: { - name: "String" - } - }, - allSettings: { - serializedName: "allSettings", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - parameters: { - serializedName: "parameters", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - manifestUrl: { - serializedName: "manifestUrl", - type: { - name: "String" - } - }, - msaAppType: { - serializedName: "msaAppType", - type: { - name: "String" - } - }, - msaAppId: { - serializedName: "msaAppId", - required: true, - type: { - name: "String" - } - }, - msaAppTenantId: { - serializedName: "msaAppTenantId", - type: { - name: "String" - } - }, - msaAppMSIResourceId: { - serializedName: "msaAppMSIResourceId", - type: { - name: "String" - } - }, - configuredChannels: { - serializedName: "configuredChannels", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - enabledChannels: { - serializedName: "enabledChannels", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - developerAppInsightKey: { - serializedName: "developerAppInsightKey", - type: { - name: "String" - } - }, - developerAppInsightsApiKey: { - serializedName: "developerAppInsightsApiKey", - type: { - name: "String" - } - }, - developerAppInsightsApplicationId: { - serializedName: "developerAppInsightsApplicationId", - type: { - name: "String" - } - }, - luisAppIds: { - serializedName: "luisAppIds", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - luisKey: { - serializedName: "luisKey", - type: { - name: "String" - } - }, - isCmekEnabled: { - defaultValue: false, - serializedName: "isCmekEnabled", - type: { - name: "Boolean" - } - }, - cmekKeyVaultUrl: { - serializedName: "cmekKeyVaultUrl", - type: { - name: "String" - } - }, - cmekEncryptionStatus: { - serializedName: "cmekEncryptionStatus", - readOnly: true, - type: { - name: "String" - } - }, - tenantId: { - serializedName: "tenantId", - type: { - name: "String" - } - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "publicNetworkAccess", - type: { - name: "String" - } - }, - isStreamingSupported: { - defaultValue: false, - serializedName: "isStreamingSupported", - type: { - name: "Boolean" - } - }, - isDeveloperAppInsightsApiKeySet: { - serializedName: "isDeveloperAppInsightsApiKeySet", - readOnly: true, - type: { - name: "Boolean" - } - }, - migrationToken: { - serializedName: "migrationToken", - readOnly: true, - type: { - name: "String" - } - }, - disableLocalAuth: { - serializedName: "disableLocalAuth", - type: { - name: "Boolean" - } - }, - schemaTransformationVersion: { - serializedName: "schemaTransformationVersion", - nullable: true, - type: { - name: "String" - } - }, - storageResourceId: { - serializedName: "storageResourceId", - type: { - name: "String" - } - }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } - } - }, - openWithHint: { - serializedName: "openWithHint", - type: { - name: "String" - } - }, - appPasswordHint: { - serializedName: "appPasswordHint", - type: { - name: "String" - } - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - publishingCredentials: { - serializedName: "publishingCredentials", - type: { - name: "String" - } - } - } - } -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - actionsRequired: { - serializedName: "actionsRequired", - type: { - name: "String" - } - } - } - } -}; - -export const PrivateLinkResourceBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceBase", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - kind: { - serializedName: "kind", - nullable: true, - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - zones: { - serializedName: "zones", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const Sku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Sku", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - tier: { - serializedName: "tier", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ErrorModel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorModel", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorBody" - } - } - } - } -}; - -export const ErrorBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorBody", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const BotResponseList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BotResponseList", - modelProperties: { - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Bot" - } - } - } - } - } - } -}; - -export const Channel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Channel", - uberParent: "Channel", - polymorphicDiscriminator: { - serializedName: "channelName", - clientName: "channelName" - }, - modelProperties: { - channelName: { - serializedName: "channelName", - required: true, - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - nullable: true, - type: { - name: "String" - } - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - location: { - defaultValue: "global", - serializedName: "location", - type: { - name: "String" - } - } - } - } -}; - -export const ChannelSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ChannelSettings", - modelProperties: { - extensionKey1: { - defaultValue: "", - serializedName: "extensionKey1", - type: { - name: "String" - } - }, - extensionKey2: { - defaultValue: "", - serializedName: "extensionKey2", - type: { - name: "String" - } - }, - sites: { - serializedName: "sites", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Site" - } - } - } - }, - channelId: { - serializedName: "channelId", - type: { - name: "String" - } - }, - channelDisplayName: { - serializedName: "channelDisplayName", - type: { - name: "String" - } - }, - botId: { - serializedName: "botId", - type: { - name: "String" - } - }, - botIconUrl: { - serializedName: "botIconUrl", - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - type: { - name: "Boolean" - } - }, - disableLocalAuth: { - serializedName: "disableLocalAuth", - type: { - name: "Boolean" - } - }, - requireTermsAgreement: { - serializedName: "requireTermsAgreement", - type: { - name: "Boolean" - } - } - } - } -}; - -export const Site: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Site", - modelProperties: { - tenantId: { - serializedName: "tenantId", - type: { - name: "String" - } - }, - siteId: { - serializedName: "siteId", - readOnly: true, - type: { - name: "String" - } - }, - siteName: { - serializedName: "siteName", - required: true, - type: { - name: "String" - } - }, - key: { - serializedName: "key", - readOnly: true, - type: { - name: "String" - } - }, - key2: { - serializedName: "key2", - readOnly: true, - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - }, - isTokenEnabled: { - serializedName: "isTokenEnabled", - readOnly: true, - type: { - name: "Boolean" - } - }, - isEndpointParametersEnabled: { - serializedName: "isEndpointParametersEnabled", - type: { - name: "Boolean" - } - }, - isDetailedLoggingEnabled: { - serializedName: "isDetailedLoggingEnabled", - type: { - name: "Boolean" - } - }, - isBlockUserUploadEnabled: { - serializedName: "isBlockUserUploadEnabled", - nullable: true, - type: { - name: "Boolean" - } - }, - isNoStorageEnabled: { - serializedName: "isNoStorageEnabled", - type: { - name: "Boolean" - } - }, - eTag: { - serializedName: "eTag", - type: { - name: "String" - } - }, - appId: { - serializedName: "appId", - type: { - name: "String" - } - }, - isV1Enabled: { - serializedName: "isV1Enabled", - type: { - name: "Boolean" - } - }, - isV3Enabled: { - serializedName: "isV3Enabled", - type: { - name: "Boolean" - } - }, - isSecureSiteEnabled: { - serializedName: "isSecureSiteEnabled", - type: { - name: "Boolean" - } - }, - trustedOrigins: { - serializedName: "trustedOrigins", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - isWebChatSpeechEnabled: { - defaultValue: false, - serializedName: "isWebChatSpeechEnabled", - type: { - name: "Boolean" - } - }, - isWebchatPreviewEnabled: { - defaultValue: false, - serializedName: "isWebchatPreviewEnabled", - type: { - name: "Boolean" - } - } - } - } -}; - -export const ChannelResponseList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ChannelResponseList", - modelProperties: { - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BotChannel" - } - } - } - } - } - } -}; - -export const SiteInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SiteInfo", - modelProperties: { - siteName: { - serializedName: "siteName", - required: true, - type: { - name: "String" - } - }, - key: { - serializedName: "key", - required: true, - type: { - name: "Enum", - allowedValues: ["key1", "key2"] - } - } - } - } -}; - -export const CreateEmailSignInUrlResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CreateEmailSignInUrlResponse", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "CreateEmailSignInUrlResponseProperties" - } - } - } - } -}; - -export const CreateEmailSignInUrlResponseProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CreateEmailSignInUrlResponseProperties", - modelProperties: { - url: { - serializedName: "url", - type: { - name: "String" - } - } - } - } -}; - -export const CheckNameAvailabilityRequestBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckNameAvailabilityRequestBody", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - } - } - } -}; - -export const CheckNameAvailabilityResponseBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckNameAvailabilityResponseBody", - modelProperties: { - valid: { - serializedName: "valid", - type: { - name: "Boolean" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - }, - absCode: { - serializedName: "absCode", - type: { - name: "String" - } - } - } - } -}; - -export const OperationEntityListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationEntityListResult", - modelProperties: { - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationEntity" - } - } - } - } - } - } -}; - -export const OperationEntity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationEntity", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplayInfo" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - -export const OperationDisplayInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplayInfo", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - } - } - } -}; - -export const ServiceProviderResponseList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceProviderResponseList", - modelProperties: { - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ServiceProvider" - } - } - } - } - } - } -}; - -export const ServiceProvider: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceProvider", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ServiceProviderProperties" - } - } - } - } -}; - -export const ServiceProviderProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceProviderProperties", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - readOnly: true, - type: { - name: "String" - } - }, - serviceProviderName: { - serializedName: "serviceProviderName", - readOnly: true, - type: { - name: "String" - } - }, - devPortalUrl: { - serializedName: "devPortalUrl", - readOnly: true, - type: { - name: "String" - } - }, - iconUrl: { - defaultValue: "", - serializedName: "iconUrl", - type: { - name: "String" - } - }, - parameters: { - serializedName: "parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ServiceProviderParameter" - } - } - } - } - } - } -}; - -export const ServiceProviderParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceProviderParameter", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - readOnly: true, - type: { - name: "String" - } - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String" - } - }, - helpUrl: { - serializedName: "helpUrl", - readOnly: true, - type: { - name: "String" - } - }, - default: { - serializedName: "default", - readOnly: true, - type: { - name: "String" - } - }, - metadata: { - serializedName: "metadata", - type: { - name: "Composite", - className: "ServiceProviderParameterMetadata" - } - } - } - } -}; - -export const ServiceProviderParameterMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceProviderParameterMetadata", - modelProperties: { - constraints: { - serializedName: "constraints", - type: { - name: "Composite", - className: "ServiceProviderParameterMetadataConstraints" - } - } - } - } -}; - -export const ServiceProviderParameterMetadataConstraints: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceProviderParameterMetadataConstraints", - modelProperties: { - required: { - serializedName: "required", - type: { - name: "Boolean" - } - } - } - } -}; - -export const QnAMakerEndpointKeysRequestBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QnAMakerEndpointKeysRequestBody", - modelProperties: { - hostname: { - serializedName: "hostname", - type: { - name: "String" - } - }, - authkey: { - serializedName: "authkey", - type: { - name: "String" - } - } - } - } -}; - -export const QnAMakerEndpointKeysResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QnAMakerEndpointKeysResponse", - modelProperties: { - primaryEndpointKey: { - serializedName: "primaryEndpointKey", - type: { - name: "String" - } - }, - secondaryEndpointKey: { - serializedName: "secondaryEndpointKey", - type: { - name: "String" - } - }, - installedVersion: { - serializedName: "installedVersion", - type: { - name: "String" - } - }, - lastStableVersion: { - serializedName: "lastStableVersion", - type: { - name: "String" - } - } - } - } -}; - -export const ConnectionSettingProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ConnectionSettingProperties", - modelProperties: { - clientId: { - serializedName: "clientId", - type: { - name: "String" - } - }, - settingId: { - serializedName: "settingId", - readOnly: true, - type: { - name: "String" - } - }, - clientSecret: { - serializedName: "clientSecret", - type: { - name: "String" - } - }, - scopes: { - defaultValue: "", - serializedName: "scopes", - type: { - name: "String" - } - }, - serviceProviderId: { - serializedName: "serviceProviderId", - type: { - name: "String" - } - }, - serviceProviderDisplayName: { - serializedName: "serviceProviderDisplayName", - type: { - name: "String" - } - }, - parameters: { - serializedName: "parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ConnectionSettingParameter" - } - } - } - }, - provisioningState: { - serializedName: "provisioningState", - type: { - name: "String" - } - } - } - } -}; - -export const ConnectionSettingParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ConnectionSettingParameter", - modelProperties: { - key: { - serializedName: "key", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - nullable: true, - type: { - name: "String" - } - } - } - } -}; - -export const ConnectionSettingResponseList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ConnectionSettingResponseList", - modelProperties: { - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ConnectionSetting" - } - } - } - } - } - } -}; - -export const HostSettingsResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "HostSettingsResponse", - modelProperties: { - oAuthUrl: { - serializedName: "OAuthUrl", - type: { - name: "String" - } - }, - toBotFromChannelOpenIdMetadataUrl: { - serializedName: "ToBotFromChannelOpenIdMetadataUrl", - type: { - name: "String" - } - }, - toBotFromChannelTokenIssuer: { - serializedName: "ToBotFromChannelTokenIssuer", - type: { - name: "String" - } - }, - toBotFromEmulatorOpenIdMetadataUrl: { - serializedName: "ToBotFromEmulatorOpenIdMetadataUrl", - type: { - name: "String" - } - }, - toChannelFromBotLoginUrl: { - serializedName: "ToChannelFromBotLoginUrl", - type: { - name: "String" - } - }, - toChannelFromBotOAuthScope: { - serializedName: "ToChannelFromBotOAuthScope", - type: { - name: "String" - } - }, - validateAuthority: { - serializedName: "ValidateAuthority", - type: { - name: "Boolean" - } - }, - botOpenIdMetadata: { - serializedName: "BotOpenIdMetadata", - type: { - name: "String" - } - } - } - } -}; - -export const OperationResultsDescription: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationResultsDescription", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String" - } - }, - startTime: { - serializedName: "startTime", - readOnly: true, - type: { - name: "DateTime" - } - } - } - } -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } - } - } - } - } -}; - -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource" - } - } - } - } - } - } -}; - -export const AlexaChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlexaChannelProperties", - modelProperties: { - alexaSkillId: { - serializedName: "alexaSkillId", - required: true, - type: { - name: "String" - } - }, - urlFragment: { - serializedName: "urlFragment", - readOnly: true, - type: { - name: "String" - } - }, - serviceEndpointUri: { - serializedName: "serviceEndpointUri", - readOnly: true, - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const FacebookChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FacebookChannelProperties", - modelProperties: { - verifyToken: { - serializedName: "verifyToken", - readOnly: true, - type: { - name: "String" - } - }, - pages: { - serializedName: "pages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FacebookPage" - } - } - } - }, - appId: { - serializedName: "appId", - required: true, - type: { - name: "String" - } - }, - appSecret: { - serializedName: "appSecret", - type: { - name: "String" - } - }, - callbackUrl: { - serializedName: "callbackUrl", - readOnly: true, - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const FacebookPage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FacebookPage", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String" - } - }, - accessToken: { - serializedName: "accessToken", - type: { - name: "String" - } - } - } - } -}; - -export const EmailChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EmailChannelProperties", - modelProperties: { - emailAddress: { - serializedName: "emailAddress", - required: true, - type: { - name: "String" - } - }, - authMethod: { - serializedName: "authMethod", - type: { - name: "Enum", - allowedValues: [0, 1] - } - }, - password: { - serializedName: "password", - type: { - name: "String" - } - }, - magicCode: { - serializedName: "magicCode", - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const MsTeamsChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MsTeamsChannelProperties", - modelProperties: { - enableCalling: { - defaultValue: false, - serializedName: "enableCalling", - type: { - name: "Boolean" - } - }, - callingWebhook: { - serializedName: "callingWebhook", - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - }, - incomingCallRoute: { - serializedName: "incomingCallRoute", - type: { - name: "String" - } - }, - deploymentEnvironment: { - defaultValue: "FallbackDeploymentEnvironment", - serializedName: "deploymentEnvironment", - type: { - name: "String" - } - }, - acceptedTerms: { - serializedName: "acceptedTerms", - nullable: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const SkypeChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkypeChannelProperties", - modelProperties: { - enableMessaging: { - serializedName: "enableMessaging", - type: { - name: "Boolean" - } - }, - enableMediaCards: { - serializedName: "enableMediaCards", - type: { - name: "Boolean" - } - }, - enableVideo: { - serializedName: "enableVideo", - type: { - name: "Boolean" - } - }, - enableCalling: { - defaultValue: false, - serializedName: "enableCalling", - type: { - name: "Boolean" - } - }, - enableScreenSharing: { - serializedName: "enableScreenSharing", - type: { - name: "Boolean" - } - }, - enableGroups: { - serializedName: "enableGroups", - type: { - name: "Boolean" - } - }, - groupsMode: { - serializedName: "groupsMode", - type: { - name: "String" - } - }, - callingWebHook: { - serializedName: "callingWebHook", - type: { - name: "String" - } - }, - incomingCallRoute: { - serializedName: "incomingCallRoute", - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const KikChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KikChannelProperties", - modelProperties: { - userName: { - serializedName: "userName", - required: true, - type: { - name: "String" - } - }, - apiKey: { - serializedName: "apiKey", - type: { - name: "String" - } - }, - isValidated: { - serializedName: "isValidated", - type: { - name: "Boolean" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const WebChatChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WebChatChannelProperties", - modelProperties: { - webChatEmbedCode: { - serializedName: "webChatEmbedCode", - readOnly: true, - type: { - name: "String" - } - }, - sites: { - serializedName: "sites", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebChatSite" - } - } - } - } - } - } -}; - -export const DirectLineChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DirectLineChannelProperties", - modelProperties: { - sites: { - serializedName: "sites", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DirectLineSite" - } - } - } - }, - extensionKey1: { - defaultValue: "", - serializedName: "extensionKey1", - type: { - name: "String" - } - }, - extensionKey2: { - defaultValue: "", - serializedName: "extensionKey2", - type: { - name: "String" - } - }, - directLineEmbedCode: { - serializedName: "DirectLineEmbedCode", - type: { - name: "String" - } - } - } - } -}; - -export const TelegramChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TelegramChannelProperties", - modelProperties: { - accessToken: { - serializedName: "accessToken", - type: { - name: "String" - } - }, - isValidated: { - serializedName: "isValidated", - type: { - name: "Boolean" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const SmsChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SmsChannelProperties", - modelProperties: { - phone: { - serializedName: "phone", - required: true, - type: { - name: "String" - } - }, - accountSID: { - serializedName: "accountSID", - required: true, - type: { - name: "String" - } - }, - authToken: { - serializedName: "authToken", - type: { - name: "String" - } - }, - isValidated: { - serializedName: "isValidated", - type: { - name: "Boolean" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const SlackChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SlackChannelProperties", - modelProperties: { - clientId: { - serializedName: "clientId", - type: { - name: "String" - } - }, - clientSecret: { - serializedName: "clientSecret", - type: { - name: "String" - } - }, - verificationToken: { - serializedName: "verificationToken", - type: { - name: "String" - } - }, - scopes: { - serializedName: "scopes", - type: { - name: "String" - } - }, - landingPageUrl: { - serializedName: "landingPageUrl", - type: { - name: "String" - } - }, - redirectAction: { - serializedName: "redirectAction", - readOnly: true, - type: { - name: "String" - } - }, - lastSubmissionId: { - serializedName: "lastSubmissionId", - readOnly: true, - type: { - name: "String" - } - }, - registerBeforeOAuthFlow: { - serializedName: "registerBeforeOAuthFlow", - type: { - name: "Boolean" - } - }, - isValidated: { - serializedName: "IsValidated", - readOnly: true, - type: { - name: "Boolean" - } - }, - signingSecret: { - serializedName: "signingSecret", - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - required: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const LineChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LineChannelProperties", - modelProperties: { - lineRegistrations: { - serializedName: "lineRegistrations", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LineRegistration" - } - } - } - }, - callbackUrl: { - serializedName: "callbackUrl", - readOnly: true, - type: { - name: "String" - } - }, - isValidated: { - serializedName: "isValidated", - readOnly: true, - type: { - name: "Boolean" - } - } - } - } -}; - -export const LineRegistration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LineRegistration", - modelProperties: { - generatedId: { - serializedName: "generatedId", - readOnly: true, - type: { - name: "String" - } - }, - channelSecret: { - serializedName: "channelSecret", - type: { - name: "String" - } - }, - channelAccessToken: { - serializedName: "channelAccessToken", - type: { - name: "String" - } - } - } - } -}; - -export const DirectLineSpeechChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DirectLineSpeechChannelProperties", - modelProperties: { - cognitiveServiceResourceId: { - serializedName: "cognitiveServiceResourceId", - type: { - name: "String" - } - }, - cognitiveServiceRegion: { - serializedName: "cognitiveServiceRegion", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceSubscriptionKey: { - serializedName: "cognitiveServiceSubscriptionKey", - nullable: true, - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - type: { - name: "Boolean" - } - }, - customVoiceDeploymentId: { - serializedName: "customVoiceDeploymentId", - type: { - name: "String" - } - }, - customSpeechModelId: { - serializedName: "customSpeechModelId", - type: { - name: "String" - } - }, - isDefaultBotForCogSvcAccount: { - serializedName: "isDefaultBotForCogSvcAccount", - type: { - name: "Boolean" - } - } - } - } -}; - -export const TelephonyChannelProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TelephonyChannelProperties", - modelProperties: { - phoneNumbers: { - serializedName: "phoneNumbers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TelephonyPhoneNumbers" - } - } - } - }, - apiConfigurations: { - serializedName: "apiConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TelephonyChannelResourceApiConfiguration" - } - } - } - }, - cognitiveServiceSubscriptionKey: { - serializedName: "cognitiveServiceSubscriptionKey", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceRegion: { - serializedName: "cognitiveServiceRegion", - nullable: true, - type: { - name: "String" - } - }, - defaultLocale: { - serializedName: "defaultLocale", - nullable: true, - type: { - name: "String" - } - }, - premiumSKU: { - serializedName: "premiumSKU", - nullable: true, - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "isEnabled", - type: { - name: "Boolean" - } - } - } - } -}; - -export const TelephonyPhoneNumbers: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TelephonyPhoneNumbers", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - phoneNumber: { - serializedName: "phoneNumber", - type: { - name: "String" - } - }, - acsEndpoint: { - serializedName: "acsEndpoint", - nullable: true, - type: { - name: "String" - } - }, - acsSecret: { - serializedName: "acsSecret", - nullable: true, - type: { - name: "String" - } - }, - acsResourceId: { - serializedName: "acsResourceId", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceSubscriptionKey: { - serializedName: "cognitiveServiceSubscriptionKey", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceRegion: { - serializedName: "cognitiveServiceRegion", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceResourceId: { - serializedName: "cognitiveServiceResourceId", - nullable: true, - type: { - name: "String" - } - }, - defaultLocale: { - serializedName: "defaultLocale", - nullable: true, - type: { - name: "String" - } - }, - offerType: { - serializedName: "offerType", - nullable: true, - type: { - name: "String" - } - } - } - } -}; - -export const TelephonyChannelResourceApiConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TelephonyChannelResourceApiConfiguration", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - providerName: { - serializedName: "providerName", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceSubscriptionKey: { - serializedName: "cognitiveServiceSubscriptionKey", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceRegion: { - serializedName: "cognitiveServiceRegion", - nullable: true, - type: { - name: "String" - } - }, - cognitiveServiceResourceId: { - serializedName: "cognitiveServiceResourceId", - nullable: true, - type: { - name: "String" - } - }, - defaultLocale: { - serializedName: "defaultLocale", - nullable: true, - type: { - name: "String" - } - } - } - } -}; - -export const ConnectionItemName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ConnectionItemName", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...PrivateLinkResourceBase.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint" - } - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - groupIds: { - serializedName: "properties.groupIds", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - ...PrivateLinkResourceBase.type.modelProperties, - groupId: { - serializedName: "properties.groupId", - readOnly: true, - type: { - name: "String" - } - }, - requiredMembers: { - serializedName: "properties.requiredMembers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - requiredZoneNames: { - serializedName: "properties.requiredZoneNames", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const Bot: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Bot", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "BotProperties" - } - } - } - } -}; - -export const BotChannel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BotChannel", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "Channel" - } - } - } - } -}; - -export const ConnectionSetting: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ConnectionSetting", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ConnectionSettingProperties" - } - } - } - } -}; - -export const AlexaChannel: coreClient.CompositeMapper = { - serializedName: "AlexaChannel", - type: { - name: "Composite", - className: "AlexaChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "AlexaChannelProperties" - } - } - } - } -}; - -export const FacebookChannel: coreClient.CompositeMapper = { - serializedName: "FacebookChannel", - type: { - name: "Composite", - className: "FacebookChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "FacebookChannelProperties" - } - } - } - } -}; - -export const EmailChannel: coreClient.CompositeMapper = { - serializedName: "EmailChannel", - type: { - name: "Composite", - className: "EmailChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "EmailChannelProperties" - } - } - } - } -}; - -export const OutlookChannel: coreClient.CompositeMapper = { - serializedName: "OutlookChannel", - type: { - name: "Composite", - className: "OutlookChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties - } - } -}; - -export const MsTeamsChannel: coreClient.CompositeMapper = { - serializedName: "MsTeamsChannel", - type: { - name: "Composite", - className: "MsTeamsChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "MsTeamsChannelProperties" - } - } - } - } -}; - -export const SkypeChannel: coreClient.CompositeMapper = { - serializedName: "SkypeChannel", - type: { - name: "Composite", - className: "SkypeChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "SkypeChannelProperties" - } - } - } - } -}; - -export const KikChannel: coreClient.CompositeMapper = { - serializedName: "KikChannel", - type: { - name: "Composite", - className: "KikChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "KikChannelProperties" - } - } - } - } -}; - -export const WebChatChannel: coreClient.CompositeMapper = { - serializedName: "WebChatChannel", - type: { - name: "Composite", - className: "WebChatChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "WebChatChannelProperties" - } - } - } - } -}; - -export const DirectLineChannel: coreClient.CompositeMapper = { - serializedName: "DirectLineChannel", - type: { - name: "Composite", - className: "DirectLineChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DirectLineChannelProperties" - } - } - } - } -}; - -export const TelegramChannel: coreClient.CompositeMapper = { - serializedName: "TelegramChannel", - type: { - name: "Composite", - className: "TelegramChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "TelegramChannelProperties" - } - } - } - } -}; - -export const SmsChannel: coreClient.CompositeMapper = { - serializedName: "SmsChannel", - type: { - name: "Composite", - className: "SmsChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "SmsChannelProperties" - } - } - } - } -}; - -export const SlackChannel: coreClient.CompositeMapper = { - serializedName: "SlackChannel", - type: { - name: "Composite", - className: "SlackChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "SlackChannelProperties" - } - } - } - } -}; - -export const LineChannel: coreClient.CompositeMapper = { - serializedName: "LineChannel", - type: { - name: "Composite", - className: "LineChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "LineChannelProperties" - } - } - } - } -}; - -export const DirectLineSpeechChannel: coreClient.CompositeMapper = { - serializedName: "DirectLineSpeechChannel", - type: { - name: "Composite", - className: "DirectLineSpeechChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DirectLineSpeechChannelProperties" - } - } - } - } -}; - -export const Omnichannel: coreClient.CompositeMapper = { - serializedName: "Omnichannel", - type: { - name: "Composite", - className: "Omnichannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties - } - } -}; - -export const TelephonyChannel: coreClient.CompositeMapper = { - serializedName: "TelephonyChannel", - type: { - name: "Composite", - className: "TelephonyChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "TelephonyChannelProperties" - } - } - } - } -}; - -export const AcsChatChannel: coreClient.CompositeMapper = { - serializedName: "AcsChatChannel", - type: { - name: "Composite", - className: "AcsChatChannel", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties - } - } -}; - -export const SearchAssistant: coreClient.CompositeMapper = { - serializedName: "SearchAssistant", - type: { - name: "Composite", - className: "SearchAssistant", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties - } - } -}; - -export const M365Extensions: coreClient.CompositeMapper = { - serializedName: "M365Extensions", - type: { - name: "Composite", - className: "M365Extensions", - uberParent: "Channel", - polymorphicDiscriminator: Channel.type.polymorphicDiscriminator, - modelProperties: { - ...Channel.type.modelProperties - } - } -}; - -export const WebChatSite: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WebChatSite", - modelProperties: { - ...Site.type.modelProperties - } - } -}; - -export const DirectLineSite: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DirectLineSite", - modelProperties: { - ...Site.type.modelProperties - } - } -}; - -export const ListChannelWithKeysResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ListChannelWithKeysResponse", - modelProperties: { - ...BotChannel.type.modelProperties, - resource: { - serializedName: "resource", - type: { - name: "Composite", - className: "Channel" - } - }, - setting: { - serializedName: "setting", - type: { - name: "Composite", - className: "ChannelSettings" - } - }, - provisioningState: { - serializedName: "provisioningState", - type: { - name: "String" - } - }, - entityTag: { - serializedName: "entityTag", - type: { - name: "String" - } - }, - changedTime: { - serializedName: "changedTime", - type: { - name: "String" - } - } - } - } -}; - -export let discriminators = { - Channel: Channel, - "Channel.AlexaChannel": AlexaChannel, - "Channel.FacebookChannel": FacebookChannel, - "Channel.EmailChannel": EmailChannel, - "Channel.OutlookChannel": OutlookChannel, - "Channel.MsTeamsChannel": MsTeamsChannel, - "Channel.SkypeChannel": SkypeChannel, - "Channel.KikChannel": KikChannel, - "Channel.WebChatChannel": WebChatChannel, - "Channel.DirectLineChannel": DirectLineChannel, - "Channel.TelegramChannel": TelegramChannel, - "Channel.SmsChannel": SmsChannel, - "Channel.SlackChannel": SlackChannel, - "Channel.LineChannel": LineChannel, - "Channel.DirectLineSpeechChannel": DirectLineSpeechChannel, - "Channel.Omnichannel": Omnichannel, - "Channel.TelephonyChannel": TelephonyChannel, - "Channel.AcsChatChannel": AcsChatChannel, - "Channel.SearchAssistant": SearchAssistant, - "Channel.M365Extensions": M365Extensions -}; diff --git a/sdk/botservice/arm-botservice/src/models/models.ts b/sdk/botservice/arm-botservice/src/models/models.ts new file mode 100644 index 000000000000..8f0b5607098f --- /dev/null +++ b/sdk/botservice/arm-botservice/src/models/models.ts @@ -0,0 +1,3548 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** The list of bot service operation response. */ +export interface _OperationEntityListResult { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of operations. */ + value: OperationEntity[]; +} + +export function _operationEntityListResultDeserializer(item: any): _OperationEntityListResult { + return { + nextLink: item["nextLink"], + value: operationEntityArrayDeserializer(item["value"]), + }; +} + +export function operationEntityArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationEntityDeserializer(item); + }); +} + +/** The operations supported by Bot Service Management. */ +export interface OperationEntity { + /** Operation name: {provider}/{resource}/{operation}. */ + name?: string; + /** The operation supported by Bot Service Management. */ + display?: OperationDisplayInfo; + /** The origin of the operation. */ + origin?: string; + /** Additional properties. */ + properties?: any; +} + +export function operationEntityDeserializer(item: any): OperationEntity { + return { + name: item["name"], + display: !item["display"] ? item["display"] : operationDisplayInfoDeserializer(item["display"]), + origin: item["origin"], + properties: item["properties"], + }; +} + +/** The operation supported by Bot Service Management. */ +export interface OperationDisplayInfo { + /** The description of the operation. */ + description?: string; + /** The action that users can perform, based on their permission level. */ + operation?: string; + /** Service provider: Microsoft Bot Service. */ + provider?: string; + /** Resource on which the operation is performed. */ + resource?: string; +} + +export function operationDisplayInfoDeserializer(item: any): OperationDisplayInfo { + return { + description: item["description"], + operation: item["operation"], + provider: item["provider"], + resource: item["resource"], + }; +} + +/** Bot Service error object. */ +export interface ErrorModel { + /** The error body. */ + error?: ErrorBody; +} + +export function errorDeserializer(item: any): ErrorModel { + return { + error: !item["error"] ? item["error"] : errorBodyDeserializer(item["error"]), + }; +} + +/** Bot Service error body. */ +export interface ErrorBody { + /** error code */ + code: string; + /** error message */ + message: string; +} + +export function errorBodyDeserializer(item: any): ErrorBody { + return { + code: item["code"], + message: item["message"], + }; +} + +/** Bot resource definition */ +export interface Bot extends TrackedResource { + /** The set of properties specific to bot resource */ + properties?: BotProperties; + /** Gets or sets the SKU of the resource. */ + sku?: Sku; + /** Required. Gets or sets the Kind of the resource. */ + kind?: Kind; + /** Entity Tag. */ + etag?: string; + /** Entity zones */ + readonly zones?: string[]; +} + +export function botSerializer(item: Bot): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : botPropertiesSerializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + kind: item["kind"], + etag: item["etag"], + }; +} + +export function botDeserializer(item: any): Bot { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : botPropertiesDeserializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + kind: item["kind"], + etag: item["etag"], + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** The parameters to provide for the Bot. */ +export interface BotProperties { + /** The Name of the bot */ + displayName: string; + /** The description of the bot */ + description?: string; + /** The Icon Url of the bot */ + iconUrl?: string; + /** The bot's endpoint */ + endpoint: string | null; + /** The bot's endpoint version */ + readonly endpointVersion?: string; + /** Contains resource all settings defined as key/value pairs. */ + allSettings?: Record; + /** Contains resource parameters defined as key/value pairs. */ + parameters?: Record; + /** The bot's manifest url */ + manifestUrl?: string; + /** Microsoft App Type for the bot */ + msaAppType?: MsaAppType; + /** Microsoft App Id for the bot */ + msaAppId: string; + /** Microsoft App Tenant Id for the bot */ + msaAppTenantId?: string; + /** Microsoft App Managed Identity Resource Id for the bot */ + msaAppMSIResourceId?: string; + /** Collection of channels for which the bot is configured */ + readonly configuredChannels?: string[]; + /** Collection of channels for which the bot is enabled */ + readonly enabledChannels?: string[]; + /** The Application Insights key */ + developerAppInsightKey?: string; + /** The Application Insights Api Key */ + developerAppInsightsApiKey?: string; + /** The Application Insights App Id */ + developerAppInsightsApplicationId?: string; + /** Collection of LUIS App Ids */ + luisAppIds?: string[]; + /** The LUIS Key */ + luisKey?: string; + /** Whether Cmek is enabled */ + isCmekEnabled?: boolean; + /** The CMK Url */ + cmekKeyVaultUrl?: string; + /** The CMK encryption status */ + readonly cmekEncryptionStatus?: string; + /** The Tenant Id for the bot */ + tenantId?: string; + /** Whether the bot is in an isolated network */ + publicNetworkAccess?: PublicNetworkAccess; + /** Whether the bot is streaming supported */ + isStreamingSupported?: boolean; + /** Whether the bot is developerAppInsightsApiKey set */ + readonly isDeveloperAppInsightsApiKeySet?: boolean; + /** Token used to migrate non Azure bot to azure subscription */ + readonly migrationToken?: string; + /** Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ + disableLocalAuth?: boolean; + /** The channel schema transformation version for the bot */ + schemaTransformationVersion?: string | null; + /** The storage resourceId for the bot */ + storageResourceId?: string; + /** List of Private Endpoint Connections configured for the bot */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** List of Network Security Perimeter configurations for the bot */ + readonly networkSecurityPerimeterConfigurations?: NetworkSecurityPerimeterConfiguration[]; + /** The hint to browser (e.g. protocol handler) on how to open the bot for authoring */ + openWithHint?: string; + /** The hint (e.g. keyVault secret resourceId) on how to fetch the app secret */ + appPasswordHint?: string; + /** Provisioning state of the resource */ + readonly provisioningState?: string; + /** Publishing credentials of the resource */ + publishingCredentials?: string; +} + +export function botPropertiesSerializer(item: BotProperties): any { + return { + displayName: item["displayName"], + description: item["description"], + iconUrl: item["iconUrl"], + endpoint: item["endpoint"], + allSettings: item["allSettings"], + parameters: item["parameters"], + manifestUrl: item["manifestUrl"], + msaAppType: item["msaAppType"], + msaAppId: item["msaAppId"], + msaAppTenantId: item["msaAppTenantId"], + msaAppMSIResourceId: item["msaAppMSIResourceId"], + developerAppInsightKey: item["developerAppInsightKey"], + developerAppInsightsApiKey: item["developerAppInsightsApiKey"], + developerAppInsightsApplicationId: item["developerAppInsightsApplicationId"], + luisAppIds: !item["luisAppIds"] + ? item["luisAppIds"] + : item["luisAppIds"].map((p: any) => { + return p; + }), + luisKey: item["luisKey"], + isCmekEnabled: item["isCmekEnabled"], + cmekKeyVaultUrl: item["cmekKeyVaultUrl"], + tenantId: item["tenantId"], + publicNetworkAccess: item["publicNetworkAccess"], + isStreamingSupported: item["isStreamingSupported"], + disableLocalAuth: item["disableLocalAuth"], + schemaTransformationVersion: item["schemaTransformationVersion"], + storageResourceId: item["storageResourceId"], + openWithHint: item["openWithHint"], + appPasswordHint: item["appPasswordHint"], + publishingCredentials: item["publishingCredentials"], + }; +} + +export function botPropertiesDeserializer(item: any): BotProperties { + return { + displayName: item["displayName"], + description: item["description"], + iconUrl: item["iconUrl"], + endpoint: item["endpoint"], + endpointVersion: item["endpointVersion"], + allSettings: item["allSettings"], + parameters: item["parameters"], + manifestUrl: item["manifestUrl"], + msaAppType: item["msaAppType"], + msaAppId: item["msaAppId"], + msaAppTenantId: item["msaAppTenantId"], + msaAppMSIResourceId: item["msaAppMSIResourceId"], + configuredChannels: !item["configuredChannels"] + ? item["configuredChannels"] + : item["configuredChannels"].map((p: any) => { + return p; + }), + enabledChannels: !item["enabledChannels"] + ? item["enabledChannels"] + : item["enabledChannels"].map((p: any) => { + return p; + }), + developerAppInsightKey: item["developerAppInsightKey"], + developerAppInsightsApiKey: item["developerAppInsightsApiKey"], + developerAppInsightsApplicationId: item["developerAppInsightsApplicationId"], + luisAppIds: !item["luisAppIds"] + ? item["luisAppIds"] + : item["luisAppIds"].map((p: any) => { + return p; + }), + luisKey: item["luisKey"], + isCmekEnabled: item["isCmekEnabled"], + cmekKeyVaultUrl: item["cmekKeyVaultUrl"], + cmekEncryptionStatus: item["cmekEncryptionStatus"], + tenantId: item["tenantId"], + publicNetworkAccess: item["publicNetworkAccess"], + isStreamingSupported: item["isStreamingSupported"], + isDeveloperAppInsightsApiKeySet: item["isDeveloperAppInsightsApiKeySet"], + migrationToken: item["migrationToken"], + disableLocalAuth: item["disableLocalAuth"], + schemaTransformationVersion: item["schemaTransformationVersion"], + storageResourceId: item["storageResourceId"], + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + networkSecurityPerimeterConfigurations: !item["networkSecurityPerimeterConfigurations"] + ? item["networkSecurityPerimeterConfigurations"] + : networkSecurityPerimeterConfigurationArrayDeserializer( + item["networkSecurityPerimeterConfigurations"], + ), + openWithHint: item["openWithHint"], + appPasswordHint: item["appPasswordHint"], + provisioningState: item["provisioningState"], + publishingCredentials: item["publishingCredentials"], + }; +} + +/** Microsoft App Type for the bot */ +export enum KnownMsaAppType { + UserAssignedMSI = "UserAssignedMSI", + SingleTenant = "SingleTenant", + MultiTenant = "MultiTenant", +} + +/** + * Microsoft App Type for the bot \ + * {@link KnownMsaAppType} can be used interchangeably with MsaAppType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **UserAssignedMSI** \ + * **SingleTenant** \ + * **MultiTenant** + */ +export type MsaAppType = string; + +/** Whether the bot is in an isolated network */ +export enum KnownPublicNetworkAccess { + Enabled = "Enabled", + Disabled = "Disabled", + SecuredByPerimeter = "SecuredByPerimeter", +} + +/** + * Whether the bot is in an isolated network \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **SecuredByPerimeter** + */ +export type PublicNetworkAccess = string; + +export function privateEndpointConnectionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionSerializer(item); + }); +} + +export function privateEndpointConnectionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionDeserializer(item); + }); +} + +/** The Private Endpoint Connection resource. */ +export interface PrivateEndpointConnection extends ProxyResource { + /** Resource properties. */ + properties?: PrivateEndpointConnectionProperties; +} + +export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { + return { + properties: !item["properties"] + ? item["properties"] + : privateEndpointConnectionPropertiesSerializer(item["properties"]), + }; +} + +export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : privateEndpointConnectionPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of the PrivateEndpointConnectProperties. */ +export interface PrivateEndpointConnectionProperties { + /** The resource of private end point. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** The provisioning state of the private endpoint connection resource. */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + /** Group ids */ + groupIds?: string[]; +} + +export function privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnectionProperties, +): any { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointSerializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateSerializer( + item["privateLinkServiceConnectionState"], + ), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +export function privateEndpointConnectionPropertiesDeserializer( + item: any, +): PrivateEndpointConnectionProperties { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( + item["privateLinkServiceConnectionState"], + ), + provisioningState: item["provisioningState"], + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +/** The Private Endpoint resource. */ +export interface PrivateEndpoint { + /** The ARM identifier for Private Endpoint */ + readonly id?: string; +} + +export function privateEndpointSerializer(item: PrivateEndpoint): any { + return item; +} + +export function privateEndpointDeserializer(item: any): PrivateEndpoint { + return { + id: item["id"], + }; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +export function privateLinkServiceConnectionStateSerializer( + item: PrivateLinkServiceConnectionState, +): any { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +export function privateLinkServiceConnectionStateDeserializer( + item: any, +): PrivateLinkServiceConnectionState { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +/** The private endpoint connection status. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", +} + +/** + * The private endpoint connection status. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** The current provisioning state. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + Succeeded = "Succeeded", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", +} + +/** + * The current provisioning state. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = string; + +export function networkSecurityPerimeterConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkSecurityPerimeterConfigurationDeserializer(item); + }); +} + +/** Network Security Perimeter configuration */ +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + /** Properties of the Network Security Perimeter configuration */ + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +export function networkSecurityPerimeterConfigurationDeserializer( + item: any, +): NetworkSecurityPerimeterConfiguration { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkSecurityPerimeterConfigurationPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of Network Security Perimeter configuration */ +export interface NetworkSecurityPerimeterConfigurationProperties { + provisioningState?: ProvisioningState; + /** List of Provisioning Issues if any */ + provisioningIssues?: ProvisioningIssue[]; + /** Information about Network Security Perimeter */ + readonly networkSecurityPerimeter?: NetworkSecurityPerimeter; + /** Information about resource association */ + readonly resourceAssociation?: ResourceAssociation; + /** Information about profile */ + readonly profile?: Profile; +} + +export function networkSecurityPerimeterConfigurationPropertiesDeserializer( + item: any, +): NetworkSecurityPerimeterConfigurationProperties { + return { + provisioningState: item["provisioningState"], + provisioningIssues: !item["provisioningIssues"] + ? item["provisioningIssues"] + : provisioningIssueArrayDeserializer(item["provisioningIssues"]), + networkSecurityPerimeter: !item["networkSecurityPerimeter"] + ? item["networkSecurityPerimeter"] + : networkSecurityPerimeterDeserializer(item["networkSecurityPerimeter"]), + resourceAssociation: !item["resourceAssociation"] + ? item["resourceAssociation"] + : resourceAssociationDeserializer(item["resourceAssociation"]), + profile: !item["profile"] ? item["profile"] : profileDeserializer(item["profile"]), + }; +} + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Creating = "Creating", + Updating = "Updating", + Accepted = "Accepted", + Succeeded = "Succeeded", + Failed = "Failed", + Deleting = "Deleting", +} + +/** Type of ProvisioningState */ +export type ProvisioningState = string; + +export function provisioningIssueArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return provisioningIssueDeserializer(item); + }); +} + +/** Describes Provisioning issue for given Network Security Perimeter configuration */ +export interface ProvisioningIssue { + /** Name of the issue */ + name?: string; + /** Properties of Provisioning Issue */ + readonly properties?: ProvisioningIssueProperties; +} + +export function provisioningIssueDeserializer(item: any): ProvisioningIssue { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : provisioningIssuePropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of Provisioning Issue */ +export interface ProvisioningIssueProperties { + /** Type of Issue */ + issueType?: string; + /** Provisioning state of Network Security Perimeter configuration propagation */ + severity?: Severity; + /** Description of the issue */ + description?: string; + /** ARM IDs of resources that can be associated to the same perimeter to remediate the issue. */ + readonly suggestedResourceIds?: string[]; + /** Access rules that can be added to the same profile to remediate the issue. */ + suggestedAccessRules?: NspAccessRule[]; +} + +export function provisioningIssuePropertiesDeserializer(item: any): ProvisioningIssueProperties { + return { + issueType: item["issueType"], + severity: item["severity"], + description: item["description"], + suggestedResourceIds: !item["suggestedResourceIds"] + ? item["suggestedResourceIds"] + : item["suggestedResourceIds"].map((p: any) => { + return p; + }), + suggestedAccessRules: !item["suggestedAccessRules"] + ? item["suggestedAccessRules"] + : nspAccessRuleArrayDeserializer(item["suggestedAccessRules"]), + }; +} + +/** Provisioning state of Network Security Perimeter configuration propagation */ +export enum KnownSeverity { + Warning = "Warning", + Error = "Error", +} + +/** + * Provisioning state of Network Security Perimeter configuration propagation \ + * {@link KnownSeverity} can be used interchangeably with Severity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Warning** \ + * **Error** + */ +export type Severity = string; + +export function nspAccessRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return nspAccessRuleDeserializer(item); + }); +} + +/** Information of Access Rule in a profile */ +export interface NspAccessRule { + /** Name of the access rule */ + name?: string; + /** Properties of Access Rule */ + readonly properties?: NspAccessRuleProperties; +} + +export function nspAccessRuleDeserializer(item: any): NspAccessRule { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : nspAccessRulePropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of Access Rule */ +export interface NspAccessRuleProperties { + /** Direction of Access Rule */ + direction?: NspAccessRuleDirection; + /** Address prefixes in the CIDR format for inbound rules */ + addressPrefixes?: string[]; + /** Subscriptions for inbound rules */ + subscriptions?: NspAccessRulePropertiesSubscriptionsItem[]; + /** NetworkSecurityPerimeters for inbound rules */ + readonly networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + /** FQDN for outbound rules */ + readonly fullyQualifiedDomainNames?: string[]; + /** Email addresses for outbound rules */ + readonly emailAddresses?: string[]; + /** Phone numbers for outbound rules */ + readonly phoneNumbers?: string[]; +} + +export function nspAccessRulePropertiesDeserializer(item: any): NspAccessRuleProperties { + return { + direction: item["direction"], + addressPrefixes: !item["addressPrefixes"] + ? item["addressPrefixes"] + : item["addressPrefixes"].map((p: any) => { + return p; + }), + subscriptions: !item["subscriptions"] + ? item["subscriptions"] + : nspAccessRulePropertiesSubscriptionsItemArrayDeserializer(item["subscriptions"]), + networkSecurityPerimeters: !item["networkSecurityPerimeters"] + ? item["networkSecurityPerimeters"] + : networkSecurityPerimeterArrayDeserializer(item["networkSecurityPerimeters"]), + fullyQualifiedDomainNames: !item["fullyQualifiedDomainNames"] + ? item["fullyQualifiedDomainNames"] + : item["fullyQualifiedDomainNames"].map((p: any) => { + return p; + }), + emailAddresses: !item["emailAddresses"] + ? item["emailAddresses"] + : item["emailAddresses"].map((p: any) => { + return p; + }), + phoneNumbers: !item["phoneNumbers"] + ? item["phoneNumbers"] + : item["phoneNumbers"].map((p: any) => { + return p; + }), + }; +} + +/** Direction of Access Rule */ +export enum KnownNspAccessRuleDirection { + Inbound = "Inbound", + Outbound = "Outbound", +} + +/** + * Direction of Access Rule \ + * {@link KnownNspAccessRuleDirection} can be used interchangeably with NspAccessRuleDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inbound** \ + * **Outbound** + */ +export type NspAccessRuleDirection = string; + +export function nspAccessRulePropertiesSubscriptionsItemArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return nspAccessRulePropertiesSubscriptionsItemDeserializer(item); + }); +} + +/** Subscription for inbound rule */ +export interface NspAccessRulePropertiesSubscriptionsItem { + /** Fully qualified identifier of subscription */ + id?: string; +} + +export function nspAccessRulePropertiesSubscriptionsItemDeserializer( + item: any, +): NspAccessRulePropertiesSubscriptionsItem { + return { + id: item["id"], + }; +} + +export function networkSecurityPerimeterArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkSecurityPerimeterDeserializer(item); + }); +} + +/** Information about Network Security Perimeter */ +export interface NetworkSecurityPerimeter { + /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ + readonly id?: string; + /** Guid of the Network Security Perimeter */ + perimeterGuid?: string; + /** Location of the Network Security Perimeter */ + location?: string; +} + +export function networkSecurityPerimeterDeserializer(item: any): NetworkSecurityPerimeter { + return { + id: item["id"], + perimeterGuid: item["perimeterGuid"], + location: item["location"], + }; +} + +/** Information about resource association */ +export interface ResourceAssociation { + /** Name of the resource association */ + name?: string; + /** Access Mode of the resource association */ + accessMode?: AccessMode; +} + +export function resourceAssociationDeserializer(item: any): ResourceAssociation { + return { + name: item["name"], + accessMode: item["accessMode"], + }; +} + +/** Access Mode of the resource association */ +export enum KnownAccessMode { + Enforced = "Enforced", + Learning = "Learning", + Audit = "Audit", +} + +/** + * Access Mode of the resource association \ + * {@link KnownAccessMode} can be used interchangeably with AccessMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enforced** \ + * **Learning** \ + * **Audit** + */ +export type AccessMode = string; + +/** Information about profile */ +export interface Profile { + /** Name of the profile */ + name?: string; + /** Current access rules version */ + accessRulesVersion?: number; + /** List of Access Rules */ + accessRules?: NspAccessRule[]; + /** Current diagnostic settings version */ + diagnosticSettingsVersion?: number; + /** List of log categories */ + readonly enabledLogCategories?: string[]; +} + +export function profileDeserializer(item: any): Profile { + return { + name: item["name"], + accessRulesVersion: item["accessRulesVersion"], + accessRules: !item["accessRules"] + ? item["accessRules"] + : nspAccessRuleArrayDeserializer(item["accessRules"]), + diagnosticSettingsVersion: item["diagnosticSettingsVersion"], + enabledLogCategories: !item["enabledLogCategories"] + ? item["enabledLogCategories"] + : item["enabledLogCategories"].map((p: any) => { + return p; + }), + }; +} + +/** The SKU of the cognitive services account. */ +export interface Sku { + /** The sku name */ + name: SkuName; + /** Gets the sku tier. This is based on the SKU name. */ + readonly tier?: SkuTier; +} + +export function skuSerializer(item: Sku): any { + return { name: item["name"] }; +} + +export function skuDeserializer(item: any): Sku { + return { + name: item["name"], + tier: item["tier"], + }; +} + +/** The name of SKU. */ +export enum KnownSkuName { + F0 = "F0", + S1 = "S1", +} + +/** + * The name of SKU. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **F0** \ + * **S1** + */ +export type SkuName = string; + +/** Gets the sku tier. This is based on the SKU name. */ +export enum KnownSkuTier { + Free = "Free", + Standard = "Standard", +} + +/** + * Gets the sku tier. This is based on the SKU name. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Free** \ + * **Standard** + */ +export type SkuTier = string; + +/** Indicates the type of bot service */ +export enum KnownKind { + Sdk = "sdk", + Designer = "designer", + Bot = "bot", + Function = "function", + Azurebot = "azurebot", +} + +/** + * Indicates the type of bot service \ + * {@link KnownKind} can be used interchangeably with Kind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **sdk** \ + * **designer** \ + * **bot** \ + * **function** \ + * **azurebot** + */ +export type Kind = string; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource): any { + return item; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnowncreatedByType} can be used interchangeably with createdByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** The list of bot service operation response. */ +export interface _BotResponseList { + /** The Bot items on this page */ + readonly value: Bot[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _botResponseListDeserializer(item: any): _BotResponseList { + return { + value: botArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function botArraySerializer(result: Array): any[] { + return result.map((item) => { + return botSerializer(item); + }); +} + +export function botArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return botDeserializer(item); + }); +} + +/** The ARM create email sign in url operation response. */ +export interface CreateEmailSignInUrlResponse { + /** Specifies the resource ID. */ + readonly id?: string; + /** Specifies the location of the resource. */ + location?: string; + /** The set of properties specific to sign in url */ + properties?: CreateEmailSignInUrlResponseProperties; +} + +export function createEmailSignInUrlResponseDeserializer(item: any): CreateEmailSignInUrlResponse { + return { + id: item["id"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : createEmailSignInUrlResponsePropertiesDeserializer(item["properties"]), + }; +} + +/** The set of properties specific to sign in url */ +export interface CreateEmailSignInUrlResponseProperties { + /** Sign in url. */ + url?: string; +} + +export function createEmailSignInUrlResponsePropertiesDeserializer( + item: any, +): CreateEmailSignInUrlResponseProperties { + return { + url: item["url"], + }; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; +} + +export function privateLinkResourceListResultDeserializer( + item: any, +): PrivateLinkResourceListResult { + return { + value: !item["value"] ? item["value"] : privateLinkResourceArrayDeserializer(item["value"]), + }; +} + +export function privateLinkResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return privateLinkResourceDeserializer(item); + }); +} + +/** A private link resource */ +export interface PrivateLinkResource extends PrivateLinkResourceBase { + /** Resource properties. */ + properties?: PrivateLinkResourceProperties; +} + +export function privateLinkResourceDeserializer(item: any): PrivateLinkResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + properties: !item["properties"] + ? item["properties"] + : privateLinkResourcePropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +export function privateLinkResourcePropertiesDeserializer( + item: any, +): PrivateLinkResourceProperties { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +/** Common fields that are returned in the response for all BotService Private Link Resources */ +export interface PrivateLinkResourceBase { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; +} + +export function privateLinkResourceBaseDeserializer(item: any): PrivateLinkResourceBase { + return { + id: item["id"], + name: item["name"], + type: item["type"], + }; +} + +/** Bot channel resource definition */ +export interface BotChannel extends TrackedResource { + /** The set of properties specific to bot channel resource */ + properties?: ChannelUnion; + /** Gets or sets the SKU of the resource. */ + sku?: Sku; + /** Required. Gets or sets the Kind of the resource. */ + kind?: Kind; + /** Entity Tag. */ + etag?: string; + /** Entity zones */ + readonly zones?: string[]; +} + +export function botChannelSerializer(item: BotChannel): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : channelUnionSerializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + kind: item["kind"], + etag: item["etag"], + }; +} + +export function botChannelDeserializer(item: any): BotChannel { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : channelUnionDeserializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + kind: item["kind"], + etag: item["etag"], + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** Channel definition */ +export interface Channel { + /** The channel name */ + /** The discriminator possible values: AlexaChannel, FacebookChannel, EmailChannel, OutlookChannel, MsTeamsChannel, SkypeChannel, KikChannel, WebChatChannel, DirectLineChannel, TelegramChannel, SmsChannel, SlackChannel, LineChannel, DirectLineSpeechChannel, Omnichannel, TelephonyChannel, AcsChatChannel, SearchAssistant, M365Extensions */ + channelName: string; + /** Entity Tag of the resource */ + etag?: string | null; + /** Provisioning state of the resource */ + readonly provisioningState?: string; + /** Specifies the location of the resource. */ + location?: string; +} + +export function channelSerializer(item: Channel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + }; +} + +export function channelDeserializer(item: any): Channel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + }; +} + +/** Alias for ChannelUnion */ +export type ChannelUnion = + | AlexaChannel + | FacebookChannel + | EmailChannel + | OutlookChannel + | MsTeamsChannel + | SkypeChannel + | KikChannel + | WebChatChannel + | DirectLineChannel + | TelegramChannel + | SmsChannel + | SlackChannel + | LineChannel + | DirectLineSpeechChannel + | Omnichannel + | TelephonyChannel + | AcsChatChannel + | SearchAssistant + | M365Extensions + | Channel; + +export function channelUnionSerializer(item: ChannelUnion): any { + switch (item.channelName) { + case "AlexaChannel": + return alexaChannelSerializer(item as AlexaChannel); + + case "FacebookChannel": + return facebookChannelSerializer(item as FacebookChannel); + + case "EmailChannel": + return emailChannelSerializer(item as EmailChannel); + + case "OutlookChannel": + return outlookChannelSerializer(item as OutlookChannel); + + case "MsTeamsChannel": + return msTeamsChannelSerializer(item as MsTeamsChannel); + + case "SkypeChannel": + return skypeChannelSerializer(item as SkypeChannel); + + case "KikChannel": + return kikChannelSerializer(item as KikChannel); + + case "WebChatChannel": + return webChatChannelSerializer(item as WebChatChannel); + + case "DirectLineChannel": + return directLineChannelSerializer(item as DirectLineChannel); + + case "TelegramChannel": + return telegramChannelSerializer(item as TelegramChannel); + + case "SmsChannel": + return smsChannelSerializer(item as SmsChannel); + + case "SlackChannel": + return slackChannelSerializer(item as SlackChannel); + + case "LineChannel": + return lineChannelSerializer(item as LineChannel); + + case "DirectLineSpeechChannel": + return directLineSpeechChannelSerializer(item as DirectLineSpeechChannel); + + case "Omnichannel": + return omnichannelSerializer(item as Omnichannel); + + case "TelephonyChannel": + return telephonyChannelSerializer(item as TelephonyChannel); + + case "AcsChatChannel": + return acsChatChannelSerializer(item as AcsChatChannel); + + case "SearchAssistant": + return searchAssistantSerializer(item as SearchAssistant); + + case "M365Extensions": + return m365ExtensionsSerializer(item as M365Extensions); + + default: + return channelSerializer(item); + } +} + +export function channelUnionDeserializer(item: any): ChannelUnion { + switch (item.channelName) { + case "AlexaChannel": + return alexaChannelDeserializer(item as AlexaChannel); + + case "FacebookChannel": + return facebookChannelDeserializer(item as FacebookChannel); + + case "EmailChannel": + return emailChannelDeserializer(item as EmailChannel); + + case "OutlookChannel": + return outlookChannelDeserializer(item as OutlookChannel); + + case "MsTeamsChannel": + return msTeamsChannelDeserializer(item as MsTeamsChannel); + + case "SkypeChannel": + return skypeChannelDeserializer(item as SkypeChannel); + + case "KikChannel": + return kikChannelDeserializer(item as KikChannel); + + case "WebChatChannel": + return webChatChannelDeserializer(item as WebChatChannel); + + case "DirectLineChannel": + return directLineChannelDeserializer(item as DirectLineChannel); + + case "TelegramChannel": + return telegramChannelDeserializer(item as TelegramChannel); + + case "SmsChannel": + return smsChannelDeserializer(item as SmsChannel); + + case "SlackChannel": + return slackChannelDeserializer(item as SlackChannel); + + case "LineChannel": + return lineChannelDeserializer(item as LineChannel); + + case "DirectLineSpeechChannel": + return directLineSpeechChannelDeserializer(item as DirectLineSpeechChannel); + + case "Omnichannel": + return omnichannelDeserializer(item as Omnichannel); + + case "TelephonyChannel": + return telephonyChannelDeserializer(item as TelephonyChannel); + + case "AcsChatChannel": + return acsChatChannelDeserializer(item as AcsChatChannel); + + case "SearchAssistant": + return searchAssistantDeserializer(item as SearchAssistant); + + case "M365Extensions": + return m365ExtensionsDeserializer(item as M365Extensions); + + default: + return channelDeserializer(item); + } +} + +/** Alexa channel definition */ +export interface AlexaChannel extends Channel { + /** The set of properties specific to Alexa channel resource */ + properties?: AlexaChannelProperties; + /** The channel name */ + channelName: "AlexaChannel"; +} + +export function alexaChannelSerializer(item: AlexaChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : alexaChannelPropertiesSerializer(item["properties"]), + }; +} + +export function alexaChannelDeserializer(item: any): AlexaChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : alexaChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Alexa channel. */ +export interface AlexaChannelProperties { + /** The Alexa skill Id */ + alexaSkillId: string; + /** Url fragment used in part of the Uri configured in Alexa */ + readonly urlFragment?: string; + /** Full Uri used to configured the skill in Alexa */ + readonly serviceEndpointUri?: string; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function alexaChannelPropertiesSerializer(item: AlexaChannelProperties): any { + return { alexaSkillId: item["alexaSkillId"], isEnabled: item["isEnabled"] }; +} + +export function alexaChannelPropertiesDeserializer(item: any): AlexaChannelProperties { + return { + alexaSkillId: item["alexaSkillId"], + urlFragment: item["urlFragment"], + serviceEndpointUri: item["serviceEndpointUri"], + isEnabled: item["isEnabled"], + }; +} + +/** Facebook channel definition */ +export interface FacebookChannel extends Channel { + /** The set of properties specific to bot facebook channel */ + properties?: FacebookChannelProperties; + /** The channel name */ + channelName: "FacebookChannel"; +} + +export function facebookChannelSerializer(item: FacebookChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : facebookChannelPropertiesSerializer(item["properties"]), + }; +} + +export function facebookChannelDeserializer(item: any): FacebookChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : facebookChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Facebook channel. */ +export interface FacebookChannelProperties { + /** Verify token. Value only returned through POST to the action Channel List API, otherwise empty. */ + readonly verifyToken?: string; + /** The list of Facebook pages */ + pages?: FacebookPage[]; + /** Facebook application id */ + appId: string; + /** Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty. */ + appSecret?: string; + /** Callback Url */ + readonly callbackUrl?: string; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function facebookChannelPropertiesSerializer(item: FacebookChannelProperties): any { + return { + pages: !item["pages"] ? item["pages"] : facebookPageArraySerializer(item["pages"]), + appId: item["appId"], + appSecret: item["appSecret"], + isEnabled: item["isEnabled"], + }; +} + +export function facebookChannelPropertiesDeserializer(item: any): FacebookChannelProperties { + return { + verifyToken: item["verifyToken"], + pages: !item["pages"] ? item["pages"] : facebookPageArrayDeserializer(item["pages"]), + appId: item["appId"], + appSecret: item["appSecret"], + callbackUrl: item["callbackUrl"], + isEnabled: item["isEnabled"], + }; +} + +export function facebookPageArraySerializer(result: Array): any[] { + return result.map((item) => { + return facebookPageSerializer(item); + }); +} + +export function facebookPageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return facebookPageDeserializer(item); + }); +} + +/** A Facebook page for Facebook channel registration */ +export interface FacebookPage { + /** Page id */ + id: string; + /** Facebook application access token. Value only returned through POST to the action Channel List API, otherwise empty. */ + accessToken?: string; +} + +export function facebookPageSerializer(item: FacebookPage): any { + return { id: item["id"], accessToken: item["accessToken"] }; +} + +export function facebookPageDeserializer(item: any): FacebookPage { + return { + id: item["id"], + accessToken: item["accessToken"], + }; +} + +/** Email channel definition */ +export interface EmailChannel extends Channel { + /** The set of properties specific to email channel resource */ + properties?: EmailChannelProperties; + /** The channel name */ + channelName: "EmailChannel"; +} + +export function emailChannelSerializer(item: EmailChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : emailChannelPropertiesSerializer(item["properties"]), + }; +} + +export function emailChannelDeserializer(item: any): EmailChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : emailChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Email channel. */ +export interface EmailChannelProperties { + /** The email address */ + emailAddress: string; + /** Email channel auth method. 0 Password (Default); 1 Graph. */ + authMethod?: EmailChannelAuthMethod; + /** The password for the email address. Value only returned through POST to the action Channel List API, otherwise empty. */ + password?: string; + /** The magic code for setting up the modern authentication. */ + magicCode?: string; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function emailChannelPropertiesSerializer(item: EmailChannelProperties): any { + return { + emailAddress: item["emailAddress"], + authMethod: item["authMethod"], + password: item["password"], + magicCode: item["magicCode"], + isEnabled: item["isEnabled"], + }; +} + +export function emailChannelPropertiesDeserializer(item: any): EmailChannelProperties { + return { + emailAddress: item["emailAddress"], + authMethod: item["authMethod"], + password: item["password"], + magicCode: item["magicCode"], + isEnabled: item["isEnabled"], + }; +} + +/** Email channel auth method. 0 Password (Default); 1 Graph. */ +export type EmailChannelAuthMethod = 0 | 1; + +/** Outlook channel definition */ +export interface OutlookChannel extends Channel { + /** The channel name */ + channelName: "OutlookChannel"; +} + +export function outlookChannelSerializer(item: OutlookChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + }; +} + +export function outlookChannelDeserializer(item: any): OutlookChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + }; +} + +/** Microsoft Teams channel definition */ +export interface MsTeamsChannel extends Channel { + /** The set of properties specific to Microsoft Teams channel resource */ + properties?: MsTeamsChannelProperties; + /** The channel name */ + channelName: "MsTeamsChannel"; +} + +export function msTeamsChannelSerializer(item: MsTeamsChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : msTeamsChannelPropertiesSerializer(item["properties"]), + }; +} + +export function msTeamsChannelDeserializer(item: any): MsTeamsChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : msTeamsChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Microsoft Teams channel. */ +export interface MsTeamsChannelProperties { + /** Enable calling for Microsoft Teams channel */ + enableCalling?: boolean; + /** Webhook for Microsoft Teams channel calls */ + callingWebhook?: string; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; + /** Webhook for Microsoft Teams channel calls */ + incomingCallRoute?: string; + /** Deployment environment for Microsoft Teams channel calls */ + deploymentEnvironment?: string; + /** Whether this channel accepted terms */ + acceptedTerms?: boolean | null; +} + +export function msTeamsChannelPropertiesSerializer(item: MsTeamsChannelProperties): any { + return { + enableCalling: item["enableCalling"], + callingWebhook: item["callingWebhook"], + isEnabled: item["isEnabled"], + incomingCallRoute: item["incomingCallRoute"], + deploymentEnvironment: item["deploymentEnvironment"], + acceptedTerms: item["acceptedTerms"], + }; +} + +export function msTeamsChannelPropertiesDeserializer(item: any): MsTeamsChannelProperties { + return { + enableCalling: item["enableCalling"], + callingWebhook: item["callingWebhook"], + isEnabled: item["isEnabled"], + incomingCallRoute: item["incomingCallRoute"], + deploymentEnvironment: item["deploymentEnvironment"], + acceptedTerms: item["acceptedTerms"], + }; +} + +/** Skype channel definition */ +export interface SkypeChannel extends Channel { + /** The set of properties specific to Skype channel resource */ + properties?: SkypeChannelProperties; + /** The channel name */ + channelName: "SkypeChannel"; +} + +export function skypeChannelSerializer(item: SkypeChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : skypeChannelPropertiesSerializer(item["properties"]), + }; +} + +export function skypeChannelDeserializer(item: any): SkypeChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : skypeChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Microsoft Teams channel. */ +export interface SkypeChannelProperties { + /** Enable messaging for Skype channel */ + enableMessaging?: boolean; + /** Enable media cards for Skype channel */ + enableMediaCards?: boolean; + /** Enable video for Skype channel */ + enableVideo?: boolean; + /** Enable calling for Skype channel */ + enableCalling?: boolean; + /** Enable screen sharing for Skype channel */ + enableScreenSharing?: boolean; + /** Enable groups for Skype channel */ + enableGroups?: boolean; + /** Group mode for Skype channel */ + groupsMode?: string; + /** Calling web hook for Skype channel */ + callingWebHook?: string; + /** Incoming call route for Skype channel */ + incomingCallRoute?: string; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function skypeChannelPropertiesSerializer(item: SkypeChannelProperties): any { + return { + enableMessaging: item["enableMessaging"], + enableMediaCards: item["enableMediaCards"], + enableVideo: item["enableVideo"], + enableCalling: item["enableCalling"], + enableScreenSharing: item["enableScreenSharing"], + enableGroups: item["enableGroups"], + groupsMode: item["groupsMode"], + callingWebHook: item["callingWebHook"], + incomingCallRoute: item["incomingCallRoute"], + isEnabled: item["isEnabled"], + }; +} + +export function skypeChannelPropertiesDeserializer(item: any): SkypeChannelProperties { + return { + enableMessaging: item["enableMessaging"], + enableMediaCards: item["enableMediaCards"], + enableVideo: item["enableVideo"], + enableCalling: item["enableCalling"], + enableScreenSharing: item["enableScreenSharing"], + enableGroups: item["enableGroups"], + groupsMode: item["groupsMode"], + callingWebHook: item["callingWebHook"], + incomingCallRoute: item["incomingCallRoute"], + isEnabled: item["isEnabled"], + }; +} + +/** Kik channel definition */ +export interface KikChannel extends Channel { + /** The set of properties specific to Kik channel resource */ + properties?: KikChannelProperties; + /** The channel name */ + channelName: "KikChannel"; +} + +export function kikChannelSerializer(item: KikChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : kikChannelPropertiesSerializer(item["properties"]), + }; +} + +export function kikChannelDeserializer(item: any): KikChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : kikChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Kik channel. */ +export interface KikChannelProperties { + /** The Kik user name */ + userName: string; + /** Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. */ + apiKey?: string; + /** Whether this channel is validated for the bot */ + isValidated?: boolean; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function kikChannelPropertiesSerializer(item: KikChannelProperties): any { + return { + userName: item["userName"], + apiKey: item["apiKey"], + isValidated: item["isValidated"], + isEnabled: item["isEnabled"], + }; +} + +export function kikChannelPropertiesDeserializer(item: any): KikChannelProperties { + return { + userName: item["userName"], + apiKey: item["apiKey"], + isValidated: item["isValidated"], + isEnabled: item["isEnabled"], + }; +} + +/** Web Chat channel definition */ +export interface WebChatChannel extends Channel { + /** The set of properties specific to Web Chat channel resource */ + properties?: WebChatChannelProperties; + /** The channel name */ + channelName: "WebChatChannel"; +} + +export function webChatChannelSerializer(item: WebChatChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : webChatChannelPropertiesSerializer(item["properties"]), + }; +} + +export function webChatChannelDeserializer(item: any): WebChatChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : webChatChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Web Chat channel. */ +export interface WebChatChannelProperties { + /** Web chat control embed code */ + readonly webChatEmbedCode?: string; + /** The list of Web Chat sites */ + sites?: WebChatSite[]; +} + +export function webChatChannelPropertiesSerializer(item: WebChatChannelProperties): any { + return { + sites: !item["sites"] ? item["sites"] : webChatSiteArraySerializer(item["sites"]), + }; +} + +export function webChatChannelPropertiesDeserializer(item: any): WebChatChannelProperties { + return { + webChatEmbedCode: item["webChatEmbedCode"], + sites: !item["sites"] ? item["sites"] : webChatSiteArrayDeserializer(item["sites"]), + }; +} + +export function webChatSiteArraySerializer(result: Array): any[] { + return result.map((item) => { + return webChatSiteSerializer(item); + }); +} + +export function webChatSiteArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return webChatSiteDeserializer(item); + }); +} + +/** A site for the Webchat channel */ +export interface WebChatSite extends Site {} + +export function webChatSiteSerializer(item: WebChatSite): any { + return { + tenantId: item["tenantId"], + siteName: item["siteName"], + isEnabled: item["isEnabled"], + isEndpointParametersEnabled: item["isEndpointParametersEnabled"], + isDetailedLoggingEnabled: item["isDetailedLoggingEnabled"], + isBlockUserUploadEnabled: item["isBlockUserUploadEnabled"], + isNoStorageEnabled: item["isNoStorageEnabled"], + eTag: item["eTag"], + appId: item["appId"], + isV1Enabled: item["isV1Enabled"], + isV3Enabled: item["isV3Enabled"], + isSecureSiteEnabled: item["isSecureSiteEnabled"], + trustedOrigins: !item["trustedOrigins"] + ? item["trustedOrigins"] + : item["trustedOrigins"].map((p: any) => { + return p; + }), + isWebChatSpeechEnabled: item["isWebChatSpeechEnabled"], + isWebchatPreviewEnabled: item["isWebchatPreviewEnabled"], + }; +} + +export function webChatSiteDeserializer(item: any): WebChatSite { + return { + tenantId: item["tenantId"], + siteId: item["siteId"], + siteName: item["siteName"], + key: item["key"], + key2: item["key2"], + isEnabled: item["isEnabled"], + isTokenEnabled: item["isTokenEnabled"], + isEndpointParametersEnabled: item["isEndpointParametersEnabled"], + isDetailedLoggingEnabled: item["isDetailedLoggingEnabled"], + isBlockUserUploadEnabled: item["isBlockUserUploadEnabled"], + isNoStorageEnabled: item["isNoStorageEnabled"], + eTag: item["eTag"], + appId: item["appId"], + isV1Enabled: item["isV1Enabled"], + isV3Enabled: item["isV3Enabled"], + isSecureSiteEnabled: item["isSecureSiteEnabled"], + trustedOrigins: !item["trustedOrigins"] + ? item["trustedOrigins"] + : item["trustedOrigins"].map((p: any) => { + return p; + }), + isWebChatSpeechEnabled: item["isWebChatSpeechEnabled"], + isWebchatPreviewEnabled: item["isWebchatPreviewEnabled"], + }; +} + +/** Direct Line channel definition */ +export interface DirectLineChannel extends Channel { + /** The set of properties specific to Direct Line channel resource */ + properties?: DirectLineChannelProperties; + /** The channel name */ + channelName: "DirectLineChannel"; +} + +export function directLineChannelSerializer(item: DirectLineChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : directLineChannelPropertiesSerializer(item["properties"]), + }; +} + +export function directLineChannelDeserializer(item: any): DirectLineChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : directLineChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Direct Line channel. */ +export interface DirectLineChannelProperties { + /** The list of Direct Line sites */ + sites?: DirectLineSite[]; + /** The extensionKey1 */ + extensionKey1?: string; + /** The extensionKey2 */ + extensionKey2?: string; + /** Direct Line embed code of the resource */ + directLineEmbedCode?: string; +} + +export function directLineChannelPropertiesSerializer(item: DirectLineChannelProperties): any { + return { + sites: !item["sites"] ? item["sites"] : directLineSiteArraySerializer(item["sites"]), + extensionKey1: item["extensionKey1"], + extensionKey2: item["extensionKey2"], + DirectLineEmbedCode: item["directLineEmbedCode"], + }; +} + +export function directLineChannelPropertiesDeserializer(item: any): DirectLineChannelProperties { + return { + sites: !item["sites"] ? item["sites"] : directLineSiteArrayDeserializer(item["sites"]), + extensionKey1: item["extensionKey1"], + extensionKey2: item["extensionKey2"], + directLineEmbedCode: item["DirectLineEmbedCode"], + }; +} + +export function directLineSiteArraySerializer(result: Array): any[] { + return result.map((item) => { + return directLineSiteSerializer(item); + }); +} + +export function directLineSiteArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return directLineSiteDeserializer(item); + }); +} + +/** A site for the Direct Line channel */ +export interface DirectLineSite extends Site {} + +export function directLineSiteSerializer(item: DirectLineSite): any { + return { + tenantId: item["tenantId"], + siteName: item["siteName"], + isEnabled: item["isEnabled"], + isEndpointParametersEnabled: item["isEndpointParametersEnabled"], + isDetailedLoggingEnabled: item["isDetailedLoggingEnabled"], + isBlockUserUploadEnabled: item["isBlockUserUploadEnabled"], + isNoStorageEnabled: item["isNoStorageEnabled"], + eTag: item["eTag"], + appId: item["appId"], + isV1Enabled: item["isV1Enabled"], + isV3Enabled: item["isV3Enabled"], + isSecureSiteEnabled: item["isSecureSiteEnabled"], + trustedOrigins: !item["trustedOrigins"] + ? item["trustedOrigins"] + : item["trustedOrigins"].map((p: any) => { + return p; + }), + isWebChatSpeechEnabled: item["isWebChatSpeechEnabled"], + isWebchatPreviewEnabled: item["isWebchatPreviewEnabled"], + }; +} + +export function directLineSiteDeserializer(item: any): DirectLineSite { + return { + tenantId: item["tenantId"], + siteId: item["siteId"], + siteName: item["siteName"], + key: item["key"], + key2: item["key2"], + isEnabled: item["isEnabled"], + isTokenEnabled: item["isTokenEnabled"], + isEndpointParametersEnabled: item["isEndpointParametersEnabled"], + isDetailedLoggingEnabled: item["isDetailedLoggingEnabled"], + isBlockUserUploadEnabled: item["isBlockUserUploadEnabled"], + isNoStorageEnabled: item["isNoStorageEnabled"], + eTag: item["eTag"], + appId: item["appId"], + isV1Enabled: item["isV1Enabled"], + isV3Enabled: item["isV3Enabled"], + isSecureSiteEnabled: item["isSecureSiteEnabled"], + trustedOrigins: !item["trustedOrigins"] + ? item["trustedOrigins"] + : item["trustedOrigins"].map((p: any) => { + return p; + }), + isWebChatSpeechEnabled: item["isWebChatSpeechEnabled"], + isWebchatPreviewEnabled: item["isWebchatPreviewEnabled"], + }; +} + +/** Telegram channel definition */ +export interface TelegramChannel extends Channel { + /** The set of properties specific to Telegram channel resource */ + properties?: TelegramChannelProperties; + /** The channel name */ + channelName: "TelegramChannel"; +} + +export function telegramChannelSerializer(item: TelegramChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : telegramChannelPropertiesSerializer(item["properties"]), + }; +} + +export function telegramChannelDeserializer(item: any): TelegramChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : telegramChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Telegram channel. */ +export interface TelegramChannelProperties { + /** The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty. */ + accessToken?: string; + /** Whether this channel is validated for the bot */ + isValidated?: boolean; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function telegramChannelPropertiesSerializer(item: TelegramChannelProperties): any { + return { + accessToken: item["accessToken"], + isValidated: item["isValidated"], + isEnabled: item["isEnabled"], + }; +} + +export function telegramChannelPropertiesDeserializer(item: any): TelegramChannelProperties { + return { + accessToken: item["accessToken"], + isValidated: item["isValidated"], + isEnabled: item["isEnabled"], + }; +} + +/** Sms channel definition */ +export interface SmsChannel extends Channel { + /** The set of properties specific to Sms channel resource */ + properties?: SmsChannelProperties; + /** The channel name */ + channelName: "SmsChannel"; +} + +export function smsChannelSerializer(item: SmsChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : smsChannelPropertiesSerializer(item["properties"]), + }; +} + +export function smsChannelDeserializer(item: any): SmsChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : smsChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Sms channel. */ +export interface SmsChannelProperties { + /** The Sms phone */ + phone: string; + /** The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. */ + accountSID: string; + /** The Sms auth token. Value only returned through POST to the action Channel List API, otherwise empty. */ + authToken?: string; + /** Whether this channel is validated for the bot */ + isValidated?: boolean; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function smsChannelPropertiesSerializer(item: SmsChannelProperties): any { + return { + phone: item["phone"], + accountSID: item["accountSID"], + authToken: item["authToken"], + isValidated: item["isValidated"], + isEnabled: item["isEnabled"], + }; +} + +export function smsChannelPropertiesDeserializer(item: any): SmsChannelProperties { + return { + phone: item["phone"], + accountSID: item["accountSID"], + authToken: item["authToken"], + isValidated: item["isValidated"], + isEnabled: item["isEnabled"], + }; +} + +/** Slack channel definition */ +export interface SlackChannel extends Channel { + /** The set of properties specific to Slack channel resource */ + properties?: SlackChannelProperties; + /** The channel name */ + channelName: "SlackChannel"; +} + +export function slackChannelSerializer(item: SlackChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : slackChannelPropertiesSerializer(item["properties"]), + }; +} + +export function slackChannelDeserializer(item: any): SlackChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : slackChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Slack channel. */ +export interface SlackChannelProperties { + /** The Slack client id */ + clientId?: string; + /** The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty. */ + clientSecret?: string; + /** The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty. */ + verificationToken?: string; + /** The Slack permission scopes. */ + scopes?: string; + /** The Slack landing page Url */ + landingPageUrl?: string; + /** The Slack redirect action */ + readonly redirectAction?: string; + /** The Sms auth token */ + readonly lastSubmissionId?: string; + /** Whether to register the settings before OAuth validation is performed. Recommended to True. */ + registerBeforeOAuthFlow?: boolean; + /** Whether this channel is validated for the bot */ + readonly isValidated?: boolean; + /** The Slack signing secret. */ + signingSecret?: string; + /** Whether this channel is enabled for the bot */ + isEnabled: boolean; +} + +export function slackChannelPropertiesSerializer(item: SlackChannelProperties): any { + return { + clientId: item["clientId"], + clientSecret: item["clientSecret"], + verificationToken: item["verificationToken"], + scopes: item["scopes"], + landingPageUrl: item["landingPageUrl"], + registerBeforeOAuthFlow: item["registerBeforeOAuthFlow"], + signingSecret: item["signingSecret"], + isEnabled: item["isEnabled"], + }; +} + +export function slackChannelPropertiesDeserializer(item: any): SlackChannelProperties { + return { + clientId: item["clientId"], + clientSecret: item["clientSecret"], + verificationToken: item["verificationToken"], + scopes: item["scopes"], + landingPageUrl: item["landingPageUrl"], + redirectAction: item["redirectAction"], + lastSubmissionId: item["lastSubmissionId"], + registerBeforeOAuthFlow: item["registerBeforeOAuthFlow"], + isValidated: item["IsValidated"], + signingSecret: item["signingSecret"], + isEnabled: item["isEnabled"], + }; +} + +/** Line channel definition */ +export interface LineChannel extends Channel { + /** The set of properties specific to line channel resource */ + properties?: LineChannelProperties; + /** The channel name */ + channelName: "LineChannel"; +} + +export function lineChannelSerializer(item: LineChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : lineChannelPropertiesSerializer(item["properties"]), + }; +} + +export function lineChannelDeserializer(item: any): LineChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : lineChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Line channel. */ +export interface LineChannelProperties { + /** The list of line channel registrations */ + lineRegistrations: LineRegistration[]; + /** Callback Url to enter in line registration. */ + readonly callbackUrl?: string; + /** Whether this channel is validated for the bot */ + readonly isValidated?: boolean; +} + +export function lineChannelPropertiesSerializer(item: LineChannelProperties): any { + return { + lineRegistrations: lineRegistrationArraySerializer(item["lineRegistrations"]), + }; +} + +export function lineChannelPropertiesDeserializer(item: any): LineChannelProperties { + return { + lineRegistrations: lineRegistrationArrayDeserializer(item["lineRegistrations"]), + callbackUrl: item["callbackUrl"], + isValidated: item["isValidated"], + }; +} + +export function lineRegistrationArraySerializer(result: Array): any[] { + return result.map((item) => { + return lineRegistrationSerializer(item); + }); +} + +export function lineRegistrationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return lineRegistrationDeserializer(item); + }); +} + +/** The properties corresponding to a line channel registration */ +export interface LineRegistration { + /** Id generated for the line channel registration */ + readonly generatedId?: string; + /** Secret for the line channel registration */ + channelSecret?: string; + /** Access token for the line channel registration */ + channelAccessToken?: string; +} + +export function lineRegistrationSerializer(item: LineRegistration): any { + return { + channelSecret: item["channelSecret"], + channelAccessToken: item["channelAccessToken"], + }; +} + +export function lineRegistrationDeserializer(item: any): LineRegistration { + return { + generatedId: item["generatedId"], + channelSecret: item["channelSecret"], + channelAccessToken: item["channelAccessToken"], + }; +} + +/** DirectLine Speech channel definition */ +export interface DirectLineSpeechChannel extends Channel { + /** The set of properties specific to DirectLine Speech channel resource */ + properties?: DirectLineSpeechChannelProperties; + /** The channel name */ + channelName: "DirectLineSpeechChannel"; +} + +export function directLineSpeechChannelSerializer(item: DirectLineSpeechChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : directLineSpeechChannelPropertiesSerializer(item["properties"]), + }; +} + +export function directLineSpeechChannelDeserializer(item: any): DirectLineSpeechChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : directLineSpeechChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the DirectLine Speech channel. */ +export interface DirectLineSpeechChannelProperties { + /** The cognitive service id with this channel registration. */ + cognitiveServiceResourceId?: string; + /** The cognitive service region with this channel registration. */ + cognitiveServiceRegion?: string | null; + /** The cognitive service subscription key to use with this channel registration. */ + cognitiveServiceSubscriptionKey?: string | null; + /** Whether this channel is enabled or not. */ + isEnabled?: boolean; + /** Custom speech model id (optional). */ + customVoiceDeploymentId?: string; + /** Custom voice deployment id (optional). */ + customSpeechModelId?: string; + /** Make this a default bot for chosen cognitive service account. */ + isDefaultBotForCogSvcAccount?: boolean; +} + +export function directLineSpeechChannelPropertiesSerializer( + item: DirectLineSpeechChannelProperties, +): any { + return { + cognitiveServiceResourceId: item["cognitiveServiceResourceId"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + isEnabled: item["isEnabled"], + customVoiceDeploymentId: item["customVoiceDeploymentId"], + customSpeechModelId: item["customSpeechModelId"], + isDefaultBotForCogSvcAccount: item["isDefaultBotForCogSvcAccount"], + }; +} + +export function directLineSpeechChannelPropertiesDeserializer( + item: any, +): DirectLineSpeechChannelProperties { + return { + cognitiveServiceResourceId: item["cognitiveServiceResourceId"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + isEnabled: item["isEnabled"], + customVoiceDeploymentId: item["customVoiceDeploymentId"], + customSpeechModelId: item["customSpeechModelId"], + isDefaultBotForCogSvcAccount: item["isDefaultBotForCogSvcAccount"], + }; +} + +/** Omnichannel channel definition */ +export interface Omnichannel extends Channel { + /** The channel name */ + channelName: "Omnichannel"; +} + +export function omnichannelSerializer(item: Omnichannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + }; +} + +export function omnichannelDeserializer(item: any): Omnichannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + }; +} + +/** Telephony channel definition */ +export interface TelephonyChannel extends Channel { + /** The set of properties specific to Telephony channel resource */ + properties?: TelephonyChannelProperties; + /** The channel name */ + channelName: "TelephonyChannel"; +} + +export function telephonyChannelSerializer(item: TelephonyChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : telephonyChannelPropertiesSerializer(item["properties"]), + }; +} + +export function telephonyChannelDeserializer(item: any): TelephonyChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : telephonyChannelPropertiesDeserializer(item["properties"]), + }; +} + +/** The parameters to provide for the Direct Line channel. */ +export interface TelephonyChannelProperties { + /** The list of Telephony phone numbers */ + phoneNumbers?: TelephonyPhoneNumbers[]; + /** The list of Telephony api configuration */ + apiConfigurations?: TelephonyChannelResourceApiConfiguration[]; + /** The extensionKey1 */ + cognitiveServiceSubscriptionKey?: string | null; + /** The extensionKey2 */ + cognitiveServiceRegion?: string | null; + /** The default locale of the channel */ + defaultLocale?: string | null; + /** The premium SKU applied to the channel */ + premiumSKU?: string | null; + /** Whether the channel is enabled */ + isEnabled?: boolean; +} + +export function telephonyChannelPropertiesSerializer(item: TelephonyChannelProperties): any { + return { + phoneNumbers: !item["phoneNumbers"] + ? item["phoneNumbers"] + : telephonyPhoneNumbersArraySerializer(item["phoneNumbers"]), + apiConfigurations: !item["apiConfigurations"] + ? item["apiConfigurations"] + : telephonyChannelResourceApiConfigurationArraySerializer(item["apiConfigurations"]), + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + defaultLocale: item["defaultLocale"], + premiumSKU: item["premiumSKU"], + isEnabled: item["isEnabled"], + }; +} + +export function telephonyChannelPropertiesDeserializer(item: any): TelephonyChannelProperties { + return { + phoneNumbers: !item["phoneNumbers"] + ? item["phoneNumbers"] + : telephonyPhoneNumbersArrayDeserializer(item["phoneNumbers"]), + apiConfigurations: !item["apiConfigurations"] + ? item["apiConfigurations"] + : telephonyChannelResourceApiConfigurationArrayDeserializer(item["apiConfigurations"]), + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + defaultLocale: item["defaultLocale"], + premiumSKU: item["premiumSKU"], + isEnabled: item["isEnabled"], + }; +} + +export function telephonyPhoneNumbersArraySerializer(result: Array): any[] { + return result.map((item) => { + return telephonyPhoneNumbersSerializer(item); + }); +} + +export function telephonyPhoneNumbersArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return telephonyPhoneNumbersDeserializer(item); + }); +} + +/** A telephone number for the Telephony channel */ +export interface TelephonyPhoneNumbers { + /** The element id. */ + id?: string; + /** The phone number. */ + phoneNumber?: string; + /** The endpoint of ACS. */ + acsEndpoint?: string | null; + /** The secret of ACS. */ + acsSecret?: string | null; + /** The resource id of ACS. */ + acsResourceId?: string | null; + /** The subscription key of cognitive service. */ + cognitiveServiceSubscriptionKey?: string | null; + /** The service region of cognitive service. */ + cognitiveServiceRegion?: string | null; + /** The resource id of cognitive service. */ + cognitiveServiceResourceId?: string | null; + /** The default locale of the phone number. */ + defaultLocale?: string | null; + /** Optional Property that will determine the offering type of the phone. */ + offerType?: string | null; +} + +export function telephonyPhoneNumbersSerializer(item: TelephonyPhoneNumbers): any { + return { + id: item["id"], + phoneNumber: item["phoneNumber"], + acsEndpoint: item["acsEndpoint"], + acsSecret: item["acsSecret"], + acsResourceId: item["acsResourceId"], + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + cognitiveServiceResourceId: item["cognitiveServiceResourceId"], + defaultLocale: item["defaultLocale"], + offerType: item["offerType"], + }; +} + +export function telephonyPhoneNumbersDeserializer(item: any): TelephonyPhoneNumbers { + return { + id: item["id"], + phoneNumber: item["phoneNumber"], + acsEndpoint: item["acsEndpoint"], + acsSecret: item["acsSecret"], + acsResourceId: item["acsResourceId"], + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + cognitiveServiceResourceId: item["cognitiveServiceResourceId"], + defaultLocale: item["defaultLocale"], + offerType: item["offerType"], + }; +} + +export function telephonyChannelResourceApiConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return telephonyChannelResourceApiConfigurationSerializer(item); + }); +} + +export function telephonyChannelResourceApiConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return telephonyChannelResourceApiConfigurationDeserializer(item); + }); +} + +/** A resource Api configuration for the Telephony channel */ +export interface TelephonyChannelResourceApiConfiguration { + /** The id of config. */ + id?: string; + /** The provider name. */ + providerName?: string | null; + /** The cognitive service subscription key. */ + cognitiveServiceSubscriptionKey?: string | null; + /** The cognitive service region. */ + cognitiveServiceRegion?: string | null; + /** The cognitive service resourceId. */ + cognitiveServiceResourceId?: string | null; + /** The default locale. */ + defaultLocale?: string | null; +} + +export function telephonyChannelResourceApiConfigurationSerializer( + item: TelephonyChannelResourceApiConfiguration, +): any { + return { + id: item["id"], + providerName: item["providerName"], + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + cognitiveServiceResourceId: item["cognitiveServiceResourceId"], + defaultLocale: item["defaultLocale"], + }; +} + +export function telephonyChannelResourceApiConfigurationDeserializer( + item: any, +): TelephonyChannelResourceApiConfiguration { + return { + id: item["id"], + providerName: item["providerName"], + cognitiveServiceSubscriptionKey: item["cognitiveServiceSubscriptionKey"], + cognitiveServiceRegion: item["cognitiveServiceRegion"], + cognitiveServiceResourceId: item["cognitiveServiceResourceId"], + defaultLocale: item["defaultLocale"], + }; +} + +/** AcsChat channel definition */ +export interface AcsChatChannel extends Channel { + /** The channel name */ + channelName: "AcsChatChannel"; +} + +export function acsChatChannelSerializer(item: AcsChatChannel): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + }; +} + +export function acsChatChannelDeserializer(item: any): AcsChatChannel { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + }; +} + +/** SearchAssistant definition */ +export interface SearchAssistant extends Channel { + /** The channel name */ + channelName: "SearchAssistant"; +} + +export function searchAssistantSerializer(item: SearchAssistant): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + }; +} + +export function searchAssistantDeserializer(item: any): SearchAssistant { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + }; +} + +/** M365 Extensions definition */ +export interface M365Extensions extends Channel { + /** The channel name */ + channelName: "M365Extensions"; +} + +export function m365ExtensionsSerializer(item: M365Extensions): any { + return { + channelName: item["channelName"], + etag: item["etag"], + location: item["location"], + }; +} + +export function m365ExtensionsDeserializer(item: any): M365Extensions { + return { + channelName: item["channelName"], + etag: item["etag"], + provisioningState: item["provisioningState"], + location: item["location"], + }; +} + +/** A site for the channel */ +export interface Site { + /** Tenant Id */ + tenantId?: string; + /** Site Id */ + readonly siteId?: string; + /** Site name */ + siteName: string; + /** Primary key. Value only returned through POST to the action Channel List API, otherwise empty. */ + readonly key?: string; + /** Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. */ + readonly key2?: string; + /** Whether this site is enabled for DirectLine channel */ + isEnabled: boolean; + /** Whether this site is token enabled for channel */ + readonly isTokenEnabled?: boolean; + /** Whether this site is EndpointParameters enabled for channel */ + isEndpointParametersEnabled?: boolean; + /** Whether this site is disabled detailed logging for */ + isDetailedLoggingEnabled?: boolean; + /** Whether this site is enabled for block user upload. */ + isBlockUserUploadEnabled?: boolean | null; + /** Whether this no-storage site is disabled detailed logging for */ + isNoStorageEnabled?: boolean; + /** Entity Tag */ + eTag?: string; + /** DirectLine application id */ + appId?: string; + /** Whether this site is enabled for Bot Framework V1 protocol. */ + isV1Enabled?: boolean; + /** Whether this site is enabled for Bot Framework V3 protocol. */ + isV3Enabled?: boolean; + /** Whether this site is enabled for authentication with Bot Framework. */ + isSecureSiteEnabled?: boolean; + /** List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. */ + trustedOrigins?: string[]; + /** Whether this site is enabled for Webchat Speech */ + isWebChatSpeechEnabled?: boolean; + /** Whether this site is enabled for preview versions of Webchat */ + isWebchatPreviewEnabled?: boolean; +} + +export function siteSerializer(item: Site): any { + return { + tenantId: item["tenantId"], + siteName: item["siteName"], + isEnabled: item["isEnabled"], + isEndpointParametersEnabled: item["isEndpointParametersEnabled"], + isDetailedLoggingEnabled: item["isDetailedLoggingEnabled"], + isBlockUserUploadEnabled: item["isBlockUserUploadEnabled"], + isNoStorageEnabled: item["isNoStorageEnabled"], + eTag: item["eTag"], + appId: item["appId"], + isV1Enabled: item["isV1Enabled"], + isV3Enabled: item["isV3Enabled"], + isSecureSiteEnabled: item["isSecureSiteEnabled"], + trustedOrigins: !item["trustedOrigins"] + ? item["trustedOrigins"] + : item["trustedOrigins"].map((p: any) => { + return p; + }), + isWebChatSpeechEnabled: item["isWebChatSpeechEnabled"], + isWebchatPreviewEnabled: item["isWebchatPreviewEnabled"], + }; +} + +export function siteDeserializer(item: any): Site { + return { + tenantId: item["tenantId"], + siteId: item["siteId"], + siteName: item["siteName"], + key: item["key"], + key2: item["key2"], + isEnabled: item["isEnabled"], + isTokenEnabled: item["isTokenEnabled"], + isEndpointParametersEnabled: item["isEndpointParametersEnabled"], + isDetailedLoggingEnabled: item["isDetailedLoggingEnabled"], + isBlockUserUploadEnabled: item["isBlockUserUploadEnabled"], + isNoStorageEnabled: item["isNoStorageEnabled"], + eTag: item["eTag"], + appId: item["appId"], + isV1Enabled: item["isV1Enabled"], + isV3Enabled: item["isV3Enabled"], + isSecureSiteEnabled: item["isSecureSiteEnabled"], + trustedOrigins: !item["trustedOrigins"] + ? item["trustedOrigins"] + : item["trustedOrigins"].map((p: any) => { + return p; + }), + isWebChatSpeechEnabled: item["isWebChatSpeechEnabled"], + isWebchatPreviewEnabled: item["isWebchatPreviewEnabled"], + }; +} + +/** The list of bot service channel operation response. */ +export interface _ChannelResponseList { + /** The BotChannel items on this page */ + readonly value: BotChannel[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _channelResponseListDeserializer(item: any): _ChannelResponseList { + return { + value: botChannelArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function botChannelArraySerializer(result: Array): any[] { + return result.map((item) => { + return botChannelSerializer(item); + }); +} + +export function botChannelArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return botChannelDeserializer(item); + }); +} + +/** The ARM channel of list channel with keys operation response. */ +export interface ListChannelWithKeysResponse extends BotChannel { + /** The set of properties specific to bot channel resource */ + resource?: ChannelUnion; + /** Channel settings */ + setting?: ChannelSettings; + /** Provisioning state of the resource */ + provisioningState?: string; + /** Entity tag of the resource */ + entityTag?: string; + /** Changed time of the resource */ + changedTime?: string; +} + +export function listChannelWithKeysResponseDeserializer(item: any): ListChannelWithKeysResponse { + return { + properties: !item["properties"] + ? item["properties"] + : channelUnionDeserializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + kind: item["kind"], + etag: item["etag"], + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + resource: !item["resource"] ? item["resource"] : channelUnionDeserializer(item["resource"]), + setting: !item["setting"] ? item["setting"] : channelSettingsDeserializer(item["setting"]), + provisioningState: item["provisioningState"], + entityTag: item["entityTag"], + changedTime: item["changedTime"], + }; +} + +/** Channel settings definition */ +export interface ChannelSettings { + /** The extensionKey1 */ + extensionKey1?: string; + /** The extensionKey2 */ + extensionKey2?: string; + /** The list of sites */ + sites?: Site[]; + /** The channel id */ + channelId?: string; + /** The channel display name */ + channelDisplayName?: string; + /** The bot id */ + botId?: string; + /** The bot icon url */ + botIconUrl?: string; + /** Whether this channel is enabled for the bot */ + isEnabled?: boolean; + /** Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ + disableLocalAuth?: boolean; + /** Whether customer needs to agree to new terms. */ + requireTermsAgreement?: boolean; +} + +export function channelSettingsDeserializer(item: any): ChannelSettings { + return { + extensionKey1: item["extensionKey1"], + extensionKey2: item["extensionKey2"], + sites: !item["sites"] ? item["sites"] : siteArrayDeserializer(item["sites"]), + channelId: item["channelId"], + channelDisplayName: item["channelDisplayName"], + botId: item["botId"], + botIconUrl: item["botIconUrl"], + isEnabled: item["isEnabled"], + disableLocalAuth: item["disableLocalAuth"], + requireTermsAgreement: item["requireTermsAgreement"], + }; +} + +export function siteArraySerializer(result: Array): any[] { + return result.map((item) => { + return siteSerializer(item); + }); +} + +export function siteArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return siteDeserializer(item); + }); +} + +/** Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. */ +export interface SiteInfo { + /** The site name */ + siteName: string; + /** Determines which key is to be regenerated */ + key: Key; +} + +export function siteInfoSerializer(item: SiteInfo): any { + return { siteName: item["siteName"], key: item["key"] }; +} + +/** Determines which key is to be regenerated */ +export type Key = "key1" | "key2"; + +/** Bot channel resource definition */ +export interface ConnectionSetting extends TrackedResource { + /** The set of properties specific to bot channel resource */ + properties?: ConnectionSettingProperties; + /** Gets or sets the SKU of the resource. */ + sku?: Sku; + /** Required. Gets or sets the Kind of the resource. */ + kind?: Kind; + /** Entity Tag. */ + etag?: string; + /** Entity zones */ + readonly zones?: string[]; +} + +export function connectionSettingSerializer(item: ConnectionSetting): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : connectionSettingPropertiesSerializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + kind: item["kind"], + etag: item["etag"], + }; +} + +export function connectionSettingDeserializer(item: any): ConnectionSetting { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : connectionSettingPropertiesDeserializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + kind: item["kind"], + etag: item["etag"], + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** Properties for a Connection Setting Item */ +export interface ConnectionSettingProperties { + /** Id of the Connection Setting. */ + id?: string; + /** Name of the Connection Setting. */ + name?: string; + /** Client Id associated with the Connection Setting. */ + clientId?: string; + /** Setting Id set by the service for the Connection Setting. */ + readonly settingId?: string; + /** Client Secret associated with the Connection Setting */ + clientSecret?: string; + /** Scopes associated with the Connection Setting */ + scopes?: string; + /** Service Provider Id associated with the Connection Setting */ + serviceProviderId?: string; + /** Service Provider Display Name associated with the Connection Setting */ + serviceProviderDisplayName?: string; + /** Service Provider Parameters associated with the Connection Setting */ + parameters?: ConnectionSettingParameter[]; + /** Provisioning state of the resource */ + provisioningState?: string; +} + +export function connectionSettingPropertiesSerializer(item: ConnectionSettingProperties): any { + return { + id: item["id"], + name: item["name"], + clientId: item["clientId"], + clientSecret: item["clientSecret"], + scopes: item["scopes"], + serviceProviderId: item["serviceProviderId"], + serviceProviderDisplayName: item["serviceProviderDisplayName"], + parameters: !item["parameters"] + ? item["parameters"] + : connectionSettingParameterArraySerializer(item["parameters"]), + provisioningState: item["provisioningState"], + }; +} + +export function connectionSettingPropertiesDeserializer(item: any): ConnectionSettingProperties { + return { + id: item["id"], + name: item["name"], + clientId: item["clientId"], + settingId: item["settingId"], + clientSecret: item["clientSecret"], + scopes: item["scopes"], + serviceProviderId: item["serviceProviderId"], + serviceProviderDisplayName: item["serviceProviderDisplayName"], + parameters: !item["parameters"] + ? item["parameters"] + : connectionSettingParameterArrayDeserializer(item["parameters"]), + provisioningState: item["provisioningState"], + }; +} + +export function connectionSettingParameterArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return connectionSettingParameterSerializer(item); + }); +} + +export function connectionSettingParameterArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return connectionSettingParameterDeserializer(item); + }); +} + +/** Extra Parameter in a Connection Setting Properties to indicate service provider specific properties */ +export interface ConnectionSettingParameter { + /** Key for the Connection Setting Parameter. */ + key?: string; + /** Value associated with the Connection Setting Parameter. */ + value?: string | null; +} + +export function connectionSettingParameterSerializer(item: ConnectionSettingParameter): any { + return { key: item["key"], value: item["value"] }; +} + +export function connectionSettingParameterDeserializer(item: any): ConnectionSettingParameter { + return { + key: item["key"], + value: item["value"], + }; +} + +/** The list of bot service connection settings response. */ +export interface _ConnectionSettingResponseList { + /** The ConnectionSetting items on this page */ + readonly value: ConnectionSetting[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _connectionSettingResponseListDeserializer( + item: any, +): _ConnectionSettingResponseList { + return { + value: connectionSettingArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function connectionSettingArraySerializer(result: Array): any[] { + return result.map((item) => { + return connectionSettingSerializer(item); + }); +} + +export function connectionSettingArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return connectionSettingDeserializer(item); + }); +} + +/** List of private endpoint connection associated with the specified storage account */ +export interface _PrivateEndpointConnectionListResult { + /** Array of private endpoint connections */ + value?: PrivateEndpointConnection[]; + /** The link used to get the next page of private endpoint connections. */ + nextLink?: string; +} + +export function _privateEndpointConnectionListResultDeserializer( + item: any, +): _PrivateEndpointConnectionListResult { + return { + value: !item["value"] + ? item["value"] + : privateEndpointConnectionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** Result of the List NetworkSecurityPerimeterConfiguration operation. */ +export interface _NetworkSecurityPerimeterConfigurationList { + /** The NetworkSecurityPerimeterConfiguration items on this page */ + readonly value: NetworkSecurityPerimeterConfiguration[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkSecurityPerimeterConfigurationListDeserializer( + item: any, +): _NetworkSecurityPerimeterConfigurationList { + return { + value: networkSecurityPerimeterConfigurationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** The request body for a request to Bot Service Management to check availability of a bot name. */ +export interface CheckNameAvailabilityRequestBody { + /** the name of the bot for which availability needs to be checked. */ + name?: string; + /** the type of the bot for which availability needs to be checked */ + type?: string; +} + +export function checkNameAvailabilityRequestBodySerializer( + item: CheckNameAvailabilityRequestBody, +): any { + return { name: item["name"], type: item["type"] }; +} + +/** The response body returned for a request to Bot Service Management to check availability of a bot name. */ +export interface CheckNameAvailabilityResponseBody { + /** indicates if the bot name is valid. */ + valid?: boolean; + /** additional message from the bot management api showing why a bot name is not available */ + message?: string; + /** response code from ABS */ + absCode?: string; +} + +export function checkNameAvailabilityResponseBodyDeserializer( + item: any, +): CheckNameAvailabilityResponseBody { + return { + valid: item["valid"], + message: item["message"], + absCode: item["absCode"], + }; +} + +/** The list of bot service providers response. */ +export interface ServiceProviderResponseList { + /** The link used to get the next page of bot service providers. */ + nextLink?: string; + /** Gets the list of bot service providers and their properties. */ + readonly value?: ServiceProvider[]; +} + +export function serviceProviderResponseListDeserializer(item: any): ServiceProviderResponseList { + return { + nextLink: item["nextLink"], + value: !item["value"] ? item["value"] : serviceProviderArrayDeserializer(item["value"]), + }; +} + +export function serviceProviderArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return serviceProviderDeserializer(item); + }); +} + +/** Service Provider Definition */ +export interface ServiceProvider { + /** The Properties of a Service Provider Object */ + properties?: ServiceProviderProperties; +} + +export function serviceProviderDeserializer(item: any): ServiceProvider { + return { + properties: !item["properties"] + ? item["properties"] + : serviceProviderPropertiesDeserializer(item["properties"]), + }; +} + +/** The Object used to describe a Service Provider supported by Bot Service */ +export interface ServiceProviderProperties { + /** Id for Service Provider */ + readonly id?: string; + /** Display Name of the Service Provider */ + readonly displayName?: string; + /** Name of the Service Provider */ + readonly serviceProviderName?: string; + /** URL of Dev Portal */ + readonly devPortalUrl?: string; + /** The URL of icon */ + iconUrl?: string; + /** The list of parameters for the Service Provider */ + parameters?: ServiceProviderParameter[]; +} + +export function serviceProviderPropertiesDeserializer(item: any): ServiceProviderProperties { + return { + id: item["id"], + displayName: item["displayName"], + serviceProviderName: item["serviceProviderName"], + devPortalUrl: item["devPortalUrl"], + iconUrl: item["iconUrl"], + parameters: !item["parameters"] + ? item["parameters"] + : serviceProviderParameterArrayDeserializer(item["parameters"]), + }; +} + +export function serviceProviderParameterArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return serviceProviderParameterDeserializer(item); + }); +} + +/** Extra Parameters specific to each Service Provider */ +export interface ServiceProviderParameter { + /** Name of the Service Provider */ + readonly name?: string; + /** Type of the Service Provider */ + readonly type?: string; + /** Display Name of the Service Provider */ + readonly displayName?: string; + /** Description of the Service Provider */ + readonly description?: string; + /** Help Url for the Service Provider */ + readonly helpUrl?: string; + /** Default Name for the Service Provider */ + readonly default?: string; + /** Meta data for the Service Provider */ + readonly metadata?: ServiceProviderParameterMetadata; +} + +export function serviceProviderParameterDeserializer(item: any): ServiceProviderParameter { + return { + name: item["name"], + type: item["type"], + displayName: item["displayName"], + description: item["description"], + helpUrl: item["helpUrl"], + default: item["default"], + metadata: !item["metadata"] + ? item["metadata"] + : serviceProviderParameterMetadataDeserializer(item["metadata"]), + }; +} + +/** Meta data for the Service Provider */ +export interface ServiceProviderParameterMetadata { + /** the constraints of the bot meta data. */ + constraints?: ServiceProviderParameterMetadataConstraints; +} + +export function serviceProviderParameterMetadataDeserializer( + item: any, +): ServiceProviderParameterMetadata { + return { + constraints: !item["constraints"] + ? item["constraints"] + : serviceProviderParameterMetadataConstraintsDeserializer(item["constraints"]), + }; +} + +/** the constraints of the bot meta data. */ +export interface ServiceProviderParameterMetadataConstraints { + /** Whether required the constraints of the bot meta data. */ + required?: boolean; +} + +export function serviceProviderParameterMetadataConstraintsDeserializer( + item: any, +): ServiceProviderParameterMetadataConstraints { + return { + required: item["required"], + }; +} + +/** The request body for a request to Bot Service Management to list QnA Maker endpoint keys. */ +export interface QnAMakerEndpointKeysRequestBody { + /** the host name of the QnA Maker endpoint */ + hostname?: string; + /** Subscription key which provides access to this API. */ + authkey?: string; +} + +export function qnAMakerEndpointKeysRequestBodySerializer( + item: QnAMakerEndpointKeysRequestBody, +): any { + return { hostname: item["hostname"], authkey: item["authkey"] }; +} + +/** Schema for EndpointKeys generate/refresh operations. */ +export interface QnAMakerEndpointKeysResponse { + /** Primary Access Key. */ + primaryEndpointKey?: string; + /** Secondary Access Key. */ + secondaryEndpointKey?: string; + /** Current version of runtime. */ + installedVersion?: string; + /** Latest version of runtime. */ + lastStableVersion?: string; +} + +export function qnAMakerEndpointKeysResponseDeserializer(item: any): QnAMakerEndpointKeysResponse { + return { + primaryEndpointKey: item["primaryEndpointKey"], + secondaryEndpointKey: item["secondaryEndpointKey"], + installedVersion: item["installedVersion"], + lastStableVersion: item["lastStableVersion"], + }; +} + +/** The response body returned for a request to Bot Service Management to check per subscription hostSettings */ +export interface HostSettingsResponse { + /** For in-conversation bot user authentication */ + oAuthUrl?: string; + /** For verifying incoming tokens from the channels */ + toBotFromChannelOpenIdMetadataUrl?: string; + /** For verifying incoming tokens from the channels */ + toBotFromChannelTokenIssuer?: string; + /** For verifying incoming tokens from bot emulator */ + toBotFromEmulatorOpenIdMetadataUrl?: string; + /** For getting access token to channels from bot host */ + toChannelFromBotLoginUrl?: string; + /** For getting access token to channels from bot host */ + toChannelFromBotOAuthScope?: string; + /** Per cloud OAuth setting on whether authority is validated */ + validateAuthority?: boolean; + /** Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12 */ + botOpenIdMetadata?: string; +} + +export function hostSettingsResponseDeserializer(item: any): HostSettingsResponse { + return { + oAuthUrl: item["OAuthUrl"], + toBotFromChannelOpenIdMetadataUrl: item["ToBotFromChannelOpenIdMetadataUrl"], + toBotFromChannelTokenIssuer: item["ToBotFromChannelTokenIssuer"], + toBotFromEmulatorOpenIdMetadataUrl: item["ToBotFromEmulatorOpenIdMetadataUrl"], + toChannelFromBotLoginUrl: item["ToChannelFromBotLoginUrl"], + toChannelFromBotOAuthScope: item["ToChannelFromBotOAuthScope"], + validateAuthority: item["ValidateAuthority"], + botOpenIdMetadata: item["BotOpenIdMetadata"], + }; +} + +/** The properties indicating the operation result of an operation on a service. */ +export interface OperationResultsDescription { + /** The ID of the operation returned. */ + readonly id?: string; + /** The name of the operation result. */ + readonly name?: string; + /** The status of the operation being performed. */ + readonly status?: OperationResultStatus; + /** The time that the operation was started. */ + readonly startTime?: Date; +} + +export function operationResultsDescriptionDeserializer(item: any): OperationResultsDescription { + return { + id: item["id"], + name: item["name"], + status: item["status"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + }; +} + +/** The status of the operation being performed. */ +export enum KnownOperationResultStatus { + Canceled = "Canceled", + Succeeded = "Succeeded", + Failed = "Failed", + Requested = "Requested", + Running = "Running", +} + +/** + * The status of the operation being performed. \ + * {@link KnownOperationResultStatus} can be used interchangeably with OperationResultStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Canceled** \ + * **Succeeded** \ + * **Failed** \ + * **Requested** \ + * **Running** + */ +export type OperationResultStatus = string; + +/** The available API versions. */ +export enum KnownVersions { + /** The 2023-09-15-preview API version. */ + V20230915Preview = "2023-09-15-preview", +} diff --git a/sdk/botservice/arm-botservice/src/models/parameters.ts b/sdk/botservice/arm-botservice/src/models/parameters.ts deleted file mode 100644 index 7bb3cbdaff45..000000000000 --- a/sdk/botservice/arm-botservice/src/models/parameters.ts +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - OperationParameter, - OperationURLParameter, - OperationQueryParameter -} from "@azure/core-client"; -import { - Bot as BotMapper, - CheckNameAvailabilityRequestBody as CheckNameAvailabilityRequestBodyMapper, - BotChannel as BotChannelMapper, - SiteInfo as SiteInfoMapper, - ConnectionSetting as ConnectionSettingMapper, - QnAMakerEndpointKeysRequestBody as QnAMakerEndpointKeysRequestBodyMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper -} from "../models/mappers.js"; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: BotMapper -}; - -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } - } -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), - MaxLength: 64, - MinLength: 2 - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String" - } - } -}; - -export const resourceName: OperationURLParameter = { - parameterPath: "resourceName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), - MaxLength: 64, - MinLength: 2 - }, - serializedName: "resourceName", - required: true, - type: { - name: "String" - } - } -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2022-09-15", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - serializedName: "subscriptionId", - required: true, - type: { - name: "String" - } - } -}; - -export const location: OperationParameter = { - parameterPath: ["options", "location"], - mapper: BotMapper -}; - -export const tags: OperationParameter = { - parameterPath: ["options", "tags"], - mapper: BotMapper -}; - -export const sku: OperationParameter = { - parameterPath: ["options", "sku"], - mapper: BotMapper -}; - -export const kind: OperationParameter = { - parameterPath: ["options", "kind"], - mapper: BotMapper -}; - -export const etag: OperationParameter = { - parameterPath: ["options", "etag"], - mapper: BotMapper -}; - -export const properties: OperationParameter = { - parameterPath: ["options", "properties"], - mapper: BotMapper -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: CheckNameAvailabilityRequestBodyMapper -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: BotChannelMapper -}; - -export const channelName: OperationURLParameter = { - parameterPath: "channelName", - mapper: { - serializedName: "channelName", - required: true, - type: { - name: "Enum", - allowedValues: [ - "AlexaChannel", - "FacebookChannel", - "EmailChannel", - "KikChannel", - "TelegramChannel", - "SlackChannel", - "MsTeamsChannel", - "SkypeChannel", - "WebChatChannel", - "DirectLineChannel", - "SmsChannel", - "LineChannel", - "DirectLineSpeechChannel", - "OutlookChannel", - "Omnichannel", - "TelephonyChannel", - "AcsChatChannel", - "SearchAssistant", - "M365Extensions" - ] - } - } -}; - -export const location1: OperationParameter = { - parameterPath: ["options", "location"], - mapper: BotChannelMapper -}; - -export const tags1: OperationParameter = { - parameterPath: ["options", "tags"], - mapper: BotChannelMapper -}; - -export const sku1: OperationParameter = { - parameterPath: ["options", "sku"], - mapper: BotChannelMapper -}; - -export const kind1: OperationParameter = { - parameterPath: ["options", "kind"], - mapper: BotChannelMapper -}; - -export const etag1: OperationParameter = { - parameterPath: ["options", "etag"], - mapper: BotChannelMapper -}; - -export const properties1: OperationParameter = { - parameterPath: ["options", "properties"], - mapper: BotChannelMapper -}; - -export const channelName1: OperationURLParameter = { - parameterPath: "channelName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), - MaxLength: 64, - MinLength: 2 - }, - serializedName: "channelName", - required: true, - type: { - name: "String" - } - } -}; - -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: SiteInfoMapper -}; - -export const channelName2: OperationURLParameter = { - parameterPath: "channelName", - mapper: { - serializedName: "channelName", - required: true, - type: { - name: "Enum", - allowedValues: ["WebChatChannel", "DirectLineChannel"] - } - } -}; - -export const connectionName: OperationURLParameter = { - parameterPath: "connectionName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$"), - MaxLength: 64, - MinLength: 2 - }, - serializedName: "connectionName", - required: true, - type: { - name: "String" - } - } -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: ConnectionSettingMapper -}; - -export const parameters7: OperationParameter = { - parameterPath: "parameters", - mapper: QnAMakerEndpointKeysRequestBodyMapper -}; - -export const operationResultId: OperationURLParameter = { - parameterPath: "operationResultId", - mapper: { - serializedName: "operationResultId", - required: true, - type: { - name: "String" - } - } -}; - -export const privateEndpointConnectionName: OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", - mapper: { - serializedName: "privateEndpointConnectionName", - required: true, - type: { - name: "String" - } - } -}; - -export const properties2: OperationParameter = { - parameterPath: "properties", - mapper: PrivateEndpointConnectionMapper -}; diff --git a/sdk/botservice/arm-botservice/src/operations/botConnection.ts b/sdk/botservice/arm-botservice/src/operations/botConnection.ts deleted file mode 100644 index 02df7b3b5b44..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/botConnection.ts +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { BotConnection } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - ConnectionSetting, - BotConnectionListByBotServiceNextOptionalParams, - BotConnectionListByBotServiceOptionalParams, - BotConnectionListByBotServiceResponse, - BotConnectionListServiceProvidersOptionalParams, - BotConnectionListServiceProvidersResponse, - BotConnectionListWithSecretsOptionalParams, - BotConnectionListWithSecretsResponse, - BotConnectionCreateOptionalParams, - BotConnectionCreateResponse, - BotConnectionUpdateOptionalParams, - BotConnectionUpdateResponse, - BotConnectionGetOptionalParams, - BotConnectionGetResponse, - BotConnectionDeleteOptionalParams, - BotConnectionListByBotServiceNextResponse -} from "../models/index.js"; - -/// -/** Class containing BotConnection operations. */ -export class BotConnectionImpl implements BotConnection { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class BotConnection class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Returns all the Connection Settings registered to a particular BotService resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - public listByBotService( - resourceGroupName: string, - resourceName: string, - options?: BotConnectionListByBotServiceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByBotServicePagingAll( - resourceGroupName, - resourceName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBotServicePagingPage( - resourceGroupName, - resourceName, - options, - settings - ); - } - }; - } - - private async *listByBotServicePagingPage( - resourceGroupName: string, - resourceName: string, - options?: BotConnectionListByBotServiceOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BotConnectionListByBotServiceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBotService( - resourceGroupName, - resourceName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBotServiceNext( - resourceGroupName, - resourceName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBotServicePagingAll( - resourceGroupName: string, - resourceName: string, - options?: BotConnectionListByBotServiceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByBotServicePagingPage( - resourceGroupName, - resourceName, - options - )) { - yield* page; - } - } - - /** - * Lists the available Service Providers for creating Connection Settings - * @param options The options parameters. - */ - listServiceProviders( - options?: BotConnectionListServiceProvidersOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { options }, - listServiceProvidersOperationSpec - ); - } - - /** - * Get a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param options The options parameters. - */ - listWithSecrets( - resourceGroupName: string, - resourceName: string, - connectionName: string, - options?: BotConnectionListWithSecretsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, connectionName, options }, - listWithSecretsOperationSpec - ); - } - - /** - * Register a new Auth Connection for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param parameters The parameters to provide for creating the Connection Setting. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - connectionName: string, - parameters: ConnectionSetting, - options?: BotConnectionCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, connectionName, parameters, options }, - createOperationSpec - ); - } - - /** - * Updates a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param parameters The parameters to provide for updating the Connection Setting. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - connectionName: string, - parameters: ConnectionSetting, - options?: BotConnectionUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, connectionName, parameters, options }, - updateOperationSpec - ); - } - - /** - * Get a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - connectionName: string, - options?: BotConnectionGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, connectionName, options }, - getOperationSpec - ); - } - - /** - * Deletes a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - connectionName: string, - options?: BotConnectionDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, connectionName, options }, - deleteOperationSpec - ); - } - - /** - * Returns all the Connection Settings registered to a particular BotService resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - private _listByBotService( - resourceGroupName: string, - resourceName: string, - options?: BotConnectionListByBotServiceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - listByBotServiceOperationSpec - ); - } - - /** - * ListByBotServiceNext - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param nextLink The nextLink from the previous successful call to the ListByBotService method. - * @param options The options parameters. - */ - private _listByBotServiceNext( - resourceGroupName: string, - resourceName: string, - nextLink: string, - options?: BotConnectionListByBotServiceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, nextLink, options }, - listByBotServiceNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listServiceProvidersOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ServiceProviderResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listWithSecretsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ConnectionSetting - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.connectionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ConnectionSetting - }, - 201: { - bodyMapper: Mappers.ConnectionSetting - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.connectionName - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ConnectionSetting - }, - 201: { - bodyMapper: Mappers.ConnectionSetting - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.connectionName - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ConnectionSetting - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.connectionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.connectionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByBotServiceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ConnectionSettingResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByBotServiceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ConnectionSettingResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/bots.ts b/sdk/botservice/arm-botservice/src/operations/bots.ts deleted file mode 100644 index ff4ef0c1b22d..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/bots.ts +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Bots } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - Bot, - BotsListByResourceGroupNextOptionalParams, - BotsListByResourceGroupOptionalParams, - BotsListByResourceGroupResponse, - BotsListNextOptionalParams, - BotsListOptionalParams, - BotsListResponse, - BotsCreateOptionalParams, - BotsCreateResponse, - BotsUpdateOptionalParams, - BotsUpdateResponse, - BotsDeleteOptionalParams, - BotsGetOptionalParams, - BotsGetResponse, - CheckNameAvailabilityRequestBody, - BotsGetCheckNameAvailabilityOptionalParams, - BotsGetCheckNameAvailabilityResponse, - BotsListByResourceGroupNextResponse, - BotsListNextResponse -} from "../models/index.js"; - -/// -/** Class containing Bots operations. */ -export class BotsImpl implements Bots { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class Bots class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Returns all the resources of a particular type belonging to a resource group - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: BotsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: BotsListByResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BotsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: BotsListByResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * @param options The options parameters. - */ - public list( - options?: BotsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - } - }; - } - - private async *listPagingPage( - options?: BotsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BotsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: BotsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Creates a Bot Service. Bot Service is a resource group wide resource type. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - parameters: Bot, - options?: BotsCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, parameters, options }, - createOperationSpec - ); - } - - /** - * Updates a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - options?: BotsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - updateOperationSpec - ); - } - - /** - * Deletes a Bot Service from the resource group. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - options?: BotsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - deleteOperationSpec - ); - } - - /** - * Returns a BotService specified by the parameters. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - options?: BotsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - getOperationSpec - ); - } - - /** - * Returns all the resources of a particular type belonging to a resource group - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: BotsListByResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec - ); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * @param options The options parameters. - */ - private _list(options?: BotsListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Check whether a bot name is available. - * @param parameters The request body parameters to provide for the check name availability request - * @param options The options parameters. - */ - getCheckNameAvailability( - parameters: CheckNameAvailabilityRequestBody, - options?: BotsGetCheckNameAvailabilityOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { parameters, options }, - getCheckNameAvailabilityOperationSpec - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: BotsListByResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: BotsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Bot - }, - 201: { - bodyMapper: Mappers.Bot - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Bot - }, - 201: { - bodyMapper: Mappers.Bot - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: { - parameterPath: { - location: ["options", "location"], - tags: ["options", "tags"], - sku: ["options", "sku"], - kind: ["options", "kind"], - etag: ["options", "etag"], - properties: ["options", "properties"] - }, - mapper: { ...Mappers.Bot, required: true } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Bot - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BotResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BotResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const getCheckNameAvailabilityOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.BotService/checkNameAvailability", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.CheckNameAvailabilityResponseBody - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BotResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BotResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/channels.ts b/sdk/botservice/arm-botservice/src/operations/channels.ts deleted file mode 100644 index acb425cae01c..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/channels.ts +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Channels } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - BotChannel, - ChannelsListByResourceGroupNextOptionalParams, - ChannelsListByResourceGroupOptionalParams, - ChannelsListByResourceGroupResponse, - ChannelName, - ChannelsCreateOptionalParams, - ChannelsCreateResponse, - ChannelsUpdateOptionalParams, - ChannelsUpdateResponse, - ChannelsDeleteOptionalParams, - ChannelsGetOptionalParams, - ChannelsGetResponse, - ChannelsListWithKeysOptionalParams, - ChannelsListWithKeysResponse, - ChannelsListByResourceGroupNextResponse -} from "../models/index.js"; - -/// -/** Class containing Channels operations. */ -export class ChannelsImpl implements Channels { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class Channels class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Returns all the Channel registrations of a particular BotService resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - resourceName: string, - options?: ChannelsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll( - resourceGroupName, - resourceName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - resourceName, - options, - settings - ); - } - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - resourceName: string, - options?: ChannelsListByResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: ChannelsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup( - resourceGroupName, - resourceName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - resourceName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - resourceName: string, - options?: ChannelsListByResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - resourceName, - options - )) { - yield* page; - } - } - - /** - * Creates a Channel registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource. - * @param parameters The parameters to provide for the created bot. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - channelName: ChannelName, - parameters: BotChannel, - options?: ChannelsCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, channelName, parameters, options }, - createOperationSpec - ); - } - - /** - * Updates a Channel registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - channelName: ChannelName, - options?: ChannelsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, channelName, options }, - updateOperationSpec - ); - } - - /** - * Deletes a Channel registration from a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Bot resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - channelName: string, - options?: ChannelsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, channelName, options }, - deleteOperationSpec - ); - } - - /** - * Returns a BotService Channel registration specified by the parameters. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Bot resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - channelName: string, - options?: ChannelsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, channelName, options }, - getOperationSpec - ); - } - - /** - * Lists a Channel registration for a Bot Service including secrets - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource. - * @param options The options parameters. - */ - listWithKeys( - resourceGroupName: string, - resourceName: string, - channelName: ChannelName, - options?: ChannelsListWithKeysOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, channelName, options }, - listWithKeysOperationSpec - ); - } - - /** - * Returns all the Channel registrations of a particular BotService resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - resourceName: string, - options?: ChannelsListByResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - listByResourceGroupOperationSpec - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - resourceName: string, - nextLink: string, - options?: ChannelsListByResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, nextLink, options }, - listByResourceGroupNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.BotChannel - }, - 201: { - bodyMapper: Mappers.BotChannel - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.channelName - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.BotChannel - }, - 201: { - bodyMapper: Mappers.BotChannel - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: { - parameterPath: { - location: ["options", "location"], - tags: ["options", "tags"], - sku: ["options", "sku"], - kind: ["options", "kind"], - etag: ["options", "etag"], - properties: ["options", "properties"] - }, - mapper: { ...Mappers.BotChannel, required: true } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.channelName - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.channelName1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BotChannel - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.channelName1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listWithKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/listChannelWithKeys", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ListChannelWithKeysResponse - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.channelName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ChannelResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ChannelResponseList - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/directLine.ts b/sdk/botservice/arm-botservice/src/operations/directLine.ts deleted file mode 100644 index 1d0afa44c46e..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/directLine.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { DirectLine } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - SiteInfo, - RegenerateKeysChannelName, - DirectLineRegenerateKeysOptionalParams, - DirectLineRegenerateKeysResponse -} from "../models/index.js"; - -/** Class containing DirectLine operations. */ -export class DirectLineImpl implements DirectLine { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class DirectLine class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService - * resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource for which keys are to be regenerated. - * @param parameters The parameters to provide for the created bot. - * @param options The options parameters. - */ - regenerateKeys( - resourceGroupName: string, - resourceName: string, - channelName: RegenerateKeysChannelName, - parameters: SiteInfo, - options?: DirectLineRegenerateKeysOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, channelName, parameters, options }, - regenerateKeysOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const regenerateKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.BotChannel - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.channelName2 - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/email.ts b/sdk/botservice/arm-botservice/src/operations/email.ts deleted file mode 100644 index 25c9f2e2798d..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/email.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { Email } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - EmailCreateSignInUrlOptionalParams, - EmailCreateSignInUrlResponse -} from "../models/index.js"; - -/** Class containing Email operations. */ -export class EmailImpl implements Email { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class Email class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Creates an email channel sign in url for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - createSignInUrl( - resourceGroupName: string, - resourceName: string, - options?: EmailCreateSignInUrlOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - createSignInUrlOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createSignInUrlOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/createEmailSignInUrl", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.CreateEmailSignInUrlResponse - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/hostSettings.ts b/sdk/botservice/arm-botservice/src/operations/hostSettings.ts deleted file mode 100644 index af323174fe03..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/hostSettings.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { HostSettings } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - HostSettingsGetOptionalParams, - HostSettingsGetResponse -} from "../models/index.js"; - -/** Class containing HostSettings operations. */ -export class HostSettingsImpl implements HostSettings { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class HostSettings class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Get per subscription settings needed to host bot in compute resource such as Azure App Service - * @param options The options parameters. - */ - get( - options?: HostSettingsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, getOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.HostSettingsResponse - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/index.ts b/sdk/botservice/arm-botservice/src/operations/index.ts deleted file mode 100644 index 5d5f4be4b6d4..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./bots.js"; -export * from "./channels.js"; -export * from "./directLine.js"; -export * from "./email.js"; -export * from "./operations.js"; -export * from "./botConnection.js"; -export * from "./qnAMakerEndpointKeys.js"; -export * from "./hostSettings.js"; -export * from "./operationResults.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; diff --git a/sdk/botservice/arm-botservice/src/operations/operationResults.ts b/sdk/botservice/arm-botservice/src/operations/operationResults.ts deleted file mode 100644 index 497234ccb57e..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/operationResults.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { OperationResults } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl.js"; -import { - OperationResultsGetOptionalParams, - OperationResultsGetResponse -} from "../models/index.js"; - -/** Class containing OperationResults operations. */ -export class OperationResultsImpl implements OperationResults { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class OperationResults class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Get the operation result for a long running operation. - * @param operationResultId The ID of the operation result to get. - * @param options The options parameters. - */ - async beginGet( - operationResultId: string, - options?: OperationResultsGetOptionalParams - ): Promise< - PollerLike< - PollOperationState, - OperationResultsGetResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { operationResultId, options }, - getOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * Get the operation result for a long running operation. - * @param operationResultId The ID of the operation result to get. - * @param options The options parameters. - */ - async beginGetAndWait( - operationResultId: string, - options?: OperationResultsGetOptionalParams - ): Promise { - const poller = await this.beginGet(operationResultId, options); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationResultsDescription - }, - 201: { - bodyMapper: Mappers.OperationResultsDescription - }, - 202: { - bodyMapper: Mappers.OperationResultsDescription - }, - 204: { - bodyMapper: Mappers.OperationResultsDescription - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.operationResultId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/operations.ts b/sdk/botservice/arm-botservice/src/operations/operations.ts deleted file mode 100644 index b757beecc3ce..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/operations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Operations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - OperationEntity, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse -} from "../models/index.js"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Lists all the available BotService operations. - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - } - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all the available BotService operations. - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.BotService/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationEntityListResult - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationEntityListResult - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/privateEndpointConnections.ts b/sdk/botservice/arm-botservice/src/operations/privateEndpointConnections.ts deleted file mode 100644 index 96c656dd8a0f..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/privateEndpointConnections.ts +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PrivateEndpointConnections } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsListResponse, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsCreateResponse, - PrivateEndpointConnectionsDeleteOptionalParams -} from "../models/index.js"; - -/// -/** Class containing PrivateEndpointConnections operations. */ -export class PrivateEndpointConnectionsImpl - implements PrivateEndpointConnections { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class PrivateEndpointConnections class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * List all the private endpoint connections associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - resourceName: string, - options?: PrivateEndpointConnectionsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, resourceName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - resourceName, - options, - settings - ); - } - }; - } - - private async *listPagingPage( - resourceGroupName: string, - resourceName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - _settings?: PageSettings - ): AsyncIterableIterator { - let result: PrivateEndpointConnectionsListResponse; - result = await this._list(resourceGroupName, resourceName, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceGroupName: string, - resourceName: string, - options?: PrivateEndpointConnectionsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - resourceName, - options - )) { - yield* page; - } - } - - /** - * List all the private endpoint connections associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - resourceName: string, - options?: PrivateEndpointConnectionsListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - listOperationSpec - ); - } - - /** - * Gets the specified private endpoint connection associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - privateEndpointConnectionName, - options - }, - getOperationSpec - ); - } - - /** - * Update the state of specified private endpoint connection associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param properties The private endpoint connection properties. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - privateEndpointConnectionName, - properties, - options - }, - createOperationSpec - ); - } - - /** - * Deletes the specified private endpoint connection associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - privateEndpointConnectionName, - options - }, - deleteOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.privateEndpointConnectionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.properties2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.privateEndpointConnectionName - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId, - Parameters.privateEndpointConnectionName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/privateLinkResources.ts b/sdk/botservice/arm-botservice/src/operations/privateLinkResources.ts deleted file mode 100644 index ef08264bc5f9..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/privateLinkResources.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PrivateLinkResources } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - PrivateLinkResourcesListByBotResourceOptionalParams, - PrivateLinkResourcesListByBotResourceResponse -} from "../models/index.js"; - -/** Class containing PrivateLinkResources operations. */ -export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class PrivateLinkResources class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Gets the private link resources that need to be created for a Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - listByBotResource( - resourceGroupName: string, - resourceName: string, - options?: PrivateLinkResourcesListByBotResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - listByBotResourceOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByBotResourceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operations/qnAMakerEndpointKeys.ts b/sdk/botservice/arm-botservice/src/operations/qnAMakerEndpointKeys.ts deleted file mode 100644 index 31978213a28e..000000000000 --- a/sdk/botservice/arm-botservice/src/operations/qnAMakerEndpointKeys.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { QnAMakerEndpointKeys } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { AzureBotService } from "../azureBotService.js"; -import { - QnAMakerEndpointKeysRequestBody, - QnAMakerEndpointKeysGetOptionalParams, - QnAMakerEndpointKeysGetResponse -} from "../models/index.js"; - -/** Class containing QnAMakerEndpointKeys operations. */ -export class QnAMakerEndpointKeysImpl implements QnAMakerEndpointKeys { - private readonly client: AzureBotService; - - /** - * Initialize a new instance of the class QnAMakerEndpointKeys class. - * @param client Reference to the service client - */ - constructor(client: AzureBotService) { - this.client = client; - } - - /** - * Lists the QnA Maker endpoint keys - * @param parameters The request body parameters to provide for the check name availability request - * @param options The options parameters. - */ - get( - parameters: QnAMakerEndpointKeysRequestBody, - options?: QnAMakerEndpointKeysGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { parameters, options }, - getOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.QnAMakerEndpointKeysResponse - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer -}; diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/botConnection.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/botConnection.ts deleted file mode 100644 index aa29847cf225..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/botConnection.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - ConnectionSetting, - BotConnectionListByBotServiceOptionalParams, - BotConnectionListServiceProvidersOptionalParams, - BotConnectionListServiceProvidersResponse, - BotConnectionListWithSecretsOptionalParams, - BotConnectionListWithSecretsResponse, - BotConnectionCreateOptionalParams, - BotConnectionCreateResponse, - BotConnectionUpdateOptionalParams, - BotConnectionUpdateResponse, - BotConnectionGetOptionalParams, - BotConnectionGetResponse, - BotConnectionDeleteOptionalParams -} from "../models/index.js"; - -/// -/** Interface representing a BotConnection. */ -export interface BotConnection { - /** - * Returns all the Connection Settings registered to a particular BotService resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - listByBotService( - resourceGroupName: string, - resourceName: string, - options?: BotConnectionListByBotServiceOptionalParams - ): PagedAsyncIterableIterator; - /** - * Lists the available Service Providers for creating Connection Settings - * @param options The options parameters. - */ - listServiceProviders( - options?: BotConnectionListServiceProvidersOptionalParams - ): Promise; - /** - * Get a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param options The options parameters. - */ - listWithSecrets( - resourceGroupName: string, - resourceName: string, - connectionName: string, - options?: BotConnectionListWithSecretsOptionalParams - ): Promise; - /** - * Register a new Auth Connection for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param parameters The parameters to provide for creating the Connection Setting. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - connectionName: string, - parameters: ConnectionSetting, - options?: BotConnectionCreateOptionalParams - ): Promise; - /** - * Updates a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param parameters The parameters to provide for updating the Connection Setting. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - connectionName: string, - parameters: ConnectionSetting, - options?: BotConnectionUpdateOptionalParams - ): Promise; - /** - * Get a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - connectionName: string, - options?: BotConnectionGetOptionalParams - ): Promise; - /** - * Deletes a Connection Setting registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param connectionName The name of the Bot Service Connection Setting resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - connectionName: string, - options?: BotConnectionDeleteOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/bots.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/bots.ts deleted file mode 100644 index a1cb30b9e472..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/bots.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - Bot, - BotsListByResourceGroupOptionalParams, - BotsListOptionalParams, - BotsCreateOptionalParams, - BotsCreateResponse, - BotsUpdateOptionalParams, - BotsUpdateResponse, - BotsDeleteOptionalParams, - BotsGetOptionalParams, - BotsGetResponse, - CheckNameAvailabilityRequestBody, - BotsGetCheckNameAvailabilityOptionalParams, - BotsGetCheckNameAvailabilityResponse -} from "../models/index.js"; - -/// -/** Interface representing a Bots. */ -export interface Bots { - /** - * Returns all the resources of a particular type belonging to a resource group - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: BotsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Returns all the resources of a particular type belonging to a subscription. - * @param options The options parameters. - */ - list(options?: BotsListOptionalParams): PagedAsyncIterableIterator; - /** - * Creates a Bot Service. Bot Service is a resource group wide resource type. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - parameters: Bot, - options?: BotsCreateOptionalParams - ): Promise; - /** - * Updates a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - options?: BotsUpdateOptionalParams - ): Promise; - /** - * Deletes a Bot Service from the resource group. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - options?: BotsDeleteOptionalParams - ): Promise; - /** - * Returns a BotService specified by the parameters. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - options?: BotsGetOptionalParams - ): Promise; - /** - * Check whether a bot name is available. - * @param parameters The request body parameters to provide for the check name availability request - * @param options The options parameters. - */ - getCheckNameAvailability( - parameters: CheckNameAvailabilityRequestBody, - options?: BotsGetCheckNameAvailabilityOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/channels.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/channels.ts deleted file mode 100644 index 5c8452a91db8..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/channels.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - BotChannel, - ChannelsListByResourceGroupOptionalParams, - ChannelName, - ChannelsCreateOptionalParams, - ChannelsCreateResponse, - ChannelsUpdateOptionalParams, - ChannelsUpdateResponse, - ChannelsDeleteOptionalParams, - ChannelsGetOptionalParams, - ChannelsGetResponse, - ChannelsListWithKeysOptionalParams, - ChannelsListWithKeysResponse -} from "../models/index.js"; - -/// -/** Interface representing a Channels. */ -export interface Channels { - /** - * Returns all the Channel registrations of a particular BotService resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - resourceName: string, - options?: ChannelsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Creates a Channel registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource. - * @param parameters The parameters to provide for the created bot. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - channelName: ChannelName, - parameters: BotChannel, - options?: ChannelsCreateOptionalParams - ): Promise; - /** - * Updates a Channel registration for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - channelName: ChannelName, - options?: ChannelsUpdateOptionalParams - ): Promise; - /** - * Deletes a Channel registration from a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Bot resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - channelName: string, - options?: ChannelsDeleteOptionalParams - ): Promise; - /** - * Returns a BotService Channel registration specified by the parameters. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Bot resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - channelName: string, - options?: ChannelsGetOptionalParams - ): Promise; - /** - * Lists a Channel registration for a Bot Service including secrets - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource. - * @param options The options parameters. - */ - listWithKeys( - resourceGroupName: string, - resourceName: string, - channelName: ChannelName, - options?: ChannelsListWithKeysOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/directLine.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/directLine.ts deleted file mode 100644 index 19f43d192cd5..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/directLine.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - SiteInfo, - RegenerateKeysChannelName, - DirectLineRegenerateKeysOptionalParams, - DirectLineRegenerateKeysResponse -} from "../models/index.js"; - -/** Interface representing a DirectLine. */ -export interface DirectLine { - /** - * Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService - * resource - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param channelName The name of the Channel resource for which keys are to be regenerated. - * @param parameters The parameters to provide for the created bot. - * @param options The options parameters. - */ - regenerateKeys( - resourceGroupName: string, - resourceName: string, - channelName: RegenerateKeysChannelName, - parameters: SiteInfo, - options?: DirectLineRegenerateKeysOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/email.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/email.ts deleted file mode 100644 index 411950835eff..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/email.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - EmailCreateSignInUrlOptionalParams, - EmailCreateSignInUrlResponse -} from "../models/index.js"; - -/** Interface representing a Email. */ -export interface Email { - /** - * Creates an email channel sign in url for a Bot Service - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - createSignInUrl( - resourceGroupName: string, - resourceName: string, - options?: EmailCreateSignInUrlOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/hostSettings.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/hostSettings.ts deleted file mode 100644 index 31f1b9519e36..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/hostSettings.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - HostSettingsGetOptionalParams, - HostSettingsGetResponse -} from "../models/index.js"; - -/** Interface representing a HostSettings. */ -export interface HostSettings { - /** - * Get per subscription settings needed to host bot in compute resource such as Azure App Service - * @param options The options parameters. - */ - get( - options?: HostSettingsGetOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/index.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/index.ts deleted file mode 100644 index 5d5f4be4b6d4..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./bots.js"; -export * from "./channels.js"; -export * from "./directLine.js"; -export * from "./email.js"; -export * from "./operations.js"; -export * from "./botConnection.js"; -export * from "./qnAMakerEndpointKeys.js"; -export * from "./hostSettings.js"; -export * from "./operationResults.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/operationResults.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/operationResults.ts deleted file mode 100644 index 52e52c111e1b..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/operationResults.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PollerLike, PollOperationState } from "@azure/core-lro"; -import { - OperationResultsGetOptionalParams, - OperationResultsGetResponse -} from "../models/index.js"; - -/** Interface representing a OperationResults. */ -export interface OperationResults { - /** - * Get the operation result for a long running operation. - * @param operationResultId The ID of the operation result to get. - * @param options The options parameters. - */ - beginGet( - operationResultId: string, - options?: OperationResultsGetOptionalParams - ): Promise< - PollerLike< - PollOperationState, - OperationResultsGetResponse - > - >; - /** - * Get the operation result for a long running operation. - * @param operationResultId The ID of the operation result to get. - * @param options The options parameters. - */ - beginGetAndWait( - operationResultId: string, - options?: OperationResultsGetOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/operations.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/operations.ts deleted file mode 100644 index f5a58e206af3..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { OperationEntity, OperationsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * Lists all the available BotService operations. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/privateEndpointConnections.ts deleted file mode 100644 index 46dc34779999..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/privateEndpointConnections.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsCreateResponse, - PrivateEndpointConnectionsDeleteOptionalParams -} from "../models/index.js"; - -/// -/** Interface representing a PrivateEndpointConnections. */ -export interface PrivateEndpointConnections { - /** - * List all the private endpoint connections associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - resourceName: string, - options?: PrivateEndpointConnectionsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets the specified private endpoint connection associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams - ): Promise; - /** - * Update the state of specified private endpoint connection associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param properties The private endpoint connection properties. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams - ): Promise; - /** - * Deletes the specified private endpoint connection associated with the Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/privateLinkResources.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/privateLinkResources.ts deleted file mode 100644 index 14d9e29b01b0..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/privateLinkResources.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - PrivateLinkResourcesListByBotResourceOptionalParams, - PrivateLinkResourcesListByBotResourceResponse -} from "../models/index.js"; - -/** Interface representing a PrivateLinkResources. */ -export interface PrivateLinkResources { - /** - * Gets the private link resources that need to be created for a Bot. - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param resourceName The name of the Bot resource. - * @param options The options parameters. - */ - listByBotResource( - resourceGroupName: string, - resourceName: string, - options?: PrivateLinkResourcesListByBotResourceOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/operationsInterfaces/qnAMakerEndpointKeys.ts b/sdk/botservice/arm-botservice/src/operationsInterfaces/qnAMakerEndpointKeys.ts deleted file mode 100644 index 440fb6a6b93e..000000000000 --- a/sdk/botservice/arm-botservice/src/operationsInterfaces/qnAMakerEndpointKeys.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - QnAMakerEndpointKeysRequestBody, - QnAMakerEndpointKeysGetOptionalParams, - QnAMakerEndpointKeysGetResponse -} from "../models/index.js"; - -/** Interface representing a QnAMakerEndpointKeys. */ -export interface QnAMakerEndpointKeys { - /** - * Lists the QnA Maker endpoint keys - * @param parameters The request body parameters to provide for the check name availability request - * @param options The options parameters. - */ - get( - parameters: QnAMakerEndpointKeysRequestBody, - options?: QnAMakerEndpointKeysGetOptionalParams - ): Promise; -} diff --git a/sdk/botservice/arm-botservice/src/pagingHelper.ts b/sdk/botservice/arm-botservice/src/pagingHelper.ts deleted file mode 100644 index 269a2b9814b5..000000000000 --- a/sdk/botservice/arm-botservice/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/botservice/arm-botservice/src/restorePollerHelpers.ts b/sdk/botservice/arm-botservice/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..21fd15bfd212 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/restorePollerHelpers.ts @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BotServiceClient } from "./botServiceClient.js"; +import { _getDeserialize } from "./api/operationResultsOperationGroup/operations.js"; +import { _reconcileDeserialize } from "./api/networkSecurityPerimeterConfigurations/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: BotServiceClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "GET /subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}": + { deserializer: _getDeserialize, expectedStatuses: ["200", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile": + { deserializer: _reconcileDeserialize, expectedStatuses: ["202", "200"] }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // 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) { + 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] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/botservice/arm-botservice/src/static-helpers/pagingHelpers.ts b/sdk/botservice/arm-botservice/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..ce33af5f4178 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/botservice/arm-botservice/src/static-helpers/pollingHelpers.ts b/sdk/botservice/arm-botservice/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..f01c41bab69d --- /dev/null +++ b/sdk/botservice/arm-botservice/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/botservice/arm-botservice/src/static-helpers/urlTemplate.ts b/sdk/botservice/arm-botservice/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..cd03319fda35 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/static-helpers/urlTemplate.ts @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +//--------------------- +// interfaces +//--------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string) { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string) { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string) { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any) { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false) { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions) { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + val === "" ? vals.push(ifEmpty) : vals.push("="); + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + named && val === "" ? vals.push(ifEmpty) : vals.push("="); + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions) { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + val === "" ? vals.push(ifEmpty) : vals.push("="); + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + (op = expr[0]), (expr = expr.slice(1)); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:\*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); +} diff --git a/sdk/botservice/arm-botservice/test/botservice_examples.spec.ts b/sdk/botservice/arm-botservice/test/botservice_examples.spec.ts deleted file mode 100644 index 88bc3591a5d4..000000000000 --- a/sdk/botservice/arm-botservice/test/botservice_examples.spec.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import type { RecorderStartOptions } from "@azure-tools/test-recorder"; -import { env, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { AzureBotService } from "../src/azureBotService.js"; -import { afterEach, assert, beforeEach, describe, it } from "vitest"; - -const replaceableVariables: Record = { - SUBSCRIPTION_ID: "azure_subscription_id", -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("Botservice test", () => { - let recorder: Recorder; - let client: AzureBotService; - let subscriptionId: string; - - beforeEach(async (ctx) => { - recorder = new Recorder(ctx); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ""; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new AzureBotService(credential, subscriptionId, recorder.configureClientOptions({})); - }); - - afterEach(async () => { - await recorder.stop(); - }); - - it("operations list test", async () => { - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - assert.notEqual(resArray.length, 0); - }); -}); diff --git a/sdk/botservice/arm-botservice/test/public/sampleTest.spec.ts b/sdk/botservice/arm-botservice/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..e4591bbad342 --- /dev/null +++ b/sdk/botservice/arm-botservice/test/public/sampleTest.spec.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async () => { + // recorder = await createRecorder(this); + }); + + afterEach(async () => { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/botservice/arm-botservice/test/public/utils/recordedClient.ts b/sdk/botservice/arm-botservice/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..14dcd9fa397c --- /dev/null +++ b/sdk/botservice/arm-botservice/test/public/utils/recordedClient.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Recorder, RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder(context: VitestTestContext): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/botservice/arm-botservice/test/snippets.spec.ts b/sdk/botservice/arm-botservice/test/snippets.spec.ts index 1a8f5075bbad..c0a3fabb31b7 100644 --- a/sdk/botservice/arm-botservice/test/snippets.spec.ts +++ b/sdk/botservice/arm-botservice/test/snippets.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { AzureBotService } from "../src/index.js"; +import { BotServiceClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; @@ -9,7 +9,7 @@ import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new AzureBotService(new DefaultAzureCredential(), subscriptionId); + const client = new BotServiceClient(new DefaultAzureCredential(), subscriptionId); }); it("ReadmeSampleCreateClient_Browser", async () => { @@ -18,7 +18,7 @@ describe("snippets", () => { tenantId: "", clientId: "", }); - const client = new AzureBotService(credential, subscriptionId); + const client = new BotServiceClient(credential, subscriptionId); }); it("SetLogLevel", async () => { diff --git a/sdk/botservice/arm-botservice/tsconfig.browser.config.json b/sdk/botservice/arm-botservice/tsconfig.browser.config.json index b6586181d006..75871518e3a0 100644 --- a/sdk/botservice/arm-botservice/tsconfig.browser.config.json +++ b/sdk/botservice/arm-botservice/tsconfig.browser.config.json @@ -1,17 +1,3 @@ { - "extends": "./.tshy/build.json", - "include": [ - "./src/**/*.ts", - "./src/**/*.mts", - "./test/**/*.spec.ts", - "./test/**/*.mts" - ], - "exclude": [ - "./test/**/node/**/*.ts" - ], - "compilerOptions": { - "outDir": "./dist-test/browser", - "rootDir": ".", - "skipLibCheck": true - } + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] } diff --git a/sdk/botservice/arm-botservice/tsconfig.samples.json b/sdk/botservice/arm-botservice/tsconfig.samples.json index f9408972b093..9056588bc39f 100644 --- a/sdk/botservice/arm-botservice/tsconfig.samples.json +++ b/sdk/botservice/arm-botservice/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-botservice": [ - "./dist/esm" - ] + "@azure/arm-botservice": ["./dist/esm"] } } } diff --git a/sdk/botservice/arm-botservice/tsconfig.test.json b/sdk/botservice/arm-botservice/tsconfig.test.json index 3c2b783a8c1b..290ca214aebc 100644 --- a/sdk/botservice/arm-botservice/tsconfig.test.json +++ b/sdk/botservice/arm-botservice/tsconfig.test.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.src.json", - "../../../tsconfig.test.base.json" - ] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] } diff --git a/sdk/botservice/arm-botservice/tsp-location.yaml b/sdk/botservice/arm-botservice/tsp-location.yaml new file mode 100644 index 000000000000..b38901c27408 --- /dev/null +++ b/sdk/botservice/arm-botservice/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/botservice/BotService.Management +commit: 7be0444544b6bdd1aad8f9103f7620602aec7a1c +repo: ../azure-rest-api-specs +additionalDirectories: diff --git a/sdk/botservice/arm-botservice/vitest.browser.config.ts b/sdk/botservice/arm-botservice/vitest.browser.config.ts index b48c61b2ef46..182729ab5ce9 100644 --- a/sdk/botservice/arm-botservice/vitest.browser.config.ts +++ b/sdk/botservice/arm-botservice/vitest.browser.config.ts @@ -9,9 +9,9 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: [ - "dist-test/browser/test/**/*.spec.js", - ], + include: ["dist-test/browser/test/**/*.spec.js",], + testTimeout: 1200000, + hookTimeout: 1200000, }, }), ); diff --git a/sdk/botservice/arm-botservice/vitest.config.ts b/sdk/botservice/arm-botservice/vitest.config.ts index 2a4750c84292..40e031385dd8 100644 --- a/sdk/botservice/arm-botservice/vitest.config.ts +++ b/sdk/botservice/arm-botservice/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,8 +9,8 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - hookTimeout: 1200000, testTimeout: 1200000, + hookTimeout: 1200000, }, }), ); diff --git a/sdk/botservice/ci.mgmt.yml b/sdk/botservice/ci.mgmt.yml index 705201570497..adc95f7f7156 100644 --- a/sdk/botservice/ci.mgmt.yml +++ b/sdk/botservice/ci.mgmt.yml @@ -1,11 +1,13 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: - main - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/botservice/ci.mgmt.yml