commonMain.aws.sdk.kotlin.services.athena.serde.ColumnInfoDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of athena-jvm Show documentation
Show all versions of athena-jvm Show documentation
The AWS SDK for Kotlin client for Athena
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.athena.serde
import aws.sdk.kotlin.services.athena.model.ColumnInfo
import aws.sdk.kotlin.services.athena.model.ColumnNullable
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 deserializeColumnInfoDocument(deserializer: Deserializer): ColumnInfo {
val builder = ColumnInfo.Builder()
val CASESENSITIVE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("CaseSensitive"))
val CATALOGNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CatalogName"))
val LABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Label"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val NULLABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Nullable"))
val PRECISION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Precision"))
val SCALE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Scale"))
val SCHEMANAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SchemaName"))
val TABLENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TableName"))
val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Type"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CASESENSITIVE_DESCRIPTOR)
field(CATALOGNAME_DESCRIPTOR)
field(LABEL_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(NULLABLE_DESCRIPTOR)
field(PRECISION_DESCRIPTOR)
field(SCALE_DESCRIPTOR)
field(SCHEMANAME_DESCRIPTOR)
field(TABLENAME_DESCRIPTOR)
field(TYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CASESENSITIVE_DESCRIPTOR.index -> builder.caseSensitive = deserializeBoolean()
CATALOGNAME_DESCRIPTOR.index -> builder.catalogName = deserializeString()
LABEL_DESCRIPTOR.index -> builder.label = deserializeString()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
NULLABLE_DESCRIPTOR.index -> builder.nullable = deserializeString().let { ColumnNullable.fromValue(it) }
PRECISION_DESCRIPTOR.index -> builder.precision = deserializeInt()
SCALE_DESCRIPTOR.index -> builder.scale = deserializeInt()
SCHEMANAME_DESCRIPTOR.index -> builder.schemaName = deserializeString()
TABLENAME_DESCRIPTOR.index -> builder.tableName = deserializeString()
TYPE_DESCRIPTOR.index -> builder.type = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}