com.pulumi.awsnative.frauddetector.kotlin.Detector.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.frauddetector.kotlin
import com.pulumi.awsnative.frauddetector.kotlin.enums.DetectorRuleExecutionMode
import com.pulumi.awsnative.frauddetector.kotlin.enums.DetectorVersionStatus
import com.pulumi.awsnative.frauddetector.kotlin.outputs.DetectorEventType
import com.pulumi.awsnative.frauddetector.kotlin.outputs.DetectorModel
import com.pulumi.awsnative.frauddetector.kotlin.outputs.DetectorRule
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.frauddetector.kotlin.enums.DetectorRuleExecutionMode.Companion.toKotlin as detectorRuleExecutionModeToKotlin
import com.pulumi.awsnative.frauddetector.kotlin.enums.DetectorVersionStatus.Companion.toKotlin as detectorVersionStatusToKotlin
import com.pulumi.awsnative.frauddetector.kotlin.outputs.DetectorEventType.Companion.toKotlin as detectorEventTypeToKotlin
import com.pulumi.awsnative.frauddetector.kotlin.outputs.DetectorModel.Companion.toKotlin as detectorModelToKotlin
import com.pulumi.awsnative.frauddetector.kotlin.outputs.DetectorRule.Companion.toKotlin as detectorRuleToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [Detector].
*/
@PulumiTagMarker
public class DetectorResourceBuilder internal constructor() {
public var name: String? = null
public var args: DetectorArgs = DetectorArgs()
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 DetectorArgsBuilder.() -> Unit) {
val builder = DetectorArgsBuilder()
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(): Detector {
val builtJavaResource = com.pulumi.awsnative.frauddetector.Detector(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Detector(builtJavaResource)
}
}
/**
* A resource schema for a Detector in Amazon Fraud Detector.
*/
public class Detector internal constructor(
override val javaResource: com.pulumi.awsnative.frauddetector.Detector,
) : KotlinCustomResource(javaResource, DetectorMapper) {
/**
* The ARN of the detector.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The models to associate with this detector.
*/
public val associatedModels: Output>?
get() = javaResource.associatedModels().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> detectorModelToKotlin(args0) }) })
}).orElse(null)
})
/**
* The time when the detector was created.
*/
public val createdTime: Output
get() = javaResource.createdTime().applyValue({ args0 -> args0 })
/**
* The description of the detector.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the detector
*/
public val detectorId: Output
get() = javaResource.detectorId().applyValue({ args0 -> args0 })
/**
* The active version ID of the detector
*/
public val detectorVersionId: Output
get() = javaResource.detectorVersionId().applyValue({ args0 -> args0 })
/**
* The desired detector version status for the detector
*/
public val detectorVersionStatus: Output?
get() = javaResource.detectorVersionStatus().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> detectorVersionStatusToKotlin(args0) })
}).orElse(null)
})
/**
* The event type to associate this detector with.
*/
public val eventType: Output
get() = javaResource.eventType().applyValue({ args0 ->
args0.let({ args0 ->
detectorEventTypeToKotlin(args0)
})
})
/**
* The time when the detector was last updated.
*/
public val lastUpdatedTime: Output
get() = javaResource.lastUpdatedTime().applyValue({ args0 -> args0 })
/**
* The rule execution mode for the rules included in the detector version.
* Valid values: `FIRST_MATCHED | ALL_MATCHED` Default value: `FIRST_MATCHED`
* You can define and edit the rule mode at the detector version level, when it is in draft status.
* If you specify `FIRST_MATCHED` , Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.
* If you specifiy `ALL_MATCHED` , Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules.
*/
public val ruleExecutionMode: Output?
get() = javaResource.ruleExecutionMode().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> detectorRuleExecutionModeToKotlin(args0) })
}).orElse(null)
})
/**
* The rules to include in the detector version.
*/
public val rules: Output>
get() = javaResource.rules().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
detectorRuleToKotlin(args0)
})
})
})
/**
* Tags associated with this detector.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object DetectorMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.frauddetector.Detector::class == javaResource::class
override fun map(javaResource: Resource): Detector = Detector(
javaResource as
com.pulumi.awsnative.frauddetector.Detector,
)
}
/**
* @see [Detector].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Detector].
*/
public suspend fun detector(name: String, block: suspend DetectorResourceBuilder.() -> Unit): Detector {
val builder = DetectorResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Detector].
* @param name The _unique_ name of the resulting resource.
*/
public fun detector(name: String): Detector {
val builder = DetectorResourceBuilder()
builder.name(name)
return builder.build()
}