commonMain.aws.sdk.kotlin.services.kinesisvideo.serde.ImageGenerationConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kinesisvideo-jvm Show documentation
Show all versions of kinesisvideo-jvm Show documentation
The AWS SDK for Kotlin client for Kinesis Video
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kinesisvideo.serde
import aws.sdk.kotlin.services.kinesisvideo.model.ConfigurationStatus
import aws.sdk.kotlin.services.kinesisvideo.model.Format
import aws.sdk.kotlin.services.kinesisvideo.model.FormatConfigKey
import aws.sdk.kotlin.services.kinesisvideo.model.ImageGenerationConfiguration
import aws.sdk.kotlin.services.kinesisvideo.model.ImageSelectorType
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.mutableMapOf
internal fun deserializeImageGenerationConfigurationDocument(deserializer: Deserializer): ImageGenerationConfiguration {
val builder = ImageGenerationConfiguration.Builder()
val DESTINATIONCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DestinationConfig"))
val FORMAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Format"))
val FORMATCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("FormatConfig"))
val HEIGHTPIXELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("HeightPixels"))
val IMAGESELECTORTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ImageSelectorType"))
val SAMPLINGINTERVAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("SamplingInterval"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val WIDTHPIXELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("WidthPixels"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DESTINATIONCONFIG_DESCRIPTOR)
field(FORMAT_DESCRIPTOR)
field(FORMATCONFIG_DESCRIPTOR)
field(HEIGHTPIXELS_DESCRIPTOR)
field(IMAGESELECTORTYPE_DESCRIPTOR)
field(SAMPLINGINTERVAL_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(WIDTHPIXELS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DESTINATIONCONFIG_DESCRIPTOR.index -> builder.destinationConfig = deserializeImageGenerationDestinationConfigDocument(deserializer)
FORMAT_DESCRIPTOR.index -> builder.format = deserializeString().let { Format.fromValue(it) }
FORMATCONFIG_DESCRIPTOR.index -> builder.formatConfig =
deserializer.deserializeMap(FORMATCONFIG_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = FormatConfigKey.fromValue(key())
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
HEIGHTPIXELS_DESCRIPTOR.index -> builder.heightPixels = deserializeInt()
IMAGESELECTORTYPE_DESCRIPTOR.index -> builder.imageSelectorType = deserializeString().let { ImageSelectorType.fromValue(it) }
SAMPLINGINTERVAL_DESCRIPTOR.index -> builder.samplingInterval = deserializeInt()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ConfigurationStatus.fromValue(it) }
WIDTHPIXELS_DESCRIPTOR.index -> builder.widthPixels = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}