// 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.implementation;

import com.azure.resourcemanager.managementgroups.fluent.models.EntityInfoInner;
import com.azure.resourcemanager.managementgroups.models.EntityInfo;
import com.azure.resourcemanager.managementgroups.models.EntityParentGroupInfo;
import com.azure.resourcemanager.managementgroups.models.Permissions;
import java.util.Collections;
import java.util.List;

public final class EntityInfoImpl implements EntityInfo {
    private EntityInfoInner innerObject;

    private final com.azure.resourcemanager.managementgroups.ManagementGroupsManager serviceManager;

    EntityInfoImpl(
        EntityInfoInner innerObject,
        com.azure.resourcemanager.managementgroups.ManagementGroupsManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

    public String id() {
        return this.innerModel().id();
    }

    public String type() {
        return this.innerModel().type();
    }

    public String name() {
        return this.innerModel().name();
    }

    public String tenantId() {
        return this.innerModel().tenantId();
    }

    public String displayName() {
        return this.innerModel().displayName();
    }

    public EntityParentGroupInfo parent() {
        return this.innerModel().parent();
    }

    public Permissions permissions() {
        return this.innerModel().permissions();
    }

    public Permissions inheritedPermissions() {
        return this.innerModel().inheritedPermissions();
    }

    public Integer numberOfDescendants() {
        return this.innerModel().numberOfDescendants();
    }

    public Integer numberOfChildren() {
        return this.innerModel().numberOfChildren();
    }

    public Integer numberOfChildGroups() {
        return this.innerModel().numberOfChildGroups();
    }

    public List<String> parentDisplayNameChain() {
        List<String> inner = this.innerModel().parentDisplayNameChain();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public List<String> parentNameChain() {
        List<String> inner = this.innerModel().parentNameChain();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public EntityInfoInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.managementgroups.ManagementGroupsManager manager() {
        return this.serviceManager;
    }
}
