// 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.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The child information of a management group used during creation. */
@Immutable
public final class CreateManagementGroupChildInfo {
    /*
     * The fully qualified resource type which includes provider namespace (e.g. Microsoft.Management/managementGroups)
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private ManagementGroupChildType type;

    /*
     * The fully qualified ID for the child resource (management group or subscription).  For example,
     * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * The name of the child entity.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * The friendly name of the child resource.
     */
    @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY)
    private String displayName;

    /*
     * The list of children.
     */
    @JsonProperty(value = "children", access = JsonProperty.Access.WRITE_ONLY)
    private List<CreateManagementGroupChildInfo> children;

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

    /**
     * Get the type property: The fully qualified resource type which includes provider namespace (e.g.
     * Microsoft.Management/managementGroups).
     *
     * @return the type value.
     */
    public ManagementGroupChildType type() {
        return this.type;
    }

    /**
     * Get the id property: The fully qualified ID for the child resource (management group or subscription). For
     * example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Get the name property: The name of the child entity.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the displayName property: The friendly name of the child resource.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

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

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