
commonMain.aws.sdk.kotlin.services.ivs.serde.RenditionConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.ivs.serde
import aws.sdk.kotlin.services.ivs.model.RenditionConfiguration
import aws.sdk.kotlin.services.ivs.model.RenditionConfigurationRendition
import aws.sdk.kotlin.services.ivs.model.RenditionConfigurationRenditionSelection
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 deserializeRenditionConfigurationDocument(deserializer: Deserializer): RenditionConfiguration {
val builder = RenditionConfiguration.Builder()
val RENDITIONSELECTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("renditionSelection"))
val RENDITIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("renditions"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(RENDITIONSELECTION_DESCRIPTOR)
field(RENDITIONS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
RENDITIONSELECTION_DESCRIPTOR.index -> builder.renditionSelection = deserializeString().let { RenditionConfigurationRenditionSelection.fromValue(it) }
RENDITIONS_DESCRIPTOR.index -> builder.renditions =
deserializer.deserializeList(RENDITIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { RenditionConfigurationRendition.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy