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

com.pulumi.awsnative.imagebuilder.kotlin.Component.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.imagebuilder.kotlin

import com.pulumi.awsnative.imagebuilder.kotlin.enums.ComponentPlatform
import com.pulumi.awsnative.imagebuilder.kotlin.enums.ComponentType
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 kotlin.collections.Map
import com.pulumi.awsnative.imagebuilder.kotlin.enums.ComponentPlatform.Companion.toKotlin as componentPlatformToKotlin
import com.pulumi.awsnative.imagebuilder.kotlin.enums.ComponentType.Companion.toKotlin as componentTypeToKotlin

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

    public var args: ComponentArgs = ComponentArgs()

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

/**
 * Resource schema for AWS::ImageBuilder::Component
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class Component internal constructor(
    override val javaResource: com.pulumi.awsnative.imagebuilder.Component,
) : KotlinCustomResource(javaResource, ComponentMapper) {
    /**
     * The Amazon Resource Name (ARN) of the component.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

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

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

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

    /**
     * The encryption status of the component.
     */
    public val encrypted: Output
        get() = javaResource.encrypted().applyValue({ args0 -> args0 })

    /**
     * The KMS key identifier used to encrypt the component.
     */
    public val kmsKeyId: Output?
        get() = javaResource.kmsKeyId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

    /**
     * The platform of the component.
     */
    public val platform: Output
        get() = javaResource.platform().applyValue({ args0 ->
            args0.let({ args0 ->
                componentPlatformToKotlin(args0)
            })
        })

    /**
     * The operating system (OS) version supported by the component.
     */
    public val supportedOsVersions: Output>?
        get() = javaResource.supportedOsVersions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The tags associated with the component.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The type of the component denotes whether the component is used to build the image or only to test it.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 ->
            args0.let({ args0 ->
                componentTypeToKotlin(args0)
            })
        })

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

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

public object ComponentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.imagebuilder.Component::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy