// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.managementgroups;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.managementgroups.ManagementGroupArgs;
import com.pulumi.azure.managementgroups.inputs.ManagementGroupState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import javax.annotation.Nullable;

/**
 * Manages a Management Group.
 * 
 * !&gt; **Note:** Configuring `subscription_ids` is not supported when using the `azure.management.GroupSubscriptionAssociation` resource, results will be unpredictable.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.CoreFunctions;
 * import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
 * import com.pulumi.azure.management.Group;
 * import com.pulumi.azure.management.GroupArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         final var current = CoreFunctions.getSubscription();
 * 
 *         var exampleParent = new Group(&#34;exampleParent&#34;, GroupArgs.builder()        
 *             .displayName(&#34;ParentGroup&#34;)
 *             .subscriptionIds(current.applyValue(getSubscriptionResult -&gt; getSubscriptionResult.subscriptionId()))
 *             .build());
 * 
 *         var exampleChild = new Group(&#34;exampleChild&#34;, GroupArgs.builder()        
 *             .displayName(&#34;ChildGroup&#34;)
 *             .parentManagementGroupId(exampleParent.id())
 *             .subscriptionIds(current.applyValue(getSubscriptionResult -&gt; getSubscriptionResult.subscriptionId()))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Management Groups can be imported using the `management group resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:managementgroups/managementGroup:ManagementGroup example /providers/Microsoft.Management/managementGroups/group1
 * ```
 * 
 * @deprecated
 * azure.managementgroups.ManagementGroup has been deprecated in favor of azure.management.Group
 * 
 */
@Deprecated /* azure.managementgroups.ManagementGroup has been deprecated in favor of azure.management.Group */
@ResourceType(type="azure:managementgroups/managementGroup:ManagementGroup")
public class ManagementGroup extends com.pulumi.resources.CustomResource {
    /**
     * A friendly name for this Management Group. If not specified, this will be the same as the `name`.
     * 
     */
    @Export(name="displayName", refs={String.class}, tree="[0]")
    private Output<String> displayName;

    /**
     * @return A friendly name for this Management Group. If not specified, this will be the same as the `name`.
     * 
     */
    public Output<String> displayName() {
        return this.displayName;
    }
    /**
     * The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The ID of the Parent Management Group.
     * 
     */
    @Export(name="parentManagementGroupId", refs={String.class}, tree="[0]")
    private Output<String> parentManagementGroupId;

    /**
     * @return The ID of the Parent Management Group.
     * 
     */
    public Output<String> parentManagementGroupId() {
        return this.parentManagementGroupId;
    }
    /**
     * A list of Subscription GUIDs which should be assigned to the Management Group.
     * 
     * &gt; **Note:** To clear all Subscriptions from the Management Group set `subscription_ids` to an empty list
     * 
     */
    @Export(name="subscriptionIds", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> subscriptionIds;

    /**
     * @return A list of Subscription GUIDs which should be assigned to the Management Group.
     * 
     * &gt; **Note:** To clear all Subscriptions from the Management Group set `subscription_ids` to an empty list
     * 
     */
    public Output<List<String>> subscriptionIds() {
        return this.subscriptionIds;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ManagementGroup(String name) {
        this(name, ManagementGroupArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ManagementGroup(String name, @Nullable ManagementGroupArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public ManagementGroup(String name, @Nullable ManagementGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:managementgroups/managementGroup:ManagementGroup", name, args == null ? ManagementGroupArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private ManagementGroup(String name, Output<String> id, @Nullable ManagementGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:managementgroups/managementGroup:ManagementGroup", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static ManagementGroup get(String name, Output<String> id, @Nullable ManagementGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ManagementGroup(name, id, state, options);
    }
}
