commonMain.aws.sdk.kotlin.services.glue.serde.WorkflowDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.Workflow
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 deserializeWorkflowDocument(deserializer: Deserializer): Workflow {
val builder = Workflow.Builder()
val BLUEPRINTDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("BlueprintDetails"))
val CREATEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedOn"))
val DEFAULTRUNPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("DefaultRunProperties"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val GRAPH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Graph"))
val LASTMODIFIEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedOn"))
val LASTRUN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("LastRun"))
val MAXCONCURRENTRUNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxConcurrentRuns"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(BLUEPRINTDETAILS_DESCRIPTOR)
field(CREATEDON_DESCRIPTOR)
field(DEFAULTRUNPROPERTIES_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(GRAPH_DESCRIPTOR)
field(LASTMODIFIEDON_DESCRIPTOR)
field(LASTRUN_DESCRIPTOR)
field(MAXCONCURRENTRUNS_DESCRIPTOR)
field(NAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
BLUEPRINTDETAILS_DESCRIPTOR.index -> builder.blueprintDetails = deserializeBlueprintDetailsDocument(deserializer)
CREATEDON_DESCRIPTOR.index -> builder.createdOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DEFAULTRUNPROPERTIES_DESCRIPTOR.index -> builder.defaultRunProperties =
deserializer.deserializeMap(DEFAULTRUNPROPERTIES_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
GRAPH_DESCRIPTOR.index -> builder.graph = deserializeWorkflowGraphDocument(deserializer)
LASTMODIFIEDON_DESCRIPTOR.index -> builder.lastModifiedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LASTRUN_DESCRIPTOR.index -> builder.lastRun = deserializeWorkflowRunDocument(deserializer)
MAXCONCURRENTRUNS_DESCRIPTOR.index -> builder.maxConcurrentRuns = deserializeInt()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}