commonMain.aws.sdk.kotlin.services.glue.serde.ViewDefinitionDocumentDeserializer.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
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.ViewDefinition
import aws.sdk.kotlin.services.glue.model.ViewRepresentation
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 kotlin.collections.mutableListOf
internal fun deserializeViewDefinitionDocument(deserializer: Deserializer): ViewDefinition {
val builder = ViewDefinition.Builder()
val DEFINER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Definer"))
val ISPROTECTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("IsProtected"))
val REPRESENTATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Representations"))
val SUBOBJECTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SubObjects"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DEFINER_DESCRIPTOR)
field(ISPROTECTED_DESCRIPTOR)
field(REPRESENTATIONS_DESCRIPTOR)
field(SUBOBJECTS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DEFINER_DESCRIPTOR.index -> builder.definer = deserializeString()
ISPROTECTED_DESCRIPTOR.index -> builder.isProtected = deserializeBoolean()
REPRESENTATIONS_DESCRIPTOR.index -> builder.representations =
deserializer.deserializeList(REPRESENTATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeViewRepresentationDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SUBOBJECTS_DESCRIPTOR.index -> builder.subObjects =
deserializer.deserializeList(SUBOBJECTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}