com.pulumi.awsnative.iot.kotlin.ThingGroup.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.iot.kotlin
import com.pulumi.awsnative.iot.kotlin.outputs.ThingGroupPropertiesProperties
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.iot.kotlin.outputs.ThingGroupPropertiesProperties.Companion.toKotlin as thingGroupPropertiesPropertiesToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [ThingGroup].
*/
@PulumiTagMarker
public class ThingGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: ThingGroupArgs = ThingGroupArgs()
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 ThingGroupArgsBuilder.() -> Unit) {
val builder = ThingGroupArgsBuilder()
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(): ThingGroup {
val builtJavaResource = com.pulumi.awsnative.iot.ThingGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ThingGroup(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::IoT::ThingGroup
*/
public class ThingGroup internal constructor(
override val javaResource: com.pulumi.awsnative.iot.ThingGroup,
) : KotlinCustomResource(javaResource, ThingGroupMapper) {
/**
* The thing group ARN.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The thing group ID.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The parent thing group name.
* A Dynamic Thing Group does not have `parentGroupName` defined.
*/
public val parentGroupName: Output?
get() = javaResource.parentGroupName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The dynamic thing group search query string.
* The `queryString` attribute *is* required for `CreateDynamicThingGroup` . The `queryString` attribute *is not* required for `CreateThingGroup` .
*/
public val queryString: Output?
get() = javaResource.queryString().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The thing group name.
*/
public val thingGroupName: Output?
get() = javaResource.thingGroupName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Thing group properties.
*/
public val thingGroupProperties: Output?
get() = javaResource.thingGroupProperties().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> thingGroupPropertiesPropertiesToKotlin(args0) })
}).orElse(null)
})
}
public object ThingGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iot.ThingGroup::class == javaResource::class
override fun map(javaResource: Resource): ThingGroup = ThingGroup(
javaResource as
com.pulumi.awsnative.iot.ThingGroup,
)
}
/**
* @see [ThingGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ThingGroup].
*/
public suspend fun thingGroup(name: String, block: suspend ThingGroupResourceBuilder.() -> Unit): ThingGroup {
val builder = ThingGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ThingGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun thingGroup(name: String): ThingGroup {
val builder = ThingGroupResourceBuilder()
builder.name(name)
return builder.build()
}