diff --git a/sdk/healthbot/arm-healthbot/README.md b/sdk/healthbot/arm-healthbot/README.md index 9c958930e38f..df3b15254be2 100644 --- a/sdk/healthbot/arm-healthbot/README.md +++ b/sdk/healthbot/arm-healthbot/README.md @@ -1,11 +1,11 @@ ## Azure HealthbotClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for HealthbotClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for HealthbotClient. ### 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-healthbot @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.ArmHealthbot.HealthbotClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; diff --git a/sdk/healthbot/arm-healthbot/package.json b/sdk/healthbot/arm-healthbot/package.json index fa10f70a96ff..9273bbdccc24 100644 --- a/sdk/healthbot/arm-healthbot/package.json +++ b/sdk/healthbot/arm-healthbot/package.json @@ -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/healthbot/arm-healthbot", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/healthbot/arm-healthbot", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/healthbot/arm-healthbot/src/healthbotClientContext.ts b/sdk/healthbot/arm-healthbot/src/healthbotClientContext.ts index 2938b4b9edcb..994e61f22632 100644 --- a/sdk/healthbot/arm-healthbot/src/healthbotClientContext.ts +++ b/sdk/healthbot/arm-healthbot/src/healthbotClientContext.ts @@ -9,8 +9,8 @@ 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-healthbot"; const packageVersion = "1.1.0"; @@ -42,14 +42,14 @@ export class HealthbotClientContext extends msRestAzure.AzureServiceClient { if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = '2020-12-08'; + this.apiVersion = '2021-06-10'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -57,10 +57,10 @@ export class HealthbotClientContext extends msRestAzure.AzureServiceClient { this.credentials = credentials; this.subscriptionId = subscriptionId; - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/healthbot/arm-healthbot/src/models/botsMappers.ts b/sdk/healthbot/arm-healthbot/src/models/botsMappers.ts index 5c3ff8b1f439..c87ba5aa0f6f 100644 --- a/sdk/healthbot/arm-healthbot/src/models/botsMappers.ts +++ b/sdk/healthbot/arm-healthbot/src/models/botsMappers.ts @@ -15,8 +15,10 @@ export { HealthBot, HealthBotProperties, HealthBotUpdateParameters, + Identity, Resource, Sku, SystemData, - TrackedResource + TrackedResource, + UserAssignedIdentity } from "../models/mappers"; diff --git a/sdk/healthbot/arm-healthbot/src/models/index.ts b/sdk/healthbot/arm-healthbot/src/models/index.ts index 84815fda0add..7480838567f5 100644 --- a/sdk/healthbot/arm-healthbot/src/models/index.ts +++ b/sdk/healthbot/arm-healthbot/src/models/index.ts @@ -11,12 +11,58 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; +/** + * The details of the user assigned managed identity used by the Video Analyzer resource. + */ +export interface UserAssignedIdentity { + /** + * The principal ID of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The client ID of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + +/** + * Identity for the resource. + */ +export interface Identity { + /** + * The principal ID of resource identity. This property will only be provided for a system + * assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The tenant ID of resource. This property will only be provided for a system assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will remove any identities + * from the Azure Health Bot. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + */ + type?: ResourceIdentityType; + /** + * The list of user identities associated with the resource. The user identity dictionary key + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + /** * The resource model definition representing SKU */ export interface Sku { /** - * The name of the HealthBot SKU. Possible values include: 'F0', 'S1', 'C0' + * The name of the Azure Health Bot SKU. Possible values include: 'F0', 'S1', 'C0' */ name: SkuName; } @@ -94,14 +140,14 @@ export interface TrackedResource extends Resource { } /** - * The properties of a HealthBot. The Health Bot Service is a cloud platform that empowers + * The properties of a Azure Health Bot. The Health Bot Service is a cloud platform that empowers * developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual * health assistants and health bots, that help them improve processes and reduce costs. * @summary HealthBotProperties */ export interface HealthBotProperties { /** - * The provisioning state of the Healthbot resource. + * The provisioning state of the Azure Health Bot resource. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly provisioningState?: string; @@ -113,31 +159,40 @@ export interface HealthBotProperties { } /** - * HealthBot resource definition + * Azure Health Bot resource definition */ export interface HealthBot extends TrackedResource { /** - * SKU of the HealthBot. + * SKU of the Azure Health Bot. */ sku: Sku; /** - * The set of properties specific to Healthbot resource. + * The identity of the Azure Health Bot. + */ + identity?: Identity; + /** + * The set of properties specific to Azure Health Bot resource. */ properties?: HealthBotProperties; } /** - * Parameters for updating a HealthBot. + * Parameters for updating a Azure Health Bot. */ export interface HealthBotUpdateParameters { /** - * Tags for a HealthBot. + * Tags for a Azure Health Bot. */ tags?: { [propertyName: string]: string }; /** - * SKU of the HealthBot. + * SKU of the Azure Health Bot. */ sku?: Sku; + /** + * The identity of the Azure Health Bot. + */ + identity?: Identity; + location?: string; } /** @@ -265,7 +320,7 @@ export interface HealthbotClientOptions extends AzureServiceClientOptions { /** * @interface - * The list of Healthbot operation response. + * The list of Azure Health Bot operation response. * @extends Array */ export interface BotResponseList extends Array { @@ -289,6 +344,15 @@ export interface AvailableOperations extends Array { nextLink?: string; } +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None'; + /** * Defines values for SkuName. * Possible values include: 'F0', 'S1', 'C0' diff --git a/sdk/healthbot/arm-healthbot/src/models/mappers.ts b/sdk/healthbot/arm-healthbot/src/models/mappers.ts index 14dd1d6f1bb7..9fa752a92ba3 100644 --- a/sdk/healthbot/arm-healthbot/src/models/mappers.ts +++ b/sdk/healthbot/arm-healthbot/src/models/mappers.ts @@ -12,6 +12,78 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const UserAssignedIdentity: msRest.CompositeMapper = { + serializedName: "UserAssignedIdentity", + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + +export const Identity: msRest.CompositeMapper = { + serializedName: "Identity", + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentity" + } + } + } + } + } + } +}; + export const Sku: msRest.CompositeMapper = { serializedName: "Sku", type: { @@ -187,6 +259,13 @@ export const HealthBot: msRest.CompositeMapper = { className: "Sku" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, properties: { serializedName: "properties", type: { @@ -221,6 +300,19 @@ export const HealthBotUpdateParameters: msRest.CompositeMapper = { name: "Composite", className: "Sku" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } } } } diff --git a/sdk/healthbot/arm-healthbot/src/operations/bots.ts b/sdk/healthbot/arm-healthbot/src/operations/bots.ts index 2a3cc33c7f1c..db43486a3cea 100644 --- a/sdk/healthbot/arm-healthbot/src/operations/bots.ts +++ b/sdk/healthbot/arm-healthbot/src/operations/bots.ts @@ -27,10 +27,10 @@ export class Bots { } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @param [options] The optional parameters * @returns Promise */ @@ -75,7 +75,7 @@ export class Bots { * Patch a HealthBot. * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @param [options] The optional parameters * @returns Promise */ @@ -83,14 +83,14 @@ export class Bots { /** * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @param callback The callback */ update(resourceGroupName: string, botName: string, parameters: Models.HealthBotUpdateParameters, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @param options The optional parameters * @param callback The callback */ @@ -172,10 +172,10 @@ export class Bots { } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @param [options] The optional parameters * @returns Promise */ diff --git a/sdk/healthbot/arm-healthbot/src/operations/operations.ts b/sdk/healthbot/arm-healthbot/src/operations/operations.ts index e135da03c699..c98a601d79f8 100644 --- a/sdk/healthbot/arm-healthbot/src/operations/operations.ts +++ b/sdk/healthbot/arm-healthbot/src/operations/operations.ts @@ -26,7 +26,7 @@ export class Operations { } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * @param [options] The optional parameters * @returns Promise */ @@ -50,7 +50,7 @@ export class Operations { } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise