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

/** Deployment container liveness/readiness probe configuration. */
@Fluent
public final class ProbeSettings {
    /*
     * The number of failures to allow before returning an unhealthy status.
     */
    @JsonProperty(value = "failureThreshold")
    private Integer failureThreshold;

    /*
     * The delay before the first probe in ISO 8601 format.
     */
    @JsonProperty(value = "initialDelay")
    private Duration initialDelay;

    /*
     * The length of time between probes in ISO 8601 format.
     */
    @JsonProperty(value = "period")
    private Duration period;

    /*
     * The number of successful probes before returning a healthy status.
     */
    @JsonProperty(value = "successThreshold")
    private Integer successThreshold;

    /*
     * The probe timeout in ISO 8601 format.
     */
    @JsonProperty(value = "timeout")
    private Duration timeout;

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

    /**
     * Get the failureThreshold property: The number of failures to allow before returning an unhealthy status.
     *
     * @return the failureThreshold value.
     */
    public Integer failureThreshold() {
        return this.failureThreshold;
    }

    /**
     * Set the failureThreshold property: The number of failures to allow before returning an unhealthy status.
     *
     * @param failureThreshold the failureThreshold value to set.
     * @return the ProbeSettings object itself.
     */
    public ProbeSettings withFailureThreshold(Integer failureThreshold) {
        this.failureThreshold = failureThreshold;
        return this;
    }

    /**
     * Get the initialDelay property: The delay before the first probe in ISO 8601 format.
     *
     * @return the initialDelay value.
     */
    public Duration initialDelay() {
        return this.initialDelay;
    }

    /**
     * Set the initialDelay property: The delay before the first probe in ISO 8601 format.
     *
     * @param initialDelay the initialDelay value to set.
     * @return the ProbeSettings object itself.
     */
    public ProbeSettings withInitialDelay(Duration initialDelay) {
        this.initialDelay = initialDelay;
        return this;
    }

    /**
     * Get the period property: The length of time between probes in ISO 8601 format.
     *
     * @return the period value.
     */
    public Duration period() {
        return this.period;
    }

    /**
     * Set the period property: The length of time between probes in ISO 8601 format.
     *
     * @param period the period value to set.
     * @return the ProbeSettings object itself.
     */
    public ProbeSettings withPeriod(Duration period) {
        this.period = period;
        return this;
    }

    /**
     * Get the successThreshold property: The number of successful probes before returning a healthy status.
     *
     * @return the successThreshold value.
     */
    public Integer successThreshold() {
        return this.successThreshold;
    }

    /**
     * Set the successThreshold property: The number of successful probes before returning a healthy status.
     *
     * @param successThreshold the successThreshold value to set.
     * @return the ProbeSettings object itself.
     */
    public ProbeSettings withSuccessThreshold(Integer successThreshold) {
        this.successThreshold = successThreshold;
        return this;
    }

    /**
     * Get the timeout property: The probe timeout in ISO 8601 format.
     *
     * @return the timeout value.
     */
    public Duration timeout() {
        return this.timeout;
    }

    /**
     * Set the timeout property: The probe timeout in ISO 8601 format.
     *
     * @param timeout the timeout value to set.
     * @return the ProbeSettings object itself.
     */
    public ProbeSettings withTimeout(Duration timeout) {
        this.timeout = timeout;
        return this;
    }

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