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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.amplifyuibuilder.kotlin

import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentBindingPropertiesValue
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentChild
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentDataConfiguration
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentEvent
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentProperty
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentVariant
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.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentBindingPropertiesValue.Companion.toKotlin as componentBindingPropertiesValueToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentChild.Companion.toKotlin as componentChildToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentDataConfiguration.Companion.toKotlin as componentDataConfigurationToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentEvent.Companion.toKotlin as componentEventToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentProperty.Companion.toKotlin as componentPropertyToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.ComponentVariant.Companion.toKotlin as componentVariantToKotlin

/**
 * 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.amplifyuibuilder.Component(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Component(builtJavaResource)
    }
}

/**
 * Definition of AWS::AmplifyUIBuilder::Component Resource Type
 */
public class Component internal constructor(
    override val javaResource: com.pulumi.awsnative.amplifyuibuilder.Component,
) : KotlinCustomResource(javaResource, ComponentMapper) {
    /**
     * The unique ID of the Amplify app associated with the component.
     */
    public val appId: Output?
        get() = javaResource.appId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

    /**
     * The information to connect a component's properties to data at runtime. You can't specify `tags` as a valid property for `bindingProperties` .
     */
    public val bindingProperties: Output>?
        get() = javaResource.bindingProperties().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            componentBindingPropertiesValueToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * A list of the component's `ComponentChild` instances.
     */
    public val children: Output>?
        get() = javaResource.children().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> componentChildToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The data binding configuration for the component's properties. Use this for a collection component. You can't specify `tags` as a valid property for `collectionProperties` .
     */
    public val collectionProperties: Output>?
        get() = javaResource.collectionProperties().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            componentDataConfigurationToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * The type of the component. This can be an Amplify custom UI component or another custom component.
     */
    public val componentType: Output?
        get() = javaResource.componentType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The time that the component was created.
     */
    public val createdAt: Output
        get() = javaResource.createdAt().applyValue({ args0 -> args0 })

    /**
     * The name of the backend environment that is a part of the Amplify app.
     */
    public val environmentName: Output?
        get() = javaResource.environmentName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Describes the events that can be raised on the component. Use for the workflow feature in Amplify Studio that allows you to bind events and actions to components.
     */
    public val events: Output>?
        get() = javaResource.events().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            componentEventToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * The time that the component was modified.
     */
    public val modifiedAt: Output
        get() = javaResource.modifiedAt().applyValue({ args0 -> args0 })

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

    /**
     * Describes the component's properties that can be overriden in a customized instance of the component. You can't specify `tags` as a valid property for `overrides` .
     */
    public val overrides: Output>?
        get() = javaResource.overrides().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Describes the component's properties. You can't specify `tags` as a valid property for `properties` .
     */
    public val properties: Output>?
        get() = javaResource.properties().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            componentPropertyToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * The schema version of the component when it was imported.
     */
    public val schemaVersion: Output?
        get() = javaResource.schemaVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The unique ID of the component in its original source system, such as Figma.
     */
    public val sourceId: Output?
        get() = javaResource.sourceId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * One or more key-value pairs to use when tagging 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)
        })

    /**
     * A list of the component's variants. A variant is a unique style configuration of a main component.
     */
    public val variants: Output>?
        get() = javaResource.variants().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> componentVariantToKotlin(args0) })
                })
            }).orElse(null)
        })
}

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

    override fun map(javaResource: Resource): Component = Component(
        javaResource as
            com.pulumi.awsnative.amplifyuibuilder.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