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

package com.azure.resourcemanager.iotcentral.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.iotcentral.fluent.models.AppAvailabilityInfoInner;
import com.azure.resourcemanager.iotcentral.fluent.models.AppInner;
import com.azure.resourcemanager.iotcentral.fluent.models.AppTemplateInner;
import com.azure.resourcemanager.iotcentral.models.AppPatch;
import com.azure.resourcemanager.iotcentral.models.OperationInputs;

/** An instance of this class provides access to all the operations defined in AppsClient. */
public interface AppsClient {
    /**
     * Get the metadata of an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @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 metadata of an IoT Central application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AppInner getByResourceGroup(String resourceGroupName, String resourceName);

    /**
     * Get the metadata of an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @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 metadata of an IoT Central application along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<AppInner> getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context);

    /**
     * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to
     * retrieve the IoT Central application metadata and security metadata, and then combine them with the modified
     * values in a new body to update the IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param app The IoT Central application metadata and security metadata.
     * @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 IoT Central application.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<AppInner>, AppInner> beginCreateOrUpdate(
        String resourceGroupName, String resourceName, AppInner app);

    /**
     * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to
     * retrieve the IoT Central application metadata and security metadata, and then combine them with the modified
     * values in a new body to update the IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param app The IoT Central application metadata and security metadata.
     * @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 IoT Central application.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<AppInner>, AppInner> beginCreateOrUpdate(
        String resourceGroupName, String resourceName, AppInner app, Context context);

    /**
     * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to
     * retrieve the IoT Central application metadata and security metadata, and then combine them with the modified
     * values in a new body to update the IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param app The IoT Central application metadata and security metadata.
     * @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 IoT Central application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AppInner createOrUpdate(String resourceGroupName, String resourceName, AppInner app);

    /**
     * Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to
     * retrieve the IoT Central application metadata and security metadata, and then combine them with the modified
     * values in a new body to update the IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param app The IoT Central application metadata and security metadata.
     * @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 IoT Central application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AppInner createOrUpdate(String resourceGroupName, String resourceName, AppInner app, Context context);

    /**
     * Update the metadata of an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param appPatch The IoT Central application metadata and security metadata.
     * @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> beginUpdate(String resourceGroupName, String resourceName, AppPatch appPatch);

    /**
     * Update the metadata of an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param appPatch The IoT Central application metadata and security metadata.
     * @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> beginUpdate(
        String resourceGroupName, String resourceName, AppPatch appPatch, Context context);

    /**
     * Update the metadata of an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param appPatch The IoT Central application metadata and security metadata.
     * @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 update(String resourceGroupName, String resourceName, AppPatch appPatch);

    /**
     * Update the metadata of an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @param appPatch The IoT Central application metadata and security metadata.
     * @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 update(String resourceGroupName, String resourceName, AppPatch appPatch, Context context);

    /**
     * Delete an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @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);

    /**
     * Delete an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @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);

    /**
     * Delete an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @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);

    /**
     * Delete an IoT Central application.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @param resourceName The ARM resource name of the IoT Central application.
     * @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);

    /**
     * Get all IoT Central Applications in a 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 all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AppInner> list();

    /**
     * Get all IoT Central Applications in a 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 all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AppInner> list(Context context);

    /**
     * Get all the IoT Central Applications in a resource group.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @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 all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AppInner> listByResourceGroup(String resourceGroupName);

    /**
     * Get all the IoT Central Applications in a resource group.
     *
     * @param resourceGroupName The name of the resource group that contains the IoT Central application.
     * @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 all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AppInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Check if an IoT Central application name is available.
     *
     * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT Central
     *     application to check.
     * @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 properties indicating whether a given IoT Central application name or subdomain is available.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AppAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs);

    /**
     * Check if an IoT Central application name is available.
     *
     * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT Central
     *     application to check.
     * @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 properties indicating whether a given IoT Central application name or subdomain is available along
     *     with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<AppAvailabilityInfoInner> checkNameAvailabilityWithResponse(
        OperationInputs operationInputs, Context context);

    /**
     * Check if an IoT Central application subdomain is available.
     *
     * @param operationInputs Set the name parameter in the OperationInputs structure to the subdomain of the IoT
     *     Central application to check.
     * @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 properties indicating whether a given IoT Central application name or subdomain is available.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AppAvailabilityInfoInner checkSubdomainAvailability(OperationInputs operationInputs);

    /**
     * Check if an IoT Central application subdomain is available.
     *
     * @param operationInputs Set the name parameter in the OperationInputs structure to the subdomain of the IoT
     *     Central application to check.
     * @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 properties indicating whether a given IoT Central application name or subdomain is available along
     *     with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<AppAvailabilityInfoInner> checkSubdomainAvailabilityWithResponse(
        OperationInputs operationInputs, Context context);

    /**
     * Get all available application templates.
     *
     * @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 all available application templates as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AppTemplateInner> listTemplates();

    /**
     * Get all available application templates.
     *
     * @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 all available application templates as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AppTemplateInner> listTemplates(Context context);
}
