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

package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.RackInner;
import com.azure.resourcemanager.networkcloud.models.RackPatchParameters;

/** An instance of this class provides access to all the operations defined in RacksClient. */
public interface RacksClient {
    /**
     * List racks in the subscription.
     *
     * <p>Get a list of racks in the provided subscription.
     *
     * @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 list of racks in the provided subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<RackInner> list();

    /**
     * List racks in the subscription.
     *
     * <p>Get a list of racks in the provided subscription.
     *
     * @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 list of racks in the provided subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<RackInner> list(Context context);

    /**
     * List racks in the resource group.
     *
     * <p>Get a list of racks in the provided resource group.
     *
     * @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 list of racks in the provided resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<RackInner> listByResourceGroup(String resourceGroupName);

    /**
     * List racks in the resource group.
     *
     * <p>Get a list of racks in the provided resource group.
     *
     * @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 list of racks in the provided resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<RackInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Retrieve the rack.
     *
     * <p>Get properties of the provided rack.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 properties of the provided rack along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<RackInner> getByResourceGroupWithResponse(String resourceGroupName, String rackName, Context context);

    /**
     * Retrieve the rack.
     *
     * <p>Get properties of the provided rack.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 properties of the provided rack.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    RackInner getByResourceGroup(String resourceGroupName, String rackName);

    /**
     * Create or update the rack.
     *
     * <p>Create a new rack or update properties of the existing one. All customer initiated requests will be rejected
     * as the life cycle of this resource is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @param rackParameters The request body.
     * @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 rack represents the hardware of the rack and is dependent upon the
     *     cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<RackInner>, RackInner> beginCreateOrUpdate(
        String resourceGroupName, String rackName, RackInner rackParameters);

    /**
     * Create or update the rack.
     *
     * <p>Create a new rack or update properties of the existing one. All customer initiated requests will be rejected
     * as the life cycle of this resource is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @param rackParameters The request body.
     * @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 rack represents the hardware of the rack and is dependent upon the
     *     cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<RackInner>, RackInner> beginCreateOrUpdate(
        String resourceGroupName, String rackName, RackInner rackParameters, Context context);

    /**
     * Create or update the rack.
     *
     * <p>Create a new rack or update properties of the existing one. All customer initiated requests will be rejected
     * as the life cycle of this resource is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @param rackParameters The request body.
     * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    RackInner createOrUpdate(String resourceGroupName, String rackName, RackInner rackParameters);

    /**
     * Create or update the rack.
     *
     * <p>Create a new rack or update properties of the existing one. All customer initiated requests will be rejected
     * as the life cycle of this resource is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @param rackParameters The request body.
     * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    RackInner createOrUpdate(String resourceGroupName, String rackName, RackInner rackParameters, Context context);

    /**
     * Delete the rack.
     *
     * <p>Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource
     * is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 rackName);

    /**
     * Delete the rack.
     *
     * <p>Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource
     * is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 rackName, Context context);

    /**
     * Delete the rack.
     *
     * <p>Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource
     * is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 rackName);

    /**
     * Delete the rack.
     *
     * <p>Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource
     * is managed by the system.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 rackName, Context context);

    /**
     * Patch the rack.
     *
     * <p>Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates
     * can be done independently.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 rack represents the hardware of the rack and is dependent upon the
     *     cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<RackInner>, RackInner> beginUpdate(String resourceGroupName, String rackName);

    /**
     * Patch the rack.
     *
     * <p>Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates
     * can be done independently.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @param rackUpdateParameters The request body.
     * @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 rack represents the hardware of the rack and is dependent upon the
     *     cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<RackInner>, RackInner> beginUpdate(
        String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context);

    /**
     * Patch the rack.
     *
     * <p>Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates
     * can be done independently.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    RackInner update(String resourceGroupName, String rackName);

    /**
     * Patch the rack.
     *
     * <p>Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates
     * can be done independently.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param rackName The name of the rack.
     * @param rackUpdateParameters The request body.
     * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    RackInner update(
        String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context);
}
