commonMain.aws.sdk.kotlin.services.mediaconvert.serde.InputDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mediaconvert-jvm Show documentation
Show all versions of mediaconvert-jvm Show documentation
The AWS SDK for Kotlin client for MediaConvert
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.mediaconvert.serde
import aws.sdk.kotlin.services.mediaconvert.model.AdvancedInputFilter
import aws.sdk.kotlin.services.mediaconvert.model.AudioSelector
import aws.sdk.kotlin.services.mediaconvert.model.AudioSelectorGroup
import aws.sdk.kotlin.services.mediaconvert.model.CaptionSelector
import aws.sdk.kotlin.services.mediaconvert.model.Input
import aws.sdk.kotlin.services.mediaconvert.model.InputClipping
import aws.sdk.kotlin.services.mediaconvert.model.InputDeblockFilter
import aws.sdk.kotlin.services.mediaconvert.model.InputDenoiseFilter
import aws.sdk.kotlin.services.mediaconvert.model.InputFilterEnable
import aws.sdk.kotlin.services.mediaconvert.model.InputPsiControl
import aws.sdk.kotlin.services.mediaconvert.model.InputScanType
import aws.sdk.kotlin.services.mediaconvert.model.InputTimecodeSource
import aws.sdk.kotlin.services.mediaconvert.model.VideoOverlay
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 deserializeInputDocument(deserializer: Deserializer): Input {
val builder = Input.Builder()
val ADVANCEDINPUTFILTER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("advancedInputFilter"))
val ADVANCEDINPUTFILTERSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("advancedInputFilterSettings"))
val AUDIOSELECTORGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("audioSelectorGroups"))
val AUDIOSELECTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("audioSelectors"))
val CAPTIONSELECTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("captionSelectors"))
val CROP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("crop"))
val DEBLOCKFILTER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("deblockFilter"))
val DECRYPTIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("decryptionSettings"))
val DENOISEFILTER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("denoiseFilter"))
val DOLBYVISIONMETADATAXML_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dolbyVisionMetadataXml"))
val FILEINPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("fileInput"))
val FILTERENABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("filterEnable"))
val FILTERSTRENGTH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("filterStrength"))
val IMAGEINSERTER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("imageInserter"))
val INPUTCLIPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("inputClippings"))
val INPUTSCANTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("inputScanType"))
val POSITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("position"))
val PROGRAMNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("programNumber"))
val PSICONTROL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("psiControl"))
val SUPPLEMENTALIMPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supplementalImps"))
val TIMECODESOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("timecodeSource"))
val TIMECODESTART_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("timecodeStart"))
val VIDEOGENERATOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("videoGenerator"))
val VIDEOOVERLAYS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("videoOverlays"))
val VIDEOSELECTOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("videoSelector"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADVANCEDINPUTFILTER_DESCRIPTOR)
field(ADVANCEDINPUTFILTERSETTINGS_DESCRIPTOR)
field(AUDIOSELECTORGROUPS_DESCRIPTOR)
field(AUDIOSELECTORS_DESCRIPTOR)
field(CAPTIONSELECTORS_DESCRIPTOR)
field(CROP_DESCRIPTOR)
field(DEBLOCKFILTER_DESCRIPTOR)
field(DECRYPTIONSETTINGS_DESCRIPTOR)
field(DENOISEFILTER_DESCRIPTOR)
field(DOLBYVISIONMETADATAXML_DESCRIPTOR)
field(FILEINPUT_DESCRIPTOR)
field(FILTERENABLE_DESCRIPTOR)
field(FILTERSTRENGTH_DESCRIPTOR)
field(IMAGEINSERTER_DESCRIPTOR)
field(INPUTCLIPPINGS_DESCRIPTOR)
field(INPUTSCANTYPE_DESCRIPTOR)
field(POSITION_DESCRIPTOR)
field(PROGRAMNUMBER_DESCRIPTOR)
field(PSICONTROL_DESCRIPTOR)
field(SUPPLEMENTALIMPS_DESCRIPTOR)
field(TIMECODESOURCE_DESCRIPTOR)
field(TIMECODESTART_DESCRIPTOR)
field(VIDEOGENERATOR_DESCRIPTOR)
field(VIDEOOVERLAYS_DESCRIPTOR)
field(VIDEOSELECTOR_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADVANCEDINPUTFILTER_DESCRIPTOR.index -> builder.advancedInputFilter = deserializeString().let { AdvancedInputFilter.fromValue(it) }
ADVANCEDINPUTFILTERSETTINGS_DESCRIPTOR.index -> builder.advancedInputFilterSettings = deserializeAdvancedInputFilterSettingsDocument(deserializer)
AUDIOSELECTORGROUPS_DESCRIPTOR.index -> builder.audioSelectorGroups =
deserializer.deserializeMap(AUDIOSELECTORGROUPS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeAudioSelectorGroupDocument(deserializer) } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
AUDIOSELECTORS_DESCRIPTOR.index -> builder.audioSelectors =
deserializer.deserializeMap(AUDIOSELECTORS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeAudioSelectorDocument(deserializer) } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
CAPTIONSELECTORS_DESCRIPTOR.index -> builder.captionSelectors =
deserializer.deserializeMap(CAPTIONSELECTORS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeCaptionSelectorDocument(deserializer) } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
CROP_DESCRIPTOR.index -> builder.crop = deserializeRectangleDocument(deserializer)
DEBLOCKFILTER_DESCRIPTOR.index -> builder.deblockFilter = deserializeString().let { InputDeblockFilter.fromValue(it) }
DECRYPTIONSETTINGS_DESCRIPTOR.index -> builder.decryptionSettings = deserializeInputDecryptionSettingsDocument(deserializer)
DENOISEFILTER_DESCRIPTOR.index -> builder.denoiseFilter = deserializeString().let { InputDenoiseFilter.fromValue(it) }
DOLBYVISIONMETADATAXML_DESCRIPTOR.index -> builder.dolbyVisionMetadataXml = deserializeString()
FILEINPUT_DESCRIPTOR.index -> builder.fileInput = deserializeString()
FILTERENABLE_DESCRIPTOR.index -> builder.filterEnable = deserializeString().let { InputFilterEnable.fromValue(it) }
FILTERSTRENGTH_DESCRIPTOR.index -> builder.filterStrength = deserializeInt()
IMAGEINSERTER_DESCRIPTOR.index -> builder.imageInserter = deserializeImageInserterDocument(deserializer)
INPUTCLIPPINGS_DESCRIPTOR.index -> builder.inputClippings =
deserializer.deserializeList(INPUTCLIPPINGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeInputClippingDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
INPUTSCANTYPE_DESCRIPTOR.index -> builder.inputScanType = deserializeString().let { InputScanType.fromValue(it) }
POSITION_DESCRIPTOR.index -> builder.position = deserializeRectangleDocument(deserializer)
PROGRAMNUMBER_DESCRIPTOR.index -> builder.programNumber = deserializeInt()
PSICONTROL_DESCRIPTOR.index -> builder.psiControl = deserializeString().let { InputPsiControl.fromValue(it) }
SUPPLEMENTALIMPS_DESCRIPTOR.index -> builder.supplementalImps =
deserializer.deserializeList(SUPPLEMENTALIMPS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TIMECODESOURCE_DESCRIPTOR.index -> builder.timecodeSource = deserializeString().let { InputTimecodeSource.fromValue(it) }
TIMECODESTART_DESCRIPTOR.index -> builder.timecodeStart = deserializeString()
VIDEOGENERATOR_DESCRIPTOR.index -> builder.videoGenerator = deserializeInputVideoGeneratorDocument(deserializer)
VIDEOOVERLAYS_DESCRIPTOR.index -> builder.videoOverlays =
deserializer.deserializeList(VIDEOOVERLAYS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeVideoOverlayDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
VIDEOSELECTOR_DESCRIPTOR.index -> builder.videoSelector = deserializeVideoSelectorDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}