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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The properties of a role definition. */
@Fluent
public final class BillingRoleDefinitionInner extends ProxyResource {
    /*
     * The properties of the a role definition.
     */
    @JsonProperty(value = "properties")
    private BillingRoleDefinitionProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of the a role definition.
     *
     * @return the innerProperties value.
     */
    private BillingRoleDefinitionProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the description property: The role description.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Get the permissions property: The billingPermissions the role has.
     *
     * @return the permissions value.
     */
    public List<BillingPermissionsPropertiesInner> permissions() {
        return this.innerProperties() == null ? null : this.innerProperties().permissions();
    }

    /**
     * Set the permissions property: The billingPermissions the role has.
     *
     * @param permissions the permissions value to set.
     * @return the BillingRoleDefinitionInner object itself.
     */
    public BillingRoleDefinitionInner withPermissions(List<BillingPermissionsPropertiesInner> permissions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BillingRoleDefinitionProperties();
        }
        this.innerProperties().withPermissions(permissions);
        return this;
    }

    /**
     * Get the roleName property: The name of the role.
     *
     * @return the roleName value.
     */
    public String roleName() {
        return this.innerProperties() == null ? null : this.innerProperties().roleName();
    }

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