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

package com.azure.resourcemanager.redisenterprise.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 Databases. */
public interface Databases {
    /**
     * Gets all databases in the specified RedisEnterprise cluster.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @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 all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}.
     */
    PagedIterable<Database> listByCluster(String resourceGroupName, String clusterName);

    /**
     * Gets all databases in the specified RedisEnterprise cluster.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @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 all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}.
     */
    PagedIterable<Database> listByCluster(String resourceGroupName, String clusterName, Context context);

    /**
     * Gets information about a database in a RedisEnterprise cluster.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @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 information about a database in a RedisEnterprise cluster along with {@link Response}.
     */
    Response<Database> getWithResponse(
        String resourceGroupName, String clusterName, String databaseName, Context context);

    /**
     * Gets information about a database in a RedisEnterprise cluster.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @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 information about a database in a RedisEnterprise cluster.
     */
    Database get(String resourceGroupName, String clusterName, String databaseName);

    /**
     * Deletes a single database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @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 resourceGroupName, String clusterName, String databaseName);

    /**
     * Deletes a single database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @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 resourceGroupName, String clusterName, String databaseName, Context context);

    /**
     * Retrieves the access keys for the RedisEnterprise database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @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 access keys along with {@link Response}.
     */
    Response<AccessKeys> listKeysWithResponse(
        String resourceGroupName, String clusterName, String databaseName, Context context);

    /**
     * Retrieves the access keys for the RedisEnterprise database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @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 access keys.
     */
    AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName);

    /**
     * Regenerates the RedisEnterprise database's access keys.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Specifies which key to regenerate.
     * @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 access keys.
     */
    AccessKeys regenerateKey(
        String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters);

    /**
     * Regenerates the RedisEnterprise database's access keys.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Specifies which key to regenerate.
     * @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 access keys.
     */
    AccessKeys regenerateKey(
        String resourceGroupName,
        String clusterName,
        String databaseName,
        RegenerateKeyParameters parameters,
        Context context);

    /**
     * Imports database files to target database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Storage information for importing into the cluster.
     * @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 importMethod(
        String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters);

    /**
     * Imports database files to target database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Storage information for importing into the cluster.
     * @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 importMethod(
        String resourceGroupName,
        String clusterName,
        String databaseName,
        ImportClusterParameters parameters,
        Context context);

    /**
     * Exports a database file from target database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Storage information for exporting into the cluster.
     * @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 export(String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters);

    /**
     * Exports a database file from target database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Storage information for exporting into the cluster.
     * @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 export(
        String resourceGroupName,
        String clusterName,
        String databaseName,
        ExportClusterParameters parameters,
        Context context);

    /**
     * Forcibly removes the link to the specified database resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Information identifying the database to be unlinked.
     * @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 forceUnlink(
        String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters);

    /**
     * Forcibly removes the link to the specified database resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Information identifying the database to be unlinked.
     * @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 forceUnlink(
        String resourceGroupName,
        String clusterName,
        String databaseName,
        ForceUnlinkParameters parameters,
        Context context);

    /**
     * Flushes all the keys in this database and also from its linked databases.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Information identifying the databases to be flushed.
     * @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 flush(String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters);

    /**
     * Flushes all the keys in this database and also from its linked databases.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param clusterName The name of the RedisEnterprise cluster.
     * @param databaseName The name of the database.
     * @param parameters Information identifying the databases to be flushed.
     * @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 flush(
        String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters, Context context);

    /**
     * Gets information about a database in a RedisEnterprise cluster.
     *
     * @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 information about a database in a RedisEnterprise cluster along with {@link Response}.
     */
    Database getById(String id);

    /**
     * Gets information about a database in a RedisEnterprise cluster.
     *
     * @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 information about a database in a RedisEnterprise cluster along with {@link Response}.
     */
    Response<Database> getByIdWithResponse(String id, Context context);

    /**
     * Deletes a single database.
     *
     * @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 single database.
     *
     * @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 Database resource.
     *
     * @param name resource name.
     * @return the first stage of the new Database definition.
     */
    Database.DefinitionStages.Blank define(String name);
}
