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

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

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

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



/**
 * Represents a stream of events between Amazon Lex V2 and your application.
 */
public sealed class StartConversationResponseEventStream {
    /**
     * An event sent from Amazon Lex V2 to your client application containing audio to play to the user.
     */
    public data class AudioResponseEvent(val value: aws.sdk.kotlin.services.lexruntimev2.model.AudioResponseEvent) : aws.sdk.kotlin.services.lexruntimev2.model.StartConversationResponseEventStream() {
    }

    /**
     * Event that Amazon Lex V2 sends to indicate that the stream is still open between the client application and Amazon Lex V2
     */
    public data class HeartbeatEvent(val value: aws.sdk.kotlin.services.lexruntimev2.model.HeartbeatEvent) : aws.sdk.kotlin.services.lexruntimev2.model.StartConversationResponseEventStream() {
    }

    /**
     * Event sent from Amazon Lex V2 to the client application containing the current state of the conversation between the user and Amazon Lex V2.
     */
    public data class IntentResultEvent(val value: aws.sdk.kotlin.services.lexruntimev2.model.IntentResultEvent) : aws.sdk.kotlin.services.lexruntimev2.model.StartConversationResponseEventStream() {
    }

    /**
     * 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 data class PlaybackInterruptionEvent(val value: aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionEvent) : aws.sdk.kotlin.services.lexruntimev2.model.StartConversationResponseEventStream() {
    }

    /**
     * The event sent from Amazon Lex V2 to your application with text to present to the user.
     */
    public data class TextResponseEvent(val value: aws.sdk.kotlin.services.lexruntimev2.model.TextResponseEvent) : aws.sdk.kotlin.services.lexruntimev2.model.StartConversationResponseEventStream() {
    }

    /**
     * Event sent from Amazon Lex V2 to your client application that contains a transcript of voice audio.
     */
    public data class TranscriptEvent(val value: aws.sdk.kotlin.services.lexruntimev2.model.TranscriptEvent) : aws.sdk.kotlin.services.lexruntimev2.model.StartConversationResponseEventStream() {
    }

    public object SdkUnknown : aws.sdk.kotlin.services.lexruntimev2.model.StartConversationResponseEventStream() {
    }

    /**
     * Casts this [StartConversationResponseEventStream] as a [AudioResponseEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.AudioResponseEvent] value. Throws an exception if the [StartConversationResponseEventStream] is not a
     * [AudioResponseEvent].
     */
    public fun asAudioResponseEvent(): aws.sdk.kotlin.services.lexruntimev2.model.AudioResponseEvent = (this as StartConversationResponseEventStream.AudioResponseEvent).value

    /**
     * Casts this [StartConversationResponseEventStream] as a [AudioResponseEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.AudioResponseEvent] value. Returns null if the [StartConversationResponseEventStream] is not a [AudioResponseEvent].
     */
    public fun asAudioResponseEventOrNull(): aws.sdk.kotlin.services.lexruntimev2.model.AudioResponseEvent? = (this as? StartConversationResponseEventStream.AudioResponseEvent)?.value

    /**
     * Casts this [StartConversationResponseEventStream] as a [HeartbeatEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.HeartbeatEvent] value. Throws an exception if the [StartConversationResponseEventStream] is not a
     * [HeartbeatEvent].
     */
    public fun asHeartbeatEvent(): aws.sdk.kotlin.services.lexruntimev2.model.HeartbeatEvent = (this as StartConversationResponseEventStream.HeartbeatEvent).value

    /**
     * Casts this [StartConversationResponseEventStream] as a [HeartbeatEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.HeartbeatEvent] value. Returns null if the [StartConversationResponseEventStream] is not a [HeartbeatEvent].
     */
    public fun asHeartbeatEventOrNull(): aws.sdk.kotlin.services.lexruntimev2.model.HeartbeatEvent? = (this as? StartConversationResponseEventStream.HeartbeatEvent)?.value

    /**
     * Casts this [StartConversationResponseEventStream] as a [IntentResultEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.IntentResultEvent] value. Throws an exception if the [StartConversationResponseEventStream] is not a
     * [IntentResultEvent].
     */
    public fun asIntentResultEvent(): aws.sdk.kotlin.services.lexruntimev2.model.IntentResultEvent = (this as StartConversationResponseEventStream.IntentResultEvent).value

    /**
     * Casts this [StartConversationResponseEventStream] as a [IntentResultEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.IntentResultEvent] value. Returns null if the [StartConversationResponseEventStream] is not a [IntentResultEvent].
     */
    public fun asIntentResultEventOrNull(): aws.sdk.kotlin.services.lexruntimev2.model.IntentResultEvent? = (this as? StartConversationResponseEventStream.IntentResultEvent)?.value

    /**
     * Casts this [StartConversationResponseEventStream] as a [PlaybackInterruptionEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionEvent] value. Throws an exception if the [StartConversationResponseEventStream] is not a
     * [PlaybackInterruptionEvent].
     */
    public fun asPlaybackInterruptionEvent(): aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionEvent = (this as StartConversationResponseEventStream.PlaybackInterruptionEvent).value

    /**
     * Casts this [StartConversationResponseEventStream] as a [PlaybackInterruptionEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionEvent] value. Returns null if the [StartConversationResponseEventStream] is not a [PlaybackInterruptionEvent].
     */
    public fun asPlaybackInterruptionEventOrNull(): aws.sdk.kotlin.services.lexruntimev2.model.PlaybackInterruptionEvent? = (this as? StartConversationResponseEventStream.PlaybackInterruptionEvent)?.value

    /**
     * Casts this [StartConversationResponseEventStream] as a [TextResponseEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.TextResponseEvent] value. Throws an exception if the [StartConversationResponseEventStream] is not a
     * [TextResponseEvent].
     */
    public fun asTextResponseEvent(): aws.sdk.kotlin.services.lexruntimev2.model.TextResponseEvent = (this as StartConversationResponseEventStream.TextResponseEvent).value

    /**
     * Casts this [StartConversationResponseEventStream] as a [TextResponseEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.TextResponseEvent] value. Returns null if the [StartConversationResponseEventStream] is not a [TextResponseEvent].
     */
    public fun asTextResponseEventOrNull(): aws.sdk.kotlin.services.lexruntimev2.model.TextResponseEvent? = (this as? StartConversationResponseEventStream.TextResponseEvent)?.value

    /**
     * Casts this [StartConversationResponseEventStream] as a [TranscriptEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.TranscriptEvent] value. Throws an exception if the [StartConversationResponseEventStream] is not a
     * [TranscriptEvent].
     */
    public fun asTranscriptEvent(): aws.sdk.kotlin.services.lexruntimev2.model.TranscriptEvent = (this as StartConversationResponseEventStream.TranscriptEvent).value

    /**
     * Casts this [StartConversationResponseEventStream] as a [TranscriptEvent] and retrieves its [aws.sdk.kotlin.services.lexruntimev2.model.TranscriptEvent] value. Returns null if the [StartConversationResponseEventStream] is not a [TranscriptEvent].
     */
    public fun asTranscriptEventOrNull(): aws.sdk.kotlin.services.lexruntimev2.model.TranscriptEvent? = (this as? StartConversationResponseEventStream.TranscriptEvent)?.value
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy