Skip to content

Commit 85ddf28

Browse files
authored
managementgroups-track2-ga (Azure#19514)
1 parent ac1c4dc commit 85ddf28

File tree

13 files changed

+74
-131
lines changed

13 files changed

+74
-131
lines changed
Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1-
## Release History
1+
# Release History
2+
3+
## 2.0.0 (2021-12-22)
24

3-
### 2.0.0-beta.2 (Unreleased)
5+
The package of @azure/arm-managementgroups is using our next generation design principles since version 2.0.0, which contains breaking changes.
46

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

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

9-
#### Bugs Fixed
10-
11-
#### Other Changes
12-
13-
### 2.0.0-beta.1 (2021-11-22)
14-
15-
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.
16-
17-
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/).
18-
19-
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.
20-
21-
**Noteworthy changes and features**
22-
- 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.
23-
- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
24-
- 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.
25-
- 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`.
26-
- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6.
11+
To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

sdk/managementgroups/arm-managementgroups/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manage access control, policies, alerting and reporting for those resources.
99

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

1515
## Getting started
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"commit": "e827b527ff33475b4b561d445f06bf4b184e3efe",
2+
"commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf",
33
"readme": "specification/managementgroups/resource-manager/readme.md",
4-
"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/typescript@6.0.0-alpha.15.20211116.1",
4+
"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/typescript@6.0.0-alpha.16.20211217.1",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"use": "@autorest/typescript@6.0.0-alpha.15.20211116.1"
6+
"use": "@autorest/typescript@6.0.0-alpha.16.20211217.1"
77
}

sdk/managementgroups/arm-managementgroups/package.json

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
"sdk-type": "mgmt",
44
"author": "Microsoft Corporation",
55
"description": "A generated SDK for ManagementGroupsAPI.",
6-
"version": "2.0.0-beta.2",
7-
"engines": {
8-
"node": ">=12.0.0"
9-
},
6+
"version": "2.0.0",
7+
"engines": { "node": ">=12.0.0" },
108
"dependencies": {
119
"@azure/core-lro": "^2.2.0",
1210
"@azure/abort-controller": "^1.0.0",
@@ -16,13 +14,7 @@
1614
"@azure/core-rest-pipeline": "^1.1.0",
1715
"tslib": "^2.2.0"
1816
},
19-
"keywords": [
20-
"node",
21-
"azure",
22-
"typescript",
23-
"browser",
24-
"isomorphic"
25-
],
17+
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
2618
"license": "MIT",
2719
"main": "./dist/index.js",
2820
"module": "./dist-esm/src/index.js",
@@ -49,9 +41,7 @@
4941
"type": "git",
5042
"url": "https://github.com/Azure/azure-sdk-for-js.git"
5143
},
52-
"bugs": {
53-
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
54-
},
44+
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
5545
"files": [
5646
"dist/**/*.js",
5747
"dist/**/*.js.map",

sdk/managementgroups/arm-managementgroups/review/arm-managementgroups.api.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,12 @@ export interface ManagementGroups {
395395
}
396396

397397
// @public (undocumented)
398-
export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
398+
export class ManagementGroupsAPI extends coreClient.ServiceClient {
399+
// (undocumented)
400+
$host: string;
399401
constructor(credentials: coreAuth.TokenCredential, options?: ManagementGroupsAPIOptionalParams);
402+
// (undocumented)
403+
apiVersion: string;
400404
checkNameAvailability(checkNameAvailabilityRequest: CheckNameAvailabilityRequest, options?: CheckNameAvailabilityOptionalParams): Promise<CheckNameAvailabilityResponse>;
401405
// (undocumented)
402406
entities: Entities;
@@ -412,15 +416,6 @@ export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
412416
tenantBackfillStatus(options?: TenantBackfillStatusOptionalParams): Promise<TenantBackfillStatusResponse>;
413417
}
414418

415-
// @public (undocumented)
416-
export class ManagementGroupsAPIContext extends coreClient.ServiceClient {
417-
// (undocumented)
418-
$host: string;
419-
constructor(credentials: coreAuth.TokenCredential, options?: ManagementGroupsAPIOptionalParams);
420-
// (undocumented)
421-
apiVersion: string;
422-
}
423-
424419
// @public
425420
export interface ManagementGroupsAPIOptionalParams extends coreClient.ServiceClientOptions {
426421
$host?: string;

sdk/managementgroups/arm-managementgroups/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
/// <reference lib="esnext.asynciterable" />
1010
export * from "./models";
1111
export { ManagementGroupsAPI } from "./managementGroupsAPI";
12-
export { ManagementGroupsAPIContext } from "./managementGroupsAPIContext";
1312
export * from "./operationsInterfaces";

sdk/managementgroups/arm-managementgroups/src/managementGroupsAPI.ts

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
} from "./operationsInterfaces";
2525
import * as Parameters from "./models/parameters";
2626
import * as Mappers from "./models/mappers";
27-
import { ManagementGroupsAPIContext } from "./managementGroupsAPIContext";
2827
import {
2928
ManagementGroupsAPIOptionalParams,
3029
CheckNameAvailabilityRequest,
@@ -36,7 +35,10 @@ import {
3635
TenantBackfillStatusResponse
3736
} from "./models";
3837

39-
export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
38+
export class ManagementGroupsAPI extends coreClient.ServiceClient {
39+
$host: string;
40+
apiVersion: string;
41+
4042
/**
4143
* Initializes a new instance of the ManagementGroupsAPI class.
4244
* @param credentials Subscription credentials which uniquely identify client subscription.
@@ -46,7 +48,41 @@ export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
4648
credentials: coreAuth.TokenCredential,
4749
options?: ManagementGroupsAPIOptionalParams
4850
) {
49-
super(credentials, options);
51+
if (credentials === undefined) {
52+
throw new Error("'credentials' cannot be null");
53+
}
54+
55+
// Initializing default values for options
56+
if (!options) {
57+
options = {};
58+
}
59+
const defaults: ManagementGroupsAPIOptionalParams = {
60+
requestContentType: "application/json; charset=utf-8",
61+
credential: credentials
62+
};
63+
64+
const packageDetails = `azsdk-js-arm-managementgroups/1.0.0-beta.1`;
65+
const userAgentPrefix =
66+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
67+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
68+
: `${packageDetails}`;
69+
70+
if (!options.credentialScopes) {
71+
options.credentialScopes = ["https://management.azure.com/.default"];
72+
}
73+
const optionsWithDefaults = {
74+
...defaults,
75+
...options,
76+
userAgentOptions: {
77+
userAgentPrefix
78+
},
79+
baseUri: options.endpoint || "https://management.azure.com"
80+
};
81+
super(optionsWithDefaults);
82+
83+
// Assigning values to Constant parameters
84+
this.$host = options.$host || "https://management.azure.com";
85+
this.apiVersion = options.apiVersion || "2021-04-01";
5086
this.managementGroups = new ManagementGroupsImpl(this);
5187
this.managementGroupSubscriptions = new ManagementGroupSubscriptionsImpl(
5288
this

sdk/managementgroups/arm-managementgroups/src/managementGroupsAPIContext.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

sdk/managementgroups/arm-managementgroups/src/operations/entities.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Entities } from "../operationsInterfaces";
1111
import * as coreClient from "@azure/core-client";
1212
import * as Mappers from "../models/mappers";
1313
import * as Parameters from "../models/parameters";
14-
import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
14+
import { ManagementGroupsAPI } from "../managementGroupsAPI";
1515
import {
1616
EntityInfo,
1717
EntitiesListNextOptionalParams,
@@ -23,13 +23,13 @@ import {
2323
/// <reference lib="esnext.asynciterable" />
2424
/** Class containing Entities operations. */
2525
export class EntitiesImpl implements Entities {
26-
private readonly client: ManagementGroupsAPIContext;
26+
private readonly client: ManagementGroupsAPI;
2727

2828
/**
2929
* Initialize a new instance of the class Entities class.
3030
* @param client Reference to the service client
3131
*/
32-
constructor(client: ManagementGroupsAPIContext) {
32+
constructor(client: ManagementGroupsAPI) {
3333
this.client = client;
3434
}
3535

sdk/managementgroups/arm-managementgroups/src/operations/hierarchySettingsOperations.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { HierarchySettingsOperations } from "../operationsInterfaces";
1010
import * as coreClient from "@azure/core-client";
1111
import * as Mappers from "../models/mappers";
1212
import * as Parameters from "../models/parameters";
13-
import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
13+
import { ManagementGroupsAPI } from "../managementGroupsAPI";
1414
import {
1515
HierarchySettingsListOptionalParams,
1616
HierarchySettingsListResponse,
@@ -27,13 +27,13 @@ import {
2727
/** Class containing HierarchySettingsOperations operations. */
2828
export class HierarchySettingsOperationsImpl
2929
implements HierarchySettingsOperations {
30-
private readonly client: ManagementGroupsAPIContext;
30+
private readonly client: ManagementGroupsAPI;
3131

3232
/**
3333
* Initialize a new instance of the class HierarchySettingsOperations class.
3434
* @param client Reference to the service client
3535
*/
36-
constructor(client: ManagementGroupsAPIContext) {
36+
constructor(client: ManagementGroupsAPI) {
3737
this.client = client;
3838
}
3939

0 commit comments

Comments
 (0)