com.pulumi.awsnative.macie.kotlin.Session.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.macie.kotlin
import com.pulumi.awsnative.macie.kotlin.enums.SessionFindingPublishingFrequency
import com.pulumi.awsnative.macie.kotlin.enums.SessionStatus
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 com.pulumi.awsnative.macie.kotlin.enums.SessionFindingPublishingFrequency.Companion.toKotlin as sessionFindingPublishingFrequencyToKotlin
import com.pulumi.awsnative.macie.kotlin.enums.SessionStatus.Companion.toKotlin as sessionStatusToKotlin
/**
* Builder for [Session].
*/
@PulumiTagMarker
public class SessionResourceBuilder internal constructor() {
public var name: String? = null
public var args: SessionArgs = SessionArgs()
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 SessionArgsBuilder.() -> Unit) {
val builder = SessionArgsBuilder()
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(): Session {
val builtJavaResource = com.pulumi.awsnative.macie.Session(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Session(builtJavaResource)
}
}
/**
* The AWS::Macie::Session resource specifies a new Amazon Macie session. A session is an object that represents the Amazon Macie service. A session is required for Amazon Macie to become operational.
*/
public class Session internal constructor(
override val javaResource: com.pulumi.awsnative.macie.Session,
) : KotlinCustomResource(javaResource, SessionMapper) {
/**
* AWS account ID of customer
*/
public val awsAccountId: Output
get() = javaResource.awsAccountId().applyValue({ args0 -> args0 })
/**
* A enumeration value that specifies how frequently finding updates are published.
*/
public val findingPublishingFrequency: Output?
get() = javaResource.findingPublishingFrequency().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> sessionFindingPublishingFrequencyToKotlin(args0) })
}).orElse(null)
})
/**
* Service role used by Macie
*/
public val serviceRole: Output
get() = javaResource.serviceRole().applyValue({ args0 -> args0 })
/**
* A enumeration value that specifies the status of the Macie Session.
*/
public val status: Output?
get() = javaResource.status().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
sessionStatusToKotlin(args0)
})
}).orElse(null)
})
}
public object SessionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.macie.Session::class == javaResource::class
override fun map(javaResource: Resource): Session = Session(
javaResource as
com.pulumi.awsnative.macie.Session,
)
}
/**
* @see [Session].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Session].
*/
public suspend fun session(name: String, block: suspend SessionResourceBuilder.() -> Unit): Session {
val builder = SessionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Session].
* @param name The _unique_ name of the resulting resource.
*/
public fun session(name: String): Session {
val builder = SessionResourceBuilder()
builder.name(name)
return builder.build()
}