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

package azure.resourcemanager.operationtemplates.models;

import azure.resourcemanager.operationtemplates.fluent.models.WidgetInner;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/**
 * Resource collection API of OptionalBodies.
 */
public interface OptionalBodies {
    /**
     * Get a Widget.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param widgetName The name of the Widget.
     * @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 Widget along with {@link Response}.
     */
    Response<Widget> getByResourceGroupWithResponse(String resourceGroupName, String widgetName, Context context);

    /**
     * Get a Widget.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param widgetName The name of the Widget.
     * @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 Widget.
     */
    Widget getByResourceGroup(String resourceGroupName, String widgetName);

    /**
     * Update a Widget.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param widgetName The name of the Widget.
     * @param properties The resource properties to be updated.
     * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along
     * with {@link Response}.
     */
    Response<Widget> patchWithResponse(String resourceGroupName, String widgetName, WidgetInner properties,
        Context context);

    /**
     * Update a Widget.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param widgetName The name of the Widget.
     * @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 concrete tracked resource types can be created by aliasing this type using a specific property type.
     */
    Widget patch(String resourceGroupName, String widgetName);

    /**
     * A synchronous resource action.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param widgetName The name of the Widget.
     * @param body The content of the action request.
     * @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 response body along with {@link Response}.
     */
    Response<ActionResult> postWithResponse(String resourceGroupName, String widgetName, ActionRequest body,
        Context context);

    /**
     * A synchronous resource action.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param widgetName The name of the Widget.
     * @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 response.
     */
    ActionResult post(String resourceGroupName, String widgetName);

    /**
     * The providerPost operation.
     * 
     * @param body 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 response body along with {@link Response}.
     */
    Response<ChangeAllowanceResult> providerPostWithResponse(ChangeAllowanceRequest body, Context context);

    /**
     * The providerPost operation.
     * 
     * @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 response.
     */
    ChangeAllowanceResult providerPost();
}
