// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.monitoring.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionThresholdAggregationArgs;
import com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionThresholdDenominatorAggregationArgs;
import com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionThresholdForecastOptionsArgs;
import com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionThresholdTriggerArgs;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class AlertPolicyConditionConditionThresholdArgs extends com.pulumi.resources.ResourceArgs {

    public static final AlertPolicyConditionConditionThresholdArgs Empty = new AlertPolicyConditionConditionThresholdArgs();

    /**
     * Specifies the alignment of data points in
     * individual time series as well as how to
     * combine the retrieved time series together
     * (such as when aggregating multiple streams
     * on each resource to a single stream for each
     * resource or when aggregating streams across
     * all members of a group of resources).
     * Multiple aggregations are applied in the
     * order specified.This field is similar to the
     * one in the MetricService.ListTimeSeries
     * request. It is advisable to use the
     * ListTimeSeries method when debugging this
     * field.
     * Structure is documented below.
     * 
     */
    @Import(name="aggregations")
    private @Nullable Output<List<AlertPolicyConditionConditionThresholdAggregationArgs>> aggregations;

    /**
     * @return Specifies the alignment of data points in
     * individual time series as well as how to
     * combine the retrieved time series together
     * (such as when aggregating multiple streams
     * on each resource to a single stream for each
     * resource or when aggregating streams across
     * all members of a group of resources).
     * Multiple aggregations are applied in the
     * order specified.This field is similar to the
     * one in the MetricService.ListTimeSeries
     * request. It is advisable to use the
     * ListTimeSeries method when debugging this
     * field.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<AlertPolicyConditionConditionThresholdAggregationArgs>>> aggregations() {
        return Optional.ofNullable(this.aggregations);
    }

    /**
     * The comparison to apply between the time
     * series (indicated by filter and aggregation)
     * and the threshold (indicated by
     * threshold_value). The comparison is applied
     * on each time series, with the time series on
     * the left-hand side and the threshold on the
     * right-hand side. Only COMPARISON_LT and
     * COMPARISON_GT are supported currently.
     * Possible values are: `COMPARISON_GT`, `COMPARISON_GE`, `COMPARISON_LT`, `COMPARISON_LE`, `COMPARISON_EQ`, `COMPARISON_NE`.
     * 
     */
    @Import(name="comparison", required=true)
    private Output<String> comparison;

    /**
     * @return The comparison to apply between the time
     * series (indicated by filter and aggregation)
     * and the threshold (indicated by
     * threshold_value). The comparison is applied
     * on each time series, with the time series on
     * the left-hand side and the threshold on the
     * right-hand side. Only COMPARISON_LT and
     * COMPARISON_GT are supported currently.
     * Possible values are: `COMPARISON_GT`, `COMPARISON_GE`, `COMPARISON_LT`, `COMPARISON_LE`, `COMPARISON_EQ`, `COMPARISON_NE`.
     * 
     */
    public Output<String> comparison() {
        return this.comparison;
    }

    /**
     * Specifies the alignment of data points in
     * individual time series selected by
     * denominatorFilter as well as how to combine
     * the retrieved time series together (such as
     * when aggregating multiple streams on each
     * resource to a single stream for each
     * resource or when aggregating streams across
     * all members of a group of resources).When
     * computing ratios, the aggregations and
     * denominator_aggregations fields must use the
     * same alignment period and produce time
     * series that have the same periodicity and
     * labels.This field is similar to the one in
     * the MetricService.ListTimeSeries request. It
     * is advisable to use the ListTimeSeries
     * method when debugging this field.
     * Structure is documented below.
     * 
     */
    @Import(name="denominatorAggregations")
    private @Nullable Output<List<AlertPolicyConditionConditionThresholdDenominatorAggregationArgs>> denominatorAggregations;

    /**
     * @return Specifies the alignment of data points in
     * individual time series selected by
     * denominatorFilter as well as how to combine
     * the retrieved time series together (such as
     * when aggregating multiple streams on each
     * resource to a single stream for each
     * resource or when aggregating streams across
     * all members of a group of resources).When
     * computing ratios, the aggregations and
     * denominator_aggregations fields must use the
     * same alignment period and produce time
     * series that have the same periodicity and
     * labels.This field is similar to the one in
     * the MetricService.ListTimeSeries request. It
     * is advisable to use the ListTimeSeries
     * method when debugging this field.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<AlertPolicyConditionConditionThresholdDenominatorAggregationArgs>>> denominatorAggregations() {
        return Optional.ofNullable(this.denominatorAggregations);
    }

    /**
     * A filter that identifies a time series that
     * should be used as the denominator of a ratio
     * that will be compared with the threshold. If
     * a denominator_filter is specified, the time
     * series specified by the filter field will be
     * used as the numerator.The filter is similar
     * to the one that is specified in the
     * MetricService.ListTimeSeries request (that
     * call is useful to verify the time series
     * that will be retrieved / processed) and must
     * specify the metric type and optionally may
     * contain restrictions on resource type,
     * resource labels, and metric labels. This
     * field may not exceed 2048 Unicode characters
     * in length.
     * 
     */
    @Import(name="denominatorFilter")
    private @Nullable Output<String> denominatorFilter;

    /**
     * @return A filter that identifies a time series that
     * should be used as the denominator of a ratio
     * that will be compared with the threshold. If
     * a denominator_filter is specified, the time
     * series specified by the filter field will be
     * used as the numerator.The filter is similar
     * to the one that is specified in the
     * MetricService.ListTimeSeries request (that
     * call is useful to verify the time series
     * that will be retrieved / processed) and must
     * specify the metric type and optionally may
     * contain restrictions on resource type,
     * resource labels, and metric labels. This
     * field may not exceed 2048 Unicode characters
     * in length.
     * 
     */
    public Optional<Output<String>> denominatorFilter() {
        return Optional.ofNullable(this.denominatorFilter);
    }

    /**
     * The amount of time that a time series must
     * violate the threshold to be considered
     * failing. Currently, only values that are a
     * multiple of a minute--e.g., 0, 60, 120, or
     * 300 seconds--are supported. If an invalid
     * value is given, an error will be returned.
     * When choosing a duration, it is useful to
     * keep in mind the frequency of the underlying
     * time series data (which may also be affected
     * by any alignments specified in the
     * aggregations field); a good duration is long
     * enough so that a single outlier does not
     * generate spurious alerts, but short enough
     * that unhealthy states are detected and
     * alerted on quickly.
     * 
     */
    @Import(name="duration", required=true)
    private Output<String> duration;

    /**
     * @return The amount of time that a time series must
     * violate the threshold to be considered
     * failing. Currently, only values that are a
     * multiple of a minute--e.g., 0, 60, 120, or
     * 300 seconds--are supported. If an invalid
     * value is given, an error will be returned.
     * When choosing a duration, it is useful to
     * keep in mind the frequency of the underlying
     * time series data (which may also be affected
     * by any alignments specified in the
     * aggregations field); a good duration is long
     * enough so that a single outlier does not
     * generate spurious alerts, but short enough
     * that unhealthy states are detected and
     * alerted on quickly.
     * 
     */
    public Output<String> duration() {
        return this.duration;
    }

    /**
     * A condition control that determines how
     * metric-threshold conditions are evaluated when
     * data stops arriving.
     * Possible values are: `EVALUATION_MISSING_DATA_INACTIVE`, `EVALUATION_MISSING_DATA_ACTIVE`, `EVALUATION_MISSING_DATA_NO_OP`.
     * 
     */
    @Import(name="evaluationMissingData")
    private @Nullable Output<String> evaluationMissingData;

    /**
     * @return A condition control that determines how
     * metric-threshold conditions are evaluated when
     * data stops arriving.
     * Possible values are: `EVALUATION_MISSING_DATA_INACTIVE`, `EVALUATION_MISSING_DATA_ACTIVE`, `EVALUATION_MISSING_DATA_NO_OP`.
     * 
     */
    public Optional<Output<String>> evaluationMissingData() {
        return Optional.ofNullable(this.evaluationMissingData);
    }

    /**
     * A filter that identifies which time series
     * should be compared with the threshold.The
     * filter is similar to the one that is
     * specified in the
     * MetricService.ListTimeSeries request (that
     * call is useful to verify the time series
     * that will be retrieved / processed) and must
     * specify the metric type and optionally may
     * contain restrictions on resource type,
     * resource labels, and metric labels. This
     * field may not exceed 2048 Unicode characters
     * in length.
     * 
     */
    @Import(name="filter")
    private @Nullable Output<String> filter;

    /**
     * @return A filter that identifies which time series
     * should be compared with the threshold.The
     * filter is similar to the one that is
     * specified in the
     * MetricService.ListTimeSeries request (that
     * call is useful to verify the time series
     * that will be retrieved / processed) and must
     * specify the metric type and optionally may
     * contain restrictions on resource type,
     * resource labels, and metric labels. This
     * field may not exceed 2048 Unicode characters
     * in length.
     * 
     */
    public Optional<Output<String>> filter() {
        return Optional.ofNullable(this.filter);
    }

    /**
     * When this field is present, the `MetricThreshold`
     * condition forecasts whether the time series is
     * predicted to violate the threshold within the
     * `forecastHorizon`. When this field is not set, the
     * `MetricThreshold` tests the current value of the
     * timeseries against the threshold.
     * Structure is documented below.
     * 
     */
    @Import(name="forecastOptions")
    private @Nullable Output<AlertPolicyConditionConditionThresholdForecastOptionsArgs> forecastOptions;

    /**
     * @return When this field is present, the `MetricThreshold`
     * condition forecasts whether the time series is
     * predicted to violate the threshold within the
     * `forecastHorizon`. When this field is not set, the
     * `MetricThreshold` tests the current value of the
     * timeseries against the threshold.
     * Structure is documented below.
     * 
     */
    public Optional<Output<AlertPolicyConditionConditionThresholdForecastOptionsArgs>> forecastOptions() {
        return Optional.ofNullable(this.forecastOptions);
    }

    /**
     * A value against which to compare the time
     * series.
     * 
     */
    @Import(name="thresholdValue")
    private @Nullable Output<Double> thresholdValue;

    /**
     * @return A value against which to compare the time
     * series.
     * 
     */
    public Optional<Output<Double>> thresholdValue() {
        return Optional.ofNullable(this.thresholdValue);
    }

    /**
     * The number/percent of time series for which
     * the comparison must hold in order for the
     * condition to trigger. If unspecified, then
     * the condition will trigger if the comparison
     * is true for any of the time series that have
     * been identified by filter and aggregations,
     * or by the ratio, if denominator_filter and
     * denominator_aggregations are specified.
     * Structure is documented below.
     * 
     */
    @Import(name="trigger")
    private @Nullable Output<AlertPolicyConditionConditionThresholdTriggerArgs> trigger;

    /**
     * @return The number/percent of time series for which
     * the comparison must hold in order for the
     * condition to trigger. If unspecified, then
     * the condition will trigger if the comparison
     * is true for any of the time series that have
     * been identified by filter and aggregations,
     * or by the ratio, if denominator_filter and
     * denominator_aggregations are specified.
     * Structure is documented below.
     * 
     */
    public Optional<Output<AlertPolicyConditionConditionThresholdTriggerArgs>> trigger() {
        return Optional.ofNullable(this.trigger);
    }

    private AlertPolicyConditionConditionThresholdArgs() {}

    private AlertPolicyConditionConditionThresholdArgs(AlertPolicyConditionConditionThresholdArgs $) {
        this.aggregations = $.aggregations;
        this.comparison = $.comparison;
        this.denominatorAggregations = $.denominatorAggregations;
        this.denominatorFilter = $.denominatorFilter;
        this.duration = $.duration;
        this.evaluationMissingData = $.evaluationMissingData;
        this.filter = $.filter;
        this.forecastOptions = $.forecastOptions;
        this.thresholdValue = $.thresholdValue;
        this.trigger = $.trigger;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(AlertPolicyConditionConditionThresholdArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private AlertPolicyConditionConditionThresholdArgs $;

        public Builder() {
            $ = new AlertPolicyConditionConditionThresholdArgs();
        }

        public Builder(AlertPolicyConditionConditionThresholdArgs defaults) {
            $ = new AlertPolicyConditionConditionThresholdArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param aggregations Specifies the alignment of data points in
         * individual time series as well as how to
         * combine the retrieved time series together
         * (such as when aggregating multiple streams
         * on each resource to a single stream for each
         * resource or when aggregating streams across
         * all members of a group of resources).
         * Multiple aggregations are applied in the
         * order specified.This field is similar to the
         * one in the MetricService.ListTimeSeries
         * request. It is advisable to use the
         * ListTimeSeries method when debugging this
         * field.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder aggregations(@Nullable Output<List<AlertPolicyConditionConditionThresholdAggregationArgs>> aggregations) {
            $.aggregations = aggregations;
            return this;
        }

        /**
         * @param aggregations Specifies the alignment of data points in
         * individual time series as well as how to
         * combine the retrieved time series together
         * (such as when aggregating multiple streams
         * on each resource to a single stream for each
         * resource or when aggregating streams across
         * all members of a group of resources).
         * Multiple aggregations are applied in the
         * order specified.This field is similar to the
         * one in the MetricService.ListTimeSeries
         * request. It is advisable to use the
         * ListTimeSeries method when debugging this
         * field.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder aggregations(List<AlertPolicyConditionConditionThresholdAggregationArgs> aggregations) {
            return aggregations(Output.of(aggregations));
        }

        /**
         * @param aggregations Specifies the alignment of data points in
         * individual time series as well as how to
         * combine the retrieved time series together
         * (such as when aggregating multiple streams
         * on each resource to a single stream for each
         * resource or when aggregating streams across
         * all members of a group of resources).
         * Multiple aggregations are applied in the
         * order specified.This field is similar to the
         * one in the MetricService.ListTimeSeries
         * request. It is advisable to use the
         * ListTimeSeries method when debugging this
         * field.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder aggregations(AlertPolicyConditionConditionThresholdAggregationArgs... aggregations) {
            return aggregations(List.of(aggregations));
        }

        /**
         * @param comparison The comparison to apply between the time
         * series (indicated by filter and aggregation)
         * and the threshold (indicated by
         * threshold_value). The comparison is applied
         * on each time series, with the time series on
         * the left-hand side and the threshold on the
         * right-hand side. Only COMPARISON_LT and
         * COMPARISON_GT are supported currently.
         * Possible values are: `COMPARISON_GT`, `COMPARISON_GE`, `COMPARISON_LT`, `COMPARISON_LE`, `COMPARISON_EQ`, `COMPARISON_NE`.
         * 
         * @return builder
         * 
         */
        public Builder comparison(Output<String> comparison) {
            $.comparison = comparison;
            return this;
        }

        /**
         * @param comparison The comparison to apply between the time
         * series (indicated by filter and aggregation)
         * and the threshold (indicated by
         * threshold_value). The comparison is applied
         * on each time series, with the time series on
         * the left-hand side and the threshold on the
         * right-hand side. Only COMPARISON_LT and
         * COMPARISON_GT are supported currently.
         * Possible values are: `COMPARISON_GT`, `COMPARISON_GE`, `COMPARISON_LT`, `COMPARISON_LE`, `COMPARISON_EQ`, `COMPARISON_NE`.
         * 
         * @return builder
         * 
         */
        public Builder comparison(String comparison) {
            return comparison(Output.of(comparison));
        }

        /**
         * @param denominatorAggregations Specifies the alignment of data points in
         * individual time series selected by
         * denominatorFilter as well as how to combine
         * the retrieved time series together (such as
         * when aggregating multiple streams on each
         * resource to a single stream for each
         * resource or when aggregating streams across
         * all members of a group of resources).When
         * computing ratios, the aggregations and
         * denominator_aggregations fields must use the
         * same alignment period and produce time
         * series that have the same periodicity and
         * labels.This field is similar to the one in
         * the MetricService.ListTimeSeries request. It
         * is advisable to use the ListTimeSeries
         * method when debugging this field.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder denominatorAggregations(@Nullable Output<List<AlertPolicyConditionConditionThresholdDenominatorAggregationArgs>> denominatorAggregations) {
            $.denominatorAggregations = denominatorAggregations;
            return this;
        }

        /**
         * @param denominatorAggregations Specifies the alignment of data points in
         * individual time series selected by
         * denominatorFilter as well as how to combine
         * the retrieved time series together (such as
         * when aggregating multiple streams on each
         * resource to a single stream for each
         * resource or when aggregating streams across
         * all members of a group of resources).When
         * computing ratios, the aggregations and
         * denominator_aggregations fields must use the
         * same alignment period and produce time
         * series that have the same periodicity and
         * labels.This field is similar to the one in
         * the MetricService.ListTimeSeries request. It
         * is advisable to use the ListTimeSeries
         * method when debugging this field.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder denominatorAggregations(List<AlertPolicyConditionConditionThresholdDenominatorAggregationArgs> denominatorAggregations) {
            return denominatorAggregations(Output.of(denominatorAggregations));
        }

        /**
         * @param denominatorAggregations Specifies the alignment of data points in
         * individual time series selected by
         * denominatorFilter as well as how to combine
         * the retrieved time series together (such as
         * when aggregating multiple streams on each
         * resource to a single stream for each
         * resource or when aggregating streams across
         * all members of a group of resources).When
         * computing ratios, the aggregations and
         * denominator_aggregations fields must use the
         * same alignment period and produce time
         * series that have the same periodicity and
         * labels.This field is similar to the one in
         * the MetricService.ListTimeSeries request. It
         * is advisable to use the ListTimeSeries
         * method when debugging this field.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder denominatorAggregations(AlertPolicyConditionConditionThresholdDenominatorAggregationArgs... denominatorAggregations) {
            return denominatorAggregations(List.of(denominatorAggregations));
        }

        /**
         * @param denominatorFilter A filter that identifies a time series that
         * should be used as the denominator of a ratio
         * that will be compared with the threshold. If
         * a denominator_filter is specified, the time
         * series specified by the filter field will be
         * used as the numerator.The filter is similar
         * to the one that is specified in the
         * MetricService.ListTimeSeries request (that
         * call is useful to verify the time series
         * that will be retrieved / processed) and must
         * specify the metric type and optionally may
         * contain restrictions on resource type,
         * resource labels, and metric labels. This
         * field may not exceed 2048 Unicode characters
         * in length.
         * 
         * @return builder
         * 
         */
        public Builder denominatorFilter(@Nullable Output<String> denominatorFilter) {
            $.denominatorFilter = denominatorFilter;
            return this;
        }

        /**
         * @param denominatorFilter A filter that identifies a time series that
         * should be used as the denominator of a ratio
         * that will be compared with the threshold. If
         * a denominator_filter is specified, the time
         * series specified by the filter field will be
         * used as the numerator.The filter is similar
         * to the one that is specified in the
         * MetricService.ListTimeSeries request (that
         * call is useful to verify the time series
         * that will be retrieved / processed) and must
         * specify the metric type and optionally may
         * contain restrictions on resource type,
         * resource labels, and metric labels. This
         * field may not exceed 2048 Unicode characters
         * in length.
         * 
         * @return builder
         * 
         */
        public Builder denominatorFilter(String denominatorFilter) {
            return denominatorFilter(Output.of(denominatorFilter));
        }

        /**
         * @param duration The amount of time that a time series must
         * violate the threshold to be considered
         * failing. Currently, only values that are a
         * multiple of a minute--e.g., 0, 60, 120, or
         * 300 seconds--are supported. If an invalid
         * value is given, an error will be returned.
         * When choosing a duration, it is useful to
         * keep in mind the frequency of the underlying
         * time series data (which may also be affected
         * by any alignments specified in the
         * aggregations field); a good duration is long
         * enough so that a single outlier does not
         * generate spurious alerts, but short enough
         * that unhealthy states are detected and
         * alerted on quickly.
         * 
         * @return builder
         * 
         */
        public Builder duration(Output<String> duration) {
            $.duration = duration;
            return this;
        }

        /**
         * @param duration The amount of time that a time series must
         * violate the threshold to be considered
         * failing. Currently, only values that are a
         * multiple of a minute--e.g., 0, 60, 120, or
         * 300 seconds--are supported. If an invalid
         * value is given, an error will be returned.
         * When choosing a duration, it is useful to
         * keep in mind the frequency of the underlying
         * time series data (which may also be affected
         * by any alignments specified in the
         * aggregations field); a good duration is long
         * enough so that a single outlier does not
         * generate spurious alerts, but short enough
         * that unhealthy states are detected and
         * alerted on quickly.
         * 
         * @return builder
         * 
         */
        public Builder duration(String duration) {
            return duration(Output.of(duration));
        }

        /**
         * @param evaluationMissingData A condition control that determines how
         * metric-threshold conditions are evaluated when
         * data stops arriving.
         * Possible values are: `EVALUATION_MISSING_DATA_INACTIVE`, `EVALUATION_MISSING_DATA_ACTIVE`, `EVALUATION_MISSING_DATA_NO_OP`.
         * 
         * @return builder
         * 
         */
        public Builder evaluationMissingData(@Nullable Output<String> evaluationMissingData) {
            $.evaluationMissingData = evaluationMissingData;
            return this;
        }

        /**
         * @param evaluationMissingData A condition control that determines how
         * metric-threshold conditions are evaluated when
         * data stops arriving.
         * Possible values are: `EVALUATION_MISSING_DATA_INACTIVE`, `EVALUATION_MISSING_DATA_ACTIVE`, `EVALUATION_MISSING_DATA_NO_OP`.
         * 
         * @return builder
         * 
         */
        public Builder evaluationMissingData(String evaluationMissingData) {
            return evaluationMissingData(Output.of(evaluationMissingData));
        }

        /**
         * @param filter A filter that identifies which time series
         * should be compared with the threshold.The
         * filter is similar to the one that is
         * specified in the
         * MetricService.ListTimeSeries request (that
         * call is useful to verify the time series
         * that will be retrieved / processed) and must
         * specify the metric type and optionally may
         * contain restrictions on resource type,
         * resource labels, and metric labels. This
         * field may not exceed 2048 Unicode characters
         * in length.
         * 
         * @return builder
         * 
         */
        public Builder filter(@Nullable Output<String> filter) {
            $.filter = filter;
            return this;
        }

        /**
         * @param filter A filter that identifies which time series
         * should be compared with the threshold.The
         * filter is similar to the one that is
         * specified in the
         * MetricService.ListTimeSeries request (that
         * call is useful to verify the time series
         * that will be retrieved / processed) and must
         * specify the metric type and optionally may
         * contain restrictions on resource type,
         * resource labels, and metric labels. This
         * field may not exceed 2048 Unicode characters
         * in length.
         * 
         * @return builder
         * 
         */
        public Builder filter(String filter) {
            return filter(Output.of(filter));
        }

        /**
         * @param forecastOptions When this field is present, the `MetricThreshold`
         * condition forecasts whether the time series is
         * predicted to violate the threshold within the
         * `forecastHorizon`. When this field is not set, the
         * `MetricThreshold` tests the current value of the
         * timeseries against the threshold.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder forecastOptions(@Nullable Output<AlertPolicyConditionConditionThresholdForecastOptionsArgs> forecastOptions) {
            $.forecastOptions = forecastOptions;
            return this;
        }

        /**
         * @param forecastOptions When this field is present, the `MetricThreshold`
         * condition forecasts whether the time series is
         * predicted to violate the threshold within the
         * `forecastHorizon`. When this field is not set, the
         * `MetricThreshold` tests the current value of the
         * timeseries against the threshold.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder forecastOptions(AlertPolicyConditionConditionThresholdForecastOptionsArgs forecastOptions) {
            return forecastOptions(Output.of(forecastOptions));
        }

        /**
         * @param thresholdValue A value against which to compare the time
         * series.
         * 
         * @return builder
         * 
         */
        public Builder thresholdValue(@Nullable Output<Double> thresholdValue) {
            $.thresholdValue = thresholdValue;
            return this;
        }

        /**
         * @param thresholdValue A value against which to compare the time
         * series.
         * 
         * @return builder
         * 
         */
        public Builder thresholdValue(Double thresholdValue) {
            return thresholdValue(Output.of(thresholdValue));
        }

        /**
         * @param trigger The number/percent of time series for which
         * the comparison must hold in order for the
         * condition to trigger. If unspecified, then
         * the condition will trigger if the comparison
         * is true for any of the time series that have
         * been identified by filter and aggregations,
         * or by the ratio, if denominator_filter and
         * denominator_aggregations are specified.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder trigger(@Nullable Output<AlertPolicyConditionConditionThresholdTriggerArgs> trigger) {
            $.trigger = trigger;
            return this;
        }

        /**
         * @param trigger The number/percent of time series for which
         * the comparison must hold in order for the
         * condition to trigger. If unspecified, then
         * the condition will trigger if the comparison
         * is true for any of the time series that have
         * been identified by filter and aggregations,
         * or by the ratio, if denominator_filter and
         * denominator_aggregations are specified.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder trigger(AlertPolicyConditionConditionThresholdTriggerArgs trigger) {
            return trigger(Output.of(trigger));
        }

        public AlertPolicyConditionConditionThresholdArgs build() {
            $.comparison = Objects.requireNonNull($.comparison, "expected parameter 'comparison' to be non-null");
            $.duration = Objects.requireNonNull($.duration, "expected parameter 'duration' to be non-null");
            return $;
        }
    }

}
