Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR @azure/arm-healthbot] Cmk support for Azure healthbot #16383

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/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"
Expand Down
10 changes: 5 additions & 5 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.0";
Expand Down Expand Up @@ -42,25 +42,25 @@ 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";
this.requestContentType = "application/json; charset=utf-8";
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;
}
}
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";
83 changes: 73 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,39 @@ 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;
}

/**
Expand Down Expand Up @@ -265,7 +319,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 +343,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
86 changes: 86 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,13 @@ export const HealthBotUpdateParameters: msRest.CompositeMapper = {
name: "Composite",
className: "Sku"
}
},
identity: {
serializedName: "identity",
type: {
name: "Composite",
className: "Identity"
}
}
}
}
Expand Down
Loading