// 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.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.Duration;

/** Profile for how to handle shutting down virtual machines. */
@Fluent
public final class AutoShutdownProfile {
    /*
     * Whether shutdown on disconnect is enabled
     */
    @JsonProperty(value = "shutdownOnDisconnect")
    private EnableState shutdownOnDisconnect;

    /*
     * Whether a VM will get shutdown when it hasn't been connected to after a period of time.
     */
    @JsonProperty(value = "shutdownWhenNotConnected")
    private EnableState shutdownWhenNotConnected;

    /*
     * Whether a VM will get shutdown when it has idled for a period of time.
     */
    @JsonProperty(value = "shutdownOnIdle")
    private ShutdownOnIdleMode shutdownOnIdle;

    /*
     * The amount of time a VM will stay running after a user disconnects if this behavior is enabled.
     */
    @JsonProperty(value = "disconnectDelay")
    private Duration disconnectDelay;

    /*
     * The amount of time a VM will stay running before it is shutdown if no connection is made and this behavior is
     * enabled.
     */
    @JsonProperty(value = "noConnectDelay")
    private Duration noConnectDelay;

    /*
     * The amount of time a VM will idle before it is shutdown if this behavior is enabled.
     */
    @JsonProperty(value = "idleDelay")
    private Duration idleDelay;

    /**
     * Get the shutdownOnDisconnect property: Whether shutdown on disconnect is enabled.
     *
     * @return the shutdownOnDisconnect value.
     */
    public EnableState shutdownOnDisconnect() {
        return this.shutdownOnDisconnect;
    }

    /**
     * Set the shutdownOnDisconnect property: Whether shutdown on disconnect is enabled.
     *
     * @param shutdownOnDisconnect the shutdownOnDisconnect value to set.
     * @return the AutoShutdownProfile object itself.
     */
    public AutoShutdownProfile withShutdownOnDisconnect(EnableState shutdownOnDisconnect) {
        this.shutdownOnDisconnect = shutdownOnDisconnect;
        return this;
    }

    /**
     * Get the shutdownWhenNotConnected property: Whether a VM will get shutdown when it hasn't been connected to after
     * a period of time.
     *
     * @return the shutdownWhenNotConnected value.
     */
    public EnableState shutdownWhenNotConnected() {
        return this.shutdownWhenNotConnected;
    }

    /**
     * Set the shutdownWhenNotConnected property: Whether a VM will get shutdown when it hasn't been connected to after
     * a period of time.
     *
     * @param shutdownWhenNotConnected the shutdownWhenNotConnected value to set.
     * @return the AutoShutdownProfile object itself.
     */
    public AutoShutdownProfile withShutdownWhenNotConnected(EnableState shutdownWhenNotConnected) {
        this.shutdownWhenNotConnected = shutdownWhenNotConnected;
        return this;
    }

    /**
     * Get the shutdownOnIdle property: Whether a VM will get shutdown when it has idled for a period of time.
     *
     * @return the shutdownOnIdle value.
     */
    public ShutdownOnIdleMode shutdownOnIdle() {
        return this.shutdownOnIdle;
    }

    /**
     * Set the shutdownOnIdle property: Whether a VM will get shutdown when it has idled for a period of time.
     *
     * @param shutdownOnIdle the shutdownOnIdle value to set.
     * @return the AutoShutdownProfile object itself.
     */
    public AutoShutdownProfile withShutdownOnIdle(ShutdownOnIdleMode shutdownOnIdle) {
        this.shutdownOnIdle = shutdownOnIdle;
        return this;
    }

    /**
     * Get the disconnectDelay property: The amount of time a VM will stay running after a user disconnects if this
     * behavior is enabled.
     *
     * @return the disconnectDelay value.
     */
    public Duration disconnectDelay() {
        return this.disconnectDelay;
    }

    /**
     * Set the disconnectDelay property: The amount of time a VM will stay running after a user disconnects if this
     * behavior is enabled.
     *
     * @param disconnectDelay the disconnectDelay value to set.
     * @return the AutoShutdownProfile object itself.
     */
    public AutoShutdownProfile withDisconnectDelay(Duration disconnectDelay) {
        this.disconnectDelay = disconnectDelay;
        return this;
    }

    /**
     * Get the noConnectDelay property: The amount of time a VM will stay running before it is shutdown if no connection
     * is made and this behavior is enabled.
     *
     * @return the noConnectDelay value.
     */
    public Duration noConnectDelay() {
        return this.noConnectDelay;
    }

    /**
     * Set the noConnectDelay property: The amount of time a VM will stay running before it is shutdown if no connection
     * is made and this behavior is enabled.
     *
     * @param noConnectDelay the noConnectDelay value to set.
     * @return the AutoShutdownProfile object itself.
     */
    public AutoShutdownProfile withNoConnectDelay(Duration noConnectDelay) {
        this.noConnectDelay = noConnectDelay;
        return this;
    }

    /**
     * Get the idleDelay property: The amount of time a VM will idle before it is shutdown if this behavior is enabled.
     *
     * @return the idleDelay value.
     */
    public Duration idleDelay() {
        return this.idleDelay;
    }

    /**
     * Set the idleDelay property: The amount of time a VM will idle before it is shutdown if this behavior is enabled.
     *
     * @param idleDelay the idleDelay value to set.
     * @return the AutoShutdownProfile object itself.
     */
    public AutoShutdownProfile withIdleDelay(Duration idleDelay) {
        this.idleDelay = idleDelay;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
