commonMain.aws.sdk.kotlin.services.proton.serde.ResourceSyncAttemptDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proton-jvm Show documentation
Show all versions of proton-jvm Show documentation
The AWS SDK for Kotlin client for Proton
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.proton.serde
import aws.sdk.kotlin.services.proton.model.ResourceSyncAttempt
import aws.sdk.kotlin.services.proton.model.ResourceSyncEvent
import aws.sdk.kotlin.services.proton.model.ResourceSyncStatus
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf
internal fun deserializeResourceSyncAttemptDocument(deserializer: Deserializer): ResourceSyncAttempt {
val builder = ResourceSyncAttempt.Builder()
val EVENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("events"))
val INITIALREVISION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("initialRevision"))
val STARTEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("startedAt"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
val TARGET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("target"))
val TARGETREVISION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("targetRevision"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(EVENTS_DESCRIPTOR)
field(INITIALREVISION_DESCRIPTOR)
field(STARTEDAT_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TARGET_DESCRIPTOR)
field(TARGETREVISION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
EVENTS_DESCRIPTOR.index -> builder.events =
deserializer.deserializeList(EVENTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeResourceSyncEventDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
INITIALREVISION_DESCRIPTOR.index -> builder.initialRevision = deserializeRevisionDocument(deserializer)
STARTEDAT_DESCRIPTOR.index -> builder.startedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ResourceSyncStatus.fromValue(it) }
TARGET_DESCRIPTOR.index -> builder.target = deserializeString()
TARGETREVISION_DESCRIPTOR.index -> builder.targetRevision = deserializeRevisionDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy