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

package com.azure.resourcemanager.timeseriesinsights.models;

import com.azure.core.util.Context;
import com.azure.resourcemanager.timeseriesinsights.fluent.models.AccessPolicyResourceInner;
import java.util.List;

/** An immutable client-side representation of AccessPolicyResource. */
public interface AccessPolicyResource {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the principalObjectId property: The objectId of the principal in Azure Active Directory.
     *
     * @return the principalObjectId value.
     */
    String principalObjectId();

    /**
     * Gets the description property: An description of the access policy.
     *
     * @return the description value.
     */
    String description();

    /**
     * Gets the roles property: The list of roles the principal is assigned on the environment.
     *
     * @return the roles value.
     */
    List<AccessPolicyRole> roles();

    /**
     * Gets the name of the resource group.
     *
     * @return the name of the resource group.
     */
    String resourceGroupName();

    /**
     * Gets the inner com.azure.resourcemanager.timeseriesinsights.fluent.models.AccessPolicyResourceInner object.
     *
     * @return the inner object.
     */
    AccessPolicyResourceInner innerModel();

    /** The entirety of the AccessPolicyResource definition. */
    interface Definition
        extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
    }
    /** The AccessPolicyResource definition stages. */
    interface DefinitionStages {
        /** The first stage of the AccessPolicyResource definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the AccessPolicyResource definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, environmentName.
             *
             * @param resourceGroupName Name of an Azure Resource group.
             * @param environmentName The name of the Time Series Insights environment associated with the specified
             *     resource group.
             * @return the next definition stage.
             */
            WithCreate withExistingEnvironment(String resourceGroupName, String environmentName);
        }
        /**
         * The stage of the AccessPolicyResource definition which contains all the minimum required properties for the
         * resource to be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate
            extends DefinitionStages.WithPrincipalObjectId,
                DefinitionStages.WithDescription,
                DefinitionStages.WithRoles {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            AccessPolicyResource create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            AccessPolicyResource create(Context context);
        }
        /** The stage of the AccessPolicyResource definition allowing to specify principalObjectId. */
        interface WithPrincipalObjectId {
            /**
             * Specifies the principalObjectId property: The objectId of the principal in Azure Active Directory..
             *
             * @param principalObjectId The objectId of the principal in Azure Active Directory.
             * @return the next definition stage.
             */
            WithCreate withPrincipalObjectId(String principalObjectId);
        }
        /** The stage of the AccessPolicyResource definition allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: An description of the access policy..
             *
             * @param description An description of the access policy.
             * @return the next definition stage.
             */
            WithCreate withDescription(String description);
        }
        /** The stage of the AccessPolicyResource definition allowing to specify roles. */
        interface WithRoles {
            /**
             * Specifies the roles property: The list of roles the principal is assigned on the environment..
             *
             * @param roles The list of roles the principal is assigned on the environment.
             * @return the next definition stage.
             */
            WithCreate withRoles(List<AccessPolicyRole> roles);
        }
    }
    /**
     * Begins update for the AccessPolicyResource resource.
     *
     * @return the stage of resource update.
     */
    AccessPolicyResource.Update update();

    /** The template for AccessPolicyResource update. */
    interface Update extends UpdateStages.WithDescription, UpdateStages.WithRoles {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        AccessPolicyResource apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        AccessPolicyResource apply(Context context);
    }
    /** The AccessPolicyResource update stages. */
    interface UpdateStages {
        /** The stage of the AccessPolicyResource update allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: An description of the access policy..
             *
             * @param description An description of the access policy.
             * @return the next definition stage.
             */
            Update withDescription(String description);
        }
        /** The stage of the AccessPolicyResource update allowing to specify roles. */
        interface WithRoles {
            /**
             * Specifies the roles property: The list of roles the principal is assigned on the environment..
             *
             * @param roles The list of roles the principal is assigned on the environment.
             * @return the next definition stage.
             */
            Update withRoles(List<AccessPolicyRole> roles);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    AccessPolicyResource refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    AccessPolicyResource refresh(Context context);
}
