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

package com.azure.resourcemanager.managedapplications.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.managedapplications.fluent.models.ApplicationInner;
import com.azure.resourcemanager.managedapplications.models.ApplicationPatchable;

/** An instance of this class provides access to all the operations defined in ApplicationsClient. */
public interface ApplicationsClient {
    /**
     * Gets the managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the managed application along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplicationInner> getByResourceGroupWithResponse(
        String resourceGroupName, String applicationName, Context context);

    /**
     * Gets the managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner getByResourceGroup(String resourceGroupName, String applicationName);

    /**
     * Deletes the managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 applicationName);

    /**
     * Deletes the managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 applicationName, Context context);

    /**
     * Deletes the managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 applicationName);

    /**
     * Deletes the managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 applicationName, Context context);

    /**
     * Creates a new managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 information about managed application.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ApplicationInner>, ApplicationInner> beginCreateOrUpdate(
        String resourceGroupName, String applicationName, ApplicationInner parameters);

    /**
     * Creates a new managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 information about managed application.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ApplicationInner>, ApplicationInner> beginCreateOrUpdate(
        String resourceGroupName, String applicationName, ApplicationInner parameters, Context context);

    /**
     * Creates a new managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner createOrUpdate(String resourceGroupName, String applicationName, ApplicationInner parameters);

    /**
     * Creates a new managed application.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner createOrUpdate(
        String resourceGroupName, String applicationName, ApplicationInner parameters, Context context);

    /**
     * Updates an existing managed application. The only value that can be updated via PATCH currently is the tags.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @param parameters Parameters supplied to update an existing managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplicationInner> updateWithResponse(
        String resourceGroupName, String applicationName, ApplicationPatchable parameters, Context context);

    /**
     * Updates an existing managed application. The only value that can be updated via PATCH currently is the tags.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param applicationName The name of the managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner update(String resourceGroupName, String applicationName);

    /**
     * Gets all the applications within a 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.resourcemanager.managedapplications.models.ErrorResponseException 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 applications within a resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplicationInner> listByResourceGroup(String resourceGroupName);

    /**
     * Gets all the applications within a 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.resourcemanager.managedapplications.models.ErrorResponseException 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 applications within a resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplicationInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Gets all the applications within a subscription.
     *
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 applications within a subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplicationInner> list();

    /**
     * Gets all the applications within a subscription.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 applications within a subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ApplicationInner> list(Context context);

    /**
     * Gets the managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the managed application along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplicationInner> getByIdWithResponse(String applicationId, Context context);

    /**
     * Gets the managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner getById(String applicationId);

    /**
     * Deletes the managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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> beginDeleteById(String applicationId);

    /**
     * Deletes the managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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> beginDeleteById(String applicationId, Context context);

    /**
     * Deletes the managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 deleteById(String applicationId);

    /**
     * Deletes the managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 deleteById(String applicationId, Context context);

    /**
     * Creates a new managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 information about managed application.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ApplicationInner>, ApplicationInner> beginCreateOrUpdateById(
        String applicationId, ApplicationInner parameters);

    /**
     * Creates a new managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException 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 information about managed application.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ApplicationInner>, ApplicationInner> beginCreateOrUpdateById(
        String applicationId, ApplicationInner parameters, Context context);

    /**
     * Creates a new managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner createOrUpdateById(String applicationId, ApplicationInner parameters);

    /**
     * Creates a new managed application.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param parameters Parameters supplied to the create or update a managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner createOrUpdateById(String applicationId, ApplicationInner parameters, Context context);

    /**
     * Updates an existing managed application. The only value that can be updated via PATCH currently is the tags.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @param parameters Parameters supplied to update an existing managed application.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ApplicationInner> updateByIdWithResponse(
        String applicationId, ApplicationInner parameters, Context context);

    /**
     * Updates an existing managed application. The only value that can be updated via PATCH currently is the tags.
     *
     * @param applicationId The fully qualified ID of the managed application, including the managed application name
     *     and the managed application resource type. Use the format,
     *     /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.managedapplications.models.ErrorResponseException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about managed application.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ApplicationInner updateById(String applicationId);
}
