commonMain.aws.sdk.kotlin.services.elastictranscoder.serde.VideoParametersDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elastictranscoder-jvm Show documentation
Show all versions of elastictranscoder-jvm Show documentation
The AWS SDK for Kotlin client for Elastic Transcoder
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.elastictranscoder.serde
import aws.sdk.kotlin.services.elastictranscoder.model.PresetWatermark
import aws.sdk.kotlin.services.elastictranscoder.model.VideoParameters
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 deserializeVideoParametersDocument(deserializer: Deserializer): VideoParameters {
val builder = VideoParameters.Builder()
val ASPECTRATIO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AspectRatio"))
val BITRATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BitRate"))
val CODEC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Codec"))
val CODECOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("CodecOptions"))
val DISPLAYASPECTRATIO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DisplayAspectRatio"))
val FIXEDGOP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FixedGOP"))
val FRAMERATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FrameRate"))
val KEYFRAMESMAXDIST_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KeyframesMaxDist"))
val MAXFRAMERATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MaxFrameRate"))
val MAXHEIGHT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MaxHeight"))
val MAXWIDTH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MaxWidth"))
val PADDINGPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PaddingPolicy"))
val RESOLUTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Resolution"))
val SIZINGPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SizingPolicy"))
val WATERMARKS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Watermarks"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ASPECTRATIO_DESCRIPTOR)
field(BITRATE_DESCRIPTOR)
field(CODEC_DESCRIPTOR)
field(CODECOPTIONS_DESCRIPTOR)
field(DISPLAYASPECTRATIO_DESCRIPTOR)
field(FIXEDGOP_DESCRIPTOR)
field(FRAMERATE_DESCRIPTOR)
field(KEYFRAMESMAXDIST_DESCRIPTOR)
field(MAXFRAMERATE_DESCRIPTOR)
field(MAXHEIGHT_DESCRIPTOR)
field(MAXWIDTH_DESCRIPTOR)
field(PADDINGPOLICY_DESCRIPTOR)
field(RESOLUTION_DESCRIPTOR)
field(SIZINGPOLICY_DESCRIPTOR)
field(WATERMARKS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ASPECTRATIO_DESCRIPTOR.index -> builder.aspectRatio = deserializeString()
BITRATE_DESCRIPTOR.index -> builder.bitRate = deserializeString()
CODEC_DESCRIPTOR.index -> builder.codec = deserializeString()
CODECOPTIONS_DESCRIPTOR.index -> builder.codecOptions =
deserializer.deserializeMap(CODECOPTIONS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
DISPLAYASPECTRATIO_DESCRIPTOR.index -> builder.displayAspectRatio = deserializeString()
FIXEDGOP_DESCRIPTOR.index -> builder.fixedGop = deserializeString()
FRAMERATE_DESCRIPTOR.index -> builder.frameRate = deserializeString()
KEYFRAMESMAXDIST_DESCRIPTOR.index -> builder.keyframesMaxDist = deserializeString()
MAXFRAMERATE_DESCRIPTOR.index -> builder.maxFrameRate = deserializeString()
MAXHEIGHT_DESCRIPTOR.index -> builder.maxHeight = deserializeString()
MAXWIDTH_DESCRIPTOR.index -> builder.maxWidth = deserializeString()
PADDINGPOLICY_DESCRIPTOR.index -> builder.paddingPolicy = deserializeString()
RESOLUTION_DESCRIPTOR.index -> builder.resolution = deserializeString()
SIZINGPOLICY_DESCRIPTOR.index -> builder.sizingPolicy = deserializeString()
WATERMARKS_DESCRIPTOR.index -> builder.watermarks =
deserializer.deserializeList(WATERMARKS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializePresetWatermarkDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy