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

package com.azure.resourcemanager.labservices.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.labservices.fluent.models.LabPlanInner;
import com.azure.resourcemanager.labservices.models.LabPlanUpdate;
import com.azure.resourcemanager.labservices.models.SaveImageBody;

/** An instance of this class provides access to all the operations defined in LabPlansClient. */
public interface LabPlansClient {
    /**
     * Get all lab plans for a subscription.
     *
     * <p>Returns a list of all lab plans within 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 paged list of lab plans as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LabPlanInner> list();

    /**
     * Get all lab plans for a subscription.
     *
     * <p>Returns a list of all lab plans within a subscription.
     *
     * @param filter The filter to apply to the operation.
     * @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 paged list of lab plans as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LabPlanInner> list(String filter, Context context);

    /**
     * Get all lab plans for a subscription and resource group.
     *
     * <p>Returns a list of all lab plans for a subscription and 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 paged list of lab plans as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LabPlanInner> listByResourceGroup(String resourceGroupName);

    /**
     * Get all lab plans for a subscription and resource group.
     *
     * <p>Returns a list of all lab plans for a subscription and 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 paged list of lab plans as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LabPlanInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Retrieves a Lab Plan resource.
     *
     * <p>Retrieves the properties of a Lab Plan.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 lab Plans act as a permission container for creating labs via labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LabPlanInner getByResourceGroup(String resourceGroupName, String labPlanName);

    /**
     * Retrieves a Lab Plan resource.
     *
     * <p>Retrieves the properties of a Lab Plan.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<LabPlanInner> getByResourceGroupWithResponse(
        String resourceGroupName, String labPlanName, Context context);

    /**
     * Updates or creates a Lab Plan resource.
     *
     * <p>Operation to create or update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @param body 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 lab Plans act as a permission container for creating labs via
     *     labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LabPlanInner>, LabPlanInner> beginCreateOrUpdate(
        String resourceGroupName, String labPlanName, LabPlanInner body);

    /**
     * Updates or creates a Lab Plan resource.
     *
     * <p>Operation to create or update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 {@link SyncPoller} for polling of lab Plans act as a permission container for creating labs via
     *     labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LabPlanInner>, LabPlanInner> beginCreateOrUpdate(
        String resourceGroupName, String labPlanName, LabPlanInner body, Context context);

    /**
     * Updates or creates a Lab Plan resource.
     *
     * <p>Operation to create or update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @param body 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 lab Plans act as a permission container for creating labs via labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body);

    /**
     * Updates or creates a Lab Plan resource.
     *
     * <p>Operation to create or update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 lab Plans act as a permission container for creating labs via labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body, Context context);

    /**
     * Updates a Lab Plan resource.
     *
     * <p>Operation to update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @param body 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 lab Plans act as a permission container for creating labs via
     *     labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LabPlanInner>, LabPlanInner> beginUpdate(
        String resourceGroupName, String labPlanName, LabPlanUpdate body);

    /**
     * Updates a Lab Plan resource.
     *
     * <p>Operation to update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 {@link SyncPoller} for polling of lab Plans act as a permission container for creating labs via
     *     labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LabPlanInner>, LabPlanInner> beginUpdate(
        String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context);

    /**
     * Updates a Lab Plan resource.
     *
     * <p>Operation to update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @param body 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 lab Plans act as a permission container for creating labs via labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body);

    /**
     * Updates a Lab Plan resource.
     *
     * <p>Operation to update a Lab Plan resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 lab Plans act as a permission container for creating labs via labs.azure.com.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context);

    /**
     * Deletes a Lab Plan resource.
     *
     * <p>Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan,
     * nor does it delete shared images added to a gallery via the lab plan permission container.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 labPlanName);

    /**
     * Deletes a Lab Plan resource.
     *
     * <p>Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan,
     * nor does it delete shared images added to a gallery via the lab plan permission container.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 labPlanName, Context context);

    /**
     * Deletes a Lab Plan resource.
     *
     * <p>Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan,
     * nor does it delete shared images added to a gallery via the lab plan permission container.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 labPlanName);

    /**
     * Deletes a Lab Plan resource.
     *
     * <p>Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan,
     * nor does it delete shared images added to a gallery via the lab plan permission container.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 labPlanName, Context context);

    /**
     * Save an image from a lab VM to the attached shared image gallery.
     *
     * <p>Saves an image from a lab VM to the attached shared image gallery.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @param body 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 long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginSaveImage(String resourceGroupName, String labPlanName, SaveImageBody body);

    /**
     * Save an image from a lab VM to the attached shared image gallery.
     *
     * <p>Saves an image from a lab VM to the attached shared image gallery.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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 {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginSaveImage(
        String resourceGroupName, String labPlanName, SaveImageBody body, Context context);

    /**
     * Save an image from a lab VM to the attached shared image gallery.
     *
     * <p>Saves an image from a lab VM to the attached shared image gallery.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @param body 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body);

    /**
     * Save an image from a lab VM to the attached shared image gallery.
     *
     * <p>Saves an image from a lab VM to the attached shared image gallery.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in
     *     resource URIs and in UI.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context);
}
