commonMain.aws.sdk.kotlin.services.glue.serde.NodeDocumentDeserializer.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.Node
import aws.sdk.kotlin.services.glue.model.NodeType
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
internal fun deserializeNodeDocument(deserializer: Deserializer): Node {
val builder = Node.Builder()
val CRAWLERDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CrawlerDetails"))
val JOBDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("JobDetails"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val TRIGGERDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TriggerDetails"))
val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Type"))
val UNIQUEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("UniqueId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CRAWLERDETAILS_DESCRIPTOR)
field(JOBDETAILS_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(TRIGGERDETAILS_DESCRIPTOR)
field(TYPE_DESCRIPTOR)
field(UNIQUEID_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CRAWLERDETAILS_DESCRIPTOR.index -> builder.crawlerDetails = deserializeCrawlerNodeDetailsDocument(deserializer)
JOBDETAILS_DESCRIPTOR.index -> builder.jobDetails = deserializeJobNodeDetailsDocument(deserializer)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
TRIGGERDETAILS_DESCRIPTOR.index -> builder.triggerDetails = deserializeTriggerNodeDetailsDocument(deserializer)
TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { NodeType.fromValue(it) }
UNIQUEID_DESCRIPTOR.index -> builder.uniqueId = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}