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

com.pulumi.awsnative.codestarnotifications.kotlin.NotificationRuleArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.codestarnotifications.kotlin

import com.pulumi.awsnative.codestarnotifications.NotificationRuleArgs.builder
import com.pulumi.awsnative.codestarnotifications.kotlin.enums.NotificationRuleDetailType
import com.pulumi.awsnative.codestarnotifications.kotlin.enums.NotificationRuleStatus
import com.pulumi.awsnative.codestarnotifications.kotlin.inputs.NotificationRuleTargetArgs
import com.pulumi.awsnative.codestarnotifications.kotlin.inputs.NotificationRuleTargetArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Resource Type definition for AWS::CodeStarNotifications::NotificationRule
 * @property createdBy The name or email alias of the person who created the notification rule.
 * @property detailType The level of detail to include in the notifications for this resource. `BASIC` will include only the contents of the event as it would appear in Amazon CloudWatch. `FULL` will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.
 * @property eventTypeId The event type associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
 * @property eventTypeIds A list of event types associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
 * @property name The name for the notification rule. Notification rule names must be unique in your AWS account .
 * @property resource The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in AWS CodePipeline , repositories in AWS CodeCommit , and build projects in AWS CodeBuild .
 * @property status The status of the notification rule. The default value is `ENABLED` . If the status is set to `DISABLED` , notifications aren't sent for the notification rule.
 * @property tags A list of tags to apply to this notification rule. Key names cannot start with " `aws` ".
 * @property targetAddress The Amazon Resource Name (ARN) of the Amazon SNS topic or AWS Chatbot client.
 * @property targets A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
 */
public data class NotificationRuleArgs(
    public val createdBy: Output? = null,
    public val detailType: Output? = null,
    public val eventTypeId: Output? = null,
    public val eventTypeIds: Output>? = null,
    public val name: Output? = null,
    public val resource: Output? = null,
    public val status: Output? = null,
    public val tags: Output>? = null,
    public val targetAddress: Output? = null,
    public val targets: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.codestarnotifications.NotificationRuleArgs =
        com.pulumi.awsnative.codestarnotifications.NotificationRuleArgs.builder()
            .createdBy(createdBy?.applyValue({ args0 -> args0 }))
            .detailType(detailType?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .eventTypeId(eventTypeId?.applyValue({ args0 -> args0 }))
            .eventTypeIds(eventTypeIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resource(resource?.applyValue({ args0 -> args0 }))
            .status(status?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .targetAddress(targetAddress?.applyValue({ args0 -> args0 }))
            .targets(
                targets?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [NotificationRuleArgs].
 */
@PulumiTagMarker
public class NotificationRuleArgsBuilder internal constructor() {
    private var createdBy: Output? = null

    private var detailType: Output? = null

    private var eventTypeId: Output? = null

    private var eventTypeIds: Output>? = null

    private var name: Output? = null

    private var resource: Output? = null

    private var status: Output? = null

    private var tags: Output>? = null

    private var targetAddress: Output? = null

    private var targets: Output>? = null

    /**
     * @param value The name or email alias of the person who created the notification rule.
     */
    @JvmName("vhnvouuxmsvqcsmv")
    public suspend fun createdBy(`value`: Output) {
        this.createdBy = value
    }

    /**
     * @param value The level of detail to include in the notifications for this resource. `BASIC` will include only the contents of the event as it would appear in Amazon CloudWatch. `FULL` will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.
     */
    @JvmName("hygpqoeugkuagfbk")
    public suspend fun detailType(`value`: Output) {
        this.detailType = value
    }

    /**
     * @param value The event type associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
     */
    @JvmName("rlibqmcjwyaydwfh")
    public suspend fun eventTypeId(`value`: Output) {
        this.eventTypeId = value
    }

    /**
     * @param value A list of event types associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
     */
    @JvmName("aakwtrmxfmidyloc")
    public suspend fun eventTypeIds(`value`: Output>) {
        this.eventTypeIds = value
    }

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

    /**
     * @param values A list of event types associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
     */
    @JvmName("sfxixmkmiyljlliy")
    public suspend fun eventTypeIds(values: List>) {
        this.eventTypeIds = Output.all(values)
    }

    /**
     * @param value The name for the notification rule. Notification rule names must be unique in your AWS account .
     */
    @JvmName("quswjgalauqjfbum")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in AWS CodePipeline , repositories in AWS CodeCommit , and build projects in AWS CodeBuild .
     */
    @JvmName("atfndtgghjmwkkld")
    public suspend fun resource(`value`: Output) {
        this.resource = value
    }

    /**
     * @param value The status of the notification rule. The default value is `ENABLED` . If the status is set to `DISABLED` , notifications aren't sent for the notification rule.
     */
    @JvmName("xdnafdcjiebgjuen")
    public suspend fun status(`value`: Output) {
        this.status = value
    }

    /**
     * @param value A list of tags to apply to this notification rule. Key names cannot start with " `aws` ".
     */
    @JvmName("cyidgaheynboqekc")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the Amazon SNS topic or AWS Chatbot client.
     */
    @JvmName("msddlagbmnjlboat")
    public suspend fun targetAddress(`value`: Output) {
        this.targetAddress = value
    }

    /**
     * @param value A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
     */
    @JvmName("elpnnqnbprygtaqa")
    public suspend fun targets(`value`: Output>) {
        this.targets = value
    }

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

    /**
     * @param values A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
     */
    @JvmName("xvvcasckckksdpsx")
    public suspend fun targets(values: List>) {
        this.targets = Output.all(values)
    }

    /**
     * @param value The name or email alias of the person who created the notification rule.
     */
    @JvmName("ynjbmcubjfrobttf")
    public suspend fun createdBy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.createdBy = mapped
    }

    /**
     * @param value The level of detail to include in the notifications for this resource. `BASIC` will include only the contents of the event as it would appear in Amazon CloudWatch. `FULL` will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.
     */
    @JvmName("jtcrcxfxqnvmhleh")
    public suspend fun detailType(`value`: NotificationRuleDetailType?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.detailType = mapped
    }

    /**
     * @param value The event type associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
     */
    @JvmName("iyjlbvmwovjabnvh")
    public suspend fun eventTypeId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventTypeId = mapped
    }

    /**
     * @param value A list of event types associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
     */
    @JvmName("hoofacwyeugjujmd")
    public suspend fun eventTypeIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventTypeIds = mapped
    }

    /**
     * @param values A list of event types associated with this notification rule. For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .
     */
    @JvmName("fbnxvmixqcsphebu")
    public suspend fun eventTypeIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.eventTypeIds = mapped
    }

    /**
     * @param value The name for the notification rule. Notification rule names must be unique in your AWS account .
     */
    @JvmName("giqynhwrlmymqfof")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in AWS CodePipeline , repositories in AWS CodeCommit , and build projects in AWS CodeBuild .
     */
    @JvmName("jttiyiapnldcblfl")
    public suspend fun resource(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resource = mapped
    }

    /**
     * @param value The status of the notification rule. The default value is `ENABLED` . If the status is set to `DISABLED` , notifications aren't sent for the notification rule.
     */
    @JvmName("dbbygxsemjbdxunx")
    public suspend fun status(`value`: NotificationRuleStatus?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value A list of tags to apply to this notification rule. Key names cannot start with " `aws` ".
     */
    @JvmName("opthdkklbkjuqeco")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A list of tags to apply to this notification rule. Key names cannot start with " `aws` ".
     */
    @JvmName("rsgqxkwnalhbapko")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the Amazon SNS topic or AWS Chatbot client.
     */
    @JvmName("fhuetxkujstsvrsx")
    public suspend fun targetAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetAddress = mapped
    }

    /**
     * @param value A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
     */
    @JvmName("kknusvbglcvknqbw")
    public suspend fun targets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targets = mapped
    }

    /**
     * @param argument A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
     */
    @JvmName("habeyrdkofsjamrx")
    public suspend fun targets(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NotificationRuleTargetArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.targets = mapped
    }

    /**
     * @param argument A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
     */
    @JvmName("qrcbmsvudsgriium")
    public suspend fun targets(vararg argument: suspend NotificationRuleTargetArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NotificationRuleTargetArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.targets = mapped
    }

    /**
     * @param argument A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
     */
    @JvmName("yueiaqpecptohcdi")
    public suspend fun targets(argument: suspend NotificationRuleTargetArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(NotificationRuleTargetArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.targets = mapped
    }

    /**
     * @param values A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
     */
    @JvmName("snvviaddmjaepoee")
    public suspend fun targets(vararg values: NotificationRuleTargetArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targets = mapped
    }

    internal fun build(): NotificationRuleArgs = NotificationRuleArgs(
        createdBy = createdBy,
        detailType = detailType,
        eventTypeId = eventTypeId,
        eventTypeIds = eventTypeIds,
        name = name,
        resource = resource,
        status = status,
        tags = tags,
        targetAddress = targetAddress,
        targets = targets,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy