Skip to content

Commit

Permalink
resourcehealth-track2-ga (#19515)
Browse files Browse the repository at this point in the history
  • Loading branch information
colawwj authored Dec 22, 2021
1 parent ea7b87d commit ac1c4dc
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 140 deletions.
29 changes: 7 additions & 22 deletions sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
## Release History
# Release History

## 3.0.0 (2021-12-22)

### 3.0.0-beta.2 (Unreleased)
The package of @azure/arm-resourcehealth is using our next generation design principles since version 3.0.0, which contains breaking changes.

#### Features Added
To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).

#### Breaking Changes
To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).

#### Bugs Fixed

#### Other Changes

### 3.0.0-beta.1 (2021-11-23)

This is the first preview for the new version of the `@azure/arm-resourcehealth` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.

While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/).

Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies.

**Noteworthy changes and features**
- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice.
- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page.
- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`.
- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6.
To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
2 changes: 1 addition & 1 deletion sdk/resourcehealth/arm-resourcehealth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Resource Health Client.

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcehealth/arm-resourcehealth) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcehealth) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth?view=azure-node-preview) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)

## Getting started
Expand Down
6 changes: 3 additions & 3 deletions sdk/resourcehealth/arm-resourcehealth/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commit": "b81af692dbb8395672116d85805cbc9ad1432f3b",
"commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf",
"readme": "specification/resourcehealth/resource-manager/readme.md",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/resourcehealth/resource-manager/readme.md --use=@autorest/[email protected].15.20211116.1",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/resourcehealth/resource-manager/readme.md --use=@autorest/[email protected].16.20211217.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/[email protected].15.20211116.1"
"use": "@autorest/[email protected].16.20211217.1"
}
18 changes: 4 additions & 14 deletions sdk/resourcehealth/arm-resourcehealth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for MicrosoftResourceHealth.",
"version": "3.0.0-beta.2",
"engines": {
"node": ">=12.0.0"
},
"version": "3.0.0",
"engines": { "node": ">=12.0.0" },
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
Expand All @@ -47,9 +39,7 @@
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,13 @@ export enum KnownStageValues {
}

// @public (undocumented)
export class MicrosoftResourceHealth extends MicrosoftResourceHealthContext {
export class MicrosoftResourceHealth extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftResourceHealthOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
availabilityStatuses: AvailabilityStatuses;
// (undocumented)
childAvailabilityStatuses: ChildAvailabilityStatuses;
Expand All @@ -273,15 +277,6 @@ export class MicrosoftResourceHealth extends MicrosoftResourceHealthContext {
emergingIssues: EmergingIssues;
// (undocumented)
operations: Operations;
}

// @public (undocumented)
export class MicrosoftResourceHealthContext extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftResourceHealthOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
subscriptionId: string;
}
Expand Down
1 change: 0 additions & 1 deletion sdk/resourcehealth/arm-resourcehealth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
/// <reference lib="esnext.asynciterable" />
export * from "./models";
export { MicrosoftResourceHealth } from "./microsoftResourceHealth";
export { MicrosoftResourceHealthContext } from "./microsoftResourceHealthContext";
export * from "./operationsInterfaces";
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as coreClient from "@azure/core-client";
import * as coreAuth from "@azure/core-auth";
import {
AvailabilityStatusesImpl,
Expand All @@ -21,10 +22,13 @@ import {
Operations,
EmergingIssues
} from "./operationsInterfaces";
import { MicrosoftResourceHealthContext } from "./microsoftResourceHealthContext";
import { MicrosoftResourceHealthOptionalParams } from "./models";

export class MicrosoftResourceHealth extends MicrosoftResourceHealthContext {
export class MicrosoftResourceHealth extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;

/**
* Initializes a new instance of the MicrosoftResourceHealth class.
* @param credentials Subscription credentials which uniquely identify client subscription.
Expand All @@ -37,7 +41,46 @@ export class MicrosoftResourceHealth extends MicrosoftResourceHealthContext {
subscriptionId: string,
options?: MicrosoftResourceHealthOptionalParams
) {
super(credentials, subscriptionId, options);
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: MicrosoftResourceHealthOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};

const packageDetails = `azsdk-js-arm-resourcehealth/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;

if (!options.credentialScopes) {
options.credentialScopes = ["https://management.azure.com/.default"];
}
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
baseUri: options.endpoint || "https://management.azure.com"
};
super(optionsWithDefaults);
// Parameter assignments
this.subscriptionId = subscriptionId;

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2017-07-01";
this.availabilityStatuses = new AvailabilityStatusesImpl(this);
this.childAvailabilityStatuses = new ChildAvailabilityStatusesImpl(this);
this.childResources = new ChildResourcesImpl(this);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AvailabilityStatuses } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
import {
AvailabilityStatus,
AvailabilityStatusesListBySubscriptionIdNextOptionalParams,
Expand All @@ -33,13 +33,13 @@ import {
/// <reference lib="esnext.asynciterable" />
/** Class containing AvailabilityStatuses operations. */
export class AvailabilityStatusesImpl implements AvailabilityStatuses {
private readonly client: MicrosoftResourceHealthContext;
private readonly client: MicrosoftResourceHealth;

/**
* Initialize a new instance of the class AvailabilityStatuses class.
* @param client Reference to the service client
*/
constructor(client: MicrosoftResourceHealthContext) {
constructor(client: MicrosoftResourceHealth) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ChildAvailabilityStatuses } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
import {
AvailabilityStatus,
ChildAvailabilityStatusesListNextOptionalParams,
Expand All @@ -26,13 +26,13 @@ import {
/** Class containing ChildAvailabilityStatuses operations. */
export class ChildAvailabilityStatusesImpl
implements ChildAvailabilityStatuses {
private readonly client: MicrosoftResourceHealthContext;
private readonly client: MicrosoftResourceHealth;

/**
* Initialize a new instance of the class ChildAvailabilityStatuses class.
* @param client Reference to the service client
*/
constructor(client: MicrosoftResourceHealthContext) {
constructor(client: MicrosoftResourceHealth) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ChildResources } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
import {
AvailabilityStatus,
ChildResourcesListNextOptionalParams,
Expand All @@ -23,13 +23,13 @@ import {
/// <reference lib="esnext.asynciterable" />
/** Class containing ChildResources operations. */
export class ChildResourcesImpl implements ChildResources {
private readonly client: MicrosoftResourceHealthContext;
private readonly client: MicrosoftResourceHealth;

/**
* Initialize a new instance of the class ChildResources class.
* @param client Reference to the service client
*/
constructor(client: MicrosoftResourceHealthContext) {
constructor(client: MicrosoftResourceHealth) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EmergingIssues } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
import {
EmergingIssuesGetResult,
EmergingIssuesListNextOptionalParams,
Expand All @@ -25,13 +25,13 @@ import {
/// <reference lib="esnext.asynciterable" />
/** Class containing EmergingIssues operations. */
export class EmergingIssuesImpl implements EmergingIssues {
private readonly client: MicrosoftResourceHealthContext;
private readonly client: MicrosoftResourceHealth;

/**
* Initialize a new instance of the class EmergingIssues class.
* @param client Reference to the service client
*/
constructor(client: MicrosoftResourceHealthContext) {
constructor(client: MicrosoftResourceHealth) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ import { Operations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
import {
OperationsListOptionalParams,
OperationsListResponse
} from "../models";

/** Class containing Operations operations. */
export class OperationsImpl implements Operations {
private readonly client: MicrosoftResourceHealthContext;
private readonly client: MicrosoftResourceHealth;

/**
* Initialize a new instance of the class Operations class.
* @param client Reference to the service client
*/
constructor(client: MicrosoftResourceHealthContext) {
constructor(client: MicrosoftResourceHealth) {
this.client = client;
}

Expand Down

0 comments on commit ac1c4dc

Please sign in to comment.