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

package com.azure.resourcemanager.synapse.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of KustoPoolDatabasePrincipalAssignments. */
public interface KustoPoolDatabasePrincipalAssignments {
    /**
     * Checks that the database principal assignment is valid and is not already in use.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param principalAssignmentName The name of the resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result returned from a check name availability request along with {@link Response}.
     */
    Response<CheckNameResult> checkNameAvailabilityWithResponse(
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String resourceGroupName,
        DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName,
        Context context);

    /**
     * Checks that the database principal assignment is valid and is not already in use.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param principalAssignmentName The name of the resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result returned from a check name availability request.
     */
    CheckNameResult checkNameAvailability(
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String resourceGroupName,
        DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName);

    /**
     * Lists all Kusto pool database principalAssignments.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list Kusto database principal assignments operation response as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<DatabasePrincipalAssignment> list(
        String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName);

    /**
     * Lists all Kusto pool database principalAssignments.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list Kusto database principal assignments operation response as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<DatabasePrincipalAssignment> list(
        String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName, Context context);

    /**
     * Gets a Kusto pool database principalAssignment.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param principalAssignmentName The name of the Kusto principalAssignment.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Kusto pool database principalAssignment along with {@link Response}.
     */
    Response<DatabasePrincipalAssignment> getWithResponse(
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String principalAssignmentName,
        String resourceGroupName,
        Context context);

    /**
     * Gets a Kusto pool database principalAssignment.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param principalAssignmentName The name of the Kusto principalAssignment.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Kusto pool database principalAssignment.
     */
    DatabasePrincipalAssignment get(
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String principalAssignmentName,
        String resourceGroupName);

    /**
     * Deletes a Kusto pool principalAssignment.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param principalAssignmentName The name of the Kusto principalAssignment.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void delete(
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String principalAssignmentName,
        String resourceGroupName);

    /**
     * Deletes a Kusto pool principalAssignment.
     *
     * @param workspaceName The name of the workspace.
     * @param kustoPoolName The name of the Kusto pool.
     * @param databaseName The name of the database in the Kusto pool.
     * @param principalAssignmentName The name of the Kusto principalAssignment.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void delete(
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String principalAssignmentName,
        String resourceGroupName,
        Context context);

    /**
     * Gets a Kusto pool database principalAssignment.
     *
     * @param id the resource ID.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Kusto pool database principalAssignment along with {@link Response}.
     */
    DatabasePrincipalAssignment getById(String id);

    /**
     * Gets a Kusto pool database principalAssignment.
     *
     * @param id the resource ID.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Kusto pool database principalAssignment along with {@link Response}.
     */
    Response<DatabasePrincipalAssignment> getByIdWithResponse(String id, Context context);

    /**
     * Deletes a Kusto pool principalAssignment.
     *
     * @param id the resource ID.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteById(String id);

    /**
     * Deletes a Kusto pool principalAssignment.
     *
     * @param id the resource ID.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteByIdWithResponse(String id, Context context);

    /**
     * Begins definition for a new DatabasePrincipalAssignment resource.
     *
     * @param name resource name.
     * @return the first stage of the new DatabasePrincipalAssignment definition.
     */
    DatabasePrincipalAssignment.DefinitionStages.Blank define(String name);
}
