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

com.pulumi.digitalocean.UptimeAlertArgs Maven / Gradle / Ivy

There is a newer version: 4.35.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.digitalocean;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.digitalocean.inputs.UptimeAlertNotificationArgs;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final UptimeAlertArgs Empty = new UptimeAlertArgs();

    /**
     * A unique identifier for a check
     * 
     */
    @Import(name="checkId", required=true)
    private Output checkId;

    /**
     * @return A unique identifier for a check
     * 
     */
    public Output checkId() {
        return this.checkId;
    }

    /**
     * The comparison operator used against the alert's threshold. Must be one of `greater_than` or `less_than`.
     * 
     */
    @Import(name="comparison")
    private @Nullable Output comparison;

    /**
     * @return The comparison operator used against the alert's threshold. Must be one of `greater_than` or `less_than`.
     * 
     */
    public Optional> comparison() {
        return Optional.ofNullable(this.comparison);
    }

    /**
     * A human-friendly display name.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return A human-friendly display name.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * The notification settings for a trigger alert.
     * 
     */
    @Import(name="notifications", required=true)
    private Output> notifications;

    /**
     * @return The notification settings for a trigger alert.
     * 
     */
    public Output> notifications() {
        return this.notifications;
    }

    /**
     * Period of time the threshold must be exceeded to trigger the alert. Must be one of `2m`, `3m`, `5m`, `10m`, `15m`, `30m` or `1h`.
     * 
     */
    @Import(name="period")
    private @Nullable Output period;

    /**
     * @return Period of time the threshold must be exceeded to trigger the alert. Must be one of `2m`, `3m`, `5m`, `10m`, `15m`, `30m` or `1h`.
     * 
     */
    public Optional> period() {
        return Optional.ofNullable(this.period);
    }

    /**
     * The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
     * 
     */
    @Import(name="threshold")
    private @Nullable Output threshold;

    /**
     * @return The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
     * 
     */
    public Optional> threshold() {
        return Optional.ofNullable(this.threshold);
    }

    /**
     * The type of health check to perform. Must be one of `latency`, `down`, `down_global` or `ssl_expiry`.
     * 
     */
    @Import(name="type", required=true)
    private Output type;

    /**
     * @return The type of health check to perform. Must be one of `latency`, `down`, `down_global` or `ssl_expiry`.
     * 
     */
    public Output type() {
        return this.type;
    }

    private UptimeAlertArgs() {}

    private UptimeAlertArgs(UptimeAlertArgs $) {
        this.checkId = $.checkId;
        this.comparison = $.comparison;
        this.name = $.name;
        this.notifications = $.notifications;
        this.period = $.period;
        this.threshold = $.threshold;
        this.type = $.type;
    }

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

    public static final class Builder {
        private UptimeAlertArgs $;

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

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

        /**
         * @param checkId A unique identifier for a check
         * 
         * @return builder
         * 
         */
        public Builder checkId(Output checkId) {
            $.checkId = checkId;
            return this;
        }

        /**
         * @param checkId A unique identifier for a check
         * 
         * @return builder
         * 
         */
        public Builder checkId(String checkId) {
            return checkId(Output.of(checkId));
        }

        /**
         * @param comparison The comparison operator used against the alert's threshold. Must be one of `greater_than` or `less_than`.
         * 
         * @return builder
         * 
         */
        public Builder comparison(@Nullable Output comparison) {
            $.comparison = comparison;
            return this;
        }

        /**
         * @param comparison The comparison operator used against the alert's threshold. Must be one of `greater_than` or `less_than`.
         * 
         * @return builder
         * 
         */
        public Builder comparison(String comparison) {
            return comparison(Output.of(comparison));
        }

        /**
         * @param name A human-friendly display name.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name A human-friendly display name.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param notifications The notification settings for a trigger alert.
         * 
         * @return builder
         * 
         */
        public Builder notifications(Output> notifications) {
            $.notifications = notifications;
            return this;
        }

        /**
         * @param notifications The notification settings for a trigger alert.
         * 
         * @return builder
         * 
         */
        public Builder notifications(List notifications) {
            return notifications(Output.of(notifications));
        }

        /**
         * @param notifications The notification settings for a trigger alert.
         * 
         * @return builder
         * 
         */
        public Builder notifications(UptimeAlertNotificationArgs... notifications) {
            return notifications(List.of(notifications));
        }

        /**
         * @param period Period of time the threshold must be exceeded to trigger the alert. Must be one of `2m`, `3m`, `5m`, `10m`, `15m`, `30m` or `1h`.
         * 
         * @return builder
         * 
         */
        public Builder period(@Nullable Output period) {
            $.period = period;
            return this;
        }

        /**
         * @param period Period of time the threshold must be exceeded to trigger the alert. Must be one of `2m`, `3m`, `5m`, `10m`, `15m`, `30m` or `1h`.
         * 
         * @return builder
         * 
         */
        public Builder period(String period) {
            return period(Output.of(period));
        }

        /**
         * @param threshold The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
         * 
         * @return builder
         * 
         */
        public Builder threshold(@Nullable Output threshold) {
            $.threshold = threshold;
            return this;
        }

        /**
         * @param threshold The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
         * 
         * @return builder
         * 
         */
        public Builder threshold(Integer threshold) {
            return threshold(Output.of(threshold));
        }

        /**
         * @param type The type of health check to perform. Must be one of `latency`, `down`, `down_global` or `ssl_expiry`.
         * 
         * @return builder
         * 
         */
        public Builder type(Output type) {
            $.type = type;
            return this;
        }

        /**
         * @param type The type of health check to perform. Must be one of `latency`, `down`, `down_global` or `ssl_expiry`.
         * 
         * @return builder
         * 
         */
        public Builder type(String type) {
            return type(Output.of(type));
        }

        public UptimeAlertArgs build() {
            if ($.checkId == null) {
                throw new MissingRequiredPropertyException("UptimeAlertArgs", "checkId");
            }
            if ($.notifications == null) {
                throw new MissingRequiredPropertyException("UptimeAlertArgs", "notifications");
            }
            if ($.type == null) {
                throw new MissingRequiredPropertyException("UptimeAlertArgs", "type");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy