diff --git a/sdk/managementgroups/arm-managementgroups/LICENSE.txt b/sdk/managementgroups/arm-managementgroups/LICENSE.txt index a70e8cf66038..ea8fb1516028 100644 --- a/sdk/managementgroups/arm-managementgroups/LICENSE.txt +++ b/sdk/managementgroups/arm-managementgroups/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2020 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/managementgroups/arm-managementgroups/README.md b/sdk/managementgroups/arm-managementgroups/README.md index d52fe3295611..f9dce968cfe4 100644 --- a/sdk/managementgroups/arm-managementgroups/README.md +++ b/sdk/managementgroups/arm-managementgroups/README.md @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for ManagementGroupsAPI. ### How to Install -``` +```bash npm install @azure/arm-managementgroups ``` @@ -19,13 +19,14 @@ npm install @azure/arm-managementgroups ##### Install @azure/ms-rest-nodeauth -``` -npm install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code -```ts +```typescript import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; @@ -35,8 +36,7 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new ManagementGroupsAPI(creds, subscriptionId); const cacheControl = "testcacheControl"; - const skiptoken = "testskiptoken"; - client.managementGroups.list(cacheControl, skiptoken).then((result) => { + client.managementGroups.list(cacheControl).then((result) => { console.log("The result is:"); console.log(result); }); @@ -49,7 +49,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -80,8 +80,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to } const client = new Azure.ArmManagementgroups.ManagementGroupsAPI(res.creds, subscriptionId); const cacheControl = "testcacheControl"; - const skiptoken = "testskiptoken"; - client.managementGroups.list(cacheControl, skiptoken).then((result) => { + client.managementGroups.list(cacheControl).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -99,5 +98,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmanagementgroups%2Farm-managementgroups%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/managementgroups/arm-managementgroups/README.png) diff --git a/sdk/managementgroups/arm-managementgroups/package.json b/sdk/managementgroups/arm-managementgroups/package.json index db929a6019a5..4d5edcbe9ec0 100644 --- a/sdk/managementgroups/arm-managementgroups/package.json +++ b/sdk/managementgroups/arm-managementgroups/package.json @@ -4,9 +4,9 @@ "description": "ManagementGroupsAPI Library with typescript type definitions for node.js and browser.", "version": "1.1.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,18 +20,19 @@ "module": "./esm/managementGroupsAPI.js", "types": "./esm/managementGroupsAPI.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/managementgroups/arm-managementgroups", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/managementgroups/arm-managementgroups", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", @@ -43,6 +44,7 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", "rollup.config.js", "tsconfig.json" ], diff --git a/sdk/managementgroups/arm-managementgroups/rollup.config.js b/sdk/managementgroups/arm-managementgroups/rollup.config.js index 66567ccb2196..eae144f69ab6 100644 --- a/sdk/managementgroups/arm-managementgroups/rollup.config.js +++ b/sdk/managementgroups/arm-managementgroups/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/managementGroupsAPI.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/managementGroupsAPI.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-managementgroups.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() ] }; + export default config; diff --git a/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPI.ts b/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPI.ts index fb708d943018..ca508cec3e7b 100644 --- a/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPI.ts +++ b/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPI.ts @@ -20,18 +20,22 @@ class ManagementGroupsAPI extends ManagementGroupsAPIContext { // Operation groups managementGroups: operations.ManagementGroups; managementGroupSubscriptions: operations.ManagementGroupSubscriptions; + hierarchySettings: operations.HierarchySettingsOperations; operations: operations.Operations; entities: operations.Entities; /** * Initializes a new instance of the ManagementGroupsAPI class. * @param credentials Credentials needed for the client to connect to Azure. + * @param operationResultId The id of the operation result. Possible values include: 'create', + * 'delete' * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ManagementGroupsAPIOptions) { - super(credentials, options); + constructor(credentials: msRest.ServiceClientCredentials, operationResultId: string, options?: Models.ManagementGroupsAPIOptions) { + super(credentials, operationResultId, options); this.managementGroups = new operations.ManagementGroups(this); this.managementGroupSubscriptions = new operations.ManagementGroupSubscriptions(this); + this.hierarchySettings = new operations.HierarchySettingsOperations(this); this.operations = new operations.Operations(this); this.entities = new operations.Entities(this); } diff --git a/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPIContext.ts b/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPIContext.ts index d50989717ea4..2288e8176315 100644 --- a/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPIContext.ts +++ b/sdk/managementgroups/arm-managementgroups/src/managementGroupsAPIContext.ts @@ -13,21 +13,30 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-managementgroups"; -const packageVersion = "0.1.0"; +const packageVersion = "1.1.0"; export class ManagementGroupsAPIContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; apiVersion?: string; + operationResultId: string; + skip?: number; + top?: number; + skiptoken?: string; /** * Initializes a new instance of the ManagementGroupsAPI class. * @param credentials Credentials needed for the client to connect to Azure. + * @param operationResultId The id of the operation result. Possible values include: 'create', + * 'delete' * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ManagementGroupsAPIOptions) { + constructor(credentials: msRest.ServiceClientCredentials, operationResultId: string, options?: Models.ManagementGroupsAPIOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } + if (operationResultId == undefined) { + throw new Error('\'operationResultId\' cannot be null.'); + } if (!options) { options = {}; @@ -39,13 +48,23 @@ export class ManagementGroupsAPIContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2018-03-01-preview'; + this.apiVersion = '2020-05-01'; 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.operationResultId = operationResultId; + if(options.skip !== null && options.skip !== undefined) { + this.skip = options.skip; + } + if(options.top !== null && options.top !== undefined) { + this.top = options.top; + } + if(options.skiptoken !== null && options.skiptoken !== undefined) { + this.skiptoken = options.skiptoken; + } if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } diff --git a/sdk/managementgroups/arm-managementgroups/src/models/entitiesMappers.ts b/sdk/managementgroups/arm-managementgroups/src/models/entitiesMappers.ts index 4d59b7d20746..dfb0e389f049 100644 --- a/sdk/managementgroups/arm-managementgroups/src/models/entitiesMappers.ts +++ b/sdk/managementgroups/arm-managementgroups/src/models/entitiesMappers.ts @@ -1,18 +1,15 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - EntityListResult, EntityInfo, + EntityListResult, EntityParentGroupInfo, - ErrorResponse, - ErrorDetails + ErrorDetails, + ErrorResponse } from "../models/mappers"; - diff --git a/sdk/managementgroups/arm-managementgroups/src/models/hierarchySettingsOperationsMappers.ts b/sdk/managementgroups/arm-managementgroups/src/models/hierarchySettingsOperationsMappers.ts new file mode 100644 index 000000000000..2c05760d58bb --- /dev/null +++ b/sdk/managementgroups/arm-managementgroups/src/models/hierarchySettingsOperationsMappers.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + CreateManagementGroupChildInfo, + CreateManagementGroupDetails, + CreateManagementGroupRequest, + CreateOrUpdateSettingsRequest, + CreateParentGroupInfo, + DescendantParentGroupInfo, + EntityHierarchyItem, + ErrorDetails, + ErrorResponse, + HierarchySettings, + HierarchySettingsInfo, + HierarchySettingsList, + ManagementGroup, + ManagementGroupChildInfo, + ManagementGroupDetails, + ManagementGroupPathElement, + ParentGroupInfo, + SubscriptionUnderManagementGroup +} from "../models/mappers"; diff --git a/sdk/managementgroups/arm-managementgroups/src/models/index.ts b/sdk/managementgroups/arm-managementgroups/src/models/index.ts index 882699ae9822..d0cc39daece0 100644 --- a/sdk/managementgroups/arm-managementgroups/src/models/index.ts +++ b/sdk/managementgroups/arm-managementgroups/src/models/index.ts @@ -1,11 +1,9 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; @@ -13,1063 +11,1131 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; - /** - * @interface - * An interface representing ErrorDetails. * The details of the error. - * */ export interface ErrorDetails { /** - * @member {string} [code] One of a server-defined set of error codes. + * One of a server-defined set of error codes. */ code?: string; /** - * @member {string} [message] A human-readable representation of the error. + * A human-readable representation of the error. */ message?: string; /** - * @member {string} [details] A human-readable representation of the error's - * details. + * A human-readable representation of the error's details. */ details?: string; } /** - * @interface - * An interface representing ErrorResponse. * The error object. - * */ export interface ErrorResponse { /** - * @member {ErrorDetails} [error] Error. + * Error. */ error?: ErrorDetails; } /** - * @interface - * An interface representing OperationDisplayProperties. * The object that represents the operation. - * */ export interface OperationDisplayProperties { /** - * @member {string} [provider] The name of the provider. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the provider. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly provider?: string; /** - * @member {string} [resource] The resource on which the operation is - * performed. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The resource on which the operation is performed. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly resource?: string; /** - * @member {string} [operation] The operation that can be performed. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The operation that can be performed. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly operation?: string; /** - * @member {string} [description] Operation description. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Operation description. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly description?: string; } /** - * @interface - * An interface representing Operation. * Operation supported by the Microsoft.Management resource provider. - * */ export interface Operation { /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation}. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Operation name: {provider}/{resource}/{operation}. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {OperationDisplayProperties} [display] Display. + * Display. */ display?: OperationDisplayProperties; } /** - * @interface - * An interface representing CheckNameAvailabilityResult. - * Describes the result of the request to check management group name - * availability. - * + * Describes the result of the request to check management group name availability. */ export interface CheckNameAvailabilityResult { /** - * @member {boolean} [nameAvailable] Required. True indicates name is valid - * and available. False indicates the name is invalid, unavailable, or both. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Required. True indicates name is valid and available. False indicates the name is invalid, + * unavailable, or both. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly nameAvailable?: boolean; /** - * @member {Reason} [reason] Required if nameAvailable == false. Invalid - * indicates the name provided does not match the resource provider's naming - * requirements (incorrect length, unsupported characters, etc.) - * AlreadyExists indicates that the name is already in use and is therefore - * unavailable. Possible values include: 'Invalid', 'AlreadyExists' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Required if nameAvailable == false. Invalid indicates the name provided does not match the + * resource provider's naming requirements (incorrect length, unsupported characters, etc.) + * AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible + * values include: 'Invalid', 'AlreadyExists' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly reason?: Reason; /** - * @member {string} [message] Required if nameAvailable == false. Localized. - * If reason == invalid, provide the user with the reason why the given name - * is invalid, and provide the resource naming requirements so that the user - * can select a valid name. If reason == AlreadyExists, explain that is - * already in use, and direct them to select a different name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Required if nameAvailable == false. Localized. If reason == invalid, provide the user with the + * reason why the given name is invalid, and provide the resource naming requirements so that the + * user can select a valid name. If reason == AlreadyExists, explain that is already in use, and + * direct them to select a different name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly message?: string; } /** - * @interface - * An interface representing TenantBackfillStatusResult. * The tenant backfill status - * */ export interface TenantBackfillStatusResult { /** - * @member {string} [tenantId] The AAD Tenant ID associated with the - * management group. For example, 00000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The AAD Tenant ID associated with the management group. For example, + * 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly tenantId?: string; /** - * @member {Status} [status] The status of the Tenant Backfill. Possible - * values include: 'NotStarted', 'NotStartedButGroupsExist', 'Started', - * 'Failed', 'Cancelled', 'Completed' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The status of the Tenant Backfill. Possible values include: 'NotStarted', + * 'NotStartedButGroupsExist', 'Started', 'Failed', 'Cancelled', 'Completed' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly status?: Status; } /** - * @interface - * An interface representing ManagementGroupInfo. * The management group resource. - * */ export interface ManagementGroupInfo { /** - * @member {string} [id] The fully qualified ID for the management group. - * For example, + * The fully qualified ID for the management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [type] The type of the resource. For example, - * /providers/Microsoft.Management/managementGroups - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. For example, Microsoft.Management/managementGroups + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * @member {string} [name] The name of the management group. For example, - * 00000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [tenantId] The AAD Tenant ID associated with the - * management group. For example, 00000000-0000-0000-0000-000000000000 + * The AAD Tenant ID associated with the management group. For example, + * 00000000-0000-0000-0000-000000000000 */ tenantId?: string; /** - * @member {string} [displayName] The friendly name of the management group. + * The friendly name of the management group. */ displayName?: string; } /** - * @interface - * An interface representing ParentGroupInfo. + * The ID of the parent management group. + */ +export interface DescendantParentGroupInfo { + /** + * The fully qualified ID for the parent management group. For example, + * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + */ + id?: string; +} + +/** + * The details of subscription under management group. + */ +export interface SubscriptionUnderManagementGroup extends BaseResource { + /** + * The fully qualified ID for the subscription. For example, + * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/subscriptions/0000000-0000-0000-0000-000000000001 + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the resource. For example, Microsoft.Management/managementGroups/subscriptions + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The stringified id of the subscription. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The AAD Tenant ID associated with the subscription. For example, + * 00000000-0000-0000-0000-000000000000 + */ + tenant?: string; + /** + * The friendly name of the subscription. + */ + displayName?: string; + /** + * Parent. + */ + parent?: DescendantParentGroupInfo; + /** + * The state of the subscription. + */ + state?: string; +} + +/** * (Optional) The ID of the parent management group. - * */ export interface ParentGroupInfo { /** - * @member {string} [id] The fully qualified ID for the parent management - * group. For example, + * The fully qualified ID for the parent management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 */ id?: string; /** - * @member {string} [name] The name of the parent management group + * The name of the parent management group */ name?: string; /** - * @member {string} [displayName] The friendly name of the parent management - * group. + * The friendly name of the parent management group. */ displayName?: string; } /** - * @interface - * An interface representing ManagementGroupDetails. * The details of a management group. - * */ export interface ManagementGroupDetails { /** - * @member {number} [version] The version number of the object. + * The version number of the object. */ version?: number; /** - * @member {Date} [updatedTime] The date and time when this object was last - * updated. + * The date and time when this object was last updated. */ updatedTime?: Date; /** - * @member {string} [updatedBy] The identity of the principal or process that - * updated the object. + * The identity of the principal or process that updated the object. */ updatedBy?: string; /** - * @member {ParentGroupInfo} [parent] Parent. + * Parent. */ parent?: ParentGroupInfo; } /** - * @interface - * An interface representing ManagementGroupChildInfo. * The child information of a management group. - * */ export interface ManagementGroupChildInfo { /** - * @member {Type1} [type] The type of child resource. The fully qualified - * resource type which includes provider namespace (e.g. - * /providers/Microsoft.Management/managementGroups). Possible values - * include: '/providers/Microsoft.Management/managementGroups', - * '/subscriptions' + * The type of child resource. The fully qualified resource type which includes provider + * namespace (e.g. Microsoft.Management/managementGroups). Possible values include: + * 'Microsoft.Management/managementGroups', '/subscriptions' */ type?: Type1; /** - * @member {string} [id] The fully qualified ID for the child resource - * (management group or subscription). For example, - * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + * The fully qualified ID for the child resource (management group or subscription). For + * example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 */ id?: string; /** - * @member {string} [name] The name of the child entity. + * The name of the child entity. */ name?: string; /** - * @member {string} [displayName] The friendly name of the child resource. + * The friendly name of the child resource. */ displayName?: string; /** - * @member {string[]} [roles] The roles definitions associated with the - * management group. + * The list of children. + */ + children?: ManagementGroupChildInfo[]; +} + +/** + * A path element of a management group ancestors. + */ +export interface ManagementGroupPathElement { + /** + * The name of the group. */ - roles?: string[]; + name?: string; /** - * @member {ManagementGroupChildInfo[]} [children] The list of children. + * The friendly name of the group. */ - children?: ManagementGroupChildInfo[]; + displayName?: string; } /** - * @interface - * An interface representing ManagementGroup. * The management group details. - * - * @extends BaseResource */ export interface ManagementGroup extends BaseResource { /** - * @member {string} [id] The fully qualified ID for the management group. - * For example, + * The fully qualified ID for the management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [type] The type of the resource. For example, - * /providers/Microsoft.Management/managementGroups - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. For example, Microsoft.Management/managementGroups + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * @member {string} [name] The name of the management group. For example, - * 00000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [tenantId] The AAD Tenant ID associated with the - * management group. For example, 00000000-0000-0000-0000-000000000000 + * The AAD Tenant ID associated with the management group. For example, + * 00000000-0000-0000-0000-000000000000 */ tenantId?: string; /** - * @member {string} [displayName] The friendly name of the management group. + * The friendly name of the management group. */ displayName?: string; /** - * @member {string[]} [roles] The role definitions associated with the - * management group. - */ - roles?: string[]; - /** - * @member {ManagementGroupDetails} [details] Details. + * Details. */ details?: ManagementGroupDetails; /** - * @member {ManagementGroupChildInfo[]} [children] The list of children. + * The list of children. */ children?: ManagementGroupChildInfo[]; + /** + * The path from the root to the current group. + */ + path?: ManagementGroupPathElement[]; } /** - * @interface - * An interface representing OperationResults. * The results of an asynchronous operation. - * */ export interface OperationResults { /** - * @member {string} [id] The fully qualified ID for the management group. - * For example, + * The fully qualified ID for the management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [type] The type of the resource. For example, - * /providers/Microsoft.Management/managementGroups - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. For example, Microsoft.Management/managementGroups + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * @member {string} [name] The name of the management group. For example, + * The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The AAD Tenant ID associated with the management group. For example, * 00000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + */ + tenantId?: string; + /** + * The friendly name of the management group. + */ + displayName?: string; +} + +/** + * The results of Azure-AsyncOperation. + */ +export interface AzureAsyncOperationResults { + /** + * The fully qualified ID for the management group. For example, + * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the resource. For example, Microsoft.Management/managementGroups + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {ProvisioningState} [provisioningState] Provisioning State. - * Possible values include: 'Updating' + * The current status of the asynchronous operation performed . For example, Running, Succeeded, + * Failed + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - provisioningState?: ProvisioningState; + readonly status?: string; + /** + * The AAD Tenant ID associated with the management group. For example, + * 00000000-0000-0000-0000-000000000000 + */ + tenantId?: string; + /** + * The friendly name of the management group. + */ + displayName?: string; +} + +/** + * Settings defined at the Management Group scope. + */ +export interface HierarchySettings extends BaseResource { + /** + * The fully qualified ID for the settings object. For example, + * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the resource. For example, Microsoft.Management/managementGroups/settings. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The name of the object. In this case, default. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The AAD Tenant ID associated with the hierarchy settings. For example, + * 00000000-0000-0000-0000-000000000000 + */ + tenantId?: string; + /** + * Indicates whether RBAC access is required upon group creation under the root Management Group. + * If set to true, user will require Microsoft.Management/managementGroups/write action on the + * root Management Group scope in order to create new Groups directly under the root. This will + * prevent new users from creating new Management Groups, unless they are given access. + */ + requireAuthorizationForGroupCreation?: boolean; + /** + * Settings that sets the default Management Group under which new subscriptions get added in + * this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup + */ + defaultManagementGroup?: string; +} + +/** + * The hierarchy settings resource. + */ +export interface HierarchySettingsInfo { + /** + * The fully qualified ID for the settings object. For example, + * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the resource. For example, Microsoft.Management/managementGroups/settings. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The name of the object. In this case, default. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The AAD Tenant ID associated with the hierarchy settings. For example, + * 00000000-0000-0000-0000-000000000000 + */ + tenantId?: string; + /** + * Indicates whether RBAC access is required upon group creation under the root Management Group. + * If set to true, user will require Microsoft.Management/managementGroups/write action on the + * root Management Group scope in order to create new Groups directly under the root. This will + * prevent new users from creating new Management Groups, unless they are given access. + */ + requireAuthorizationForGroupCreation?: boolean; + /** + * Settings that sets the default Management Group under which new subscriptions get added in + * this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup + */ + defaultManagementGroup?: string; +} + +/** + * Lists all hierarchy settings. + */ +export interface HierarchySettingsList { + /** + * The list of hierarchy settings. + */ + value?: HierarchySettingsInfo[]; + /** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * Parameters for creating or updating Management Group settings + */ +export interface CreateOrUpdateSettingsRequest extends BaseResource { + /** + * Indicates whether RBAC access is required upon group creation under the root Management Group. + * If set to true, user will require Microsoft.Management/managementGroups/write action on the + * root Management Group scope in order to create new Groups directly under the root. This will + * prevent new users from creating new Management Groups, unless they are given access. + */ + requireAuthorizationForGroupCreation?: boolean; + /** + * Settings that sets the default Management Group under which new subscriptions get added in + * this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup + */ + defaultManagementGroup?: string; +} + +/** + * The descendant. + */ +export interface DescendantInfo { + /** + * The fully qualified ID for the descendant. For example, + * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 or + * /subscriptions/0000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the resource. For example, Microsoft.Management/managementGroups or /subscriptions + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The name of the descendant. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The friendly name of the management group. + */ + displayName?: string; + /** + * Parent. + */ + parent?: DescendantParentGroupInfo; } /** - * @interface - * An interface representing EntityParentGroupInfo. * (Optional) The ID of the parent management group. - * */ export interface EntityParentGroupInfo { /** - * @member {string} [id] The fully qualified ID for the parent management - * group. For example, + * The fully qualified ID for the parent management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 */ id?: string; } /** - * @interface - * An interface representing EntityInfo. * The entity. - * */ export interface EntityInfo { /** - * @member {string} [id] The fully qualified ID for the entity. For example, + * The fully qualified ID for the entity. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [type] The type of the resource. For example, - * /providers/Microsoft.Management/managementGroups - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. For example, Microsoft.Management/managementGroups + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * @member {string} [name] The name of the entity. For example, - * 00000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the entity. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [tenantId] The AAD Tenant ID associated with the entity. - * For example, 00000000-0000-0000-0000-000000000000 + * The AAD Tenant ID associated with the entity. For example, + * 00000000-0000-0000-0000-000000000000 */ tenantId?: string; /** - * @member {string} [displayName] The friendly name of the management group. + * The friendly name of the management group. */ displayName?: string; /** - * @member {EntityParentGroupInfo} [parent] Parent. + * Parent. */ parent?: EntityParentGroupInfo; /** - * @member {Permissions} [permissions] Permissions. Possible values include: - * 'noaccess', 'view', 'edit', 'delete' + * Permissions. Possible values include: 'noaccess', 'view', 'edit', 'delete' */ permissions?: Permissions; /** - * @member {InheritedPermissions} [inheritedPermissions] Inherited - * Permissions. Possible values include: 'noaccess', 'view', 'edit', 'delete' + * Inherited Permissions. Possible values include: 'noaccess', 'view', 'edit', 'delete' */ inheritedPermissions?: InheritedPermissions; /** - * @member {number} [numberOfDescendants] Number of Descendants. + * Number of Descendants. */ numberOfDescendants?: number; /** - * @member {number} [numberOfChildren] Number of Children. Number of children - * is the number of Groups and Subscriptions that are exactly one level - * underneath the current Group. + * Number of Children. Number of children is the number of Groups and Subscriptions that are + * exactly one level underneath the current Group. */ numberOfChildren?: number; /** - * @member {number} [numberOfChildGroups] Number of Child Groups. Number of - * child groups is the number of Groups that are exactly one level underneath - * the current Group. + * Number of Child Groups. Number of children is the number of Groups that are exactly one level + * underneath the current Group. */ numberOfChildGroups?: number; /** - * @member {string[]} [parentDisplayNameChain] The parent display name chain - * from the root group to the immediate parent + * The parent display name chain from the root group to the immediate parent */ parentDisplayNameChain?: string[]; /** - * @member {string[]} [parentNameChain] The parent name chain from the root - * group to the immediate parent + * The parent name chain from the root group to the immediate parent */ parentNameChain?: string[]; } /** - * @interface - * An interface representing EntityHierarchyItem. * The management group details for the hierarchy view. - * - * @extends BaseResource */ export interface EntityHierarchyItem extends BaseResource { /** - * @member {string} [id] The fully qualified ID for the management group. - * For example, + * The fully qualified ID for the management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [type] The type of the resource. For example, - * /providers/Microsoft.Management/managementGroups - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. For example, Microsoft.Management/managementGroups + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * @member {string} [name] The name of the management group. For example, - * 00000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [displayName] The friendly name of the management group. + * The friendly name of the management group. */ displayName?: string; /** - * @member {Permissions1} [permissions] Permissions. Possible values include: - * 'noaccess', 'view', 'edit', 'delete' + * Permissions. Possible values include: 'noaccess', 'view', 'edit', 'delete' */ permissions?: Permissions1; /** - * @member {EntityHierarchyItem[]} [children] The list of children. + * The list of children. */ children?: EntityHierarchyItem[]; } /** - * @interface - * An interface representing PatchManagementGroupRequest. * Management group patch parameters. - * */ export interface PatchManagementGroupRequest { /** - * @member {string} [displayName] The friendly name of the management group. + * The friendly name of the management group. */ displayName?: string; /** - * @member {string} [parentId] (Optional) The fully qualified ID for the - * parent management group. For example, + * (Optional) The fully qualified ID for the parent management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 */ - parentId?: string; + parentGroupId?: string; } /** - * @interface - * An interface representing CreateParentGroupInfo. * (Optional) The ID of the parent management group used during creation. - * */ export interface CreateParentGroupInfo { /** - * @member {string} [id] The fully qualified ID for the parent management - * group. For example, + * The fully qualified ID for the parent management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 */ id?: string; /** - * @member {string} [name] The name of the parent management group - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the parent management group + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [displayName] The friendly name of the parent management - * group. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The friendly name of the parent management group. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly displayName?: string; } /** - * @interface - * An interface representing CreateManagementGroupDetails. * The details of a management group used during creation. - * */ export interface CreateManagementGroupDetails { /** - * @member {number} [version] The version number of the object. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The version number of the object. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly version?: number; /** - * @member {Date} [updatedTime] The date and time when this object was last - * updated. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The date and time when this object was last updated. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly updatedTime?: Date; /** - * @member {string} [updatedBy] The identity of the principal or process that - * updated the object. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The identity of the principal or process that updated the object. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly updatedBy?: string; /** - * @member {CreateParentGroupInfo} [parent] Parent. + * Parent. */ parent?: CreateParentGroupInfo; } /** - * @interface - * An interface representing CreateManagementGroupChildInfo. * The child information of a management group used during creation. - * */ export interface CreateManagementGroupChildInfo { /** - * @member {Type2} [type] The type of child resource. The fully qualified - * resource type which includes provider namespace (e.g. - * /providers/Microsoft.Management/managementGroups). Possible values - * include: '/providers/Microsoft.Management/managementGroups', - * '/subscriptions' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of child resource. The fully qualified resource type which includes provider + * namespace (e.g. Microsoft.Management/managementGroups). Possible values include: + * 'Microsoft.Management/managementGroups', '/subscriptions' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: Type2; /** - * @member {string} [id] The fully qualified ID for the child resource - * (management group or subscription). For example, - * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The fully qualified ID for the child resource (management group or subscription). For + * example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [name] The name of the child entity. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the child entity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [displayName] The friendly name of the child resource. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The friendly name of the child resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly displayName?: string; /** - * @member {string[]} [roles] The roles definitions associated with the - * management group. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly roles?: string[]; - /** - * @member {CreateManagementGroupChildInfo[]} [children] The list of - * children. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The list of children. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly children?: CreateManagementGroupChildInfo[]; } /** - * @interface - * An interface representing CreateManagementGroupRequest. * Management group creation parameters. - * - * @extends BaseResource */ export interface CreateManagementGroupRequest extends BaseResource { /** - * @member {string} [id] The fully qualified ID for the management group. - * For example, + * The fully qualified ID for the management group. For example, * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [type] The type of the resource. For example, - * /providers/Microsoft.Management/managementGroups - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. For example, Microsoft.Management/managementGroups + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * @member {string} [name] The name of the management group. For example, - * 00000000-0000-0000-0000-000000000000 + * The name of the management group. For example, 00000000-0000-0000-0000-000000000000 */ name?: string; /** - * @member {string} [tenantId] The AAD Tenant ID associated with the - * management group. For example, 00000000-0000-0000-0000-000000000000 - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The AAD Tenant ID associated with the management group. For example, + * 00000000-0000-0000-0000-000000000000 + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly tenantId?: string; /** - * @member {string} [displayName] The friendly name of the management group. - * If no value is passed then this field will be set to the groupId. + * The friendly name of the management group. If no value is passed then this field will be set + * to the groupId. */ displayName?: string; /** - * @member {string[]} [roles] The roles definitions associated with the - * management group. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly roles?: string[]; - /** - * @member {CreateManagementGroupDetails} [details] Details. + * Details. */ details?: CreateManagementGroupDetails; /** - * @member {CreateManagementGroupChildInfo[]} [children] The list of - * children. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The list of children. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly children?: CreateManagementGroupChildInfo[]; } /** - * @interface - * An interface representing CheckNameAvailabilityRequest. * Management group name availability check parameters. - * */ export interface CheckNameAvailabilityRequest { /** - * @member {string} [name] the name to check for availability + * the name to check for availability */ name?: string; /** - * @member {Type} [type] fully qualified resource type which includes - * provider namespace. Possible values include: - * '/providers/Microsoft.Management/managementGroups' + * fully qualified resource type which includes provider namespace. Possible values include: + * 'Microsoft.Management/managementGroups' */ type?: Type; } /** - * @interface - * An interface representing ManagementGroupsListOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsListOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; - /** - * @member {string} [skiptoken] Page continuation token is only used if a - * previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will - * include a token parameter that specifies a starting point to use for - * subsequent calls. - */ - skiptoken?: string; } /** - * @interface - * An interface representing ManagementGroupsGetOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsGetOptionalParams extends msRest.RequestOptionsBase { /** - * @member {Expand} [expand] The $expand=children query string parameter - * allows clients to request inclusion of children in the response payload. - * Possible values include: 'children' + * The $expand=children query string parameter allows clients to request inclusion of children in + * the response payload. $expand=path includes the path from the root group to the current + * group. Possible values include: 'children', 'path' */ expand?: Expand; /** - * @member {boolean} [recurse] The $recurse=true query string parameter - * allows clients to request inclusion of entire hierarchy in the response - * payload. Note that $expand=children must be passed up if $recurse is set - * to true. + * The $recurse=true query string parameter allows clients to request inclusion of entire + * hierarchy in the response payload. Note that $expand=children must be passed up if $recurse + * is set to true. */ recurse?: boolean; /** - * @member {string} [filter] A filter which allows the exclusion of - * subscriptions from results (i.e. '$filter=children.childType ne - * Subscription') + * A filter which allows the exclusion of subscriptions from results (i.e. + * '$filter=children.childType ne Subscription') */ filter?: string; /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupsCreateOrUpdateOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupsUpdateOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsUpdateOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupsDeleteMethodOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsDeleteMethodOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupsBeginCreateOrUpdateOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsBeginCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupsBeginDeleteMethodOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsBeginDeleteMethodOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupsListNextOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupsListNextOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupSubscriptionsCreateOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupSubscriptionsCreateOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing ManagementGroupSubscriptionsDeleteMethodOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface ManagementGroupSubscriptionsDeleteMethodOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing EntitiesListOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ -export interface EntitiesListOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [skiptoken] Page continuation token is only used if a - * previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will - * include a token parameter that specifies a starting point to use for - * subsequent calls. - */ - skiptoken?: string; +export interface ManagementGroupSubscriptionsGetSubscriptionOptionalParams extends msRest.RequestOptionsBase { /** - * @member {number} [skip] Number of entities to skip over when retrieving - * results. Passing this in will override $skipToken. + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ - skip?: number; - /** - * @member {number} [top] Number of elements to return when retrieving - * results. Passing this in will override $skipToken. - */ - top?: number; + cacheControl?: string; +} + +/** + * Optional Parameters. + */ +export interface EntitiesListOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [select] This parameter specifies the fields to include - * in the response. Can include any combination of + * This parameter specifies the fields to include in the response. Can include any combination of * Name,DisplayName,Type,ParentDisplayNameChain,ParentChain, e.g. - * '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. - * When specified the $select parameter can override select in $skipToken. + * '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the + * $select parameter can override select in $skipToken. */ select?: string; /** - * @member {Search} [search] The $search parameter is used in conjunction - * with the $filter parameter to return three different outputs depending on - * the parameter passed in. With $search=AllowedParents the API will return - * the entity info of all groups that the requested entity will be able to - * reparent to as determined by the user's permissions. With - * $search=AllowedChildren the API will return the entity info of all - * entities that can be added as children of the requested entity. With - * $search=ParentAndFirstLevelChildren the API will return the parent and - * first level of children that the user has either direct access to or - * indirect access via one of their descendants. Possible values include: - * 'AllowedParents', 'AllowedChildren', 'ParentAndFirstLevelChildren', - * 'ParentOnly', 'ChildrenOnly' + * The $search parameter is used in conjunction with the $filter parameter to return three + * different outputs depending on the parameter passed in. + * With $search=AllowedParents the API will return the entity info of all groups that the + * requested entity will be able to reparent to as determined by the user's permissions. + * With $search=AllowedChildren the API will return the entity info of all entities that can be + * added as children of the requested entity. + * With $search=ParentAndFirstLevelChildren the API will return the parent and first level of + * children that the user has either direct access to or indirect access via one of their + * descendants. + * With $search=ParentOnly the API will return only the group if the user has access to at least + * one of the descendants of the group. + * With $search=ChildrenOnly the API will return only the first level of children of the group + * entity info specified in $filter. The user must have direct access to the children entities + * or one of it's descendants for it to show up in the results. Possible values include: + * 'AllowedParents', 'AllowedChildren', 'ParentAndFirstLevelChildren', 'ParentOnly', + * 'ChildrenOnly' */ search?: Search; /** - * @member {string} [filter] The filter parameter allows you to filter on the - * the name or display name fields. You can check for equality on the name - * field (e.g. name eq '{entityName}') and you can check for substrings on - * either the name or display name fields(e.g. contains(name, - * '{substringToSearch}'), contains(displayName, '{substringToSearch')). Note - * that the '{entityName}' and '{substringToSearch}' fields are checked case - * insensitively. + * The filter parameter allows you to filter on the the name or display name fields. You can + * check for equality on the name field (e.g. name eq '{entityName}') and you can check for + * substrings on either the name or display name fields(e.g. contains(name, + * '{substringToSearch}'), contains(displayName, '{substringToSearch')). Note that the + * '{entityName}' and '{substringToSearch}' fields are checked case insensitively. */ filter?: string; /** - * @member {View} [view] The view parameter allows clients to filter the type - * of data that is returned by the getEntities call. Possible values include: - * 'FullHierarchy', 'GroupsOnly', 'SubscriptionsOnly', 'Audit' + * The view parameter allows clients to filter the type of data that is returned by the + * getEntities call. Possible values include: 'FullHierarchy', 'GroupsOnly', 'SubscriptionsOnly', + * 'Audit' */ view?: View; /** - * @member {string} [groupName] A filter which allows the get entities call - * to focus on a particular group (i.e. "$filter=name eq 'groupName'") + * A filter which allows the get entities call to focus on a particular group (i.e. "$filter=name + * eq 'groupName'") */ groupName?: string; /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface - * An interface representing EntitiesListNextOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface EntitiesListNextOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [cacheControl] Indicates that the request shouldn't - * utilize any caches. Default value: 'no-cache' . + * Indicates that the request shouldn't utilize any caches. Default value: 'no-cache'. */ cacheControl?: string; } /** - * @interface * An interface representing ManagementGroupsAPIOptions. - * @extends AzureServiceClientOptions */ export interface ManagementGroupsAPIOptions extends AzureServiceClientOptions { /** - * @member {string} [baseUri] + * Number of entities to skip over when retrieving results. Passing this in will override + * $skipToken. + */ + skip?: number; + /** + * Number of elements to return when retrieving results. Passing this in will override + * $skipToken. */ + top?: number; + /** + * Page continuation token is only used if a previous operation returned a partial result. + * If a previous response contains a nextLink element, the value of the nextLink element will + * include a token parameter that specifies a starting point to use for subsequent calls. + */ + skiptoken?: string; baseUri?: string; } +/** + * Defines headers for CreateOrUpdate operation. + */ +export interface ManagementGroupsCreateOrUpdateHeaders { + /** + * URL for determining when an operation has completed. Send a GET request to the URL in Location + * header. + * The URI should return a 202 until the operation reaches a terminal state and 200 once it + * reaches a terminal state. + * + * For more info: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#202-accepted-and-location-headers + */ + location: string; + /** + * URL for checking the ongoing status of the operation. + * To get the status of the asynchronous operation, send a GET request to the URL in + * Azure-AsyncOperation header value. + * + * For more info: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#asynchronous-operations + */ + azureAsyncOperation: string; +} + +/** + * Defines headers for Delete operation. + */ +export interface ManagementGroupsDeleteHeaders { + /** + * URL for determining when an operation has completed. Send a GET request to the URL in Location + * header. + * The URI should return a 202 until the operation reaches a terminal state and 200 once it + * reaches a terminal state. + * + * For more info: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#202-accepted-and-location-headers + */ + location: string; + /** + * URL for checking the ongoing status of the operation. + * To get the status of the asynchronous operation, send a GET request to the URL in + * Azure-AsyncOperation header value. + * + * For more info: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#asynchronous-operations + */ + azureAsyncOperation: string; +} /** * @interface - * An interface representing the ManagementGroupListResult. * Describes the result of the request to list management groups. - * * @extends Array */ export interface ManagementGroupListResult extends Array { /** - * @member {string} [nextLink] The URL to use for getting the next set of - * results. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Describes the result of the request to view descendants. + * @extends Array + */ +export interface DescendantListResult extends Array { + /** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * The details of all subscriptions under management group. + * @extends Array + */ +export interface ListSubscriptionUnderManagementGroup extends Array { + /** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly nextLink?: string; } /** * @interface - * An interface representing the OperationListResult. * Describes the result of the request to list Microsoft.Management operations. - * * @extends Array */ export interface OperationListResult extends Array { /** - * @member {string} [nextLink] URL to get the next set of operation list - * results if there are any. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * URL to get the next set of operation list results if there are any. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly nextLink?: string; } /** * @interface - * An interface representing the EntityListResult. * Describes the result of the request to view entities. - * * @extends Array */ export interface EntityListResult extends Array { /** - * @member {number} [count] Total count of records that match the filter - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Total count of records that match the filter + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly count?: number; /** - * @member {string} [nextLink] The URL to use for getting the next set of - * results. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly nextLink?: string; } @@ -1093,27 +1159,19 @@ export type Status = 'NotStarted' | 'NotStartedButGroupsExist' | 'Started' | 'Fa /** * Defines values for Type. - * Possible values include: '/providers/Microsoft.Management/managementGroups' + * Possible values include: 'Microsoft.Management/managementGroups' * @readonly * @enum {string} */ -export type Type = '/providers/Microsoft.Management/managementGroups'; +export type Type = 'Microsoft.Management/managementGroups'; /** * Defines values for Type1. - * Possible values include: '/providers/Microsoft.Management/managementGroups', '/subscriptions' - * @readonly - * @enum {string} - */ -export type Type1 = '/providers/Microsoft.Management/managementGroups' | '/subscriptions'; - -/** - * Defines values for ProvisioningState. - * Possible values include: 'Updating' + * Possible values include: 'Microsoft.Management/managementGroups', '/subscriptions' * @readonly * @enum {string} */ -export type ProvisioningState = 'Updating'; +export type Type1 = 'Microsoft.Management/managementGroups' | '/subscriptions'; /** * Defines values for Permissions. @@ -1141,19 +1199,19 @@ export type Permissions1 = 'noaccess' | 'view' | 'edit' | 'delete'; /** * Defines values for Type2. - * Possible values include: '/providers/Microsoft.Management/managementGroups', '/subscriptions' + * Possible values include: 'Microsoft.Management/managementGroups', '/subscriptions' * @readonly * @enum {string} */ -export type Type2 = '/providers/Microsoft.Management/managementGroups' | '/subscriptions'; +export type Type2 = 'Microsoft.Management/managementGroups' | '/subscriptions'; /** * Defines values for Expand. - * Possible values include: 'children' + * Possible values include: 'children', 'path' * @readonly * @enum {string} */ -export type Expand = 'children'; +export type Expand = 'children' | 'path'; /** * Defines values for Search. @@ -1184,6 +1242,7 @@ export type ManagementGroupsListResponse = ManagementGroupListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1203,6 +1262,7 @@ export type ManagementGroupsGetResponse = ManagementGroup & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1213,19 +1273,26 @@ export type ManagementGroupsGetResponse = ManagementGroup & { /** * Contains response data for the createOrUpdate operation. */ -export type ManagementGroupsCreateOrUpdateResponse = { +export type ManagementGroupsCreateOrUpdateResponse = ManagementGroupsCreateOrUpdateHeaders & { /** * The parsed response body. */ body: any; + /** * The underlying HTTP response. */ _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: ManagementGroupsCreateOrUpdateHeaders; + /** * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1245,6 +1312,7 @@ export type ManagementGroupsUpdateResponse = ManagementGroup & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1255,30 +1323,52 @@ export type ManagementGroupsUpdateResponse = ManagementGroup & { /** * Contains response data for the deleteMethod operation. */ -export type ManagementGroupsDeleteMethodResponse = OperationResults & { +export type ManagementGroupsDeleteResponse = AzureAsyncOperationResults & ManagementGroupsDeleteHeaders & { /** * The underlying HTTP response. */ _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: ManagementGroupsDeleteHeaders; + /** * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: OperationResults; + parsedBody: AzureAsyncOperationResults; }; }; /** - * Contains response data for the beginCreateOrUpdate operation. + * Contains response data for the getDescendants operation. */ -export type ManagementGroupsBeginCreateOrUpdateResponse = { +export type ManagementGroupsGetDescendantsResponse = DescendantListResult & { /** - * The parsed response body. + * The underlying HTTP response. */ - body: any; + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DescendantListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ManagementGroupsListNextResponse = ManagementGroupListResult & { /** * The underlying HTTP response. */ @@ -1287,17 +1377,18 @@ export type ManagementGroupsBeginCreateOrUpdateResponse = { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: any; + parsedBody: ManagementGroupListResult; }; }; /** - * Contains response data for the beginDeleteMethod operation. + * Contains response data for the getDescendantsNext operation. */ -export type ManagementGroupsBeginDeleteMethodResponse = OperationResults & { +export type ManagementGroupsGetDescendantsNextResponse = DescendantListResult & { /** * The underlying HTTP response. */ @@ -1306,17 +1397,18 @@ export type ManagementGroupsBeginDeleteMethodResponse = OperationResults & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: OperationResults; + parsedBody: DescendantListResult; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the create operation. */ -export type ManagementGroupsListNextResponse = ManagementGroupListResult & { +export type ManagementGroupSubscriptionsCreateResponse = SubscriptionUnderManagementGroup & { /** * The underlying HTTP response. */ @@ -1325,10 +1417,151 @@ export type ManagementGroupsListNextResponse = ManagementGroupListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: ManagementGroupListResult; + parsedBody: SubscriptionUnderManagementGroup; + }; +}; + +/** + * Contains response data for the getSubscription operation. + */ +export type ManagementGroupSubscriptionsGetSubscriptionResponse = SubscriptionUnderManagementGroup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SubscriptionUnderManagementGroup; + }; +}; + +/** + * Contains response data for the getSubscriptionsUnderManagementGroup operation. + */ +export type ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupResponse = ListSubscriptionUnderManagementGroup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListSubscriptionUnderManagementGroup; + }; +}; + +/** + * Contains response data for the getSubscriptionsUnderManagementGroupNext operation. + */ +export type ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextResponse = ListSubscriptionUnderManagementGroup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListSubscriptionUnderManagementGroup; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type HierarchySettingsListResponse = HierarchySettingsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HierarchySettingsList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type HierarchySettingsGetResponse = HierarchySettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HierarchySettings; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type HierarchySettingsCreateOrUpdateResponse = HierarchySettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HierarchySettings; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type HierarchySettingsUpdateResponse = HierarchySettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HierarchySettings; }; }; @@ -1344,6 +1577,7 @@ export type OperationsListResponse = OperationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1363,6 +1597,7 @@ export type OperationsListNextResponse = OperationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1382,6 +1617,7 @@ export type CheckNameAvailabilityResponse = CheckNameAvailabilityResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1401,6 +1637,7 @@ export type StartTenantBackfillResponse = TenantBackfillStatusResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1420,6 +1657,7 @@ export type TenantBackfillStatusResponse = TenantBackfillStatusResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1439,6 +1677,7 @@ export type EntitiesListResponse = EntityListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1458,6 +1697,7 @@ export type EntitiesListNextResponse = EntityListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ diff --git a/sdk/managementgroups/arm-managementgroups/src/models/managementGroupSubscriptionsMappers.ts b/sdk/managementgroups/arm-managementgroups/src/models/managementGroupSubscriptionsMappers.ts index 35f35a16b138..a7ae19c9a020 100644 --- a/sdk/managementgroups/arm-managementgroups/src/models/managementGroupSubscriptionsMappers.ts +++ b/sdk/managementgroups/arm-managementgroups/src/models/managementGroupSubscriptionsMappers.ts @@ -1,15 +1,28 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { + BaseResource, + CreateManagementGroupChildInfo, + CreateManagementGroupDetails, + CreateManagementGroupRequest, + CreateOrUpdateSettingsRequest, + CreateParentGroupInfo, + DescendantParentGroupInfo, + EntityHierarchyItem, + ErrorDetails, ErrorResponse, - ErrorDetails + HierarchySettings, + ListSubscriptionUnderManagementGroup, + ManagementGroup, + ManagementGroupChildInfo, + ManagementGroupDetails, + ManagementGroupPathElement, + ParentGroupInfo, + SubscriptionUnderManagementGroup } from "../models/mappers"; - diff --git a/sdk/managementgroups/arm-managementgroups/src/models/managementGroupsMappers.ts b/sdk/managementgroups/arm-managementgroups/src/models/managementGroupsMappers.ts index 6de4971d1994..f2d5487080bb 100644 --- a/sdk/managementgroups/arm-managementgroups/src/models/managementGroupsMappers.ts +++ b/sdk/managementgroups/arm-managementgroups/src/models/managementGroupsMappers.ts @@ -1,29 +1,35 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - ManagementGroupListResult, - ManagementGroupInfo, - ErrorResponse, + AzureAsyncOperationResults, + BaseResource, + CreateManagementGroupChildInfo, + CreateManagementGroupDetails, + CreateManagementGroupRequest, + CreateOrUpdateSettingsRequest, + CreateParentGroupInfo, + DescendantInfo, + DescendantListResult, + DescendantParentGroupInfo, + EntityHierarchyItem, ErrorDetails, + ErrorResponse, + HierarchySettings, ManagementGroup, - BaseResource, + ManagementGroupChildInfo, ManagementGroupDetails, + ManagementGroupInfo, + ManagementGroupListResult, + ManagementGroupPathElement, + ManagementGroupsCreateOrUpdateHeaders, + ManagementGroupsDeleteHeaders, ParentGroupInfo, - ManagementGroupChildInfo, - CreateManagementGroupRequest, - CreateManagementGroupDetails, - CreateParentGroupInfo, - CreateManagementGroupChildInfo, - OperationResults, PatchManagementGroupRequest, - EntityHierarchyItem + SubscriptionUnderManagementGroup } from "../models/mappers"; - diff --git a/sdk/managementgroups/arm-managementgroups/src/models/mappers.ts b/sdk/managementgroups/arm-managementgroups/src/models/mappers.ts index 4526d490119f..3f419ab97006 100644 --- a/sdk/managementgroups/arm-managementgroups/src/models/mappers.ts +++ b/sdk/managementgroups/arm-managementgroups/src/models/mappers.ts @@ -1,11 +1,9 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; @@ -231,6 +229,79 @@ export const ManagementGroupInfo: msRest.CompositeMapper = { } }; +export const DescendantParentGroupInfo: msRest.CompositeMapper = { + serializedName: "DescendantParentGroupInfo", + type: { + name: "Composite", + className: "DescendantParentGroupInfo", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const SubscriptionUnderManagementGroup: msRest.CompositeMapper = { + serializedName: "SubscriptionUnderManagementGroup", + type: { + name: "Composite", + className: "SubscriptionUnderManagementGroup", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + tenant: { + serializedName: "properties.tenant", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + parent: { + nullable: true, + serializedName: "properties.parent", + type: { + name: "Composite", + className: "DescendantParentGroupInfo" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + } + } + } +}; + export const ParentGroupInfo: msRest.CompositeMapper = { serializedName: "ParentGroupInfo", type: { @@ -324,17 +395,6 @@ export const ManagementGroupChildInfo: msRest.CompositeMapper = { name: "String" } }, - roles: { - serializedName: "roles", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, children: { serializedName: "children", type: { @@ -351,6 +411,28 @@ export const ManagementGroupChildInfo: msRest.CompositeMapper = { } }; +export const ManagementGroupPathElement: msRest.CompositeMapper = { + serializedName: "ManagementGroupPathElement", + type: { + name: "Composite", + className: "ManagementGroupPathElement", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + } + } + } +}; + export const ManagementGroup: msRest.CompositeMapper = { serializedName: "ManagementGroup", type: { @@ -390,18 +472,6 @@ export const ManagementGroup: msRest.CompositeMapper = { name: "String" } }, - roles: { - nullable: true, - serializedName: "properties.roles", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, details: { serializedName: "properties.details", type: { @@ -421,6 +491,19 @@ export const ManagementGroup: msRest.CompositeMapper = { } } } + }, + path: { + nullable: true, + serializedName: "properties.path", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementGroupPathElement" + } + } + } } } } @@ -453,8 +536,113 @@ export const OperationResults: msRest.CompositeMapper = { name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + } + } + } +}; + +export const AzureAsyncOperationResults: msRest.CompositeMapper = { + serializedName: "AzureAsyncOperationResults", + type: { + name: "Composite", + className: "AzureAsyncOperationResults", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + } + } + } +}; + +export const HierarchySettings: msRest.CompositeMapper = { + serializedName: "HierarchySettings", + type: { + name: "Composite", + className: "HierarchySettings", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + requireAuthorizationForGroupCreation: { + serializedName: "properties.requireAuthorizationForGroupCreation", + type: { + name: "Boolean" + } + }, + defaultManagementGroup: { + serializedName: "properties.defaultManagementGroup", type: { name: "String" } @@ -463,6 +651,154 @@ export const OperationResults: msRest.CompositeMapper = { } }; +export const HierarchySettingsInfo: msRest.CompositeMapper = { + serializedName: "HierarchySettingsInfo", + type: { + name: "Composite", + className: "HierarchySettingsInfo", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + requireAuthorizationForGroupCreation: { + serializedName: "properties.requireAuthorizationForGroupCreation", + type: { + name: "Boolean" + } + }, + defaultManagementGroup: { + serializedName: "properties.defaultManagementGroup", + type: { + name: "String" + } + } + } + } +}; + +export const HierarchySettingsList: msRest.CompositeMapper = { + serializedName: "HierarchySettingsList", + type: { + name: "Composite", + className: "HierarchySettingsList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HierarchySettingsInfo" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CreateOrUpdateSettingsRequest: msRest.CompositeMapper = { + serializedName: "CreateOrUpdateSettingsRequest", + type: { + name: "Composite", + className: "CreateOrUpdateSettingsRequest", + modelProperties: { + requireAuthorizationForGroupCreation: { + serializedName: "properties.requireAuthorizationForGroupCreation", + type: { + name: "Boolean" + } + }, + defaultManagementGroup: { + serializedName: "properties.defaultManagementGroup", + type: { + name: "String" + } + } + } + } +}; + +export const DescendantInfo: msRest.CompositeMapper = { + serializedName: "DescendantInfo", + type: { + name: "Composite", + className: "DescendantInfo", + modelProperties: { + id: { + nullable: true, + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + nullable: true, + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + nullable: true, + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + parent: { + nullable: true, + serializedName: "properties.parent", + type: { + name: "Composite", + className: "DescendantParentGroupInfo" + } + } + } + } +}; + export const EntityParentGroupInfo: msRest.CompositeMapper = { serializedName: "EntityParentGroupInfo", type: { @@ -660,9 +996,9 @@ export const PatchManagementGroupRequest: msRest.CompositeMapper = { name: "String" } }, - parentId: { + parentGroupId: { nullable: true, - serializedName: "parentId", + serializedName: "parentGroupId", type: { name: "String" } @@ -773,18 +1109,6 @@ export const CreateManagementGroupChildInfo: msRest.CompositeMapper = { name: "String" } }, - roles: { - readOnly: true, - serializedName: "roles", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, children: { readOnly: true, serializedName: "children", @@ -842,19 +1166,6 @@ export const CreateManagementGroupRequest: msRest.CompositeMapper = { name: "String" } }, - roles: { - nullable: true, - readOnly: true, - serializedName: "properties.roles", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, details: { serializedName: "properties.details", type: { @@ -897,7 +1208,7 @@ export const CheckNameAvailabilityRequest: msRest.CompositeMapper = { type: { name: "Enum", allowedValues: [ - "/providers/Microsoft.Management/managementGroups" + "Microsoft.Management/managementGroups" ] } } @@ -905,6 +1216,50 @@ export const CheckNameAvailabilityRequest: msRest.CompositeMapper = { } }; +export const ManagementGroupsCreateOrUpdateHeaders: msRest.CompositeMapper = { + serializedName: "managementgroups-createorupdate-headers", + type: { + name: "Composite", + className: "ManagementGroupsCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const ManagementGroupsDeleteHeaders: msRest.CompositeMapper = { + serializedName: "managementgroups-delete-headers", + type: { + name: "Composite", + className: "ManagementGroupsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + export const ManagementGroupListResult: msRest.CompositeMapper = { serializedName: "ManagementGroupListResult", type: { @@ -934,6 +1289,64 @@ export const ManagementGroupListResult: msRest.CompositeMapper = { } }; +export const DescendantListResult: msRest.CompositeMapper = { + serializedName: "DescendantListResult", + type: { + name: "Composite", + className: "DescendantListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DescendantInfo" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ListSubscriptionUnderManagementGroup: msRest.CompositeMapper = { + serializedName: "ListSubscriptionUnderManagementGroup", + type: { + name: "Composite", + className: "ListSubscriptionUnderManagementGroup", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubscriptionUnderManagementGroup" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const OperationListResult: msRest.CompositeMapper = { serializedName: "OperationListResult", type: { diff --git a/sdk/managementgroups/arm-managementgroups/src/models/operationsMappers.ts b/sdk/managementgroups/arm-managementgroups/src/models/operationsMappers.ts index 16e1a0a23e0f..192b333f71f0 100644 --- a/sdk/managementgroups/arm-managementgroups/src/models/operationsMappers.ts +++ b/sdk/managementgroups/arm-managementgroups/src/models/operationsMappers.ts @@ -1,18 +1,15 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - OperationListResult, + ErrorDetails, + ErrorResponse, Operation, OperationDisplayProperties, - ErrorResponse, - ErrorDetails + OperationListResult } from "../models/mappers"; - diff --git a/sdk/managementgroups/arm-managementgroups/src/models/parameters.ts b/sdk/managementgroups/arm-managementgroups/src/models/parameters.ts index c94a3fc9c620..d42e9f972ca7 100644 --- a/sdk/managementgroups/arm-managementgroups/src/models/parameters.ts +++ b/sdk/managementgroups/arm-managementgroups/src/models/parameters.ts @@ -137,10 +137,7 @@ export const select: msRest.OperationQueryParameter = { } }; export const skip: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skip" - ], + parameterPath: "skip", mapper: { serializedName: "$skip", type: { @@ -149,10 +146,7 @@ export const skip: msRest.OperationQueryParameter = { } }; export const skiptoken: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skiptoken" - ], + parameterPath: "skiptoken", mapper: { serializedName: "$skiptoken", type: { @@ -171,10 +165,7 @@ export const subscriptionId: msRest.OperationURLParameter = { } }; export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + parameterPath: "top", mapper: { serializedName: "$top", type: { diff --git a/sdk/managementgroups/arm-managementgroups/src/operations/hierarchySettingsOperations.ts b/sdk/managementgroups/arm-managementgroups/src/operations/hierarchySettingsOperations.ts new file mode 100644 index 000000000000..d3547b4afbcc --- /dev/null +++ b/sdk/managementgroups/arm-managementgroups/src/operations/hierarchySettingsOperations.ts @@ -0,0 +1,307 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/hierarchySettingsOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext"; + +/** Class representing a HierarchySettingsOperations. */ +export class HierarchySettingsOperations { + private readonly client: ManagementGroupsAPIContext; + + /** + * Create a HierarchySettingsOperations. + * @param {ManagementGroupsAPIContext} client Reference to the service client. + */ + constructor(client: ManagementGroupsAPIContext) { + this.client = client; + } + + /** + * Gets all the hierarchy settings defined at the Management Group level. Settings can only be set + * on the root Management Group of the hierarchy. + * @param groupId Management Group ID. + * @param [options] The optional parameters + * @returns Promise + */ + list(groupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId Management Group ID. + * @param callback The callback + */ + list(groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param options The optional parameters + * @param callback The callback + */ + list(groupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(groupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the hierarchy settings defined at the Management Group level. Settings can only be set on + * the root Management Group of the hierarchy. + * @param groupId Management Group ID. + * @param [options] The optional parameters + * @returns Promise + */ + get(groupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId Management Group ID. + * @param callback The callback + */ + get(groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param options The optional parameters + * @param callback The callback + */ + get(groupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(groupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the hierarchy settings defined at the Management Group level. + * @param groupId Management Group ID. + * @param createTenantSettingsRequest Tenant level settings request parameter. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId Management Group ID. + * @param createTenantSettingsRequest Tenant level settings request parameter. + * @param callback The callback + */ + createOrUpdate(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param createTenantSettingsRequest Tenant level settings request parameter. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + createTenantSettingsRequest, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Updates the hierarchy settings defined at the Management Group level. + * @param groupId Management Group ID. + * @param createTenantSettingsRequest Tenant level settings request parameter. + * @param [options] The optional parameters + * @returns Promise + */ + update(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId Management Group ID. + * @param createTenantSettingsRequest Tenant level settings request parameter. + * @param callback The callback + */ + update(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param createTenantSettingsRequest Tenant level settings request parameter. + * @param options The optional parameters + * @param callback The callback + */ + update(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(groupId: string, createTenantSettingsRequest: Models.CreateOrUpdateSettingsRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + createTenantSettingsRequest, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the hierarchy settings defined at the Management Group level. + * @param groupId Management Group ID. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(groupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId Management Group ID. + * @param callback The callback + */ + deleteMethod(groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(groupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(groupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + options + }, + deleteMethodOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/settings", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HierarchySettingsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/settings/default", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HierarchySettings + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.Management/managementGroups/{groupId}/settings/default", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "createTenantSettingsRequest", + mapper: { + ...Mappers.CreateOrUpdateSettingsRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HierarchySettings + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "providers/Microsoft.Management/managementGroups/{groupId}/settings/default", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "createTenantSettingsRequest", + mapper: { + ...Mappers.CreateOrUpdateSettingsRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HierarchySettings + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "providers/Microsoft.Management/managementGroups/{groupId}/settings/default", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/managementgroups/arm-managementgroups/src/operations/index.ts b/sdk/managementgroups/arm-managementgroups/src/operations/index.ts index 9712e3b21827..70a319ac718a 100644 --- a/sdk/managementgroups/arm-managementgroups/src/operations/index.ts +++ b/sdk/managementgroups/arm-managementgroups/src/operations/index.ts @@ -10,5 +10,6 @@ export * from "./managementGroups"; export * from "./managementGroupSubscriptions"; +export * from "./hierarchySettingsOperations"; export * from "./operations"; export * from "./entities"; diff --git a/sdk/managementgroups/arm-managementgroups/src/operations/managementGroupSubscriptions.ts b/sdk/managementgroups/arm-managementgroups/src/operations/managementGroupSubscriptions.ts index bc93eaddafa2..2c70ad88ee98 100644 --- a/sdk/managementgroups/arm-managementgroups/src/operations/managementGroupSubscriptions.ts +++ b/sdk/managementgroups/arm-managementgroups/src/operations/managementGroupSubscriptions.ts @@ -31,23 +31,23 @@ export class ManagementGroupSubscriptions { * @param groupId Management Group ID. * @param subscriptionId Subscription ID. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - create(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsCreateOptionalParams): Promise; + create(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsCreateOptionalParams): Promise; /** * @param groupId Management Group ID. * @param subscriptionId Subscription ID. * @param callback The callback */ - create(groupId: string, subscriptionId: string, callback: msRest.ServiceCallback): void; + create(groupId: string, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param groupId Management Group ID. * @param subscriptionId Subscription ID. * @param options The optional parameters * @param callback The callback */ - create(groupId: string, subscriptionId: string, options: Models.ManagementGroupSubscriptionsCreateOptionalParams, callback: msRest.ServiceCallback): void; - create(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create(groupId: string, subscriptionId: string, options: Models.ManagementGroupSubscriptionsCreateOptionalParams, callback: msRest.ServiceCallback): void; + create(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { groupId, @@ -55,7 +55,7 @@ export class ManagementGroupSubscriptions { options }, createOperationSpec, - callback); + callback) as Promise; } /** @@ -89,6 +89,96 @@ export class ManagementGroupSubscriptions { deleteMethodOperationSpec, callback); } + + /** + * Retrieves details about given subscription which is associated with the management group. + * @param groupId Management Group ID. + * @param subscriptionId Subscription ID. + * @param [options] The optional parameters + * @returns Promise + */ + getSubscription(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsGetSubscriptionOptionalParams): Promise; + /** + * @param groupId Management Group ID. + * @param subscriptionId Subscription ID. + * @param callback The callback + */ + getSubscription(groupId: string, subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param subscriptionId Subscription ID. + * @param options The optional parameters + * @param callback The callback + */ + getSubscription(groupId: string, subscriptionId: string, options: Models.ManagementGroupSubscriptionsGetSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + getSubscription(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsGetSubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + subscriptionId, + options + }, + getSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Retrieves details about all subscriptions which are associated with the management group. + * @param groupId Management Group ID. + * @param [options] The optional parameters + * @returns + * Promise + */ + getSubscriptionsUnderManagementGroup(groupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId Management Group ID. + * @param callback The callback + */ + getSubscriptionsUnderManagementGroup(groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param options The optional parameters + * @param callback The callback + */ + getSubscriptionsUnderManagementGroup(groupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSubscriptionsUnderManagementGroup(groupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + options + }, + getSubscriptionsUnderManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Retrieves details about all subscriptions which are associated with the management group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns + * Promise + */ + getSubscriptionsUnderManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + getSubscriptionsUnderManagementGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + getSubscriptionsUnderManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSubscriptionsUnderManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + getSubscriptionsUnderManagementGroupNextOperationSpec, + callback) as Promise; + } } // Operation Specifications @@ -108,7 +198,9 @@ const createOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { - 204: {}, + 200: { + bodyMapper: Mappers.SubscriptionUnderManagementGroup + }, default: { bodyMapper: Mappers.ErrorResponse } @@ -131,6 +223,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { + 200: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse @@ -138,3 +231,73 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { }, serializer }; + +const getSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}", + urlParameters: [ + Parameters.groupId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.cacheControl, + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SubscriptionUnderManagementGroup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getSubscriptionsUnderManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/subscriptions", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.skiptoken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListSubscriptionUnderManagementGroup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getSubscriptionsUnderManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListSubscriptionUnderManagementGroup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/managementgroups/arm-managementgroups/src/operations/managementGroups.ts b/sdk/managementgroups/arm-managementgroups/src/operations/managementGroups.ts index 5184f89175ae..b91fa509f2ae 100644 --- a/sdk/managementgroups/arm-managementgroups/src/operations/managementGroups.ts +++ b/sdk/managementgroups/arm-managementgroups/src/operations/managementGroups.ts @@ -80,9 +80,9 @@ export class ManagementGroups { } /** - * Create or update a management group. If a management group is already created and a subsequent - * create request is issued with different properties, the management group properties will be - * updated. + * Create or update a management group. + * If a management group is already created and a subsequent create request is issued with + * different properties, the management group properties will be updated. * @param groupId Management Group ID. * @param createManagementGroupRequest Management group creation parameters. * @param [options] The optional parameters @@ -126,20 +126,49 @@ export class ManagementGroups { } /** - * Delete management group. If a management group contains child resources, the request will fail. + * Delete management group. + * If a management group contains child resources, the request will fail. * @param groupId Management Group ID. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - deleteMethod(groupId: string, options?: Models.ManagementGroupsDeleteMethodOptionalParams): Promise { + deleteMethod(groupId: string, options?: Models.ManagementGroupsDeleteMethodOptionalParams): Promise { return this.beginDeleteMethod(groupId,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** - * Create or update a management group. If a management group is already created and a subsequent - * create request is issued with different properties, the management group properties will be - * updated. + * List all entities that descend from a management group. + * @param groupId Management Group ID. + * @param [options] The optional parameters + * @returns Promise + */ + getDescendants(groupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId Management Group ID. + * @param callback The callback + */ + getDescendants(groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId Management Group ID. + * @param options The optional parameters + * @param callback The callback + */ + getDescendants(groupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDescendants(groupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + options + }, + getDescendantsOperationSpec, + callback) as Promise; + } + + /** + * Create or update a management group. + * If a management group is already created and a subsequent create request is issued with + * different properties, the management group properties will be updated. * @param groupId Management Group ID. * @param createManagementGroupRequest Management group creation parameters. * @param [options] The optional parameters @@ -157,7 +186,8 @@ export class ManagementGroups { } /** - * Delete management group. If a management group contains child resources, the request will fail. + * Delete management group. + * If a management group contains child resources, the request will fail. * @param groupId Management Group ID. * @param [options] The optional parameters * @returns Promise @@ -199,6 +229,34 @@ export class ManagementGroups { listNextOperationSpec, callback) as Promise; } + + /** + * List all entities that descend from a management group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + getDescendantsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + getDescendantsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + getDescendantsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDescendantsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + getDescendantsNextOperationSpec, + callback) as Promise; + } } // Operation Specifications @@ -283,6 +341,31 @@ const updateOperationSpec: msRest.OperationSpec = { serializer }; +const getDescendantsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/descendants", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.skiptoken, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DescendantListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "providers/Microsoft.Management/managementGroups/{groupId}", @@ -305,13 +388,16 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { }, responses: { 200: { - bodyMapper: Mappers.ManagementGroup + bodyMapper: Mappers.ManagementGroup, + headersMapper: Mappers.ManagementGroupsCreateOrUpdateHeaders }, 202: { - bodyMapper: Mappers.OperationResults + bodyMapper: Mappers.AzureAsyncOperationResults, + headersMapper: Mappers.ManagementGroupsCreateOrUpdateHeaders }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.ManagementGroupsCreateOrUpdateHeaders } }, serializer @@ -332,11 +418,15 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { ], responses: { 202: { - bodyMapper: Mappers.OperationResults + bodyMapper: Mappers.AzureAsyncOperationResults, + headersMapper: Mappers.ManagementGroupsDeleteHeaders + }, + 204: { + headersMapper: Mappers.ManagementGroupsDeleteHeaders }, - 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.ManagementGroupsDeleteHeaders } }, serializer @@ -363,3 +453,24 @@ const listNextOperationSpec: msRest.OperationSpec = { }, serializer }; + +const getDescendantsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DescendantListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/managementgroups/arm-managementgroups/tsconfig.json b/sdk/managementgroups/arm-managementgroups/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/managementgroups/arm-managementgroups/tsconfig.json +++ b/sdk/managementgroups/arm-managementgroups/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true