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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.monitoring.inputs.AlertPolicyAlertStrategyArgs;
import com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionArgs;
import com.pulumi.gcp.monitoring.inputs.AlertPolicyDocumentationArgs;
import java.lang.Boolean;
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 AlertPolicyArgs extends com.pulumi.resources.ResourceArgs {

    public static final AlertPolicyArgs Empty = new AlertPolicyArgs();

    /**
     * Control over how this alert policy&#39;s notification channels are notified.
     * Structure is documented below.
     * 
     */
    @Import(name="alertStrategy")
    private @Nullable Output<AlertPolicyAlertStrategyArgs> alertStrategy;

    /**
     * @return Control over how this alert policy&#39;s notification channels are notified.
     * Structure is documented below.
     * 
     */
    public Optional<Output<AlertPolicyAlertStrategyArgs>> alertStrategy() {
        return Optional.ofNullable(this.alertStrategy);
    }

    /**
     * How to combine the results of multiple conditions to
     * determine if an incident should be opened.
     * Possible values are: `AND`, `OR`, `AND_WITH_MATCHING_RESOURCE`.
     * 
     */
    @Import(name="combiner", required=true)
    private Output<String> combiner;

    /**
     * @return How to combine the results of multiple conditions to
     * determine if an incident should be opened.
     * Possible values are: `AND`, `OR`, `AND_WITH_MATCHING_RESOURCE`.
     * 
     */
    public Output<String> combiner() {
        return this.combiner;
    }

    /**
     * A list of conditions for the policy. The conditions are combined by
     * AND or OR according to the combiner field. If the combined conditions
     * evaluate to true, then an incident is created. A policy can have from
     * one to six conditions.
     * Structure is documented below.
     * 
     */
    @Import(name="conditions", required=true)
    private Output<List<AlertPolicyConditionArgs>> conditions;

    /**
     * @return A list of conditions for the policy. The conditions are combined by
     * AND or OR according to the combiner field. If the combined conditions
     * evaluate to true, then an incident is created. A policy can have from
     * one to six conditions.
     * Structure is documented below.
     * 
     */
    public Output<List<AlertPolicyConditionArgs>> conditions() {
        return this.conditions;
    }

    /**
     * A short name or phrase used to identify the policy in
     * dashboards, notifications, and incidents. To avoid confusion, don&#39;t use
     * the same display name for multiple policies in the same project. The
     * name is limited to 512 Unicode characters.
     * 
     */
    @Import(name="displayName", required=true)
    private Output<String> displayName;

    /**
     * @return A short name or phrase used to identify the policy in
     * dashboards, notifications, and incidents. To avoid confusion, don&#39;t use
     * the same display name for multiple policies in the same project. The
     * name is limited to 512 Unicode characters.
     * 
     */
    public Output<String> displayName() {
        return this.displayName;
    }

    /**
     * Documentation that is included with notifications and incidents related
     * to this policy. Best practice is for the documentation to include information
     * to help responders understand, mitigate, escalate, and correct the underlying
     * problems detected by the alerting policy. Notification channels that have
     * limited capacity might not show this documentation.
     * Structure is documented below.
     * 
     */
    @Import(name="documentation")
    private @Nullable Output<AlertPolicyDocumentationArgs> documentation;

    /**
     * @return Documentation that is included with notifications and incidents related
     * to this policy. Best practice is for the documentation to include information
     * to help responders understand, mitigate, escalate, and correct the underlying
     * problems detected by the alerting policy. Notification channels that have
     * limited capacity might not show this documentation.
     * Structure is documented below.
     * 
     */
    public Optional<Output<AlertPolicyDocumentationArgs>> documentation() {
        return Optional.ofNullable(this.documentation);
    }

    /**
     * Whether or not the policy is enabled. The default is true.
     * 
     */
    @Import(name="enabled")
    private @Nullable Output<Boolean> enabled;

    /**
     * @return Whether or not the policy is enabled. The default is true.
     * 
     */
    public Optional<Output<Boolean>> enabled() {
        return Optional.ofNullable(this.enabled);
    }

    /**
     * Identifies the notification channels to which notifications should be
     * sent when incidents are opened or closed or when new violations occur
     * on an already opened incident. Each element of this array corresponds
     * to the name field in each of the NotificationChannel objects that are
     * returned from the notificationChannels.list method. The syntax of the
     * entries in this field is
     * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`
     * 
     */
    @Import(name="notificationChannels")
    private @Nullable Output<List<String>> notificationChannels;

    /**
     * @return Identifies the notification channels to which notifications should be
     * sent when incidents are opened or closed or when new violations occur
     * on an already opened incident. Each element of this array corresponds
     * to the name field in each of the NotificationChannel objects that are
     * returned from the notificationChannels.list method. The syntax of the
     * entries in this field is
     * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`
     * 
     */
    public Optional<Output<List<String>>> notificationChannels() {
        return Optional.ofNullable(this.notificationChannels);
    }

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    @Import(name="project")
    private @Nullable Output<String> project;

    /**
     * @return The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    public Optional<Output<String>> project() {
        return Optional.ofNullable(this.project);
    }

    /**
     * This field is intended to be used for organizing and identifying the AlertPolicy
     * objects.The field can contain up to 64 entries. Each key and value is limited
     * to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
     * can contain only lowercase letters, numerals, underscores, and dashes. Keys
     * must begin with a letter.
     * 
     */
    @Import(name="userLabels")
    private @Nullable Output<Map<String,String>> userLabels;

    /**
     * @return This field is intended to be used for organizing and identifying the AlertPolicy
     * objects.The field can contain up to 64 entries. Each key and value is limited
     * to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
     * can contain only lowercase letters, numerals, underscores, and dashes. Keys
     * must begin with a letter.
     * 
     */
    public Optional<Output<Map<String,String>>> userLabels() {
        return Optional.ofNullable(this.userLabels);
    }

    private AlertPolicyArgs() {}

    private AlertPolicyArgs(AlertPolicyArgs $) {
        this.alertStrategy = $.alertStrategy;
        this.combiner = $.combiner;
        this.conditions = $.conditions;
        this.displayName = $.displayName;
        this.documentation = $.documentation;
        this.enabled = $.enabled;
        this.notificationChannels = $.notificationChannels;
        this.project = $.project;
        this.userLabels = $.userLabels;
    }

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

    public static final class Builder {
        private AlertPolicyArgs $;

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

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

        /**
         * @param alertStrategy Control over how this alert policy&#39;s notification channels are notified.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder alertStrategy(@Nullable Output<AlertPolicyAlertStrategyArgs> alertStrategy) {
            $.alertStrategy = alertStrategy;
            return this;
        }

        /**
         * @param alertStrategy Control over how this alert policy&#39;s notification channels are notified.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder alertStrategy(AlertPolicyAlertStrategyArgs alertStrategy) {
            return alertStrategy(Output.of(alertStrategy));
        }

        /**
         * @param combiner How to combine the results of multiple conditions to
         * determine if an incident should be opened.
         * Possible values are: `AND`, `OR`, `AND_WITH_MATCHING_RESOURCE`.
         * 
         * @return builder
         * 
         */
        public Builder combiner(Output<String> combiner) {
            $.combiner = combiner;
            return this;
        }

        /**
         * @param combiner How to combine the results of multiple conditions to
         * determine if an incident should be opened.
         * Possible values are: `AND`, `OR`, `AND_WITH_MATCHING_RESOURCE`.
         * 
         * @return builder
         * 
         */
        public Builder combiner(String combiner) {
            return combiner(Output.of(combiner));
        }

        /**
         * @param conditions A list of conditions for the policy. The conditions are combined by
         * AND or OR according to the combiner field. If the combined conditions
         * evaluate to true, then an incident is created. A policy can have from
         * one to six conditions.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder conditions(Output<List<AlertPolicyConditionArgs>> conditions) {
            $.conditions = conditions;
            return this;
        }

        /**
         * @param conditions A list of conditions for the policy. The conditions are combined by
         * AND or OR according to the combiner field. If the combined conditions
         * evaluate to true, then an incident is created. A policy can have from
         * one to six conditions.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder conditions(List<AlertPolicyConditionArgs> conditions) {
            return conditions(Output.of(conditions));
        }

        /**
         * @param conditions A list of conditions for the policy. The conditions are combined by
         * AND or OR according to the combiner field. If the combined conditions
         * evaluate to true, then an incident is created. A policy can have from
         * one to six conditions.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder conditions(AlertPolicyConditionArgs... conditions) {
            return conditions(List.of(conditions));
        }

        /**
         * @param displayName A short name or phrase used to identify the policy in
         * dashboards, notifications, and incidents. To avoid confusion, don&#39;t use
         * the same display name for multiple policies in the same project. The
         * name is limited to 512 Unicode characters.
         * 
         * @return builder
         * 
         */
        public Builder displayName(Output<String> displayName) {
            $.displayName = displayName;
            return this;
        }

        /**
         * @param displayName A short name or phrase used to identify the policy in
         * dashboards, notifications, and incidents. To avoid confusion, don&#39;t use
         * the same display name for multiple policies in the same project. The
         * name is limited to 512 Unicode characters.
         * 
         * @return builder
         * 
         */
        public Builder displayName(String displayName) {
            return displayName(Output.of(displayName));
        }

        /**
         * @param documentation Documentation that is included with notifications and incidents related
         * to this policy. Best practice is for the documentation to include information
         * to help responders understand, mitigate, escalate, and correct the underlying
         * problems detected by the alerting policy. Notification channels that have
         * limited capacity might not show this documentation.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder documentation(@Nullable Output<AlertPolicyDocumentationArgs> documentation) {
            $.documentation = documentation;
            return this;
        }

        /**
         * @param documentation Documentation that is included with notifications and incidents related
         * to this policy. Best practice is for the documentation to include information
         * to help responders understand, mitigate, escalate, and correct the underlying
         * problems detected by the alerting policy. Notification channels that have
         * limited capacity might not show this documentation.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder documentation(AlertPolicyDocumentationArgs documentation) {
            return documentation(Output.of(documentation));
        }

        /**
         * @param enabled Whether or not the policy is enabled. The default is true.
         * 
         * @return builder
         * 
         */
        public Builder enabled(@Nullable Output<Boolean> enabled) {
            $.enabled = enabled;
            return this;
        }

        /**
         * @param enabled Whether or not the policy is enabled. The default is true.
         * 
         * @return builder
         * 
         */
        public Builder enabled(Boolean enabled) {
            return enabled(Output.of(enabled));
        }

        /**
         * @param notificationChannels Identifies the notification channels to which notifications should be
         * sent when incidents are opened or closed or when new violations occur
         * on an already opened incident. Each element of this array corresponds
         * to the name field in each of the NotificationChannel objects that are
         * returned from the notificationChannels.list method. The syntax of the
         * entries in this field is
         * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`
         * 
         * @return builder
         * 
         */
        public Builder notificationChannels(@Nullable Output<List<String>> notificationChannels) {
            $.notificationChannels = notificationChannels;
            return this;
        }

        /**
         * @param notificationChannels Identifies the notification channels to which notifications should be
         * sent when incidents are opened or closed or when new violations occur
         * on an already opened incident. Each element of this array corresponds
         * to the name field in each of the NotificationChannel objects that are
         * returned from the notificationChannels.list method. The syntax of the
         * entries in this field is
         * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`
         * 
         * @return builder
         * 
         */
        public Builder notificationChannels(List<String> notificationChannels) {
            return notificationChannels(Output.of(notificationChannels));
        }

        /**
         * @param notificationChannels Identifies the notification channels to which notifications should be
         * sent when incidents are opened or closed or when new violations occur
         * on an already opened incident. Each element of this array corresponds
         * to the name field in each of the NotificationChannel objects that are
         * returned from the notificationChannels.list method. The syntax of the
         * entries in this field is
         * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`
         * 
         * @return builder
         * 
         */
        public Builder notificationChannels(String... notificationChannels) {
            return notificationChannels(List.of(notificationChannels));
        }

        /**
         * @param project The ID of the project in which the resource belongs.
         * If it is not provided, the provider project is used.
         * 
         * @return builder
         * 
         */
        public Builder project(@Nullable Output<String> project) {
            $.project = project;
            return this;
        }

        /**
         * @param project The ID of the project in which the resource belongs.
         * If it is not provided, the provider project is used.
         * 
         * @return builder
         * 
         */
        public Builder project(String project) {
            return project(Output.of(project));
        }

        /**
         * @param userLabels This field is intended to be used for organizing and identifying the AlertPolicy
         * objects.The field can contain up to 64 entries. Each key and value is limited
         * to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
         * can contain only lowercase letters, numerals, underscores, and dashes. Keys
         * must begin with a letter.
         * 
         * @return builder
         * 
         */
        public Builder userLabels(@Nullable Output<Map<String,String>> userLabels) {
            $.userLabels = userLabels;
            return this;
        }

        /**
         * @param userLabels This field is intended to be used for organizing and identifying the AlertPolicy
         * objects.The field can contain up to 64 entries. Each key and value is limited
         * to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
         * can contain only lowercase letters, numerals, underscores, and dashes. Keys
         * must begin with a letter.
         * 
         * @return builder
         * 
         */
        public Builder userLabels(Map<String,String> userLabels) {
            return userLabels(Output.of(userLabels));
        }

        public AlertPolicyArgs build() {
            $.combiner = Objects.requireNonNull($.combiner, "expected parameter 'combiner' to be non-null");
            $.conditions = Objects.requireNonNull($.conditions, "expected parameter 'conditions' to be non-null");
            $.displayName = Objects.requireNonNull($.displayName, "expected parameter 'displayName' to be non-null");
            return $;
        }
    }

}
