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

com.pulumi.azurenative.insights.AlertRuleArgs Maven / Gradle / Ivy

There is a newer version: 2.89.2
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;

import com.pulumi.azurenative.insights.inputs.LocationThresholdRuleConditionArgs;
import com.pulumi.azurenative.insights.inputs.ManagementEventRuleConditionArgs;
import com.pulumi.azurenative.insights.inputs.RuleEmailActionArgs;
import com.pulumi.azurenative.insights.inputs.RuleWebhookActionArgs;
import com.pulumi.azurenative.insights.inputs.ThresholdRuleConditionArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final AlertRuleArgs Empty = new AlertRuleArgs();

    /**
     * action that is performed when the alert rule becomes active, and when an alert condition is resolved.
     * 
     */
    @Import(name="action")
    private @Nullable Output> action;

    /**
     * @return action that is performed when the alert rule becomes active, and when an alert condition is resolved.
     * 
     */
    public Optional>> action() {
        return Optional.ofNullable(this.action);
    }

    /**
     * the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
     * 
     */
    @Import(name="actions")
    private @Nullable Output>> actions;

    /**
     * @return the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
     * 
     */
    public Optional>>> actions() {
        return Optional.ofNullable(this.actions);
    }

    /**
     * the condition that results in the alert rule being activated.
     * 
     */
    @Import(name="condition", required=true)
    private Output condition;

    /**
     * @return the condition that results in the alert rule being activated.
     * 
     */
    public Output condition() {
        return this.condition;
    }

    /**
     * the description of the alert rule that will be included in the alert email.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return the description of the alert rule that will be included in the alert email.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * the flag that indicates whether the alert rule is enabled.
     * 
     */
    @Import(name="isEnabled", required=true)
    private Output isEnabled;

    /**
     * @return the flag that indicates whether the alert rule is enabled.
     * 
     */
    public Output isEnabled() {
        return this.isEnabled;
    }

    /**
     * Resource location
     * 
     */
    @Import(name="location")
    private @Nullable Output location;

    /**
     * @return Resource location
     * 
     */
    public Optional> location() {
        return Optional.ofNullable(this.location);
    }

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

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

    /**
     * the provisioning state.
     * 
     */
    @Import(name="provisioningState")
    private @Nullable Output provisioningState;

    /**
     * @return the provisioning state.
     * 
     */
    public Optional> provisioningState() {
        return Optional.ofNullable(this.provisioningState);
    }

    /**
     * The name of the resource group. The name is case insensitive.
     * 
     */
    @Import(name="resourceGroupName", required=true)
    private Output resourceGroupName;

    /**
     * @return The name of the resource group. The name is case insensitive.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }

    /**
     * The name of the rule.
     * 
     */
    @Import(name="ruleName")
    private @Nullable Output ruleName;

    /**
     * @return The name of the rule.
     * 
     */
    public Optional> ruleName() {
        return Optional.ofNullable(this.ruleName);
    }

    /**
     * Resource tags
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return Resource tags
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    private AlertRuleArgs() {}

    private AlertRuleArgs(AlertRuleArgs $) {
        this.action = $.action;
        this.actions = $.actions;
        this.condition = $.condition;
        this.description = $.description;
        this.isEnabled = $.isEnabled;
        this.location = $.location;
        this.name = $.name;
        this.provisioningState = $.provisioningState;
        this.resourceGroupName = $.resourceGroupName;
        this.ruleName = $.ruleName;
        this.tags = $.tags;
    }

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

    public static final class Builder {
        private AlertRuleArgs $;

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

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

        /**
         * @param action action that is performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder action(@Nullable Output> action) {
            $.action = action;
            return this;
        }

        /**
         * @param action action that is performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder action(Either action) {
            return action(Output.of(action));
        }

        /**
         * @param action action that is performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder action(RuleEmailActionArgs action) {
            return action(Either.ofLeft(action));
        }

        /**
         * @param action action that is performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder action(RuleWebhookActionArgs action) {
            return action(Either.ofRight(action));
        }

        /**
         * @param actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder actions(@Nullable Output>> actions) {
            $.actions = actions;
            return this;
        }

        /**
         * @param actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder actions(List> actions) {
            return actions(Output.of(actions));
        }

        /**
         * @param actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder actions(Either... actions) {
            return actions(List.of(actions));
        }

        /**
         * @param condition the condition that results in the alert rule being activated.
         * 
         * @return builder
         * 
         */
        public Builder condition(Output condition) {
            $.condition = condition;
            return this;
        }

        /**
         * @param condition the condition that results in the alert rule being activated.
         * 
         * @return builder
         * 
         */
        public Builder condition(Object condition) {
            return condition(Output.of(condition));
        }

        /**
         * @param description the description of the alert rule that will be included in the alert email.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description the description of the alert rule that will be included in the alert email.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param isEnabled the flag that indicates whether the alert rule is enabled.
         * 
         * @return builder
         * 
         */
        public Builder isEnabled(Output isEnabled) {
            $.isEnabled = isEnabled;
            return this;
        }

        /**
         * @param isEnabled the flag that indicates whether the alert rule is enabled.
         * 
         * @return builder
         * 
         */
        public Builder isEnabled(Boolean isEnabled) {
            return isEnabled(Output.of(isEnabled));
        }

        /**
         * @param location Resource location
         * 
         * @return builder
         * 
         */
        public Builder location(@Nullable Output location) {
            $.location = location;
            return this;
        }

        /**
         * @param location Resource location
         * 
         * @return builder
         * 
         */
        public Builder location(String location) {
            return location(Output.of(location));
        }

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

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

        /**
         * @param provisioningState the provisioning state.
         * 
         * @return builder
         * 
         */
        public Builder provisioningState(@Nullable Output provisioningState) {
            $.provisioningState = provisioningState;
            return this;
        }

        /**
         * @param provisioningState the provisioning state.
         * 
         * @return builder
         * 
         */
        public Builder provisioningState(String provisioningState) {
            return provisioningState(Output.of(provisioningState));
        }

        /**
         * @param resourceGroupName The name of the resource group. The name is case insensitive.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(Output resourceGroupName) {
            $.resourceGroupName = resourceGroupName;
            return this;
        }

        /**
         * @param resourceGroupName The name of the resource group. The name is case insensitive.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(String resourceGroupName) {
            return resourceGroupName(Output.of(resourceGroupName));
        }

        /**
         * @param ruleName The name of the rule.
         * 
         * @return builder
         * 
         */
        public Builder ruleName(@Nullable Output ruleName) {
            $.ruleName = ruleName;
            return this;
        }

        /**
         * @param ruleName The name of the rule.
         * 
         * @return builder
         * 
         */
        public Builder ruleName(String ruleName) {
            return ruleName(Output.of(ruleName));
        }

        /**
         * @param tags Resource tags
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags Resource tags
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        public AlertRuleArgs build() {
            if ($.condition == null) {
                throw new MissingRequiredPropertyException("AlertRuleArgs", "condition");
            }
            if ($.isEnabled == null) {
                throw new MissingRequiredPropertyException("AlertRuleArgs", "isEnabled");
            }
            if ($.name == null) {
                throw new MissingRequiredPropertyException("AlertRuleArgs", "name");
            }
            if ($.resourceGroupName == null) {
                throw new MissingRequiredPropertyException("AlertRuleArgs", "resourceGroupName");
            }
            return $;
        }
    }

}