// 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.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of Users. */
public interface Users {
    /**
     * 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}.
     */
    PagedIterable<User> 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}.
     */
    PagedIterable<User> 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.
     */
    User 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}.
     */
    Response<User> getWithResponse(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.
     */
    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.
     */
    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.
     */
    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.
     */
    void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context);

    /**
     * Get a lab user.
     *
     * <p>Returns the properties of a lab user.
     *
     * @param id the resource ID.
     * @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}.
     */
    User getById(String id);

    /**
     * Get a lab user.
     *
     * <p>Returns the properties of a lab user.
     *
     * @param id the resource ID.
     * @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}.
     */
    Response<User> getByIdWithResponse(String id, Context context);

    /**
     * Deletes a user resource.
     *
     * <p>Operation to delete a user resource.
     *
     * @param id the resource ID.
     * @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.
     */
    void deleteById(String id);

    /**
     * Deletes a user resource.
     *
     * <p>Operation to delete a user resource.
     *
     * @param id the resource ID.
     * @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.
     */
    void deleteByIdWithResponse(String id, Context context);

    /**
     * Begins definition for a new User resource.
     *
     * @param name resource name.
     * @return the first stage of the new User definition.
     */
    User.DefinitionStages.Blank define(String name);
}
