All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.insights.inputs.MetricCriteriaArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** 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.azurenative.insights.inputs;

import com.pulumi.azurenative.insights.enums.AggregationTypeEnum;
import com.pulumi.azurenative.insights.enums.Operator;
import com.pulumi.azurenative.insights.inputs.MetricDimensionArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Criterion to filter metrics.
 * 
 */
public final class MetricCriteriaArgs extends com.pulumi.resources.ResourceArgs {

    public static final MetricCriteriaArgs Empty = new MetricCriteriaArgs();

    /**
     * Specifies the type of threshold criteria
     * Expected value is 'StaticThresholdCriterion'.
     * 
     */
    @Import(name="criterionType", required=true)
    private Output criterionType;

    /**
     * @return Specifies the type of threshold criteria
     * Expected value is 'StaticThresholdCriterion'.
     * 
     */
    public Output criterionType() {
        return this.criterionType;
    }

    /**
     * List of dimension conditions.
     * 
     */
    @Import(name="dimensions")
    private @Nullable Output> dimensions;

    /**
     * @return List of dimension conditions.
     * 
     */
    public Optional>> dimensions() {
        return Optional.ofNullable(this.dimensions);
    }

    /**
     * Name of the metric.
     * 
     */
    @Import(name="metricName", required=true)
    private Output metricName;

    /**
     * @return Name of the metric.
     * 
     */
    public Output metricName() {
        return this.metricName;
    }

    /**
     * Namespace of the metric.
     * 
     */
    @Import(name="metricNamespace")
    private @Nullable Output metricNamespace;

    /**
     * @return Namespace of the metric.
     * 
     */
    public Optional> metricNamespace() {
        return Optional.ofNullable(this.metricNamespace);
    }

    /**
     * Name of the criteria.
     * 
     */
    @Import(name="name", required=true)
    private Output name;

    /**
     * @return Name of the criteria.
     * 
     */
    public Output name() {
        return this.name;
    }

    /**
     * the criteria operator.
     * 
     */
    @Import(name="operator", required=true)
    private Output> operator;

    /**
     * @return the criteria operator.
     * 
     */
    public Output> operator() {
        return this.operator;
    }

    /**
     * Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
     * 
     */
    @Import(name="skipMetricValidation")
    private @Nullable Output skipMetricValidation;

    /**
     * @return Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
     * 
     */
    public Optional> skipMetricValidation() {
        return Optional.ofNullable(this.skipMetricValidation);
    }

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

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

    /**
     * the criteria time aggregation types.
     * 
     */
    @Import(name="timeAggregation", required=true)
    private Output> timeAggregation;

    /**
     * @return the criteria time aggregation types.
     * 
     */
    public Output> timeAggregation() {
        return this.timeAggregation;
    }

    private MetricCriteriaArgs() {}

    private MetricCriteriaArgs(MetricCriteriaArgs $) {
        this.criterionType = $.criterionType;
        this.dimensions = $.dimensions;
        this.metricName = $.metricName;
        this.metricNamespace = $.metricNamespace;
        this.name = $.name;
        this.operator = $.operator;
        this.skipMetricValidation = $.skipMetricValidation;
        this.threshold = $.threshold;
        this.timeAggregation = $.timeAggregation;
    }

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

    public static final class Builder {
        private MetricCriteriaArgs $;

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

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

        /**
         * @param criterionType Specifies the type of threshold criteria
         * Expected value is 'StaticThresholdCriterion'.
         * 
         * @return builder
         * 
         */
        public Builder criterionType(Output criterionType) {
            $.criterionType = criterionType;
            return this;
        }

        /**
         * @param criterionType Specifies the type of threshold criteria
         * Expected value is 'StaticThresholdCriterion'.
         * 
         * @return builder
         * 
         */
        public Builder criterionType(String criterionType) {
            return criterionType(Output.of(criterionType));
        }

        /**
         * @param dimensions List of dimension conditions.
         * 
         * @return builder
         * 
         */
        public Builder dimensions(@Nullable Output> dimensions) {
            $.dimensions = dimensions;
            return this;
        }

        /**
         * @param dimensions List of dimension conditions.
         * 
         * @return builder
         * 
         */
        public Builder dimensions(List dimensions) {
            return dimensions(Output.of(dimensions));
        }

        /**
         * @param dimensions List of dimension conditions.
         * 
         * @return builder
         * 
         */
        public Builder dimensions(MetricDimensionArgs... dimensions) {
            return dimensions(List.of(dimensions));
        }

        /**
         * @param metricName Name of the metric.
         * 
         * @return builder
         * 
         */
        public Builder metricName(Output metricName) {
            $.metricName = metricName;
            return this;
        }

        /**
         * @param metricName Name of the metric.
         * 
         * @return builder
         * 
         */
        public Builder metricName(String metricName) {
            return metricName(Output.of(metricName));
        }

        /**
         * @param metricNamespace Namespace of the metric.
         * 
         * @return builder
         * 
         */
        public Builder metricNamespace(@Nullable Output metricNamespace) {
            $.metricNamespace = metricNamespace;
            return this;
        }

        /**
         * @param metricNamespace Namespace of the metric.
         * 
         * @return builder
         * 
         */
        public Builder metricNamespace(String metricNamespace) {
            return metricNamespace(Output.of(metricNamespace));
        }

        /**
         * @param name Name of the criteria.
         * 
         * @return builder
         * 
         */
        public Builder name(Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name Name of the criteria.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param operator the criteria operator.
         * 
         * @return builder
         * 
         */
        public Builder operator(Output> operator) {
            $.operator = operator;
            return this;
        }

        /**
         * @param operator the criteria operator.
         * 
         * @return builder
         * 
         */
        public Builder operator(Either operator) {
            return operator(Output.of(operator));
        }

        /**
         * @param operator the criteria operator.
         * 
         * @return builder
         * 
         */
        public Builder operator(String operator) {
            return operator(Either.ofLeft(operator));
        }

        /**
         * @param operator the criteria operator.
         * 
         * @return builder
         * 
         */
        public Builder operator(Operator operator) {
            return operator(Either.ofRight(operator));
        }

        /**
         * @param skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
         * 
         * @return builder
         * 
         */
        public Builder skipMetricValidation(@Nullable Output skipMetricValidation) {
            $.skipMetricValidation = skipMetricValidation;
            return this;
        }

        /**
         * @param skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
         * 
         * @return builder
         * 
         */
        public Builder skipMetricValidation(Boolean skipMetricValidation) {
            return skipMetricValidation(Output.of(skipMetricValidation));
        }

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

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

        /**
         * @param timeAggregation the criteria time aggregation types.
         * 
         * @return builder
         * 
         */
        public Builder timeAggregation(Output> timeAggregation) {
            $.timeAggregation = timeAggregation;
            return this;
        }

        /**
         * @param timeAggregation the criteria time aggregation types.
         * 
         * @return builder
         * 
         */
        public Builder timeAggregation(Either timeAggregation) {
            return timeAggregation(Output.of(timeAggregation));
        }

        /**
         * @param timeAggregation the criteria time aggregation types.
         * 
         * @return builder
         * 
         */
        public Builder timeAggregation(String timeAggregation) {
            return timeAggregation(Either.ofLeft(timeAggregation));
        }

        /**
         * @param timeAggregation the criteria time aggregation types.
         * 
         * @return builder
         * 
         */
        public Builder timeAggregation(AggregationTypeEnum timeAggregation) {
            return timeAggregation(Either.ofRight(timeAggregation));
        }

        public MetricCriteriaArgs build() {
            $.criterionType = Codegen.stringProp("criterionType").output().arg($.criterionType).require();
            if ($.metricName == null) {
                throw new MissingRequiredPropertyException("MetricCriteriaArgs", "metricName");
            }
            if ($.name == null) {
                throw new MissingRequiredPropertyException("MetricCriteriaArgs", "name");
            }
            if ($.operator == null) {
                throw new MissingRequiredPropertyException("MetricCriteriaArgs", "operator");
            }
            if ($.threshold == null) {
                throw new MissingRequiredPropertyException("MetricCriteriaArgs", "threshold");
            }
            if ($.timeAggregation == null) {
                throw new MissingRequiredPropertyException("MetricCriteriaArgs", "timeAggregation");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy