All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.glue.serde.MappingEntryDocumentDeserializer.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.MappingEntry
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 deserializeMappingEntryDocument(deserializer: Deserializer): MappingEntry {
    val builder = MappingEntry.Builder()
    val SOURCEPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourcePath"))
    val SOURCETABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceTable"))
    val SOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceType"))
    val TARGETPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetPath"))
    val TARGETTABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetTable"))
    val TARGETTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(SOURCEPATH_DESCRIPTOR)
        field(SOURCETABLE_DESCRIPTOR)
        field(SOURCETYPE_DESCRIPTOR)
        field(TARGETPATH_DESCRIPTOR)
        field(TARGETTABLE_DESCRIPTOR)
        field(TARGETTYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                SOURCEPATH_DESCRIPTOR.index -> builder.sourcePath = deserializeString()
                SOURCETABLE_DESCRIPTOR.index -> builder.sourceTable = deserializeString()
                SOURCETYPE_DESCRIPTOR.index -> builder.sourceType = deserializeString()
                TARGETPATH_DESCRIPTOR.index -> builder.targetPath = deserializeString()
                TARGETTABLE_DESCRIPTOR.index -> builder.targetTable = deserializeString()
                TARGETTYPE_DESCRIPTOR.index -> builder.targetType = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy