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

com.pulumi.awsnative.amplifyuibuilder.kotlin.Form.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.enums.FormActionType
import com.pulumi.awsnative.amplifyuibuilder.kotlin.enums.FormLabelDecorator
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormCta
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormDataTypeConfig
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormFieldConfig
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormSectionalElement
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormStyle
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.amplifyuibuilder.kotlin.enums.FormActionType.Companion.toKotlin as formActionTypeToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.enums.FormLabelDecorator.Companion.toKotlin as formLabelDecoratorToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormCta.Companion.toKotlin as formCtaToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormDataTypeConfig.Companion.toKotlin as formDataTypeConfigToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormFieldConfig.Companion.toKotlin as formFieldConfigToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormSectionalElement.Companion.toKotlin as formSectionalElementToKotlin
import com.pulumi.awsnative.amplifyuibuilder.kotlin.outputs.FormStyle.Companion.toKotlin as formStyleToKotlin

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

    public var args: FormArgs = FormArgs()

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

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

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

    /**
     * The `FormCTA` object that stores the call to action configuration for the form.
     */
    public val cta: Output?
        get() = javaResource.cta().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    formCtaToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The type of data source to use to create the form.
     */
    public val dataType: Output?
        get() = javaResource.dataType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    formDataTypeConfigToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * 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)
        })

    /**
     * The configuration information for the form's fields.
     */
    public val fields: Output>?
        get() = javaResource.fields().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            formFieldConfigToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies whether to perform a create or update action on the form.
     */
    public val formActionType: Output?
        get() = javaResource.formActionType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> formActionTypeToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Specifies an icon or decoration to display on the form.
     */
    public val labelDecorator: Output?
        get() = javaResource.labelDecorator().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> formLabelDecoratorToKotlin(args0) })
            }).orElse(null)
        })

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

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

    /**
     * The configuration information for the visual helper elements for the form. These elements are not associated with any data.
     */
    public val sectionalElements: Output>?
        get() = javaResource.sectionalElements().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            formSectionalElementToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * The configuration for the form's style.
     */
    public val style: Output?
        get() = javaResource.style().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    formStyleToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * One or more key-value pairs to use when tagging the form data.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

public object FormMapper : ResourceMapper
{ override fun supportsMappingOfType(javaResource: Resource): Boolean = com.pulumi.awsnative.amplifyuibuilder.Form::class == javaResource::class override fun map(javaResource: Resource): Form = Form( javaResource as com.pulumi.awsnative.amplifyuibuilder.Form, ) } /** * @see [Form]. * @param name The _unique_ name of the resulting resource. * @param block Builder for [Form]. */ public suspend fun form(name: String, block: suspend FormResourceBuilder.() -> Unit): Form { val builder = FormResourceBuilder() builder.name(name) block(builder) return builder.build() } /** * @see [Form]. * @param name The _unique_ name of the resulting resource. */ public fun form(name: String): Form { val builder = FormResourceBuilder() builder.name(name) return builder.build() }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy