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

commonMain.aws.sdk.kotlin.services.qapps.model.CardStatus.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 current status and value of a card in an active Amazon Q App session.
 */
public class CardStatus private constructor(builder: Builder) {
    /**
     * The current state of the card.
     */
    public val currentState: aws.sdk.kotlin.services.qapps.model.ExecutionStatus = requireNotNull(builder.currentState) { "A non-null value must be provided for currentState" }
    /**
     * The current value or result associated with the card.
     */
    public val currentValue: kotlin.String = requireNotNull(builder.currentValue) { "A non-null value must be provided for currentValue" }
    /**
     * A list of previous submissions, if the card is a form card.
     */
    public val submissions: List? = builder.submissions

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

    override fun toString(): kotlin.String = buildString {
        append("CardStatus(")
        append("currentState=$currentState,")
        append("currentValue=$currentValue,")
        append("submissions=$submissions")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = currentState.hashCode()
        result = 31 * result + (currentValue.hashCode())
        result = 31 * result + (submissions?.hashCode() ?: 0)
        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 CardStatus

        if (currentState != other.currentState) return false
        if (currentValue != other.currentValue) return false
        if (submissions != other.submissions) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The current state of the card.
         */
        public var currentState: aws.sdk.kotlin.services.qapps.model.ExecutionStatus? = null
        /**
         * The current value or result associated with the card.
         */
        public var currentValue: kotlin.String? = null
        /**
         * A list of previous submissions, if the card is a form card.
         */
        public var submissions: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qapps.model.CardStatus) : this() {
            this.currentState = x.currentState
            this.currentValue = x.currentValue
            this.submissions = x.submissions
        }

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

        internal fun correctErrors(): Builder {
            if (currentState == null) currentState = ExecutionStatus.SdkUnknown("no value provided")
            if (currentValue == null) currentValue = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy