// 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.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner;
import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner;
import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner;
import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationListResultInner;
import com.azure.resourcemanager.synapse.models.DataConnectionCheckNameRequest;

/** An instance of this class provides access to all the operations defined in KustoPoolDataConnectionsClient. */
public interface KustoPoolDataConnectionsClient {
    /**
     * Checks that the data connection name is valid and is not already in use.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<CheckNameResultInner> checkNameAvailabilityWithResponse(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        DataConnectionCheckNameRequest dataConnectionName,
        Context context);

    /**
     * Checks that the data connection name is valid and is not already in use.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    CheckNameResultInner checkNameAvailability(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        DataConnectionCheckNameRequest dataConnectionName);

    /**
     * Checks that the data connection parameters are valid.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 parameters The data connection parameters supplied to the CreateOrUpdate 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 {@link SyncPoller} for polling of the list Kusto data connection validation result.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataConnectionValidationListResultInner>, DataConnectionValidationListResultInner>
        beginDataConnectionValidation(
            String resourceGroupName,
            String workspaceName,
            String kustoPoolName,
            String databaseName,
            DataConnectionValidationInner parameters);

    /**
     * Checks that the data connection parameters are valid.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 parameters The data connection parameters supplied to the CreateOrUpdate operation.
     * @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 {@link SyncPoller} for polling of the list Kusto data connection validation result.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataConnectionValidationListResultInner>, DataConnectionValidationListResultInner>
        beginDataConnectionValidation(
            String resourceGroupName,
            String workspaceName,
            String kustoPoolName,
            String databaseName,
            DataConnectionValidationInner parameters,
            Context context);

    /**
     * Checks that the data connection parameters are valid.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 parameters The data connection parameters supplied to the CreateOrUpdate 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 data connection validation result.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataConnectionValidationListResultInner dataConnectionValidation(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        DataConnectionValidationInner parameters);

    /**
     * Checks that the data connection parameters are valid.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 parameters The data connection parameters supplied to the CreateOrUpdate operation.
     * @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 data connection validation result.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataConnectionValidationListResultInner dataConnectionValidation(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        DataConnectionValidationInner parameters,
        Context context);

    /**
     * Returns the list of data connections of the given Kusto pool database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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.
     * @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 data connections operation response as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DataConnectionInner> listByDatabase(
        String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName);

    /**
     * Returns the list of data connections of the given Kusto pool database.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 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 data connections operation response as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DataConnectionInner> listByDatabase(
        String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context);

    /**
     * Returns a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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 class representing a data connection along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<DataConnectionInner> getWithResponse(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        Context context);

    /**
     * Returns a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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 class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataConnectionInner get(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName);

    /**
     * Creates or updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the CreateOrUpdate 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 {@link SyncPoller} for polling of class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataConnectionInner>, DataConnectionInner> beginCreateOrUpdate(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters);

    /**
     * Creates or updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the CreateOrUpdate operation.
     * @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 {@link SyncPoller} for polling of class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataConnectionInner>, DataConnectionInner> beginCreateOrUpdate(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters,
        Context context);

    /**
     * Creates or updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the CreateOrUpdate 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 class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataConnectionInner createOrUpdate(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters);

    /**
     * Creates or updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the CreateOrUpdate operation.
     * @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 class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataConnectionInner createOrUpdate(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters,
        Context context);

    /**
     * Updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the Update 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 {@link SyncPoller} for polling of class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataConnectionInner>, DataConnectionInner> beginUpdate(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters);

    /**
     * Updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the Update operation.
     * @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 {@link SyncPoller} for polling of class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataConnectionInner>, DataConnectionInner> beginUpdate(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters,
        Context context);

    /**
     * Updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the Update 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 class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataConnectionInner update(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters);

    /**
     * Updates a data connection.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @param parameters The data connection parameters supplied to the Update operation.
     * @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 class representing a data connection.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataConnectionInner update(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        DataConnectionInner parameters,
        Context context);

    /**
     * Deletes the data connection with the given name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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 {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName);

    /**
     * Deletes the data connection with the given name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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 {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        Context context);

    /**
     * Deletes the data connection with the given name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName);

    /**
     * Deletes the data connection with the given name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 dataConnectionName The name of the data connection.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(
        String resourceGroupName,
        String workspaceName,
        String kustoPoolName,
        String databaseName,
        String dataConnectionName,
        Context context);
}
