// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.managementgroups.models.EntityParentGroupInfo;
import com.azure.resourcemanager.managementgroups.models.Permissions;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The entity. */
@Fluent
public final class EntityInfoInner {
    /*
     * The fully qualified ID for the entity.  For example,
     * /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * The type of the resource. For example, Microsoft.Management/managementGroups
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /*
     * The name of the entity. For example, 00000000-0000-0000-0000-000000000000
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * The generic properties of an entity.
     */
    @JsonProperty(value = "properties")
    private EntityInfoProperties innerProperties;

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

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

    /**
     * Get the type property: The type of the resource. For example, Microsoft.Management/managementGroups.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

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

    /**
     * Get the innerProperties property: The generic properties of an entity.
     *
     * @return the innerProperties value.
     */
    private EntityInfoProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Set the tenantId property: The AAD Tenant ID associated with the entity. For example,
     * 00000000-0000-0000-0000-000000000000.
     *
     * @param tenantId the tenantId value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withTenantId(String tenantId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withTenantId(tenantId);
        return this;
    }

    /**
     * Get the displayName property: The friendly name of the management group.
     *
     * @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.
     *
     * @param displayName the displayName value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the parent property: (Optional) The ID of the parent management group.
     *
     * @return the parent value.
     */
    public EntityParentGroupInfo parent() {
        return this.innerProperties() == null ? null : this.innerProperties().parent();
    }

    /**
     * Set the parent property: (Optional) The ID of the parent management group.
     *
     * @param parent the parent value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withParent(EntityParentGroupInfo parent) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withParent(parent);
        return this;
    }

    /**
     * Get the permissions property: The users specific permissions to this item.
     *
     * @return the permissions value.
     */
    public Permissions permissions() {
        return this.innerProperties() == null ? null : this.innerProperties().permissions();
    }

    /**
     * Set the permissions property: The users specific permissions to this item.
     *
     * @param permissions the permissions value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withPermissions(Permissions permissions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withPermissions(permissions);
        return this;
    }

    /**
     * Get the inheritedPermissions property: The users specific permissions to this item.
     *
     * @return the inheritedPermissions value.
     */
    public Permissions inheritedPermissions() {
        return this.innerProperties() == null ? null : this.innerProperties().inheritedPermissions();
    }

    /**
     * Set the inheritedPermissions property: The users specific permissions to this item.
     *
     * @param inheritedPermissions the inheritedPermissions value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withInheritedPermissions(Permissions inheritedPermissions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withInheritedPermissions(inheritedPermissions);
        return this;
    }

    /**
     * Get the numberOfDescendants property: Number of Descendants.
     *
     * @return the numberOfDescendants value.
     */
    public Integer numberOfDescendants() {
        return this.innerProperties() == null ? null : this.innerProperties().numberOfDescendants();
    }

    /**
     * Set the numberOfDescendants property: Number of Descendants.
     *
     * @param numberOfDescendants the numberOfDescendants value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withNumberOfDescendants(Integer numberOfDescendants) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withNumberOfDescendants(numberOfDescendants);
        return this;
    }

    /**
     * Get the numberOfChildren property: Number of Children
     *
     * <p>Number of children is the number of Groups and Subscriptions that are exactly one level underneath the current
     * Group.
     *
     * @return the numberOfChildren value.
     */
    public Integer numberOfChildren() {
        return this.innerProperties() == null ? null : this.innerProperties().numberOfChildren();
    }

    /**
     * Set the numberOfChildren property: Number of Children
     *
     * <p>Number of children is the number of Groups and Subscriptions that are exactly one level underneath the current
     * Group.
     *
     * @param numberOfChildren the numberOfChildren value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withNumberOfChildren(Integer numberOfChildren) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withNumberOfChildren(numberOfChildren);
        return this;
    }

    /**
     * Get the numberOfChildGroups property: Number of Child Groups
     *
     * <p>Number of children is the number of Groups that are exactly one level underneath the current Group.
     *
     * @return the numberOfChildGroups value.
     */
    public Integer numberOfChildGroups() {
        return this.innerProperties() == null ? null : this.innerProperties().numberOfChildGroups();
    }

    /**
     * Set the numberOfChildGroups property: Number of Child Groups
     *
     * <p>Number of children is the number of Groups that are exactly one level underneath the current Group.
     *
     * @param numberOfChildGroups the numberOfChildGroups value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withNumberOfChildGroups(Integer numberOfChildGroups) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withNumberOfChildGroups(numberOfChildGroups);
        return this;
    }

    /**
     * Get the parentDisplayNameChain property: The parent display name chain from the root group to the immediate
     * parent.
     *
     * @return the parentDisplayNameChain value.
     */
    public List<String> parentDisplayNameChain() {
        return this.innerProperties() == null ? null : this.innerProperties().parentDisplayNameChain();
    }

    /**
     * Set the parentDisplayNameChain property: The parent display name chain from the root group to the immediate
     * parent.
     *
     * @param parentDisplayNameChain the parentDisplayNameChain value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withParentDisplayNameChain(List<String> parentDisplayNameChain) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withParentDisplayNameChain(parentDisplayNameChain);
        return this;
    }

    /**
     * Get the parentNameChain property: The parent name chain from the root group to the immediate parent.
     *
     * @return the parentNameChain value.
     */
    public List<String> parentNameChain() {
        return this.innerProperties() == null ? null : this.innerProperties().parentNameChain();
    }

    /**
     * Set the parentNameChain property: The parent name chain from the root group to the immediate parent.
     *
     * @param parentNameChain the parentNameChain value to set.
     * @return the EntityInfoInner object itself.
     */
    public EntityInfoInner withParentNameChain(List<String> parentNameChain) {
        if (this.innerProperties() == null) {
            this.innerProperties = new EntityInfoProperties();
        }
        this.innerProperties().withParentNameChain(parentNameChain);
        return this;
    }

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