Skip to content

Commit

Permalink
CodeGen from PR 16520 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Cmk support for Azure healthbot (Azure#16520)

* adding cmk support

* healthbot - actual CMK changes

* readme update

* new line added
  • Loading branch information
SDKAuto committed Nov 1, 2021
1 parent d67a884 commit 090384b
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 28 deletions.
8 changes: 3 additions & 5 deletions sdk/healthbot/arm-healthbot/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.

Expand All @@ -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
Expand Down Expand Up @@ -87,7 +85,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
const credential = new InteractiveBrowserCredential(
{
clientId: "<client id for your Azure AD app>",
tenantId: "<optional tenant for your organization>"
tenant: "<optional tenant for your organization>"
});
const client = new Azure.ArmHealthbot.HealthbotClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
Expand Down
2 changes: 1 addition & 1 deletion sdk/healthbot/arm-healthbot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/feature/v4/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"
Expand Down
4 changes: 2 additions & 2 deletions sdk/healthbot/arm-healthbot/src/healthbotClientContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.1";
Expand Down Expand Up @@ -49,7 +49,7 @@ export class HealthbotClientContext extends msRestAzure.AzureServiceClient {

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";
Expand Down
4 changes: 3 additions & 1 deletion sdk/healthbot/arm-healthbot/src/models/botsMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export {
HealthBot,
HealthBotProperties,
HealthBotUpdateParameters,
Identity,
Resource,
Sku,
SystemData,
TrackedResource
TrackedResource,
UserAssignedIdentity
} from "../models/mappers";
84 changes: 74 additions & 10 deletions sdk/healthbot/arm-healthbot/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

/**
Expand Down Expand Up @@ -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<HealthBot>
*/
export interface BotResponseList extends Array<HealthBot> {
Expand All @@ -289,6 +344,15 @@ export interface AvailableOperations extends Array<OperationDetail> {
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'
Expand Down
92 changes: 92 additions & 0 deletions sdk/healthbot/arm-healthbot/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -187,6 +259,13 @@ export const HealthBot: msRest.CompositeMapper = {
className: "Sku"
}
},
identity: {
serializedName: "identity",
type: {
name: "Composite",
className: "Identity"
}
},
properties: {
serializedName: "properties",
type: {
Expand Down Expand Up @@ -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"
}
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions sdk/healthbot/arm-healthbot/src/operations/bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Models.BotsCreateResponse>
*/
Expand Down Expand Up @@ -75,22 +75,22 @@ 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<Models.BotsUpdateResponse>
*/
update(resourceGroupName: string, botName: string, parameters: Models.HealthBotUpdateParameters, options?: msRest.RequestOptionsBase): Promise<Models.BotsUpdateResponse>;
/**
* @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<Models.HealthBot>): 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
*/
Expand Down Expand Up @@ -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<msRestAzure.LROPoller>
*/
Expand Down
Loading

0 comments on commit 090384b

Please sign in to comment.