// 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.UserInner;
import com.azure.resourcemanager.labservices.models.InviteBody;
import com.azure.resourcemanager.labservices.models.UserUpdate;

/** An instance of this class provides access to all the operations defined in UsersClient. */
public interface UsersClient {
    /**
     * Get all users for a lab.
     *
     * <p>Returns a list of all users for a lab.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @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 users as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<UserInner> listByLab(String resourceGroupName, String labName);

    /**
     * Get all users for a lab.
     *
     * <p>Returns a list of all users for a lab.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @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 users as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<UserInner> listByLab(String resourceGroupName, String labName, String filter, Context context);

    /**
     * Get a lab user.
     *
     * <p>Returns the properties of a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within the lab.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    UserInner get(String resourceGroupName, String labName, String username);

    /**
     * Get a lab user.
     *
     * <p>Returns the properties of a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within the lab along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<UserInner> getWithResponse(String resourceGroupName, String labName, String username, Context context);

    /**
     * Create or update a lab user.
     *
     * <p>Operation to create or update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within
     *     the lab.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<UserInner>, UserInner> beginCreateOrUpdate(
        String resourceGroupName, String labName, String username, UserInner body);

    /**
     * Create or update a lab user.
     *
     * <p>Operation to create or update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within
     *     the lab.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<UserInner>, UserInner> beginCreateOrUpdate(
        String resourceGroupName, String labName, String username, UserInner body, Context context);

    /**
     * Create or update a lab user.
     *
     * <p>Operation to create or update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within the lab.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    UserInner createOrUpdate(String resourceGroupName, String labName, String username, UserInner body);

    /**
     * Create or update a lab user.
     *
     * <p>Operation to create or update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within the lab.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    UserInner createOrUpdate(
        String resourceGroupName, String labName, String username, UserInner body, Context context);

    /**
     * Update a lab user.
     *
     * <p>Operation to update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within
     *     the lab.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<UserInner>, UserInner> beginUpdate(
        String resourceGroupName, String labName, String username, UserUpdate body);

    /**
     * Update a lab user.
     *
     * <p>Operation to update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within
     *     the lab.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<UserInner>, UserInner> beginUpdate(
        String resourceGroupName, String labName, String username, UserUpdate body, Context context);

    /**
     * Update a lab user.
     *
     * <p>Operation to update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within the lab.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    UserInner update(String resourceGroupName, String labName, String username, UserUpdate body);

    /**
     * Update a lab user.
     *
     * <p>Operation to update a lab user.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 user of a lab that can register for and use virtual machines within the lab.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    UserInner update(String resourceGroupName, String labName, String username, UserUpdate body, Context context);

    /**
     * Deletes a user resource.
     *
     * <p>Operation to delete a user resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 labName, String username);

    /**
     * Deletes a user resource.
     *
     * <p>Operation to delete a user resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 labName, String username, Context context);

    /**
     * Deletes a user resource.
     *
     * <p>Operation to delete a user resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 labName, String username);

    /**
     * Deletes a user resource.
     *
     * <p>Operation to delete a user resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 labName, String username, Context context);

    /**
     * Invite a user to a lab.
     *
     * <p>Operation to invite a user to a lab.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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> beginInvite(
        String resourceGroupName, String labName, String username, InviteBody body);

    /**
     * Invite a user to a lab.
     *
     * <p>Operation to invite a user to a lab.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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> beginInvite(
        String resourceGroupName, String labName, String username, InviteBody body, Context context);

    /**
     * Invite a user to a lab.
     *
     * <p>Operation to invite a user to a lab.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 invite(String resourceGroupName, String labName, String username, InviteBody body);

    /**
     * Invite a user to a lab.
     *
     * <p>Operation to invite a user to a lab.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param labName The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.
     * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs.
     * @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 invite(String resourceGroupName, String labName, String username, InviteBody body, Context context);
}
