From 9c26823df9bc57d39307df41ff7f9a81b185a796 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 25 Sep 2020 23:02:35 +0000 Subject: [PATCH] Generated from b15efeccad067a7d52027c671538ab1730dc48ca --- .../src/models/managementGroupMappers.ts | 13 +++ .../arm-resources/src/operations/index.ts | 1 + .../src/operations/managementGroup.ts | 83 +++++++++++++++++++ .../src/resourceManagementClient.ts | 2 + 4 files changed, 99 insertions(+) create mode 100644 sdk/resources/arm-resources/src/models/managementGroupMappers.ts create mode 100644 sdk/resources/arm-resources/src/operations/managementGroup.ts diff --git a/sdk/resources/arm-resources/src/models/managementGroupMappers.ts b/sdk/resources/arm-resources/src/models/managementGroupMappers.ts new file mode 100644 index 000000000000..26d60e4f9e5d --- /dev/null +++ b/sdk/resources/arm-resources/src/models/managementGroupMappers.ts @@ -0,0 +1,13 @@ +/* + * 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 { + CloudError, + ErrorAdditionalInfo, + ErrorResponse +} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/operations/index.ts b/sdk/resources/arm-resources/src/operations/index.ts index a7cec76246cd..b41e064c362a 100644 --- a/sdk/resources/arm-resources/src/operations/index.ts +++ b/sdk/resources/arm-resources/src/operations/index.ts @@ -11,6 +11,7 @@ export * from "./operations"; export * from "./deployments"; export * from "./providers"; +export * from "./managementGroup"; export * from "./resources"; export * from "./resourceGroups"; export * from "./tagsOperations"; diff --git a/sdk/resources/arm-resources/src/operations/managementGroup.ts b/sdk/resources/arm-resources/src/operations/managementGroup.ts new file mode 100644 index 000000000000..d7e4eb7cffcd --- /dev/null +++ b/sdk/resources/arm-resources/src/operations/managementGroup.ts @@ -0,0 +1,83 @@ +/* + * 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 Mappers from "../models/managementGroupMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a ManagementGroup. */ +export class ManagementGroup { + private readonly client: ResourceManagementClientContext; + + /** + * Create a ManagementGroup. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * Registers a management group with a resource provider. + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @param [options] The optional parameters + * @returns Promise + */ + register(resourceProviderNamespace: string, groupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @param callback The callback + */ + register(resourceProviderNamespace: string, groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @param options The optional parameters + * @param callback The callback + */ + register(resourceProviderNamespace: string, groupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + register(resourceProviderNamespace: string, groupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceProviderNamespace, + groupId, + options + }, + registerOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const registerOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register", + urlParameters: [ + Parameters.resourceProviderNamespace, + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index 535cd08e4b20..5c02eb5cd292 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -20,6 +20,7 @@ class ResourceManagementClient extends ResourceManagementClientContext { operations: operations.Operations; deployments: operations.Deployments; providers: operations.Providers; + managementGroup: operations.ManagementGroup; resources: operations.Resources; resourceGroups: operations.ResourceGroups; tags: operations.TagsOperations; @@ -36,6 +37,7 @@ class ResourceManagementClient extends ResourceManagementClientContext { this.operations = new operations.Operations(this); this.deployments = new operations.Deployments(this); this.providers = new operations.Providers(this); + this.managementGroup = new operations.ManagementGroup(this); this.resources = new operations.Resources(this); this.resourceGroups = new operations.ResourceGroups(this); this.tags = new operations.TagsOperations(this);