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

commonMain.aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionEvent.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lexruntimev2.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Event sent from Amazon Lex V2 to indicate to the client application should stop playback of audio. For example, if the client is playing a prompt that asks for the user's telephone number, the user might start to say the phone number before the prompt is complete. Amazon Lex V2 sends this event to the client application to indicate that the user is responding and that Amazon Lex V2 is processing their input.
 */
public class PlaybackInterruptionEvent private constructor(builder: Builder) {
    /**
     * The identifier of the event that contained the audio, DTMF, or text that caused the interruption.
     */
    public val causedByEventId: kotlin.String? = builder.causedByEventId
    /**
     * A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form `RESPONSE-N`, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
     */
    public val eventId: kotlin.String? = builder.eventId
    /**
     * Indicates the type of user input that Amazon Lex V2 detected.
     */
    public val eventReason: aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionReason? = builder.eventReason

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

    override fun toString(): kotlin.String = buildString {
        append("PlaybackInterruptionEvent(")
        append("causedByEventId=$causedByEventId,")
        append("eventId=$eventId,")
        append("eventReason=$eventReason")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = causedByEventId?.hashCode() ?: 0
        result = 31 * result + (eventId?.hashCode() ?: 0)
        result = 31 * result + (eventReason?.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 PlaybackInterruptionEvent

        if (causedByEventId != other.causedByEventId) return false
        if (eventId != other.eventId) return false
        if (eventReason != other.eventReason) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The identifier of the event that contained the audio, DTMF, or text that caused the interruption.
         */
        public var causedByEventId: kotlin.String? = null
        /**
         * A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form `RESPONSE-N`, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
         */
        public var eventId: kotlin.String? = null
        /**
         * Indicates the type of user input that Amazon Lex V2 detected.
         */
        public var eventReason: aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionReason? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionEvent) : this() {
            this.causedByEventId = x.causedByEventId
            this.eventId = x.eventId
            this.eventReason = x.eventReason
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy