
commonMain.aws.sdk.kotlin.services.rekognition.serde.SegmentDetectionDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.rekognition.serde
import aws.sdk.kotlin.services.rekognition.model.SegmentDetection
import aws.sdk.kotlin.services.rekognition.model.SegmentType
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 deserializeSegmentDetectionDocument(deserializer: Deserializer): SegmentDetection {
val builder = SegmentDetection.Builder()
val DURATIONFRAMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("DurationFrames"))
val DURATIONMILLIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("DurationMillis"))
val DURATIONSMPTE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DurationSMPTE"))
val ENDFRAMENUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("EndFrameNumber"))
val ENDTIMECODESMPTE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EndTimecodeSMPTE"))
val ENDTIMESTAMPMILLIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("EndTimestampMillis"))
val SHOTSEGMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ShotSegment"))
val STARTFRAMENUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("StartFrameNumber"))
val STARTTIMECODESMPTE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StartTimecodeSMPTE"))
val STARTTIMESTAMPMILLIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("StartTimestampMillis"))
val TECHNICALCUESEGMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TechnicalCueSegment"))
val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Type"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DURATIONFRAMES_DESCRIPTOR)
field(DURATIONMILLIS_DESCRIPTOR)
field(DURATIONSMPTE_DESCRIPTOR)
field(ENDFRAMENUMBER_DESCRIPTOR)
field(ENDTIMECODESMPTE_DESCRIPTOR)
field(ENDTIMESTAMPMILLIS_DESCRIPTOR)
field(SHOTSEGMENT_DESCRIPTOR)
field(STARTFRAMENUMBER_DESCRIPTOR)
field(STARTTIMECODESMPTE_DESCRIPTOR)
field(STARTTIMESTAMPMILLIS_DESCRIPTOR)
field(TECHNICALCUESEGMENT_DESCRIPTOR)
field(TYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DURATIONFRAMES_DESCRIPTOR.index -> builder.durationFrames = deserializeLong()
DURATIONMILLIS_DESCRIPTOR.index -> builder.durationMillis = deserializeLong()
DURATIONSMPTE_DESCRIPTOR.index -> builder.durationSmpte = deserializeString()
ENDFRAMENUMBER_DESCRIPTOR.index -> builder.endFrameNumber = deserializeLong()
ENDTIMECODESMPTE_DESCRIPTOR.index -> builder.endTimecodeSmpte = deserializeString()
ENDTIMESTAMPMILLIS_DESCRIPTOR.index -> builder.endTimestampMillis = deserializeLong()
SHOTSEGMENT_DESCRIPTOR.index -> builder.shotSegment = deserializeShotSegmentDocument(deserializer)
STARTFRAMENUMBER_DESCRIPTOR.index -> builder.startFrameNumber = deserializeLong()
STARTTIMECODESMPTE_DESCRIPTOR.index -> builder.startTimecodeSmpte = deserializeString()
STARTTIMESTAMPMILLIS_DESCRIPTOR.index -> builder.startTimestampMillis = deserializeLong()
TECHNICALCUESEGMENT_DESCRIPTOR.index -> builder.technicalCueSegment = deserializeTechnicalCueSegmentDocument(deserializer)
TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { SegmentType.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy