// *** 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.azure.monitoring.inputs;

import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2CriteriaDimensionArgs;
import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
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 ScheduledQueryRulesAlertV2CriteriaArgs extends com.pulumi.resources.ResourceArgs {

    public static final ScheduledQueryRulesAlertV2CriteriaArgs Empty = new ScheduledQueryRulesAlertV2CriteriaArgs();

    /**
     * A `dimension` block as defined below.
     * 
     */
    @Import(name="dimensions")
    private @Nullable Output<List<ScheduledQueryRulesAlertV2CriteriaDimensionArgs>> dimensions;

    /**
     * @return A `dimension` block as defined below.
     * 
     */
    public Optional<Output<List<ScheduledQueryRulesAlertV2CriteriaDimensionArgs>>> dimensions() {
        return Optional.ofNullable(this.dimensions);
    }

    /**
     * A `failing_periods` block as defined below.
     * 
     */
    @Import(name="failingPeriods")
    private @Nullable Output<ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs> failingPeriods;

    /**
     * @return A `failing_periods` block as defined below.
     * 
     */
    public Optional<Output<ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs>> failingPeriods() {
        return Optional.ofNullable(this.failingPeriods);
    }

    /**
     * Specifies the column containing the metric measure number.
     * 
     */
    @Import(name="metricMeasureColumn")
    private @Nullable Output<String> metricMeasureColumn;

    /**
     * @return Specifies the column containing the metric measure number.
     * 
     */
    public Optional<Output<String>> metricMeasureColumn() {
        return Optional.ofNullable(this.metricMeasureColumn);
    }

    /**
     * Specifies the criteria operator. Possible values are `Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`,and `LessThanOrEqual`.
     * 
     */
    @Import(name="operator", required=true)
    private Output<String> operator;

    /**
     * @return Specifies the criteria operator. Possible values are `Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`,and `LessThanOrEqual`.
     * 
     */
    public Output<String> operator() {
        return this.operator;
    }

    /**
     * The query to run on logs. The results returned by this query are used to populate the alert.
     * 
     */
    @Import(name="query", required=true)
    private Output<String> query;

    /**
     * @return The query to run on logs. The results returned by this query are used to populate the alert.
     * 
     */
    public Output<String> query() {
        return this.query;
    }

    /**
     * Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
     * 
     */
    @Import(name="resourceIdColumn")
    private @Nullable Output<String> resourceIdColumn;

    /**
     * @return Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
     * 
     */
    public Optional<Output<String>> resourceIdColumn() {
        return Optional.ofNullable(this.resourceIdColumn);
    }

    /**
     * Specifies the criteria threshold value that activates the alert.
     * 
     */
    @Import(name="threshold", required=true)
    private Output<Double> threshold;

    /**
     * @return Specifies the criteria threshold value that activates the alert.
     * 
     */
    public Output<Double> threshold() {
        return this.threshold;
    }

    /**
     * The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
     * 
     */
    @Import(name="timeAggregationMethod", required=true)
    private Output<String> timeAggregationMethod;

    /**
     * @return The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
     * 
     */
    public Output<String> timeAggregationMethod() {
        return this.timeAggregationMethod;
    }

    private ScheduledQueryRulesAlertV2CriteriaArgs() {}

    private ScheduledQueryRulesAlertV2CriteriaArgs(ScheduledQueryRulesAlertV2CriteriaArgs $) {
        this.dimensions = $.dimensions;
        this.failingPeriods = $.failingPeriods;
        this.metricMeasureColumn = $.metricMeasureColumn;
        this.operator = $.operator;
        this.query = $.query;
        this.resourceIdColumn = $.resourceIdColumn;
        this.threshold = $.threshold;
        this.timeAggregationMethod = $.timeAggregationMethod;
    }

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

    public static final class Builder {
        private ScheduledQueryRulesAlertV2CriteriaArgs $;

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

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

        /**
         * @param dimensions A `dimension` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder dimensions(@Nullable Output<List<ScheduledQueryRulesAlertV2CriteriaDimensionArgs>> dimensions) {
            $.dimensions = dimensions;
            return this;
        }

        /**
         * @param dimensions A `dimension` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder dimensions(List<ScheduledQueryRulesAlertV2CriteriaDimensionArgs> dimensions) {
            return dimensions(Output.of(dimensions));
        }

        /**
         * @param dimensions A `dimension` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder dimensions(ScheduledQueryRulesAlertV2CriteriaDimensionArgs... dimensions) {
            return dimensions(List.of(dimensions));
        }

        /**
         * @param failingPeriods A `failing_periods` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder failingPeriods(@Nullable Output<ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs> failingPeriods) {
            $.failingPeriods = failingPeriods;
            return this;
        }

        /**
         * @param failingPeriods A `failing_periods` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder failingPeriods(ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs failingPeriods) {
            return failingPeriods(Output.of(failingPeriods));
        }

        /**
         * @param metricMeasureColumn Specifies the column containing the metric measure number.
         * 
         * @return builder
         * 
         */
        public Builder metricMeasureColumn(@Nullable Output<String> metricMeasureColumn) {
            $.metricMeasureColumn = metricMeasureColumn;
            return this;
        }

        /**
         * @param metricMeasureColumn Specifies the column containing the metric measure number.
         * 
         * @return builder
         * 
         */
        public Builder metricMeasureColumn(String metricMeasureColumn) {
            return metricMeasureColumn(Output.of(metricMeasureColumn));
        }

        /**
         * @param operator Specifies the criteria operator. Possible values are `Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`,and `LessThanOrEqual`.
         * 
         * @return builder
         * 
         */
        public Builder operator(Output<String> operator) {
            $.operator = operator;
            return this;
        }

        /**
         * @param operator Specifies the criteria operator. Possible values are `Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`,and `LessThanOrEqual`.
         * 
         * @return builder
         * 
         */
        public Builder operator(String operator) {
            return operator(Output.of(operator));
        }

        /**
         * @param query The query to run on logs. The results returned by this query are used to populate the alert.
         * 
         * @return builder
         * 
         */
        public Builder query(Output<String> query) {
            $.query = query;
            return this;
        }

        /**
         * @param query The query to run on logs. The results returned by this query are used to populate the alert.
         * 
         * @return builder
         * 
         */
        public Builder query(String query) {
            return query(Output.of(query));
        }

        /**
         * @param resourceIdColumn Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
         * 
         * @return builder
         * 
         */
        public Builder resourceIdColumn(@Nullable Output<String> resourceIdColumn) {
            $.resourceIdColumn = resourceIdColumn;
            return this;
        }

        /**
         * @param resourceIdColumn Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
         * 
         * @return builder
         * 
         */
        public Builder resourceIdColumn(String resourceIdColumn) {
            return resourceIdColumn(Output.of(resourceIdColumn));
        }

        /**
         * @param threshold Specifies the criteria threshold value that activates the alert.
         * 
         * @return builder
         * 
         */
        public Builder threshold(Output<Double> threshold) {
            $.threshold = threshold;
            return this;
        }

        /**
         * @param threshold Specifies the criteria threshold value that activates the alert.
         * 
         * @return builder
         * 
         */
        public Builder threshold(Double threshold) {
            return threshold(Output.of(threshold));
        }

        /**
         * @param timeAggregationMethod The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
         * 
         * @return builder
         * 
         */
        public Builder timeAggregationMethod(Output<String> timeAggregationMethod) {
            $.timeAggregationMethod = timeAggregationMethod;
            return this;
        }

        /**
         * @param timeAggregationMethod The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
         * 
         * @return builder
         * 
         */
        public Builder timeAggregationMethod(String timeAggregationMethod) {
            return timeAggregationMethod(Output.of(timeAggregationMethod));
        }

        public ScheduledQueryRulesAlertV2CriteriaArgs build() {
            $.operator = Objects.requireNonNull($.operator, "expected parameter 'operator' to be non-null");
            $.query = Objects.requireNonNull($.query, "expected parameter 'query' to be non-null");
            $.threshold = Objects.requireNonNull($.threshold, "expected parameter 'threshold' to be non-null");
            $.timeAggregationMethod = Objects.requireNonNull($.timeAggregationMethod, "expected parameter 'timeAggregationMethod' to be non-null");
            return $;
        }
    }

}
