Skip to content

Commit

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

## 2.0.0 (2021-12-22)

### 2.0.0-beta.2 (Unreleased)
The package of @azure/arm-managementgroups is using our next generation design principles since version 2.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

### 2.0.0-beta.1 (2021-11-22)

This is the first preview for the new version of the `@azure/arm-managementgroups` 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/managementgroups/arm-managementgroups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ manage access control, policies, alerting and reporting for those resources.

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

## Getting started
Expand Down
6 changes: 3 additions & 3 deletions sdk/managementgroups/arm-managementgroups/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commit": "e827b527ff33475b4b561d445f06bf4b184e3efe",
"commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf",
"readme": "specification/managementgroups/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/managementgroups/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/managementgroups/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/managementgroups/arm-managementgroups/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ManagementGroupsAPI.",
"version": "2.0.0-beta.2",
"engines": {
"node": ">=12.0.0"
},
"version": "2.0.0",
"engines": { "node": ">=12.0.0" },
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
Expand All @@ -16,13 +14,7 @@
"@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 @@ -49,9 +41,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 @@ -395,8 +395,12 @@ export interface ManagementGroups {
}

// @public (undocumented)
export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
export class ManagementGroupsAPI extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, options?: ManagementGroupsAPIOptionalParams);
// (undocumented)
apiVersion: string;
checkNameAvailability(checkNameAvailabilityRequest: CheckNameAvailabilityRequest, options?: CheckNameAvailabilityOptionalParams): Promise<CheckNameAvailabilityResponse>;
// (undocumented)
entities: Entities;
Expand All @@ -412,15 +416,6 @@ export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
tenantBackfillStatus(options?: TenantBackfillStatusOptionalParams): Promise<TenantBackfillStatusResponse>;
}

// @public (undocumented)
export class ManagementGroupsAPIContext extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, options?: ManagementGroupsAPIOptionalParams);
// (undocumented)
apiVersion: string;
}

// @public
export interface ManagementGroupsAPIOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
Expand Down
1 change: 0 additions & 1 deletion sdk/managementgroups/arm-managementgroups/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 { ManagementGroupsAPI } from "./managementGroupsAPI";
export { ManagementGroupsAPIContext } from "./managementGroupsAPIContext";
export * from "./operationsInterfaces";
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
} from "./operationsInterfaces";
import * as Parameters from "./models/parameters";
import * as Mappers from "./models/mappers";
import { ManagementGroupsAPIContext } from "./managementGroupsAPIContext";
import {
ManagementGroupsAPIOptionalParams,
CheckNameAvailabilityRequest,
Expand All @@ -36,7 +35,10 @@ import {
TenantBackfillStatusResponse
} from "./models";

export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
export class ManagementGroupsAPI extends coreClient.ServiceClient {
$host: string;
apiVersion: string;

/**
* Initializes a new instance of the ManagementGroupsAPI class.
* @param credentials Subscription credentials which uniquely identify client subscription.
Expand All @@ -46,7 +48,41 @@ export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
credentials: coreAuth.TokenCredential,
options?: ManagementGroupsAPIOptionalParams
) {
super(credentials, options);
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
}

// Initializing default values for options
if (!options) {
options = {};
}
const defaults: ManagementGroupsAPIOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};

const packageDetails = `azsdk-js-arm-managementgroups/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);

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-04-01";
this.managementGroups = new ManagementGroupsImpl(this);
this.managementGroupSubscriptions = new ManagementGroupSubscriptionsImpl(
this
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Entities } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
import { ManagementGroupsAPI } from "../managementGroupsAPI";
import {
EntityInfo,
EntitiesListNextOptionalParams,
Expand All @@ -23,13 +23,13 @@ import {
/// <reference lib="esnext.asynciterable" />
/** Class containing Entities operations. */
export class EntitiesImpl implements Entities {
private readonly client: ManagementGroupsAPIContext;
private readonly client: ManagementGroupsAPI;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { HierarchySettingsOperations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
import { ManagementGroupsAPI } from "../managementGroupsAPI";
import {
HierarchySettingsListOptionalParams,
HierarchySettingsListResponse,
Expand All @@ -27,13 +27,13 @@ import {
/** Class containing HierarchySettingsOperations operations. */
export class HierarchySettingsOperationsImpl
implements HierarchySettingsOperations {
private readonly client: ManagementGroupsAPIContext;
private readonly client: ManagementGroupsAPI;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ManagementGroupSubscriptions } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
import { ManagementGroupsAPI } from "../managementGroupsAPI";
import {
SubscriptionUnderManagementGroup,
ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextOptionalParams,
Expand All @@ -29,13 +29,13 @@ import {
/** Class containing ManagementGroupSubscriptions operations. */
export class ManagementGroupSubscriptionsImpl
implements ManagementGroupSubscriptions {
private readonly client: ManagementGroupsAPIContext;
private readonly client: ManagementGroupsAPI;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ManagementGroups } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
import { ManagementGroupsAPI } from "../managementGroupsAPI";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
Expand Down Expand Up @@ -40,13 +40,13 @@ import {
/// <reference lib="esnext.asynciterable" />
/** Class containing ManagementGroups operations. */
export class ManagementGroupsImpl implements ManagementGroups {
private readonly client: ManagementGroupsAPIContext;
private readonly client: ManagementGroupsAPI;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Operations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
import { ManagementGroupsAPI } from "../managementGroupsAPI";
import {
Operation,
OperationsListNextOptionalParams,
Expand All @@ -23,13 +23,13 @@ import {
/// <reference lib="esnext.asynciterable" />
/** Class containing Operations operations. */
export class OperationsImpl implements Operations {
private readonly client: ManagementGroupsAPIContext;
private readonly client: ManagementGroupsAPI;

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

Expand Down

0 comments on commit 85ddf28

Please sign in to comment.