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

package com.azure.resourcemanager.billingbenefits.fluent.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Role assignment entity. */
@Fluent
public final class RoleAssignmentEntityInner {
    /*
     * Role assignment entity id
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Role assignment entity name
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Role assignment entity properties
     */
    @JsonProperty(value = "properties")
    private RoleAssignmentEntityProperties innerProperties;

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

    /**
     * Get the id property: Role assignment entity id.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Role assignment entity id.
     *
     * @param id the id value to set.
     * @return the RoleAssignmentEntityInner object itself.
     */
    public RoleAssignmentEntityInner withId(String id) {
        this.id = id;
        return this;
    }

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

    /**
     * Set the name property: Role assignment entity name.
     *
     * @param name the name value to set.
     * @return the RoleAssignmentEntityInner object itself.
     */
    public RoleAssignmentEntityInner withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the innerProperties property: Role assignment entity properties.
     *
     * @return the innerProperties value.
     */
    private RoleAssignmentEntityProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the principalId property: Principal Id.
     *
     * @return the principalId value.
     */
    public String principalId() {
        return this.innerProperties() == null ? null : this.innerProperties().principalId();
    }

    /**
     * Set the principalId property: Principal Id.
     *
     * @param principalId the principalId value to set.
     * @return the RoleAssignmentEntityInner object itself.
     */
    public RoleAssignmentEntityInner withPrincipalId(String principalId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RoleAssignmentEntityProperties();
        }
        this.innerProperties().withPrincipalId(principalId);
        return this;
    }

    /**
     * Get the roleDefinitionId property: Role definition id.
     *
     * @return the roleDefinitionId value.
     */
    public String roleDefinitionId() {
        return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId();
    }

    /**
     * Set the roleDefinitionId property: Role definition id.
     *
     * @param roleDefinitionId the roleDefinitionId value to set.
     * @return the RoleAssignmentEntityInner object itself.
     */
    public RoleAssignmentEntityInner withRoleDefinitionId(String roleDefinitionId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RoleAssignmentEntityProperties();
        }
        this.innerProperties().withRoleDefinitionId(roleDefinitionId);
        return this;
    }

    /**
     * Get the scope property: Scope of the role assignment entity.
     *
     * @return the scope value.
     */
    public String scope() {
        return this.innerProperties() == null ? null : this.innerProperties().scope();
    }

    /**
     * Set the scope property: Scope of the role assignment entity.
     *
     * @param scope the scope value to set.
     * @return the RoleAssignmentEntityInner object itself.
     */
    public RoleAssignmentEntityInner withScope(String scope) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RoleAssignmentEntityProperties();
        }
        this.innerProperties().withScope(scope);
        return this;
    }

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