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

package com.azure.resourcemanager.storagecache.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;

/** An instance of this class provides access to all the operations defined in StorageTargetOperationsClient. */
public interface StorageTargetOperationsClient {
    /**
     * Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage
     * target's namespace will return errors until the flush operation completes.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginFlush(String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage
     * target's namespace will return errors until the flush operation completes.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginFlush(
        String resourceGroupName, String cacheName, String storageTargetName, Context context);

    /**
     * Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage
     * target's namespace will return errors until the flush operation completes.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 flush(String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage
     * target's namespace will return errors until the flush operation completes.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 flush(String resourceGroupName, String cacheName, String storageTargetName, Context context);

    /**
     * Suspends client access to a storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginSuspend(
        String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Suspends client access to a storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginSuspend(
        String resourceGroupName, String cacheName, String storageTargetName, Context context);

    /**
     * Suspends client access to a storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 suspend(String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Suspends client access to a storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 suspend(String resourceGroupName, String cacheName, String storageTargetName, Context context);

    /**
     * Resumes client access to a previously suspended storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginResume(
        String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Resumes client access to a previously suspended storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginResume(
        String resourceGroupName, String cacheName, String storageTargetName, Context context);

    /**
     * Resumes client access to a previously suspended storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 resume(String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Resumes client access to a previously suspended storage target.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 resume(String resourceGroupName, String cacheName, String storageTargetName, Context context);

    /**
     * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the
     * next request.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginInvalidate(
        String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the
     * next request.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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> beginInvalidate(
        String resourceGroupName, String cacheName, String storageTargetName, Context context);

    /**
     * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the
     * next request.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 invalidate(String resourceGroupName, String cacheName, String storageTargetName);

    /**
     * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the
     * next request.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param cacheName Name of cache. Length of name must not be greater than 80 and chars must be from the
     *     [-0-9a-zA-Z_] char class.
     * @param storageTargetName Name of Storage Target.
     * @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 invalidate(String resourceGroupName, String cacheName, String storageTargetName, Context context);
}
