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

com.pulumi.awsnative.iottwinmaker.kotlin.Entity.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.iottwinmaker.kotlin

import com.pulumi.awsnative.iottwinmaker.kotlin.outputs.EntityComponent
import com.pulumi.awsnative.iottwinmaker.kotlin.outputs.EntityCompositeComponent
import com.pulumi.awsnative.iottwinmaker.kotlin.outputs.EntityStatus
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.Map
import com.pulumi.awsnative.iottwinmaker.kotlin.outputs.EntityComponent.Companion.toKotlin as entityComponentToKotlin
import com.pulumi.awsnative.iottwinmaker.kotlin.outputs.EntityCompositeComponent.Companion.toKotlin as entityCompositeComponentToKotlin
import com.pulumi.awsnative.iottwinmaker.kotlin.outputs.EntityStatus.Companion.toKotlin as entityStatusToKotlin

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

    public var args: EntityArgs = EntityArgs()

    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 EntityArgsBuilder.() -> Unit) {
        val builder = EntityArgsBuilder()
        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(): Entity {
        val builtJavaResource = com.pulumi.awsnative.iottwinmaker.Entity(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Entity(builtJavaResource)
    }
}

/**
 * Resource schema for AWS::IoTTwinMaker::Entity
 */
public class Entity internal constructor(
    override val javaResource: com.pulumi.awsnative.iottwinmaker.Entity,
) : KotlinCustomResource(javaResource, EntityMapper) {
    /**
     * The ARN of the entity.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * A map that sets information about a component type.
     */
    public val components: Output>?
        get() = javaResource.components().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            entityComponentToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * A map that sets information about a composite component.
     */
    public val compositeComponents: Output>?
        get() = javaResource.compositeComponents().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            entityCompositeComponentToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * The date and time when the entity was created.
     */
    public val creationDateTime: Output
        get() = javaResource.creationDateTime().applyValue({ args0 -> args0 })

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

    /**
     * The ID of the entity.
     */
    public val entityId: Output?
        get() = javaResource.entityId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The name of the entity.
     */
    public val entityName: Output
        get() = javaResource.entityName().applyValue({ args0 -> args0 })

    /**
     * A Boolean value that specifies whether the entity has child entities or not.
     */
    public val hasChildEntities: Output
        get() = javaResource.hasChildEntities().applyValue({ args0 -> args0 })

    /**
     * The ID of the parent entity.
     */
    public val parentEntityId: Output?
        get() = javaResource.parentEntityId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The current status of the entity.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 ->
            args0.let({ args0 ->
                entityStatusToKotlin(args0)
            })
        })

    /**
     * A key-value pair to associate with a resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The last date and time when the entity was updated.
     */
    public val updateDateTime: Output
        get() = javaResource.updateDateTime().applyValue({ args0 -> args0 })

    /**
     * The ID of the workspace.
     */
    public val workspaceId: Output
        get() = javaResource.workspaceId().applyValue({ args0 -> args0 })
}

public object EntityMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iottwinmaker.Entity::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy