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

commonMain.aws.sdk.kotlin.services.mediaconvert.serde.VideoOverlayInputDocumentDeserializer.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.InputTimecodeSource
import aws.sdk.kotlin.services.mediaconvert.model.VideoOverlayInput
import aws.sdk.kotlin.services.mediaconvert.model.VideoOverlayInputClipping
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

internal fun deserializeVideoOverlayInputDocument(deserializer: Deserializer): VideoOverlayInput {
    val builder = VideoOverlayInput.Builder()
    val FILEINPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("fileInput"))
    val INPUTCLIPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("inputClippings"))
    val TIMECODESOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("timecodeSource"))
    val TIMECODESTART_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("timecodeStart"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(FILEINPUT_DESCRIPTOR)
        field(INPUTCLIPPINGS_DESCRIPTOR)
        field(TIMECODESOURCE_DESCRIPTOR)
        field(TIMECODESTART_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                FILEINPUT_DESCRIPTOR.index -> builder.fileInput = deserializeString()
                INPUTCLIPPINGS_DESCRIPTOR.index -> builder.inputClippings =
                    deserializer.deserializeList(INPUTCLIPPINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeVideoOverlayInputClippingDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                TIMECODESOURCE_DESCRIPTOR.index -> builder.timecodeSource = deserializeString().let { InputTimecodeSource.fromValue(it) }
                TIMECODESTART_DESCRIPTOR.index -> builder.timecodeStart = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy