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

commonMain.aws.sdk.kotlin.services.qapps.model.TextInputCardInput.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.qapps.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The input shape for defining a text input card in an Amazon Q App.
 */
public class TextInputCardInput private constructor(builder: Builder) {
    /**
     * The default value to pre-populate in the text input field.
     */
    public val defaultValue: kotlin.String? = builder.defaultValue
    /**
     * The unique identifier of the text input card.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The placeholder text to display in the text input field.
     */
    public val placeholder: kotlin.String? = builder.placeholder
    /**
     * The title or label of the text input card.
     */
    public val title: kotlin.String = requireNotNull(builder.title) { "A non-null value must be provided for title" }
    /**
     * The type of the card.
     */
    public val type: aws.sdk.kotlin.services.qapps.model.CardType = builder.type

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.qapps.model.TextInputCardInput = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("TextInputCardInput(")
        append("defaultValue=$defaultValue,")
        append("id=$id,")
        append("placeholder=$placeholder,")
        append("title=$title,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = defaultValue?.hashCode() ?: 0
        result = 31 * result + (id.hashCode())
        result = 31 * result + (placeholder?.hashCode() ?: 0)
        result = 31 * result + (title.hashCode())
        result = 31 * result + (type.hashCode())
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as TextInputCardInput

        if (defaultValue != other.defaultValue) return false
        if (id != other.id) return false
        if (placeholder != other.placeholder) return false
        if (title != other.title) return false
        if (type != other.type) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.qapps.model.TextInputCardInput = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The default value to pre-populate in the text input field.
         */
        public var defaultValue: kotlin.String? = null
        /**
         * The unique identifier of the text input card.
         */
        public var id: kotlin.String? = null
        /**
         * The placeholder text to display in the text input field.
         */
        public var placeholder: kotlin.String? = null
        /**
         * The title or label of the text input card.
         */
        public var title: kotlin.String? = null
        /**
         * The type of the card.
         */
        public var type: aws.sdk.kotlin.services.qapps.model.CardType = aws.sdk.kotlin.services.qapps.model.CardType.fromValue("text-input")

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qapps.model.TextInputCardInput) : this() {
            this.defaultValue = x.defaultValue
            this.id = x.id
            this.placeholder = x.placeholder
            this.title = x.title
            this.type = x.type
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.qapps.model.TextInputCardInput = TextInputCardInput(this)

        internal fun correctErrors(): Builder {
            if (id == null) id = ""
            if (title == null) title = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy