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

com.pulumi.cloudflare.kotlin.NotificationPolicyArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 5.40.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.NotificationPolicyArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyEmailIntegrationArgs
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyEmailIntegrationArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyFiltersArgs
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyFiltersArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyPagerdutyIntegrationArgs
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyPagerdutyIntegrationArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyWebhooksIntegrationArgs
import com.pulumi.cloudflare.kotlin.inputs.NotificationPolicyWebhooksIntegrationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a resource, that manages a notification policy for
 * Cloudflare's products. The delivery mechanisms supported are email,
 * webhooks, and PagerDuty.
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/notificationPolicy:NotificationPolicy example /
 * ```
 * @property accountId The account identifier to target for the resource.
 * @property alertType The event type that will trigger the dispatch of a notification. See the developer documentation for descriptions of [available alert types](https://developers.cloudflare.com/fundamentals/notifications/notification-available/). Available values: `advanced_http_alert_error`, `access_custom_certificate_expiration_type`, `advanced_ddos_attack_l4_alert`, `advanced_ddos_attack_l7_alert`, `bgp_hijack_notification`, `billing_usage_alert`, `block_notification_block_removed`, `block_notification_new_block`, `block_notification_review_rejected`, `brand_protection_alert`, `brand_protection_digest`, `clickhouse_alert_fw_anomaly`, `clickhouse_alert_fw_ent_anomaly`, `custom_ssl_certificate_event_type`, `dedicated_ssl_certificate_event_type`, `dos_attack_l4`, `dos_attack_l7`, `expiring_service_token_alert`, `failing_logpush_job_disabled_alert`, `fbm_auto_advertisement`, `fbm_dosd_attack`, `fbm_volumetric_attack`, `health_check_status_notification`, `hostname_aop_custom_certificate_expiration_type`, `http_alert_edge_error`, `http_alert_origin_error`, `incident_alert`, `load_balancing_health_alert`, `load_balancing_pool_enablement_alert`, `logo_match_alert`, `magic_tunnel_health_check_event`, `maintenance_event_notification`, `mtls_certificate_store_certificate_expiration_type`, `pages_event_alert`, `radar_notification`, `real_origin_monitoring`, `scriptmonitor_alert_new_code_change_detections`, `scriptmonitor_alert_new_hosts`, `scriptmonitor_alert_new_malicious_hosts`, `scriptmonitor_alert_new_malicious_scripts`, `scriptmonitor_alert_new_malicious_url`, `scriptmonitor_alert_new_max_length_resource_url`, `scriptmonitor_alert_new_resources`, `secondary_dns_all_primaries_failing`, `secondary_dns_primaries_failing`, `secondary_dns_zone_successfully_updated`, `secondary_dns_zone_validation_warning`, `sentinel_alert`, `stream_live_notifications`, `traffic_anomalies_alert`, `tunnel_health_event`, `tunnel_update_event`, `universal_ssl_event_type`, `web_analytics_metrics_update`, `weekly_account_overview`, `workers_alert`, `zone_aop_custom_certificate_expiration_type`.
 * @property description Description of the notification policy.
 * @property emailIntegrations The email ID to which the notification should be dispatched.
 * @property enabled The status of the notification policy.
 * @property filters An optional nested block of filters that applies to the selected `alert_type`. A key-value map that specifies the type of filter and the values to match against (refer to the alert type block for available fields).
 * @property name The name of the notification policy.
 * @property pagerdutyIntegrations The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
 * @property webhooksIntegrations The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
 */
public data class NotificationPolicyArgs(
    public val accountId: Output? = null,
    public val alertType: Output? = null,
    public val description: Output? = null,
    public val emailIntegrations: Output>? = null,
    public val enabled: Output? = null,
    public val filters: Output? = null,
    public val name: Output? = null,
    public val pagerdutyIntegrations: Output>? =
        null,
    public val webhooksIntegrations: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.NotificationPolicyArgs =
        com.pulumi.cloudflare.NotificationPolicyArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .alertType(alertType?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .emailIntegrations(
                emailIntegrations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .filters(filters?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .pagerdutyIntegrations(
                pagerdutyIntegrations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .webhooksIntegrations(
                webhooksIntegrations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            ).build()
}

/**
 * Builder for [NotificationPolicyArgs].
 */
@PulumiTagMarker
public class NotificationPolicyArgsBuilder internal constructor() {
    private var accountId: Output? = null

    private var alertType: Output? = null

    private var description: Output? = null

    private var emailIntegrations: Output>? = null

    private var enabled: Output? = null

    private var filters: Output? = null

    private var name: Output? = null

    private var pagerdutyIntegrations: Output>? =
        null

    private var webhooksIntegrations: Output>? = null

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("gfunnxhtoulegptc")
    public suspend fun accountId(`value`: Output) {
        this.accountId = value
    }

    /**
     * @param value The event type that will trigger the dispatch of a notification. See the developer documentation for descriptions of [available alert types](https://developers.cloudflare.com/fundamentals/notifications/notification-available/). Available values: `advanced_http_alert_error`, `access_custom_certificate_expiration_type`, `advanced_ddos_attack_l4_alert`, `advanced_ddos_attack_l7_alert`, `bgp_hijack_notification`, `billing_usage_alert`, `block_notification_block_removed`, `block_notification_new_block`, `block_notification_review_rejected`, `brand_protection_alert`, `brand_protection_digest`, `clickhouse_alert_fw_anomaly`, `clickhouse_alert_fw_ent_anomaly`, `custom_ssl_certificate_event_type`, `dedicated_ssl_certificate_event_type`, `dos_attack_l4`, `dos_attack_l7`, `expiring_service_token_alert`, `failing_logpush_job_disabled_alert`, `fbm_auto_advertisement`, `fbm_dosd_attack`, `fbm_volumetric_attack`, `health_check_status_notification`, `hostname_aop_custom_certificate_expiration_type`, `http_alert_edge_error`, `http_alert_origin_error`, `incident_alert`, `load_balancing_health_alert`, `load_balancing_pool_enablement_alert`, `logo_match_alert`, `magic_tunnel_health_check_event`, `maintenance_event_notification`, `mtls_certificate_store_certificate_expiration_type`, `pages_event_alert`, `radar_notification`, `real_origin_monitoring`, `scriptmonitor_alert_new_code_change_detections`, `scriptmonitor_alert_new_hosts`, `scriptmonitor_alert_new_malicious_hosts`, `scriptmonitor_alert_new_malicious_scripts`, `scriptmonitor_alert_new_malicious_url`, `scriptmonitor_alert_new_max_length_resource_url`, `scriptmonitor_alert_new_resources`, `secondary_dns_all_primaries_failing`, `secondary_dns_primaries_failing`, `secondary_dns_zone_successfully_updated`, `secondary_dns_zone_validation_warning`, `sentinel_alert`, `stream_live_notifications`, `traffic_anomalies_alert`, `tunnel_health_event`, `tunnel_update_event`, `universal_ssl_event_type`, `web_analytics_metrics_update`, `weekly_account_overview`, `workers_alert`, `zone_aop_custom_certificate_expiration_type`.
     */
    @JvmName("gxjifruknxbesink")
    public suspend fun alertType(`value`: Output) {
        this.alertType = value
    }

    /**
     * @param value Description of the notification policy.
     */
    @JvmName("fawbuftjgghghcjl")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The email ID to which the notification should be dispatched.
     */
    @JvmName("oqslgufthgpdqnjk")
    public suspend fun emailIntegrations(`value`: Output>) {
        this.emailIntegrations = value
    }

    @JvmName("hnammmqkpbuiecqa")
    public suspend fun emailIntegrations(vararg values: Output) {
        this.emailIntegrations = Output.all(values.asList())
    }

    /**
     * @param values The email ID to which the notification should be dispatched.
     */
    @JvmName("oekgvwvnwwkgkkkv")
    public suspend fun emailIntegrations(values: List>) {
        this.emailIntegrations = Output.all(values)
    }

    /**
     * @param value The status of the notification policy.
     */
    @JvmName("rbpgllfwonxcscvi")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value An optional nested block of filters that applies to the selected `alert_type`. A key-value map that specifies the type of filter and the values to match against (refer to the alert type block for available fields).
     */
    @JvmName("wnihftnnbrpqyarm")
    public suspend fun filters(`value`: Output) {
        this.filters = value
    }

    /**
     * @param value The name of the notification policy.
     */
    @JvmName("bnmsnexjvbbhtmhy")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
     */
    @JvmName("smwmnbutdplmixlj")
    public suspend fun pagerdutyIntegrations(`value`: Output>) {
        this.pagerdutyIntegrations = value
    }

    @JvmName("fwtyptttgkacotie")
    public suspend fun pagerdutyIntegrations(vararg values: Output) {
        this.pagerdutyIntegrations = Output.all(values.asList())
    }

    /**
     * @param values The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
     */
    @JvmName("ejlvosbhsddchnre")
    public suspend fun pagerdutyIntegrations(values: List>) {
        this.pagerdutyIntegrations = Output.all(values)
    }

    /**
     * @param value The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
     */
    @JvmName("tgdqqijfwfpfyuna")
    public suspend fun webhooksIntegrations(`value`: Output>) {
        this.webhooksIntegrations = value
    }

    @JvmName("okbkfsitbseeqcvq")
    public suspend fun webhooksIntegrations(vararg values: Output) {
        this.webhooksIntegrations = Output.all(values.asList())
    }

    /**
     * @param values The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
     */
    @JvmName("sfaolrqqtqaptblo")
    public suspend fun webhooksIntegrations(values: List>) {
        this.webhooksIntegrations = Output.all(values)
    }

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("hgtxbhbrobokfmin")
    public suspend fun accountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountId = mapped
    }

    /**
     * @param value The event type that will trigger the dispatch of a notification. See the developer documentation for descriptions of [available alert types](https://developers.cloudflare.com/fundamentals/notifications/notification-available/). Available values: `advanced_http_alert_error`, `access_custom_certificate_expiration_type`, `advanced_ddos_attack_l4_alert`, `advanced_ddos_attack_l7_alert`, `bgp_hijack_notification`, `billing_usage_alert`, `block_notification_block_removed`, `block_notification_new_block`, `block_notification_review_rejected`, `brand_protection_alert`, `brand_protection_digest`, `clickhouse_alert_fw_anomaly`, `clickhouse_alert_fw_ent_anomaly`, `custom_ssl_certificate_event_type`, `dedicated_ssl_certificate_event_type`, `dos_attack_l4`, `dos_attack_l7`, `expiring_service_token_alert`, `failing_logpush_job_disabled_alert`, `fbm_auto_advertisement`, `fbm_dosd_attack`, `fbm_volumetric_attack`, `health_check_status_notification`, `hostname_aop_custom_certificate_expiration_type`, `http_alert_edge_error`, `http_alert_origin_error`, `incident_alert`, `load_balancing_health_alert`, `load_balancing_pool_enablement_alert`, `logo_match_alert`, `magic_tunnel_health_check_event`, `maintenance_event_notification`, `mtls_certificate_store_certificate_expiration_type`, `pages_event_alert`, `radar_notification`, `real_origin_monitoring`, `scriptmonitor_alert_new_code_change_detections`, `scriptmonitor_alert_new_hosts`, `scriptmonitor_alert_new_malicious_hosts`, `scriptmonitor_alert_new_malicious_scripts`, `scriptmonitor_alert_new_malicious_url`, `scriptmonitor_alert_new_max_length_resource_url`, `scriptmonitor_alert_new_resources`, `secondary_dns_all_primaries_failing`, `secondary_dns_primaries_failing`, `secondary_dns_zone_successfully_updated`, `secondary_dns_zone_validation_warning`, `sentinel_alert`, `stream_live_notifications`, `traffic_anomalies_alert`, `tunnel_health_event`, `tunnel_update_event`, `universal_ssl_event_type`, `web_analytics_metrics_update`, `weekly_account_overview`, `workers_alert`, `zone_aop_custom_certificate_expiration_type`.
     */
    @JvmName("xjxwicrmihxmlsgu")
    public suspend fun alertType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.alertType = mapped
    }

    /**
     * @param value Description of the notification policy.
     */
    @JvmName("kgrybstfgeylunjo")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The email ID to which the notification should be dispatched.
     */
    @JvmName("qwljsasdiwfruvwi")
    public suspend fun emailIntegrations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailIntegrations = mapped
    }

    /**
     * @param argument The email ID to which the notification should be dispatched.
     */
    @JvmName("uomdopcqyahbiujm")
    public suspend fun emailIntegrations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NotificationPolicyEmailIntegrationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.emailIntegrations = mapped
    }

    /**
     * @param argument The email ID to which the notification should be dispatched.
     */
    @JvmName("kdfvebdjllntlkga")
    public suspend fun emailIntegrations(vararg argument: suspend NotificationPolicyEmailIntegrationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NotificationPolicyEmailIntegrationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.emailIntegrations = mapped
    }

    /**
     * @param argument The email ID to which the notification should be dispatched.
     */
    @JvmName("motoqlpmprlfhpxk")
    public suspend fun emailIntegrations(argument: suspend NotificationPolicyEmailIntegrationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            NotificationPolicyEmailIntegrationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.emailIntegrations = mapped
    }

    /**
     * @param values The email ID to which the notification should be dispatched.
     */
    @JvmName("ldvwfgdtpemyhhsl")
    public suspend fun emailIntegrations(vararg values: NotificationPolicyEmailIntegrationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.emailIntegrations = mapped
    }

    /**
     * @param value The status of the notification policy.
     */
    @JvmName("jyngvilouvelslfh")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value An optional nested block of filters that applies to the selected `alert_type`. A key-value map that specifies the type of filter and the values to match against (refer to the alert type block for available fields).
     */
    @JvmName("eegmvhynhpbffskm")
    public suspend fun filters(`value`: NotificationPolicyFiltersArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filters = mapped
    }

    /**
     * @param argument An optional nested block of filters that applies to the selected `alert_type`. A key-value map that specifies the type of filter and the values to match against (refer to the alert type block for available fields).
     */
    @JvmName("ustpmrctxweahxsh")
    public suspend fun filters(argument: suspend NotificationPolicyFiltersArgsBuilder.() -> Unit) {
        val toBeMapped = NotificationPolicyFiltersArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.filters = mapped
    }

    /**
     * @param value The name of the notification policy.
     */
    @JvmName("cxejxrctfooyfysi")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
     */
    @JvmName("csjxshoeyfcqlkdk")
    public suspend fun pagerdutyIntegrations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pagerdutyIntegrations = mapped
    }

    /**
     * @param argument The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
     */
    @JvmName("bwajjplttgphdrwh")
    public suspend fun pagerdutyIntegrations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NotificationPolicyPagerdutyIntegrationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.pagerdutyIntegrations = mapped
    }

    /**
     * @param argument The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
     */
    @JvmName("rqgyfyywfuxqpkdt")
    public suspend fun pagerdutyIntegrations(vararg argument: suspend NotificationPolicyPagerdutyIntegrationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NotificationPolicyPagerdutyIntegrationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.pagerdutyIntegrations = mapped
    }

    /**
     * @param argument The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
     */
    @JvmName("swlvcvuqloxtocxb")
    public suspend fun pagerdutyIntegrations(argument: suspend NotificationPolicyPagerdutyIntegrationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            NotificationPolicyPagerdutyIntegrationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.pagerdutyIntegrations = mapped
    }

    /**
     * @param values The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.
     */
    @JvmName("wqeolxycuffxshjv")
    public suspend fun pagerdutyIntegrations(vararg values: NotificationPolicyPagerdutyIntegrationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.pagerdutyIntegrations = mapped
    }

    /**
     * @param value The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
     */
    @JvmName("igqsraoixompmrei")
    public suspend fun webhooksIntegrations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.webhooksIntegrations = mapped
    }

    /**
     * @param argument The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
     */
    @JvmName("njwcbjcncsrdigwl")
    public suspend fun webhooksIntegrations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NotificationPolicyWebhooksIntegrationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.webhooksIntegrations = mapped
    }

    /**
     * @param argument The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
     */
    @JvmName("rgigygxovvkphija")
    public suspend fun webhooksIntegrations(vararg argument: suspend NotificationPolicyWebhooksIntegrationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NotificationPolicyWebhooksIntegrationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.webhooksIntegrations = mapped
    }

    /**
     * @param argument The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
     */
    @JvmName("epncpufxuvuutvds")
    public suspend fun webhooksIntegrations(argument: suspend NotificationPolicyWebhooksIntegrationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            NotificationPolicyWebhooksIntegrationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.webhooksIntegrations = mapped
    }

    /**
     * @param values The unique ID of a configured webhooks endpoint to which the notification should be dispatched.
     */
    @JvmName("jmdvvcruaqpegdxq")
    public suspend fun webhooksIntegrations(vararg values: NotificationPolicyWebhooksIntegrationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.webhooksIntegrations = mapped
    }

    internal fun build(): NotificationPolicyArgs = NotificationPolicyArgs(
        accountId = accountId,
        alertType = alertType,
        description = description,
        emailIntegrations = emailIntegrations,
        enabled = enabled,
        filters = filters,
        name = name,
        pagerdutyIntegrations = pagerdutyIntegrations,
        webhooksIntegrations = webhooksIntegrations,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy