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

commonMain.aws.sdk.kotlin.services.transcribestreaming.serde.ItemDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.transcribestreaming.serde

import aws.sdk.kotlin.services.transcribestreaming.model.Item
import aws.sdk.kotlin.services.transcribestreaming.model.ItemType
import aws.smithy.kotlin.runtime.serde.Deserializer
import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct

internal fun deserializeItemDocument(deserializer: Deserializer): Item {
    val builder = Item.Builder()
    val CONFIDENCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("Confidence"))
    val CONTENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Content"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("EndTime"))
    val SPEAKER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Speaker"))
    val STABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Stable"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("StartTime"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Type"))
    val VOCABULARYFILTERMATCH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("VocabularyFilterMatch"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CONFIDENCE_DESCRIPTOR)
        field(CONTENT_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(SPEAKER_DESCRIPTOR)
        field(STABLE_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
        field(VOCABULARYFILTERMATCH_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CONFIDENCE_DESCRIPTOR.index -> builder.confidence = deserializeDouble()
                CONTENT_DESCRIPTOR.index -> builder.content = deserializeString()
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeDouble()
                SPEAKER_DESCRIPTOR.index -> builder.speaker = deserializeString()
                STABLE_DESCRIPTOR.index -> builder.stable = deserializeBoolean()
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeDouble()
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { ItemType.fromValue(it) }
                VOCABULARYFILTERMATCH_DESCRIPTOR.index -> builder.vocabularyFilterMatch = deserializeBoolean()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy