commonMain.aws.sdk.kotlin.services.glue.serde.RedshiftTargetDocumentDeserializer.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.RedshiftTarget
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 deserializeRedshiftTargetDocument(deserializer: Deserializer): RedshiftTarget {
val builder = RedshiftTarget.Builder()
val DATABASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Database"))
val INPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Inputs"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val REDSHIFTTMPDIR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RedshiftTmpDir"))
val TABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Table"))
val TMPDIRIAMROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TmpDirIAMRole"))
val UPSERTREDSHIFTOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("UpsertRedshiftOptions"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DATABASE_DESCRIPTOR)
field(INPUTS_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(REDSHIFTTMPDIR_DESCRIPTOR)
field(TABLE_DESCRIPTOR)
field(TMPDIRIAMROLE_DESCRIPTOR)
field(UPSERTREDSHIFTOPTIONS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DATABASE_DESCRIPTOR.index -> builder.database = deserializeString()
INPUTS_DESCRIPTOR.index -> builder.inputs =
deserializer.deserializeList(INPUTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
REDSHIFTTMPDIR_DESCRIPTOR.index -> builder.redshiftTmpDir = deserializeString()
TABLE_DESCRIPTOR.index -> builder.table = deserializeString()
TMPDIRIAMROLE_DESCRIPTOR.index -> builder.tmpDirIamRole = deserializeString()
UPSERTREDSHIFTOPTIONS_DESCRIPTOR.index -> builder.upsertRedshiftOptions = deserializeUpsertRedshiftTargetOptionsDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}