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

package com.azure.resourcemanager.devtestlabs.models;

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

/** Properties of a cost threshold item. */
@Fluent
public final class CostThresholdProperties {
    /*
     * The ID of the cost threshold item.
     */
    @JsonProperty(value = "thresholdId")
    private String thresholdId;

    /*
     * The value of the percentage cost threshold.
     */
    @JsonProperty(value = "percentageThreshold")
    private PercentageCostThresholdProperties percentageThreshold;

    /*
     * Indicates whether this threshold will be displayed on cost charts.
     */
    @JsonProperty(value = "displayOnChart")
    private CostThresholdStatus displayOnChart;

    /*
     * Indicates whether notifications will be sent when this threshold is exceeded.
     */
    @JsonProperty(value = "sendNotificationWhenExceeded")
    private CostThresholdStatus sendNotificationWhenExceeded;

    /*
     * Indicates the datetime when notifications were last sent for this threshold.
     */
    @JsonProperty(value = "notificationSent")
    private String notificationSent;

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

    /**
     * Get the thresholdId property: The ID of the cost threshold item.
     *
     * @return the thresholdId value.
     */
    public String thresholdId() {
        return this.thresholdId;
    }

    /**
     * Set the thresholdId property: The ID of the cost threshold item.
     *
     * @param thresholdId the thresholdId value to set.
     * @return the CostThresholdProperties object itself.
     */
    public CostThresholdProperties withThresholdId(String thresholdId) {
        this.thresholdId = thresholdId;
        return this;
    }

    /**
     * Get the percentageThreshold property: The value of the percentage cost threshold.
     *
     * @return the percentageThreshold value.
     */
    public PercentageCostThresholdProperties percentageThreshold() {
        return this.percentageThreshold;
    }

    /**
     * Set the percentageThreshold property: The value of the percentage cost threshold.
     *
     * @param percentageThreshold the percentageThreshold value to set.
     * @return the CostThresholdProperties object itself.
     */
    public CostThresholdProperties withPercentageThreshold(PercentageCostThresholdProperties percentageThreshold) {
        this.percentageThreshold = percentageThreshold;
        return this;
    }

    /**
     * Get the displayOnChart property: Indicates whether this threshold will be displayed on cost charts.
     *
     * @return the displayOnChart value.
     */
    public CostThresholdStatus displayOnChart() {
        return this.displayOnChart;
    }

    /**
     * Set the displayOnChart property: Indicates whether this threshold will be displayed on cost charts.
     *
     * @param displayOnChart the displayOnChart value to set.
     * @return the CostThresholdProperties object itself.
     */
    public CostThresholdProperties withDisplayOnChart(CostThresholdStatus displayOnChart) {
        this.displayOnChart = displayOnChart;
        return this;
    }

    /**
     * Get the sendNotificationWhenExceeded property: Indicates whether notifications will be sent when this threshold
     * is exceeded.
     *
     * @return the sendNotificationWhenExceeded value.
     */
    public CostThresholdStatus sendNotificationWhenExceeded() {
        return this.sendNotificationWhenExceeded;
    }

    /**
     * Set the sendNotificationWhenExceeded property: Indicates whether notifications will be sent when this threshold
     * is exceeded.
     *
     * @param sendNotificationWhenExceeded the sendNotificationWhenExceeded value to set.
     * @return the CostThresholdProperties object itself.
     */
    public CostThresholdProperties withSendNotificationWhenExceeded(CostThresholdStatus sendNotificationWhenExceeded) {
        this.sendNotificationWhenExceeded = sendNotificationWhenExceeded;
        return this;
    }

    /**
     * Get the notificationSent property: Indicates the datetime when notifications were last sent for this threshold.
     *
     * @return the notificationSent value.
     */
    public String notificationSent() {
        return this.notificationSent;
    }

    /**
     * Set the notificationSent property: Indicates the datetime when notifications were last sent for this threshold.
     *
     * @param notificationSent the notificationSent value to set.
     * @return the CostThresholdProperties object itself.
     */
    public CostThresholdProperties withNotificationSent(String notificationSent) {
        this.notificationSent = notificationSent;
        return this;
    }

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