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

commonMain.aws.sdk.kotlin.services.glue.serde.CrawlerTargetsDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show 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.CatalogTarget
import aws.sdk.kotlin.services.glue.model.CrawlerTargets
import aws.sdk.kotlin.services.glue.model.DeltaTarget
import aws.sdk.kotlin.services.glue.model.DynamoDbTarget
import aws.sdk.kotlin.services.glue.model.HudiTarget
import aws.sdk.kotlin.services.glue.model.IcebergTarget
import aws.sdk.kotlin.services.glue.model.JdbcTarget
import aws.sdk.kotlin.services.glue.model.MongoDbTarget
import aws.sdk.kotlin.services.glue.model.S3Target
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 deserializeCrawlerTargetsDocument(deserializer: Deserializer): CrawlerTargets {
    val builder = CrawlerTargets.Builder()
    val CATALOGTARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("CatalogTargets"))
    val DELTATARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DeltaTargets"))
    val DYNAMODBTARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DynamoDBTargets"))
    val HUDITARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("HudiTargets"))
    val ICEBERGTARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("IcebergTargets"))
    val JDBCTARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("JdbcTargets"))
    val MONGODBTARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("MongoDBTargets"))
    val S3TARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("S3Targets"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CATALOGTARGETS_DESCRIPTOR)
        field(DELTATARGETS_DESCRIPTOR)
        field(DYNAMODBTARGETS_DESCRIPTOR)
        field(HUDITARGETS_DESCRIPTOR)
        field(ICEBERGTARGETS_DESCRIPTOR)
        field(JDBCTARGETS_DESCRIPTOR)
        field(MONGODBTARGETS_DESCRIPTOR)
        field(S3TARGETS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CATALOGTARGETS_DESCRIPTOR.index -> builder.catalogTargets =
                    deserializer.deserializeList(CATALOGTARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeCatalogTargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                DELTATARGETS_DESCRIPTOR.index -> builder.deltaTargets =
                    deserializer.deserializeList(DELTATARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDeltaTargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                DYNAMODBTARGETS_DESCRIPTOR.index -> builder.dynamoDbTargets =
                    deserializer.deserializeList(DYNAMODBTARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDynamoDbTargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                HUDITARGETS_DESCRIPTOR.index -> builder.hudiTargets =
                    deserializer.deserializeList(HUDITARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeHudiTargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ICEBERGTARGETS_DESCRIPTOR.index -> builder.icebergTargets =
                    deserializer.deserializeList(ICEBERGTARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeIcebergTargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                JDBCTARGETS_DESCRIPTOR.index -> builder.jdbcTargets =
                    deserializer.deserializeList(JDBCTARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeJdbcTargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                MONGODBTARGETS_DESCRIPTOR.index -> builder.mongoDbTargets =
                    deserializer.deserializeList(MONGODBTARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeMongoDbTargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                S3TARGETS_DESCRIPTOR.index -> builder.s3Targets =
                    deserializer.deserializeList(S3TARGETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeS3TargetDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy