
commonMain.aws.sdk.kotlin.services.appconfig.serde.DeploymentEventDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appconfig.serde
import aws.sdk.kotlin.services.appconfig.model.ActionInvocation
import aws.sdk.kotlin.services.appconfig.model.DeploymentEvent
import aws.sdk.kotlin.services.appconfig.model.DeploymentEventType
import aws.sdk.kotlin.services.appconfig.model.TriggeredBy
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 deserializeDeploymentEventDocument(deserializer: Deserializer): DeploymentEvent {
val builder = DeploymentEvent.Builder()
val ACTIONINVOCATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ActionInvocations"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val EVENTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EventType"))
val OCCURREDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("OccurredAt"))
val TRIGGEREDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TriggeredBy"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACTIONINVOCATIONS_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(EVENTTYPE_DESCRIPTOR)
field(OCCURREDAT_DESCRIPTOR)
field(TRIGGEREDBY_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACTIONINVOCATIONS_DESCRIPTOR.index -> builder.actionInvocations =
deserializer.deserializeList(ACTIONINVOCATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeActionInvocationDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
EVENTTYPE_DESCRIPTOR.index -> builder.eventType = deserializeString().let { DeploymentEventType.fromValue(it) }
OCCURREDAT_DESCRIPTOR.index -> builder.occurredAt = deserializeInstant(TimestampFormat.ISO_8601)
TRIGGEREDBY_DESCRIPTOR.index -> builder.triggeredBy = deserializeString().let { TriggeredBy.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy