From 33602ffe73abe54cf4c4e232ee60057d0ab3395e Mon Sep 17 00:00:00 2001 From: colawwj <70128817+colawwj@users.noreply.github.com> Date: Wed, 28 Jul 2021 10:00:53 +0800 Subject: [PATCH] arm-botservice (#16597) * arm-botservice * arm-botservice --- sdk/botservice/arm-botservice/LICENSE.txt | 2 +- sdk/botservice/arm-botservice/README.md | 8 +- sdk/botservice/arm-botservice/package.json | 4 +- .../arm-botservice/rollup.config.js | 4 +- .../arm-botservice/src/azureBotService.ts | 7 +- .../src/azureBotServiceContext.ts | 11 +- .../src/models/botConnectionMappers.ts | 4 +- .../arm-botservice/src/models/botsMappers.ts | 4 +- .../src/models/channelsMappers.ts | 4 +- .../src/models/directLineMappers.ts | 4 +- .../src/models/hostSettingsMappers.ts | 14 +++ .../arm-botservice/src/models/index.ts | 115 +++++++++++++++--- .../arm-botservice/src/models/mappers.ts | 106 ++++++++++++++-- .../src/models/operationsMappers.ts | 7 +- .../arm-botservice/src/models/parameters.ts | 5 +- .../src/operations/botConnection.ts | 18 +-- .../arm-botservice/src/operations/bots.ts | 11 +- .../arm-botservice/src/operations/channels.ts | 8 +- .../src/operations/directLine.ts | 5 +- .../src/operations/hostSettings.ts | 76 ++++++++++++ .../arm-botservice/src/operations/index.ts | 6 +- .../src/operations/operations.ts | 12 +- 22 files changed, 346 insertions(+), 89 deletions(-) create mode 100644 sdk/botservice/arm-botservice/src/models/hostSettingsMappers.ts create mode 100644 sdk/botservice/arm-botservice/src/operations/hostSettings.ts diff --git a/sdk/botservice/arm-botservice/LICENSE.txt b/sdk/botservice/arm-botservice/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/botservice/arm-botservice/LICENSE.txt +++ b/sdk/botservice/arm-botservice/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/botservice/arm-botservice/README.md b/sdk/botservice/arm-botservice/README.md index 0ee386505106..e9bf67944f86 100644 --- a/sdk/botservice/arm-botservice/README.md +++ b/sdk/botservice/arm-botservice/README.md @@ -1,11 +1,11 @@ ## Azure AzureBotService SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureBotService. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for AzureBotService. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-botservice @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and get bots as an example written in JavaScript. ##### Sample code @@ -87,7 +85,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmBotservice.AzureBotService(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; diff --git a/sdk/botservice/arm-botservice/package.json b/sdk/botservice/arm-botservice/package.json index b7a3d0fead4f..df4fa73884c6 100644 --- a/sdk/botservice/arm-botservice/package.json +++ b/sdk/botservice/arm-botservice/package.json @@ -2,7 +2,7 @@ "name": "@azure/arm-botservice", "author": "Microsoft Corporation", "description": "AzureBotService Library with typescript type definitions for node.js and browser.", - "version": "2.1.0", + "version": "3.0.0", "dependencies": { "@azure/ms-rest-azure-js": "^2.1.0", "@azure/ms-rest-js": "^2.2.0", @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/botservice/arm-botservice", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/botservice/arm-botservice", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/botservice/arm-botservice/rollup.config.js b/sdk/botservice/arm-botservice/rollup.config.js index b8625979d3b4..6543f70a0a0b 100644 --- a/sdk/botservice/arm-botservice/rollup.config.js +++ b/sdk/botservice/arm-botservice/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/botservice/arm-botservice/src/azureBotService.ts b/sdk/botservice/arm-botservice/src/azureBotService.ts index 771e3e36fec4..2d37e1ef8f88 100644 --- a/sdk/botservice/arm-botservice/src/azureBotService.ts +++ b/sdk/botservice/arm-botservice/src/azureBotService.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -23,6 +22,7 @@ class AzureBotService extends AzureBotServiceContext { directLine: operations.DirectLine; operations: operations.Operations; botConnection: operations.BotConnection; + hostSettings: operations.HostSettings; /** * Initializes a new instance of the AzureBotService class. @@ -42,6 +42,7 @@ class AzureBotService extends AzureBotServiceContext { this.directLine = new operations.DirectLine(this); this.operations = new operations.Operations(this); this.botConnection = new operations.BotConnection(this); + this.hostSettings = new operations.HostSettings(this); } } diff --git a/sdk/botservice/arm-botservice/src/azureBotServiceContext.ts b/sdk/botservice/arm-botservice/src/azureBotServiceContext.ts index 3261b8039599..68e7802e1cbc 100644 --- a/sdk/botservice/arm-botservice/src/azureBotServiceContext.ts +++ b/sdk/botservice/arm-botservice/src/azureBotServiceContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -10,11 +9,11 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-botservice"; -const packageVersion = "2.1.0"; +const packageVersion = "3.0.0"; export class AzureBotServiceContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials | TokenCredential; @@ -50,7 +49,7 @@ export class AzureBotServiceContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2020-06-02'; + this.apiVersion = '2021-03-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/botservice/arm-botservice/src/models/botConnectionMappers.ts b/sdk/botservice/arm-botservice/src/models/botConnectionMappers.ts index 8fd5b0040848..823620fac9fd 100644 --- a/sdk/botservice/arm-botservice/src/models/botConnectionMappers.ts +++ b/sdk/botservice/arm-botservice/src/models/botConnectionMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/botservice/arm-botservice/src/models/botsMappers.ts b/sdk/botservice/arm-botservice/src/models/botsMappers.ts index 4e14c4629175..6e2b8090090e 100644 --- a/sdk/botservice/arm-botservice/src/models/botsMappers.ts +++ b/sdk/botservice/arm-botservice/src/models/botsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/botservice/arm-botservice/src/models/channelsMappers.ts b/sdk/botservice/arm-botservice/src/models/channelsMappers.ts index 068826fddb11..014c1bd59b8d 100644 --- a/sdk/botservice/arm-botservice/src/models/channelsMappers.ts +++ b/sdk/botservice/arm-botservice/src/models/channelsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/botservice/arm-botservice/src/models/directLineMappers.ts b/sdk/botservice/arm-botservice/src/models/directLineMappers.ts index 68e686658063..fd8d98fc3334 100644 --- a/sdk/botservice/arm-botservice/src/models/directLineMappers.ts +++ b/sdk/botservice/arm-botservice/src/models/directLineMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/botservice/arm-botservice/src/models/hostSettingsMappers.ts b/sdk/botservice/arm-botservice/src/models/hostSettingsMappers.ts new file mode 100644 index 000000000000..95cf18592cd1 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/models/hostSettingsMappers.ts @@ -0,0 +1,14 @@ +/* + * 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 { + discriminators, + ErrorBody, + ErrorModel, + HostSettingsResponse +} from "../models/mappers"; diff --git a/sdk/botservice/arm-botservice/src/models/index.ts b/sdk/botservice/arm-botservice/src/models/index.ts index 191a2d329da5..b8f46f52a980 100644 --- a/sdk/botservice/arm-botservice/src/models/index.ts +++ b/sdk/botservice/arm-botservice/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -59,7 +59,7 @@ export interface Resource extends BaseResource { sku?: Sku; /** * Required. Gets or sets the Kind of the resource. Possible values include: 'sdk', 'designer', - * 'bot', 'function' + * 'bot', 'function', 'azurebot' */ kind?: Kind; /** @@ -127,6 +127,22 @@ export interface BotProperties { * The LUIS Key */ luisKey?: string; + /** + * Whether Cmek is enabled + */ + isCmekEnabled?: boolean; + /** + * The CMK Url + */ + cmekKeyVaultUrl?: string; + /** + * Whether the bot is in an isolated network + */ + isIsolated?: boolean; + /** + * The channel schema transformation version for the bot + */ + schemaTransformationVersion?: string; } /** @@ -214,7 +230,7 @@ export interface FacebookPage { * Facebook application access token. Value only returned through POST to the action Channel List * API, otherwise empty. */ - accessToken: string; + accessToken?: string; } /** @@ -239,7 +255,7 @@ export interface FacebookChannelProperties { * Facebook application secret. Value only returned through POST to the action Channel List API, * otherwise empty. */ - appSecret: string; + appSecret?: string; /** * Callback Url * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -277,7 +293,7 @@ export interface EmailChannelProperties { * The password for the email address. Value only returned through POST to the action Channel * List API, otherwise empty. */ - password: string; + password?: string; /** * Whether this channel is enabled for the bot */ @@ -397,7 +413,7 @@ export interface KikChannelProperties { /** * Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. */ - apiKey: string; + apiKey?: string; /** * Whether this channel is validated for the bot */ @@ -564,7 +580,7 @@ export interface TelegramChannelProperties { * The Telegram access token. Value only returned through POST to the action Channel List API, * otherwise empty. */ - accessToken: string; + accessToken?: string; /** * Whether this channel is validated for the bot */ @@ -606,7 +622,7 @@ export interface SmsChannelProperties { * The Sms auth token. Value only returned through POST to the action Channel List API, otherwise * empty. */ - authToken: string; + authToken?: string; /** * Whether this channel is validated for the bot */ @@ -638,17 +654,17 @@ export interface SlackChannelProperties { /** * The Slack client id */ - clientId: string; + clientId?: string; /** * The Slack client secret. Value only returned through POST to the action Channel List API, * otherwise empty. */ - clientSecret: string; + clientSecret?: string; /** * The Slack verification token. Value only returned through POST to the action Channel List API, * otherwise empty. */ - verificationToken: string; + verificationToken?: string; /** * The Slack landing page Url */ @@ -755,9 +771,13 @@ export interface LineChannel { */ export interface DirectLineSpeechChannelProperties { /** - * The cognitive service subscription ID to use with this channel registration. + * The cognitive service region with this channel registration. */ - cognitiveServicesSubscriptionId: string; + cognitiveServiceRegion: string; + /** + * The cognitive service subscription key to use with this channel registration. + */ + cognitiveServiceSubscriptionKey: string; /** * Whether this channel is enabled or not. */ @@ -1069,6 +1089,45 @@ export interface CheckNameAvailabilityResponseBody { message?: string; } +/** + * 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; +} + /** * Optional Parameters. */ @@ -1087,7 +1146,7 @@ export interface BotsUpdateOptionalParams extends msRest.RequestOptionsBase { sku?: Sku; /** * Required. Gets or sets the Kind of the resource. Possible values include: 'sdk', 'designer', - * 'bot', 'function' + * 'bot', 'function', 'azurebot' */ kind?: Kind; /** @@ -1118,7 +1177,7 @@ export interface ChannelsUpdateOptionalParams extends msRest.RequestOptionsBase sku?: Sku; /** * Required. Gets or sets the Kind of the resource. Possible values include: 'sdk', 'designer', - * 'bot', 'function' + * 'bot', 'function', 'azurebot' */ kind?: Kind; /** @@ -1204,11 +1263,11 @@ export type SkuTier = 'Free' | 'Standard'; /** * Defines values for Kind. - * Possible values include: 'sdk', 'designer', 'bot', 'function' + * Possible values include: 'sdk', 'designer', 'bot', 'function', 'azurebot' * @readonly * @enum {string} */ -export type Kind = 'sdk' | 'designer' | 'bot' | 'function'; +export type Kind = 'sdk' | 'designer' | 'bot' | 'function' | 'azurebot'; /** * Defines values for Key. @@ -1715,3 +1774,23 @@ export type BotConnectionListByBotServiceNextResponse = ConnectionSettingRespons parsedBody: ConnectionSettingResponseList; }; }; + +/** + * Contains response data for the get operation. + */ +export type HostSettingsGetResponse = HostSettingsResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostSettingsResponse; + }; +}; diff --git a/sdk/botservice/arm-botservice/src/models/mappers.ts b/sdk/botservice/arm-botservice/src/models/mappers.ts index 41feb438e31a..ef7976ee708c 100644 --- a/sdk/botservice/arm-botservice/src/models/mappers.ts +++ b/sdk/botservice/arm-botservice/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -207,6 +207,30 @@ export const BotProperties: msRest.CompositeMapper = { type: { name: "String" } + }, + isCmekEnabled: { + serializedName: "isCmekEnabled", + type: { + name: "Boolean" + } + }, + cmekKeyVaultUrl: { + serializedName: "cmekKeyVaultUrl", + type: { + name: "String" + } + }, + isIsolated: { + serializedName: "isIsolated", + type: { + name: "Boolean" + } + }, + schemaTransformationVersion: { + serializedName: "schemaTransformationVersion", + type: { + name: "String" + } } } } @@ -342,7 +366,6 @@ export const FacebookPage: msRest.CompositeMapper = { } }, accessToken: { - required: true, serializedName: "accessToken", type: { name: "String" @@ -385,7 +408,6 @@ export const FacebookChannelProperties: msRest.CompositeMapper = { } }, appSecret: { - required: true, serializedName: "appSecret", type: { name: "String" @@ -443,7 +465,6 @@ export const EmailChannelProperties: msRest.CompositeMapper = { } }, password: { - required: true, serializedName: "password", type: { name: "String" @@ -628,7 +649,6 @@ export const KikChannelProperties: msRest.CompositeMapper = { } }, apiKey: { - required: true, serializedName: "apiKey", type: { name: "String" @@ -897,7 +917,6 @@ export const TelegramChannelProperties: msRest.CompositeMapper = { className: "TelegramChannelProperties", modelProperties: { accessToken: { - required: true, serializedName: "accessToken", type: { name: "String" @@ -961,7 +980,6 @@ export const SmsChannelProperties: msRest.CompositeMapper = { } }, authToken: { - required: true, serializedName: "authToken", type: { name: "String" @@ -1011,21 +1029,18 @@ export const SlackChannelProperties: msRest.CompositeMapper = { className: "SlackChannelProperties", modelProperties: { clientId: { - required: true, serializedName: "clientId", type: { name: "String" } }, clientSecret: { - required: true, serializedName: "clientSecret", type: { name: "String" } }, verificationToken: { - required: true, serializedName: "verificationToken", type: { name: "String" @@ -1194,9 +1209,16 @@ export const DirectLineSpeechChannelProperties: msRest.CompositeMapper = { name: "Composite", className: "DirectLineSpeechChannelProperties", modelProperties: { - cognitiveServicesSubscriptionId: { + cognitiveServiceRegion: { required: true, - serializedName: "cognitiveServicesSubscriptionId", + serializedName: "cognitiveServiceRegion", + type: { + name: "String" + } + }, + cognitiveServiceSubscriptionKey: { + required: true, + serializedName: "cognitiveServiceSubscriptionKey", type: { name: "String" } @@ -1702,6 +1724,64 @@ export const CheckNameAvailabilityResponseBody: msRest.CompositeMapper = { } }; +export const HostSettingsResponse: msRest.CompositeMapper = { + serializedName: "HostSettingsResponse", + 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 BotResponseList: msRest.CompositeMapper = { serializedName: "BotResponseList", type: { diff --git a/sdk/botservice/arm-botservice/src/models/operationsMappers.ts b/sdk/botservice/arm-botservice/src/models/operationsMappers.ts index cafd02e8a5f7..a1e45fe4f853 100644 --- a/sdk/botservice/arm-botservice/src/models/operationsMappers.ts +++ b/sdk/botservice/arm-botservice/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -8,7 +8,8 @@ export { discriminators, - CloudError, + ErrorBody, + ErrorModel, OperationDisplayInfo, OperationEntity, OperationEntityListResult diff --git a/sdk/botservice/arm-botservice/src/models/parameters.ts b/sdk/botservice/arm-botservice/src/models/parameters.ts index e16378974344..8c2fb567b13c 100644 --- a/sdk/botservice/arm-botservice/src/models/parameters.ts +++ b/sdk/botservice/arm-botservice/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/botservice/arm-botservice/src/operations/botConnection.ts b/sdk/botservice/arm-botservice/src/operations/botConnection.ts index b6baaf2edfc3..9f0dcdee121a 100644 --- a/sdk/botservice/arm-botservice/src/operations/botConnection.ts +++ b/sdk/botservice/arm-botservice/src/operations/botConnection.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -326,7 +325,7 @@ const listServiceProvidersOperationSpec: msRest.OperationSpec = { const listWithSecretsOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets", urlParameters: [ Parameters.resourceGroupName, Parameters.resourceName, @@ -352,7 +351,7 @@ const listWithSecretsOperationSpec: msRest.OperationSpec = { const createOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", urlParameters: [ Parameters.resourceGroupName, Parameters.resourceName, @@ -388,7 +387,7 @@ const createOperationSpec: msRest.OperationSpec = { const updateOperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", urlParameters: [ Parameters.resourceGroupName, Parameters.resourceName, @@ -424,7 +423,7 @@ const updateOperationSpec: msRest.OperationSpec = { const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", urlParameters: [ Parameters.resourceGroupName, Parameters.resourceName, @@ -450,7 +449,7 @@ const getOperationSpec: msRest.OperationSpec = { const deleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}", urlParameters: [ Parameters.resourceGroupName, Parameters.resourceName, @@ -505,6 +504,9 @@ const listByBotServiceNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/botservice/arm-botservice/src/operations/bots.ts b/sdk/botservice/arm-botservice/src/operations/bots.ts index c16d188081f9..59813052e6a9 100644 --- a/sdk/botservice/arm-botservice/src/operations/bots.ts +++ b/sdk/botservice/arm-botservice/src/operations/bots.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -522,6 +521,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -543,6 +545,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/botservice/arm-botservice/src/operations/channels.ts b/sdk/botservice/arm-botservice/src/operations/channels.ts index f54e613f0a2b..566ccb3119c8 100644 --- a/sdk/botservice/arm-botservice/src/operations/channels.ts +++ b/sdk/botservice/arm-botservice/src/operations/channels.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -506,6 +505,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/botservice/arm-botservice/src/operations/directLine.ts b/sdk/botservice/arm-botservice/src/operations/directLine.ts index 324c434c7724..2b44cb9f82ca 100644 --- a/sdk/botservice/arm-botservice/src/operations/directLine.ts +++ b/sdk/botservice/arm-botservice/src/operations/directLine.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/botservice/arm-botservice/src/operations/hostSettings.ts b/sdk/botservice/arm-botservice/src/operations/hostSettings.ts new file mode 100644 index 000000000000..7ddc6a14b292 --- /dev/null +++ b/sdk/botservice/arm-botservice/src/operations/hostSettings.ts @@ -0,0 +1,76 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/hostSettingsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureBotServiceContext } from "../azureBotServiceContext"; + +/** Class representing a HostSettings. */ +export class HostSettings { + private readonly client: AzureBotServiceContext; + + /** + * Create a HostSettings. + * @param {AzureBotServiceContext} client Reference to the service client. + */ + constructor(client: AzureBotServiceContext) { + this.client = client; + } + + /** + * Get per subscription settings needed to host bot in compute resource such as Azure App Service + * @param [options] The optional parameters + * @returns Promise + */ + get(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + get(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + get(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HostSettingsResponse + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/botservice/arm-botservice/src/operations/index.ts b/sdk/botservice/arm-botservice/src/operations/index.ts index d4f8c52a2296..0e31ffa72008 100644 --- a/sdk/botservice/arm-botservice/src/operations/index.ts +++ b/sdk/botservice/arm-botservice/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -13,3 +12,4 @@ export * from "./channels"; export * from "./directLine"; export * from "./operations"; export * from "./botConnection"; +export * from "./hostSettings"; diff --git a/sdk/botservice/arm-botservice/src/operations/operations.ts b/sdk/botservice/arm-botservice/src/operations/operations.ts index 276bd6996cdd..ca90ce0113f8 100644 --- a/sdk/botservice/arm-botservice/src/operations/operations.ts +++ b/sdk/botservice/arm-botservice/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -95,7 +94,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationEntityListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -116,7 +118,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationEntityListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer