// 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.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.labservices.fluent.models.UserInner;
import java.time.Duration;
import java.time.OffsetDateTime;

/** An immutable client-side representation of User. */
public interface User {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the systemData property: Metadata pertaining to creation and last modification of the user resource.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the provisioningState property: Current provisioning state of the user resource.
     *
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

    /**
     * Gets the displayName property: Display name of the user, for example user's full name.
     *
     * @return the displayName value.
     */
    String displayName();

    /**
     * Gets the email property: Email address of the user.
     *
     * @return the email value.
     */
    String email();

    /**
     * Gets the registrationState property: State of the user's registration within the lab.
     *
     * @return the registrationState value.
     */
    RegistrationState registrationState();

    /**
     * Gets the invitationState property: State of the invitation message for the user.
     *
     * @return the invitationState value.
     */
    InvitationState invitationState();

    /**
     * Gets the invitationSent property: Date and time when the invitation message was sent to the user.
     *
     * @return the invitationSent value.
     */
    OffsetDateTime invitationSent();

    /**
     * Gets the totalUsage property: How long the user has used their virtual machines in this lab.
     *
     * @return the totalUsage value.
     */
    Duration totalUsage();

    /**
     * Gets the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage
     * quota.
     *
     * @return the additionalUsageQuota value.
     */
    Duration additionalUsageQuota();

    /**
     * Gets the name of the resource group.
     *
     * @return the name of the resource group.
     */
    String resourceGroupName();

    /**
     * Gets the inner com.azure.resourcemanager.labservices.fluent.models.UserInner object.
     *
     * @return the inner object.
     */
    UserInner innerModel();

    /** The entirety of the User definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithEmail,
            DefinitionStages.WithCreate {
    }
    /** The User definition stages. */
    interface DefinitionStages {
        /** The first stage of the User definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the User definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, labName.
             *
             * @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.
             * @return the next definition stage.
             */
            WithEmail withExistingLab(String resourceGroupName, String labName);
        }
        /** The stage of the User definition allowing to specify email. */
        interface WithEmail {
            /**
             * Specifies the email property: Email address of the user..
             *
             * @param email Email address of the user.
             * @return the next definition stage.
             */
            WithCreate withEmail(String email);
        }
        /**
         * The stage of the User definition which contains all the minimum required properties for the resource to be
         * created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate extends DefinitionStages.WithAdditionalUsageQuota {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            User create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            User create(Context context);
        }
        /** The stage of the User definition allowing to specify additionalUsageQuota. */
        interface WithAdditionalUsageQuota {
            /**
             * Specifies the additionalUsageQuota property: The amount of usage quota time the user gets in addition to
             * the lab usage quota..
             *
             * @param additionalUsageQuota The amount of usage quota time the user gets in addition to the lab usage
             *     quota.
             * @return the next definition stage.
             */
            WithCreate withAdditionalUsageQuota(Duration additionalUsageQuota);
        }
    }
    /**
     * Begins update for the User resource.
     *
     * @return the stage of resource update.
     */
    User.Update update();

    /** The template for User update. */
    interface Update extends UpdateStages.WithAdditionalUsageQuota {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        User apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        User apply(Context context);
    }
    /** The User update stages. */
    interface UpdateStages {
        /** The stage of the User update allowing to specify additionalUsageQuota. */
        interface WithAdditionalUsageQuota {
            /**
             * Specifies the additionalUsageQuota property: The amount of usage quota time the user gets in addition to
             * the lab usage quota..
             *
             * @param additionalUsageQuota The amount of usage quota time the user gets in addition to the lab usage
             *     quota.
             * @return the next definition stage.
             */
            Update withAdditionalUsageQuota(Duration additionalUsageQuota);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    User refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    User refresh(Context context);

    /**
     * Invite a user to a lab.
     *
     * <p>Operation to invite a user to a lab.
     *
     * @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(InviteBody body);

    /**
     * Invite a user to a lab.
     *
     * <p>Operation to invite a user to a lab.
     *
     * @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(InviteBody body, Context context);
}
