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

commonMain.aws.sdk.kotlin.services.mediaconvert.transform.CaptionDescriptionDocumentDeserializer.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.mediaconvert.transform

import aws.sdk.kotlin.services.mediaconvert.model.CaptionDescription
import aws.sdk.kotlin.services.mediaconvert.model.LanguageCode
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 deserializeCaptionDescriptionDocument(deserializer: Deserializer): CaptionDescription {
    val builder = CaptionDescription.Builder()
    val CAPTIONSELECTORNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("captionSelectorName"))
    val CUSTOMLANGUAGECODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("customLanguageCode"))
    val DESTINATIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("destinationSettings"))
    val LANGUAGECODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("languageCode"))
    val LANGUAGEDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("languageDescription"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CAPTIONSELECTORNAME_DESCRIPTOR)
        field(CUSTOMLANGUAGECODE_DESCRIPTOR)
        field(DESTINATIONSETTINGS_DESCRIPTOR)
        field(LANGUAGECODE_DESCRIPTOR)
        field(LANGUAGEDESCRIPTION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CAPTIONSELECTORNAME_DESCRIPTOR.index -> builder.captionSelectorName = deserializeString()
                CUSTOMLANGUAGECODE_DESCRIPTOR.index -> builder.customLanguageCode = deserializeString()
                DESTINATIONSETTINGS_DESCRIPTOR.index -> builder.destinationSettings = deserializeCaptionDestinationSettingsDocument(deserializer)
                LANGUAGECODE_DESCRIPTOR.index -> builder.languageCode = deserializeString().let { LanguageCode.fromValue(it) }
                LANGUAGEDESCRIPTION_DESCRIPTOR.index -> builder.languageDescription = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy