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

package com.azure.resourcemanager.signalr.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Serverless settings. */
@Fluent
public final class ServerlessSettings {
    /*
     * Gets or sets Client Connection Timeout. Optional to be set.
     * Value in seconds.
     * Default value is 30 seconds.
     * Customer should set the timeout to a shorter period if messages are expected to be sent in shorter intervals,
     * and want the client to disconnect more quickly after the last message is sent.
     * You can set the timeout to a longer period if messages are expected to be sent in longer intervals,
     * and they want to keep the same client connection alive during this session.
     * The service considers the client disconnected if it hasn't received a message (including keep-alive) in this
     * interval.
     */
    @JsonProperty(value = "connectionTimeoutInSeconds")
    private Integer connectionTimeoutInSeconds;

    /** Creates an instance of ServerlessSettings class. */
    public ServerlessSettings() {
    }

    /**
     * Get the connectionTimeoutInSeconds property: Gets or sets Client Connection Timeout. Optional to be set. Value in
     * seconds. Default value is 30 seconds. Customer should set the timeout to a shorter period if messages are
     * expected to be sent in shorter intervals, and want the client to disconnect more quickly after the last message
     * is sent. You can set the timeout to a longer period if messages are expected to be sent in longer intervals, and
     * they want to keep the same client connection alive during this session. The service considers the client
     * disconnected if it hasn't received a message (including keep-alive) in this interval.
     *
     * @return the connectionTimeoutInSeconds value.
     */
    public Integer connectionTimeoutInSeconds() {
        return this.connectionTimeoutInSeconds;
    }

    /**
     * Set the connectionTimeoutInSeconds property: Gets or sets Client Connection Timeout. Optional to be set. Value in
     * seconds. Default value is 30 seconds. Customer should set the timeout to a shorter period if messages are
     * expected to be sent in shorter intervals, and want the client to disconnect more quickly after the last message
     * is sent. You can set the timeout to a longer period if messages are expected to be sent in longer intervals, and
     * they want to keep the same client connection alive during this session. The service considers the client
     * disconnected if it hasn't received a message (including keep-alive) in this interval.
     *
     * @param connectionTimeoutInSeconds the connectionTimeoutInSeconds value to set.
     * @return the ServerlessSettings object itself.
     */
    public ServerlessSettings withConnectionTimeoutInSeconds(Integer connectionTimeoutInSeconds) {
        this.connectionTimeoutInSeconds = connectionTimeoutInSeconds;
        return this;
    }

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