
com.pulumi.awsnative.iotevents.kotlin.DetectorModel.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.iotevents.kotlin
import com.pulumi.awsnative.iotevents.kotlin.enums.DetectorModelEvaluationMethod
import com.pulumi.awsnative.iotevents.kotlin.outputs.DetectorModelDefinition
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.iotevents.kotlin.enums.DetectorModelEvaluationMethod.Companion.toKotlin as detectorModelEvaluationMethodToKotlin
import com.pulumi.awsnative.iotevents.kotlin.outputs.DetectorModelDefinition.Companion.toKotlin as detectorModelDefinitionToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [DetectorModel].
*/
@PulumiTagMarker
public class DetectorModelResourceBuilder internal constructor() {
public var name: String? = null
public var args: DetectorModelArgs = DetectorModelArgs()
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 DetectorModelArgsBuilder.() -> Unit) {
val builder = DetectorModelArgsBuilder()
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(): DetectorModel {
val builtJavaResource = com.pulumi.awsnative.iotevents.DetectorModel(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return DetectorModel(builtJavaResource)
}
}
/**
* The AWS::IoTEvents::DetectorModel resource creates a detector model. You create a *detector model* (a model of your equipment or process) using *states*. For each state, you define conditional (Boolean) logic that evaluates the incoming inputs to detect significant events. When an event is detected, it can change the state or trigger custom-built or predefined actions using other AWS services. You can define additional events that trigger actions when entering or exiting a state and, optionally, when a condition is met. For more information, see [How to Use AWS IoT Events](https://docs.aws.amazon.com/iotevents/latest/developerguide/how-to-use-iotevents.html) in the *AWS IoT Events Developer Guide*.
*/
public class DetectorModel internal constructor(
override val javaResource: com.pulumi.awsnative.iotevents.DetectorModel,
) : KotlinCustomResource(javaResource, DetectorModelMapper) {
/**
* Information that defines how a detector operates.
*/
public val detectorModelDefinition: Output
get() = javaResource.detectorModelDefinition().applyValue({ args0 ->
args0.let({ args0 ->
detectorModelDefinitionToKotlin(args0)
})
})
/**
* A brief description of the detector model.
*/
public val detectorModelDescription: Output?
get() = javaResource.detectorModelDescription().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the detector model.
*/
public val detectorModelName: Output?
get() = javaResource.detectorModelName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Information about the order in which events are evaluated and how actions are executed.
*/
public val evaluationMethod: Output?
get() = javaResource.evaluationMethod().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> detectorModelEvaluationMethodToKotlin(args0) })
}).orElse(null)
})
/**
* The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
* This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
*/
public val key: Output?
get() = javaResource.key().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ARN of the role that grants permission to AWS IoT Events to perform its operations.
*/
public val roleArn: Output
get() = javaResource.roleArn().applyValue({ args0 -> args0 })
/**
* An array of key-value pairs to apply to this resource.
* For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object DetectorModelMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iotevents.DetectorModel::class == javaResource::class
override fun map(javaResource: Resource): DetectorModel = DetectorModel(
javaResource as
com.pulumi.awsnative.iotevents.DetectorModel,
)
}
/**
* @see [DetectorModel].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [DetectorModel].
*/
public suspend fun detectorModel(
name: String,
block: suspend DetectorModelResourceBuilder.() -> Unit,
): DetectorModel {
val builder = DetectorModelResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [DetectorModel].
* @param name The _unique_ name of the resulting resource.
*/
public fun detectorModel(name: String): DetectorModel {
val builder = DetectorModelResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy