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

commonMain.aws.sdk.kotlin.services.transcribe.transform.CallAnalyticsJobSettingsDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.transcribe.transform

import aws.sdk.kotlin.services.transcribe.model.CallAnalyticsJobSettings
import aws.sdk.kotlin.services.transcribe.model.LanguageCode
import aws.sdk.kotlin.services.transcribe.model.LanguageIdSettings
import aws.sdk.kotlin.services.transcribe.model.VocabularyFilterMethod
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
import kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf

internal fun deserializeCallAnalyticsJobSettingsDocument(deserializer: Deserializer): CallAnalyticsJobSettings {
    val builder = CallAnalyticsJobSettings.Builder()
    val CONTENTREDACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ContentRedaction"))
    val LANGUAGEIDSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("LanguageIdSettings"))
    val LANGUAGEMODELNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LanguageModelName"))
    val LANGUAGEOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("LanguageOptions"))
    val VOCABULARYFILTERMETHOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VocabularyFilterMethod"))
    val VOCABULARYFILTERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VocabularyFilterName"))
    val VOCABULARYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VocabularyName"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CONTENTREDACTION_DESCRIPTOR)
        field(LANGUAGEIDSETTINGS_DESCRIPTOR)
        field(LANGUAGEMODELNAME_DESCRIPTOR)
        field(LANGUAGEOPTIONS_DESCRIPTOR)
        field(VOCABULARYFILTERMETHOD_DESCRIPTOR)
        field(VOCABULARYFILTERNAME_DESCRIPTOR)
        field(VOCABULARYNAME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CONTENTREDACTION_DESCRIPTOR.index -> builder.contentRedaction = deserializeContentRedactionDocument(deserializer)
                LANGUAGEIDSETTINGS_DESCRIPTOR.index -> builder.languageIdSettings =
                    deserializer.deserializeMap(LANGUAGEIDSETTINGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeLanguageIdSettingsDocument(deserializer) } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                LANGUAGEMODELNAME_DESCRIPTOR.index -> builder.languageModelName = deserializeString()
                LANGUAGEOPTIONS_DESCRIPTOR.index -> builder.languageOptions =
                    deserializer.deserializeList(LANGUAGEOPTIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { LanguageCode.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                VOCABULARYFILTERMETHOD_DESCRIPTOR.index -> builder.vocabularyFilterMethod = deserializeString().let { VocabularyFilterMethod.fromValue(it) }
                VOCABULARYFILTERNAME_DESCRIPTOR.index -> builder.vocabularyFilterName = deserializeString()
                VOCABULARYNAME_DESCRIPTOR.index -> builder.vocabularyName = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy