// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.managementgroups.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.managementgroups.fluent.models.CreateManagementGroupProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Management group creation parameters. */
@Fluent
public final class CreateManagementGroupRequest extends ProxyResource {
    /*
     * The name of the management group. For example, 00000000-0000-0000-0000-000000000000
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The generic properties of a management group used during creation.
     */
    @JsonProperty(value = "properties")
    private CreateManagementGroupProperties innerProperties;

    /** Creates an instance of CreateManagementGroupRequest class. */
    public CreateManagementGroupRequest() {
    }

    /**
     * Get the name property: The name of the management group. For example, 00000000-0000-0000-0000-000000000000.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: The name of the management group. For example, 00000000-0000-0000-0000-000000000000.
     *
     * @param name the name value to set.
     * @return the CreateManagementGroupRequest object itself.
     */
    public CreateManagementGroupRequest withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the innerProperties property: The generic properties of a management group used during creation.
     *
     * @return the innerProperties value.
     */
    private CreateManagementGroupProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tenantId property: The AAD Tenant ID associated with the management group. For example,
     * 00000000-0000-0000-0000-000000000000.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Get the displayName property: The friendly name of the management group. If no value is passed then this field
     * will be set to the groupId.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: The friendly name of the management group. If no value is passed then this field
     * will be set to the groupId.
     *
     * @param displayName the displayName value to set.
     * @return the CreateManagementGroupRequest object itself.
     */
    public CreateManagementGroupRequest withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new CreateManagementGroupProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the details property: The details of a management group used during creation.
     *
     * @return the details value.
     */
    public CreateManagementGroupDetails details() {
        return this.innerProperties() == null ? null : this.innerProperties().details();
    }

    /**
     * Set the details property: The details of a management group used during creation.
     *
     * @param details the details value to set.
     * @return the CreateManagementGroupRequest object itself.
     */
    public CreateManagementGroupRequest withDetails(CreateManagementGroupDetails details) {
        if (this.innerProperties() == null) {
            this.innerProperties = new CreateManagementGroupProperties();
        }
        this.innerProperties().withDetails(details);
        return this;
    }

    /**
     * Get the children property: The list of children.
     *
     * @return the children value.
     */
    public List<CreateManagementGroupChildInfo> children() {
        return this.innerProperties() == null ? null : this.innerProperties().children();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
