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

com.pulumi.awsnative.iotevents.kotlin.AlarmModel.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.iotevents.kotlin

import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmCapabilities
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmEventActions
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmRule
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmCapabilities.Companion.toKotlin as alarmModelAlarmCapabilitiesToKotlin
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmEventActions.Companion.toKotlin as alarmModelAlarmEventActionsToKotlin
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmRule.Companion.toKotlin as alarmModelAlarmRuleToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

/**
 * Builder for [AlarmModel].
 */
@PulumiTagMarker
public class AlarmModelResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: AlarmModelArgs = AlarmModelArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend AlarmModelArgsBuilder.() -> Unit) {
        val builder = AlarmModelArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): AlarmModel {
        val builtJavaResource = com.pulumi.awsnative.iotevents.AlarmModel(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return AlarmModel(builtJavaResource)
    }
}

/**
 * Represents an alarm model to monitor an ITE input attribute. You can use the alarm to get notified when the value is outside a specified range. For more information, see [Create an alarm model](https://docs.aws.amazon.com/iotevents/latest/developerguide/create-alarms.html) in the *Developer Guide*.
 */
public class AlarmModel internal constructor(
    override val javaResource: com.pulumi.awsnative.iotevents.AlarmModel,
) : KotlinCustomResource(javaResource, AlarmModelMapper) {
    /**
     * Contains the configuration information of alarm state changes.
     */
    public val alarmCapabilities: Output?
        get() = javaResource.alarmCapabilities().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> alarmModelAlarmCapabilitiesToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Contains information about one or more alarm actions.
     */
    public val alarmEventActions: Output?
        get() = javaResource.alarmEventActions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> alarmModelAlarmEventActionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The description of the alarm model.
     */
    public val alarmModelDescription: Output?
        get() = javaResource.alarmModelDescription().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the alarm model.
     */
    public val alarmModelName: Output?
        get() = javaResource.alarmModelName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Defines when your alarm is invoked.
     */
    public val alarmRule: Output
        get() = javaResource.alarmRule().applyValue({ args0 ->
            args0.let({ args0 ->
                alarmModelAlarmRuleToKotlin(args0)
            })
        })

    /**
     * An input attribute used as a key to create an alarm. ITE routes [inputs](https://docs.aws.amazon.com/iotevents/latest/apireference/API_Input.html) associated with this key to the alarm.
     */
    public val key: Output?
        get() = javaResource.key().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see [Amazon Resource Names (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General Reference*.
     */
    public val roleArn: Output
        get() = javaResource.roleArn().applyValue({ args0 -> args0 })

    /**
     * A non-negative integer that reflects the severity level of the alarm.
     */
    public val severity: Output?
        get() = javaResource.severity().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A list of key-value pairs that contain metadata for the alarm model. The tags help you manage the alarm model. For more information, see [Tagging your resources](https://docs.aws.amazon.com/iotevents/latest/developerguide/tagging-iotevents.html) in the *Developer Guide*.
     *  You can create up to 50 tags for one alarm model.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object AlarmModelMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iotevents.AlarmModel::class == javaResource::class

    override fun map(javaResource: Resource): AlarmModel = AlarmModel(
        javaResource as
            com.pulumi.awsnative.iotevents.AlarmModel,
    )
}

/**
 * @see [AlarmModel].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [AlarmModel].
 */
public suspend fun alarmModel(name: String, block: suspend AlarmModelResourceBuilder.() -> Unit): AlarmModel {
    val builder = AlarmModelResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [AlarmModel].
 * @param name The _unique_ name of the resulting resource.
 */
public fun alarmModel(name: String): AlarmModel {
    val builder = AlarmModelResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy