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

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.Duration;

/** Online deployment scoring requests configuration. */
@Fluent
public final class OnlineRequestSettings {
    /*
     * The number of maximum concurrent requests per node allowed per deployment. Defaults to 1.
     */
    @JsonProperty(value = "maxConcurrentRequestsPerInstance")
    private Integer maxConcurrentRequestsPerInstance;

    /*
     * The maximum amount of time a request will stay in the queue in ISO 8601 format.
     * Defaults to 500ms.
     */
    @JsonProperty(value = "maxQueueWait")
    private Duration maxQueueWait;

    /*
     * The scoring timeout in ISO 8601 format.
     * Defaults to 5000ms.
     */
    @JsonProperty(value = "requestTimeout")
    private Duration requestTimeout;

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

    /**
     * Get the maxConcurrentRequestsPerInstance property: The number of maximum concurrent requests per node allowed per
     * deployment. Defaults to 1.
     *
     * @return the maxConcurrentRequestsPerInstance value.
     */
    public Integer maxConcurrentRequestsPerInstance() {
        return this.maxConcurrentRequestsPerInstance;
    }

    /**
     * Set the maxConcurrentRequestsPerInstance property: The number of maximum concurrent requests per node allowed per
     * deployment. Defaults to 1.
     *
     * @param maxConcurrentRequestsPerInstance the maxConcurrentRequestsPerInstance value to set.
     * @return the OnlineRequestSettings object itself.
     */
    public OnlineRequestSettings withMaxConcurrentRequestsPerInstance(Integer maxConcurrentRequestsPerInstance) {
        this.maxConcurrentRequestsPerInstance = maxConcurrentRequestsPerInstance;
        return this;
    }

    /**
     * Get the maxQueueWait property: The maximum amount of time a request will stay in the queue in ISO 8601 format.
     * Defaults to 500ms.
     *
     * @return the maxQueueWait value.
     */
    public Duration maxQueueWait() {
        return this.maxQueueWait;
    }

    /**
     * Set the maxQueueWait property: The maximum amount of time a request will stay in the queue in ISO 8601 format.
     * Defaults to 500ms.
     *
     * @param maxQueueWait the maxQueueWait value to set.
     * @return the OnlineRequestSettings object itself.
     */
    public OnlineRequestSettings withMaxQueueWait(Duration maxQueueWait) {
        this.maxQueueWait = maxQueueWait;
        return this;
    }

    /**
     * Get the requestTimeout property: The scoring timeout in ISO 8601 format. Defaults to 5000ms.
     *
     * @return the requestTimeout value.
     */
    public Duration requestTimeout() {
        return this.requestTimeout;
    }

    /**
     * Set the requestTimeout property: The scoring timeout in ISO 8601 format. Defaults to 5000ms.
     *
     * @param requestTimeout the requestTimeout value to set.
     * @return the OnlineRequestSettings object itself.
     */
    public OnlineRequestSettings withRequestTimeout(Duration requestTimeout) {
        this.requestTimeout = requestTimeout;
        return this;
    }

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