
commonMain.aws.sdk.kotlin.services.medialive.transform.CaptionRectangleDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.medialive.transform
import aws.sdk.kotlin.services.medialive.model.CaptionRectangle
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
internal fun deserializeCaptionRectangleDocument(deserializer: Deserializer): CaptionRectangle {
val builder = CaptionRectangle.Builder()
val HEIGHT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("height"))
val LEFTOFFSET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("leftOffset"))
val TOPOFFSET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("topOffset"))
val WIDTH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("width"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(HEIGHT_DESCRIPTOR)
field(LEFTOFFSET_DESCRIPTOR)
field(TOPOFFSET_DESCRIPTOR)
field(WIDTH_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
HEIGHT_DESCRIPTOR.index -> builder.height = deserializeDouble()
LEFTOFFSET_DESCRIPTOR.index -> builder.leftOffset = deserializeDouble()
TOPOFFSET_DESCRIPTOR.index -> builder.topOffset = deserializeDouble()
WIDTH_DESCRIPTOR.index -> builder.width = deserializeDouble()
null -> break@loop
else -> skipValue()
}
}
}
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy