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

com.pulumi.azurenative.consumption.inputs.NotificationArgs Maven / Gradle / Ivy

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

import com.pulumi.azurenative.consumption.enums.CultureCode;
import com.pulumi.azurenative.consumption.enums.OperatorType;
import com.pulumi.azurenative.consumption.enums.ThresholdType;
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;


/**
 * The notification associated with a budget.
 * 
 */
public final class NotificationArgs extends com.pulumi.resources.ResourceArgs {

    public static final NotificationArgs Empty = new NotificationArgs();

    /**
     * Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
     * 
     */
    @Import(name="contactEmails", required=true)
    private Output> contactEmails;

    /**
     * @return Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
     * 
     */
    public Output> contactEmails() {
        return this.contactEmails;
    }

    /**
     * Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.
     * 
     */
    @Import(name="contactGroups")
    private @Nullable Output> contactGroups;

    /**
     * @return Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.
     * 
     */
    public Optional>> contactGroups() {
        return Optional.ofNullable(this.contactGroups);
    }

    /**
     * Contact roles to send the budget notification to when the threshold is exceeded.
     * 
     */
    @Import(name="contactRoles")
    private @Nullable Output> contactRoles;

    /**
     * @return Contact roles to send the budget notification to when the threshold is exceeded.
     * 
     */
    public Optional>> contactRoles() {
        return Optional.ofNullable(this.contactRoles);
    }

    /**
     * The notification is enabled or not.
     * 
     */
    @Import(name="enabled", required=true)
    private Output enabled;

    /**
     * @return The notification is enabled or not.
     * 
     */
    public Output enabled() {
        return this.enabled;
    }

    /**
     * Language in which the recipient will receive the notification
     * 
     */
    @Import(name="locale")
    private @Nullable Output> locale;

    /**
     * @return Language in which the recipient will receive the notification
     * 
     */
    public Optional>> locale() {
        return Optional.ofNullable(this.locale);
    }

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

    /**
     * @return The comparison operator.
     * 
     */
    public Output> operator() {
        return this.operator;
    }

    /**
     * Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.
     * 
     */
    @Import(name="threshold", required=true)
    private Output threshold;

    /**
     * @return Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.
     * 
     */
    public Output threshold() {
        return this.threshold;
    }

    /**
     * The type of threshold
     * 
     */
    @Import(name="thresholdType")
    private @Nullable Output> thresholdType;

    /**
     * @return The type of threshold
     * 
     */
    public Optional>> thresholdType() {
        return Optional.ofNullable(this.thresholdType);
    }

    private NotificationArgs() {}

    private NotificationArgs(NotificationArgs $) {
        this.contactEmails = $.contactEmails;
        this.contactGroups = $.contactGroups;
        this.contactRoles = $.contactRoles;
        this.enabled = $.enabled;
        this.locale = $.locale;
        this.operator = $.operator;
        this.threshold = $.threshold;
        this.thresholdType = $.thresholdType;
    }

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

    public static final class Builder {
        private NotificationArgs $;

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

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

        /**
         * @param contactEmails Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
         * 
         * @return builder
         * 
         */
        public Builder contactEmails(Output> contactEmails) {
            $.contactEmails = contactEmails;
            return this;
        }

        /**
         * @param contactEmails Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
         * 
         * @return builder
         * 
         */
        public Builder contactEmails(List contactEmails) {
            return contactEmails(Output.of(contactEmails));
        }

        /**
         * @param contactEmails Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
         * 
         * @return builder
         * 
         */
        public Builder contactEmails(String... contactEmails) {
            return contactEmails(List.of(contactEmails));
        }

        /**
         * @param contactGroups Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.
         * 
         * @return builder
         * 
         */
        public Builder contactGroups(@Nullable Output> contactGroups) {
            $.contactGroups = contactGroups;
            return this;
        }

        /**
         * @param contactGroups Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.
         * 
         * @return builder
         * 
         */
        public Builder contactGroups(List contactGroups) {
            return contactGroups(Output.of(contactGroups));
        }

        /**
         * @param contactGroups Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.
         * 
         * @return builder
         * 
         */
        public Builder contactGroups(String... contactGroups) {
            return contactGroups(List.of(contactGroups));
        }

        /**
         * @param contactRoles Contact roles to send the budget notification to when the threshold is exceeded.
         * 
         * @return builder
         * 
         */
        public Builder contactRoles(@Nullable Output> contactRoles) {
            $.contactRoles = contactRoles;
            return this;
        }

        /**
         * @param contactRoles Contact roles to send the budget notification to when the threshold is exceeded.
         * 
         * @return builder
         * 
         */
        public Builder contactRoles(List contactRoles) {
            return contactRoles(Output.of(contactRoles));
        }

        /**
         * @param contactRoles Contact roles to send the budget notification to when the threshold is exceeded.
         * 
         * @return builder
         * 
         */
        public Builder contactRoles(String... contactRoles) {
            return contactRoles(List.of(contactRoles));
        }

        /**
         * @param enabled The notification is enabled or not.
         * 
         * @return builder
         * 
         */
        public Builder enabled(Output enabled) {
            $.enabled = enabled;
            return this;
        }

        /**
         * @param enabled The notification is enabled or not.
         * 
         * @return builder
         * 
         */
        public Builder enabled(Boolean enabled) {
            return enabled(Output.of(enabled));
        }

        /**
         * @param locale Language in which the recipient will receive the notification
         * 
         * @return builder
         * 
         */
        public Builder locale(@Nullable Output> locale) {
            $.locale = locale;
            return this;
        }

        /**
         * @param locale Language in which the recipient will receive the notification
         * 
         * @return builder
         * 
         */
        public Builder locale(Either locale) {
            return locale(Output.of(locale));
        }

        /**
         * @param locale Language in which the recipient will receive the notification
         * 
         * @return builder
         * 
         */
        public Builder locale(String locale) {
            return locale(Either.ofLeft(locale));
        }

        /**
         * @param locale Language in which the recipient will receive the notification
         * 
         * @return builder
         * 
         */
        public Builder locale(CultureCode locale) {
            return locale(Either.ofRight(locale));
        }

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

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

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

        /**
         * @param operator The comparison operator.
         * 
         * @return builder
         * 
         */
        public Builder operator(OperatorType operator) {
            return operator(Either.ofRight(operator));
        }

        /**
         * @param threshold Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.
         * 
         * @return builder
         * 
         */
        public Builder threshold(Output threshold) {
            $.threshold = threshold;
            return this;
        }

        /**
         * @param threshold Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.
         * 
         * @return builder
         * 
         */
        public Builder threshold(Double threshold) {
            return threshold(Output.of(threshold));
        }

        /**
         * @param thresholdType The type of threshold
         * 
         * @return builder
         * 
         */
        public Builder thresholdType(@Nullable Output> thresholdType) {
            $.thresholdType = thresholdType;
            return this;
        }

        /**
         * @param thresholdType The type of threshold
         * 
         * @return builder
         * 
         */
        public Builder thresholdType(Either thresholdType) {
            return thresholdType(Output.of(thresholdType));
        }

        /**
         * @param thresholdType The type of threshold
         * 
         * @return builder
         * 
         */
        public Builder thresholdType(String thresholdType) {
            return thresholdType(Either.ofLeft(thresholdType));
        }

        /**
         * @param thresholdType The type of threshold
         * 
         * @return builder
         * 
         */
        public Builder thresholdType(ThresholdType thresholdType) {
            return thresholdType(Either.ofRight(thresholdType));
        }

        public NotificationArgs build() {
            if ($.contactEmails == null) {
                throw new MissingRequiredPropertyException("NotificationArgs", "contactEmails");
            }
            if ($.enabled == null) {
                throw new MissingRequiredPropertyException("NotificationArgs", "enabled");
            }
            if ($.operator == null) {
                throw new MissingRequiredPropertyException("NotificationArgs", "operator");
            }
            if ($.threshold == null) {
                throw new MissingRequiredPropertyException("NotificationArgs", "threshold");
            }
            $.thresholdType = Codegen.stringProp("thresholdType").left(ThresholdType.class).output().arg($.thresholdType).def("Actual").getNullable();
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy