commonMain.aws.sdk.kotlin.services.proton.serde.SyncBlockerDocumentDeserializer.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
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.proton.serde
import aws.sdk.kotlin.services.proton.model.BlockerStatus
import aws.sdk.kotlin.services.proton.model.BlockerType
import aws.sdk.kotlin.services.proton.model.SyncBlocker
import aws.sdk.kotlin.services.proton.model.SyncBlockerContext
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 deserializeSyncBlockerDocument(deserializer: Deserializer): SyncBlocker {
val builder = SyncBlocker.Builder()
val CONTEXTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("contexts"))
val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
val CREATEDREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("createdReason"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
val RESOLVEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("resolvedAt"))
val RESOLVEDREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("resolvedReason"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("type"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONTEXTS_DESCRIPTOR)
field(CREATEDAT_DESCRIPTOR)
field(CREATEDREASON_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(RESOLVEDAT_DESCRIPTOR)
field(RESOLVEDREASON_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONTEXTS_DESCRIPTOR.index -> builder.contexts =
deserializer.deserializeList(CONTEXTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeSyncBlockerContextDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
CREATEDREASON_DESCRIPTOR.index -> builder.createdReason = deserializeString()
ID_DESCRIPTOR.index -> builder.id = deserializeString()
RESOLVEDAT_DESCRIPTOR.index -> builder.resolvedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
RESOLVEDREASON_DESCRIPTOR.index -> builder.resolvedReason = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { BlockerStatus.fromValue(it) }
TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { BlockerType.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy