// *** 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.outputs;

import com.pulumi.azure.monitoring.outputs.ScheduledQueryRulesAlertV2CriteriaDimension;
import com.pulumi.azure.monitoring.outputs.ScheduledQueryRulesAlertV2CriteriaFailingPeriods;
import com.pulumi.core.annotations.CustomType;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ScheduledQueryRulesAlertV2Criteria {
    /**
     * @return A `dimension` block as defined below.
     * 
     */
    private @Nullable List<ScheduledQueryRulesAlertV2CriteriaDimension> dimensions;
    /**
     * @return A `failing_periods` block as defined below.
     * 
     */
    private @Nullable ScheduledQueryRulesAlertV2CriteriaFailingPeriods failingPeriods;
    /**
     * @return Specifies the column containing the metric measure number.
     * 
     */
    private @Nullable String metricMeasureColumn;
    /**
     * @return Specifies the criteria operator. Possible values are `Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`,and `LessThanOrEqual`.
     * 
     */
    private String operator;
    /**
     * @return The query to run on logs. The results returned by this query are used to populate the alert.
     * 
     */
    private String query;
    /**
     * @return Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
     * 
     */
    private @Nullable String resourceIdColumn;
    /**
     * @return Specifies the criteria threshold value that activates the alert.
     * 
     */
    private Double threshold;
    /**
     * @return The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
     * 
     */
    private String timeAggregationMethod;

    private ScheduledQueryRulesAlertV2Criteria() {}
    /**
     * @return A `dimension` block as defined below.
     * 
     */
    public List<ScheduledQueryRulesAlertV2CriteriaDimension> dimensions() {
        return this.dimensions == null ? List.of() : this.dimensions;
    }
    /**
     * @return A `failing_periods` block as defined below.
     * 
     */
    public Optional<ScheduledQueryRulesAlertV2CriteriaFailingPeriods> failingPeriods() {
        return Optional.ofNullable(this.failingPeriods);
    }
    /**
     * @return Specifies the column containing the metric measure number.
     * 
     */
    public Optional<String> metricMeasureColumn() {
        return Optional.ofNullable(this.metricMeasureColumn);
    }
    /**
     * @return Specifies the criteria operator. Possible values are `Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`,and `LessThanOrEqual`.
     * 
     */
    public String operator() {
        return this.operator;
    }
    /**
     * @return The query to run on logs. The results returned by this query are used to populate the alert.
     * 
     */
    public String query() {
        return this.query;
    }
    /**
     * @return Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
     * 
     */
    public Optional<String> resourceIdColumn() {
        return Optional.ofNullable(this.resourceIdColumn);
    }
    /**
     * @return Specifies the criteria threshold value that activates the alert.
     * 
     */
    public Double threshold() {
        return this.threshold;
    }
    /**
     * @return The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
     * 
     */
    public String timeAggregationMethod() {
        return this.timeAggregationMethod;
    }

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

    public static Builder builder(ScheduledQueryRulesAlertV2Criteria defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List<ScheduledQueryRulesAlertV2CriteriaDimension> dimensions;
        private @Nullable ScheduledQueryRulesAlertV2CriteriaFailingPeriods failingPeriods;
        private @Nullable String metricMeasureColumn;
        private String operator;
        private String query;
        private @Nullable String resourceIdColumn;
        private Double threshold;
        private String timeAggregationMethod;
        public Builder() {}
        public Builder(ScheduledQueryRulesAlertV2Criteria defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.dimensions = defaults.dimensions;
    	      this.failingPeriods = defaults.failingPeriods;
    	      this.metricMeasureColumn = defaults.metricMeasureColumn;
    	      this.operator = defaults.operator;
    	      this.query = defaults.query;
    	      this.resourceIdColumn = defaults.resourceIdColumn;
    	      this.threshold = defaults.threshold;
    	      this.timeAggregationMethod = defaults.timeAggregationMethod;
        }

        @CustomType.Setter
        public Builder dimensions(@Nullable List<ScheduledQueryRulesAlertV2CriteriaDimension> dimensions) {
            this.dimensions = dimensions;
            return this;
        }
        public Builder dimensions(ScheduledQueryRulesAlertV2CriteriaDimension... dimensions) {
            return dimensions(List.of(dimensions));
        }
        @CustomType.Setter
        public Builder failingPeriods(@Nullable ScheduledQueryRulesAlertV2CriteriaFailingPeriods failingPeriods) {
            this.failingPeriods = failingPeriods;
            return this;
        }
        @CustomType.Setter
        public Builder metricMeasureColumn(@Nullable String metricMeasureColumn) {
            this.metricMeasureColumn = metricMeasureColumn;
            return this;
        }
        @CustomType.Setter
        public Builder operator(String operator) {
            this.operator = Objects.requireNonNull(operator);
            return this;
        }
        @CustomType.Setter
        public Builder query(String query) {
            this.query = Objects.requireNonNull(query);
            return this;
        }
        @CustomType.Setter
        public Builder resourceIdColumn(@Nullable String resourceIdColumn) {
            this.resourceIdColumn = resourceIdColumn;
            return this;
        }
        @CustomType.Setter
        public Builder threshold(Double threshold) {
            this.threshold = Objects.requireNonNull(threshold);
            return this;
        }
        @CustomType.Setter
        public Builder timeAggregationMethod(String timeAggregationMethod) {
            this.timeAggregationMethod = Objects.requireNonNull(timeAggregationMethod);
            return this;
        }
        public ScheduledQueryRulesAlertV2Criteria build() {
            final var o = new ScheduledQueryRulesAlertV2Criteria();
            o.dimensions = dimensions;
            o.failingPeriods = failingPeriods;
            o.metricMeasureColumn = metricMeasureColumn;
            o.operator = operator;
            o.query = query;
            o.resourceIdColumn = resourceIdColumn;
            o.threshold = threshold;
            o.timeAggregationMethod = timeAggregationMethod;
            return o;
        }
    }
}
