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

commonMain.aws.sdk.kotlin.services.mediaconvert.serde.TimecodeConfigDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.mediaconvert.serde

import aws.sdk.kotlin.services.mediaconvert.model.TimecodeConfig
import aws.sdk.kotlin.services.mediaconvert.model.TimecodeSource
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 deserializeTimecodeConfigDocument(deserializer: Deserializer): TimecodeConfig {
    val builder = TimecodeConfig.Builder()
    val ANCHOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("anchor"))
    val SOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("source"))
    val START_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("start"))
    val TIMESTAMPOFFSET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("timestampOffset"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ANCHOR_DESCRIPTOR)
        field(SOURCE_DESCRIPTOR)
        field(START_DESCRIPTOR)
        field(TIMESTAMPOFFSET_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ANCHOR_DESCRIPTOR.index -> builder.anchor = deserializeString()
                SOURCE_DESCRIPTOR.index -> builder.source = deserializeString().let { TimecodeSource.fromValue(it) }
                START_DESCRIPTOR.index -> builder.start = deserializeString()
                TIMESTAMPOFFSET_DESCRIPTOR.index -> builder.timestampOffset = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy