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

package com.azure.resourcemanager.resourceconnector.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.resourceconnector.fluent.models.ApplianceGetTelemetryConfigResultInner;
import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceInner;
import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListCredentialResultsInner;
import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListKeysResultsInner;
import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner;
import com.azure.resourcemanager.resourceconnector.fluent.models.UpgradeGraphInner;
import com.azure.resourcemanager.resourceconnector.models.PatchableAppliance;

/** An instance of this class provides access to all the operations defined in AppliancesClient. */
public interface AppliancesClient {
    /**
     * Lists all available Appliances operations.
     *
     * @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 lists of Appliances operations as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplianceOperationInner> listOperations();

    /**
     * Lists all available Appliances operations.
     *
     * @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 lists of Appliances operations as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplianceOperationInner> listOperations(Context context);

    /**
     * Gets a list of Appliances in a subscription.
     *
     * <p>Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance.
     *
     * @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 Appliances in the specified subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplianceInner> list();

    /**
     * Gets a list of Appliances in a subscription.
     *
     * <p>Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance.
     *
     * @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 Appliances in the specified subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplianceInner> list(Context context);

    /**
     * Gets the telemetry config.
     *
     * @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 telemetry config along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplianceGetTelemetryConfigResultInner> getTelemetryConfigWithResponse(Context context);

    /**
     * Gets the telemetry config.
     *
     * @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 telemetry config.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplianceGetTelemetryConfigResultInner getTelemetryConfig();

    /**
     * Gets a list of Appliances in the specified subscription and resource group.
     *
     * <p>Gets a list of Appliances in the specified subscription and resource group. The operation returns properties
     * of each Appliance.
     *
     * @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 Appliances in the specified subscription and resource group as paginated response with {@link
     *     PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplianceInner> listByResourceGroup(String resourceGroupName);

    /**
     * Gets a list of Appliances in the specified subscription and resource group.
     *
     * <p>Gets a list of Appliances in the specified subscription and resource group. The operation returns properties
     * of each Appliance.
     *
     * @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 Appliances in the specified subscription and resource group as paginated response with {@link
     *     PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplianceInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Gets an Appliance.
     *
     * <p>Gets the details of an Appliance with a specified resource group and name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 details of an Appliance with a specified resource group and name along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplianceInner> getByResourceGroupWithResponse(
        String resourceGroupName, String resourceName, Context context);

    /**
     * Gets an Appliance.
     *
     * <p>Gets the details of an Appliance with a specified resource group and name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 details of an Appliance with a specified resource group and name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplianceInner getByResourceGroup(String resourceGroupName, String resourceName);

    /**
     * Creates or updates an Appliance.
     *
     * <p>Creates or updates an Appliance in the specified Subscription and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param parameters Parameters supplied to create or update an Appliance.
     * @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 appliances definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ApplianceInner>, ApplianceInner> beginCreateOrUpdate(
        String resourceGroupName, String resourceName, ApplianceInner parameters);

    /**
     * Creates or updates an Appliance.
     *
     * <p>Creates or updates an Appliance in the specified Subscription and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param parameters Parameters supplied to create or update an Appliance.
     * @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 appliances definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ApplianceInner>, ApplianceInner> beginCreateOrUpdate(
        String resourceGroupName, String resourceName, ApplianceInner parameters, Context context);

    /**
     * Creates or updates an Appliance.
     *
     * <p>Creates or updates an Appliance in the specified Subscription and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param parameters Parameters supplied to create or update an Appliance.
     * @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 appliances definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplianceInner createOrUpdate(String resourceGroupName, String resourceName, ApplianceInner parameters);

    /**
     * Creates or updates an Appliance.
     *
     * <p>Creates or updates an Appliance in the specified Subscription and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param parameters Parameters supplied to create or update an Appliance.
     * @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 appliances definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplianceInner createOrUpdate(
        String resourceGroupName, String resourceName, ApplianceInner parameters, Context context);

    /**
     * Deletes an Appliance.
     *
     * <p>Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 resourceName);

    /**
     * Deletes an Appliance.
     *
     * <p>Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 resourceName, Context context);

    /**
     * Deletes an Appliance.
     *
     * <p>Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 resourceName);

    /**
     * Deletes an Appliance.
     *
     * <p>Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 resourceName, Context context);

    /**
     * Updates an Appliance.
     *
     * <p>Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param parameters The updatable fields of an existing Appliance.
     * @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 appliances definition along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplianceInner> updateWithResponse(
        String resourceGroupName, String resourceName, PatchableAppliance parameters, Context context);

    /**
     * Updates an Appliance.
     *
     * <p>Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param parameters The updatable fields of an existing Appliance.
     * @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 appliances definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplianceInner update(String resourceGroupName, String resourceName, PatchableAppliance parameters);

    /**
     * Returns the cluster user credential.
     *
     * <p>Returns the cluster user credentials for the dedicated appliance.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 Cluster User Credential appliance along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplianceListCredentialResultsInner> listClusterUserCredentialWithResponse(
        String resourceGroupName, String resourceName, Context context);

    /**
     * Returns the cluster user credential.
     *
     * <p>Returns the cluster user credentials for the dedicated appliance.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 Cluster User Credential appliance.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplianceListCredentialResultsInner listClusterUserCredential(String resourceGroupName, String resourceName);

    /**
     * Gets the management config.
     *
     * <p>Returns the cluster customer credentials for the dedicated appliance.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 Cluster Keys Results appliance along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplianceListKeysResultsInner> listKeysWithResponse(
        String resourceGroupName, String resourceName, Context context);

    /**
     * Gets the management config.
     *
     * <p>Returns the cluster customer credentials for the dedicated appliance.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @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 Cluster Keys Results appliance.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplianceListKeysResultsInner listKeys(String resourceGroupName, String resourceName);

    /**
     * Gets an Appliance upgrade graph.
     *
     * <p>Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param upgradeGraph Upgrade graph version, ex - stable.
     * @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 upgrade graph of an Appliance with a specified resource group and name and specific release train
     *     along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<UpgradeGraphInner> getUpgradeGraphWithResponse(
        String resourceGroupName, String resourceName, String upgradeGraph, Context context);

    /**
     * Gets an Appliance upgrade graph.
     *
     * <p>Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Appliances name.
     * @param upgradeGraph Upgrade graph version, ex - stable.
     * @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 upgrade graph of an Appliance with a specified resource group and name and specific release train.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    UpgradeGraphInner getUpgradeGraph(String resourceGroupName, String resourceName, String upgradeGraph);
}
