commonMain.aws.sdk.kotlin.services.glue.serde.WorkflowRunDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.WorkflowRun
import aws.sdk.kotlin.services.glue.model.WorkflowRunStatus
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.mutableMapOf
internal fun deserializeWorkflowRunDocument(deserializer: Deserializer): WorkflowRun {
val builder = WorkflowRun.Builder()
val COMPLETEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletedOn"))
val ERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorMessage"))
val GRAPH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Graph"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val PREVIOUSRUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PreviousRunId"))
val STARTEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartedOn"))
val STARTINGEVENTBATCHCONDITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("StartingEventBatchCondition"))
val STATISTICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Statistics"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val WORKFLOWRUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("WorkflowRunId"))
val WORKFLOWRUNPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("WorkflowRunProperties"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(COMPLETEDON_DESCRIPTOR)
field(ERRORMESSAGE_DESCRIPTOR)
field(GRAPH_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(PREVIOUSRUNID_DESCRIPTOR)
field(STARTEDON_DESCRIPTOR)
field(STARTINGEVENTBATCHCONDITION_DESCRIPTOR)
field(STATISTICS_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(WORKFLOWRUNID_DESCRIPTOR)
field(WORKFLOWRUNPROPERTIES_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
COMPLETEDON_DESCRIPTOR.index -> builder.completedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
ERRORMESSAGE_DESCRIPTOR.index -> builder.errorMessage = deserializeString()
GRAPH_DESCRIPTOR.index -> builder.graph = deserializeWorkflowGraphDocument(deserializer)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
PREVIOUSRUNID_DESCRIPTOR.index -> builder.previousRunId = deserializeString()
STARTEDON_DESCRIPTOR.index -> builder.startedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
STARTINGEVENTBATCHCONDITION_DESCRIPTOR.index -> builder.startingEventBatchCondition = deserializeStartingEventBatchConditionDocument(deserializer)
STATISTICS_DESCRIPTOR.index -> builder.statistics = deserializeWorkflowRunStatisticsDocument(deserializer)
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { WorkflowRunStatus.fromValue(it) }
WORKFLOWRUNID_DESCRIPTOR.index -> builder.workflowRunId = deserializeString()
WORKFLOWRUNPROPERTIES_DESCRIPTOR.index -> builder.workflowRunProperties =
deserializer.deserializeMap(WORKFLOWRUNPROPERTIES_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}