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

package com.azure.resourcemanager.mysqlflexibleserver.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
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.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner;
import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner;
import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest;

/** An instance of this class provides access to all the operations defined in BackupAndExportsClient. */
public interface BackupAndExportsClient {
    /**
     * Exports the backup of the given server by creating a backup if not existing.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serverName The name of the server.
     * @param parameters The required parameters for creating and exporting backup of the given server.
     * @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 represents BackupAndExport API Response.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<BackupAndExportResponseInner>, BackupAndExportResponseInner> beginCreate(
        String resourceGroupName, String serverName, BackupAndExportRequest parameters);

    /**
     * Exports the backup of the given server by creating a backup if not existing.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serverName The name of the server.
     * @param parameters The required parameters for creating and exporting backup of the given server.
     * @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 represents BackupAndExport API Response.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<BackupAndExportResponseInner>, BackupAndExportResponseInner> beginCreate(
        String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context);

    /**
     * Exports the backup of the given server by creating a backup if not existing.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serverName The name of the server.
     * @param parameters The required parameters for creating and exporting backup of the given server.
     * @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 represents BackupAndExport API Response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    BackupAndExportResponseInner create(String resourceGroupName, String serverName, BackupAndExportRequest parameters);

    /**
     * Exports the backup of the given server by creating a backup if not existing.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serverName The name of the server.
     * @param parameters The required parameters for creating and exporting backup of the given server.
     * @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 represents BackupAndExport API Response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    BackupAndExportResponseInner create(
        String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context);

    /**
     * Validates if backup can be performed for given server.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serverName The name of the server.
     * @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 represents ValidateBackup API Response along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ValidateBackupResponseInner> validateBackupWithResponse(
        String resourceGroupName, String serverName, Context context);

    /**
     * Validates if backup can be performed for given server.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serverName The name of the server.
     * @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 represents ValidateBackup API Response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName);
}
