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

commonMain.aws.sdk.kotlin.services.glue.serde.CrawlerDocumentDeserializer.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.Crawler
import aws.sdk.kotlin.services.glue.model.CrawlerState
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf

internal fun deserializeCrawlerDocument(deserializer: Deserializer): Crawler {
    val builder = Crawler.Builder()
    val CLASSIFIERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Classifiers"))
    val CONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Configuration"))
    val CRAWLELAPSEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("CrawlElapsedTime"))
    val CRAWLERSECURITYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CrawlerSecurityConfiguration"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val DATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatabaseName"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val LAKEFORMATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("LakeFormationConfiguration"))
    val LASTCRAWL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("LastCrawl"))
    val LASTUPDATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdated"))
    val LINEAGECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("LineageConfiguration"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val RECRAWLPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RecrawlPolicy"))
    val ROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Role"))
    val SCHEDULE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Schedule"))
    val SCHEMACHANGEPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SchemaChangePolicy"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
    val TABLEPREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TablePrefix"))
    val TARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Targets"))
    val VERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Version"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CLASSIFIERS_DESCRIPTOR)
        field(CONFIGURATION_DESCRIPTOR)
        field(CRAWLELAPSEDTIME_DESCRIPTOR)
        field(CRAWLERSECURITYCONFIGURATION_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(DATABASENAME_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(LAKEFORMATIONCONFIGURATION_DESCRIPTOR)
        field(LASTCRAWL_DESCRIPTOR)
        field(LASTUPDATED_DESCRIPTOR)
        field(LINEAGECONFIGURATION_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(RECRAWLPOLICY_DESCRIPTOR)
        field(ROLE_DESCRIPTOR)
        field(SCHEDULE_DESCRIPTOR)
        field(SCHEMACHANGEPOLICY_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(TABLEPREFIX_DESCRIPTOR)
        field(TARGETS_DESCRIPTOR)
        field(VERSION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CLASSIFIERS_DESCRIPTOR.index -> builder.classifiers =
                    deserializer.deserializeList(CLASSIFIERS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CONFIGURATION_DESCRIPTOR.index -> builder.configuration = deserializeString()
                CRAWLELAPSEDTIME_DESCRIPTOR.index -> builder.crawlElapsedTime = deserializeLong()
                CRAWLERSECURITYCONFIGURATION_DESCRIPTOR.index -> builder.crawlerSecurityConfiguration = deserializeString()
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DATABASENAME_DESCRIPTOR.index -> builder.databaseName = deserializeString()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                LAKEFORMATIONCONFIGURATION_DESCRIPTOR.index -> builder.lakeFormationConfiguration = deserializeLakeFormationConfigurationDocument(deserializer)
                LASTCRAWL_DESCRIPTOR.index -> builder.lastCrawl = deserializeLastCrawlInfoDocument(deserializer)
                LASTUPDATED_DESCRIPTOR.index -> builder.lastUpdated = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LINEAGECONFIGURATION_DESCRIPTOR.index -> builder.lineageConfiguration = deserializeLineageConfigurationDocument(deserializer)
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                RECRAWLPOLICY_DESCRIPTOR.index -> builder.recrawlPolicy = deserializeRecrawlPolicyDocument(deserializer)
                ROLE_DESCRIPTOR.index -> builder.role = deserializeString()
                SCHEDULE_DESCRIPTOR.index -> builder.schedule = deserializeScheduleDocument(deserializer)
                SCHEMACHANGEPOLICY_DESCRIPTOR.index -> builder.schemaChangePolicy = deserializeSchemaChangePolicyDocument(deserializer)
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { CrawlerState.fromValue(it) }
                TABLEPREFIX_DESCRIPTOR.index -> builder.tablePrefix = deserializeString()
                TARGETS_DESCRIPTOR.index -> builder.targets = deserializeCrawlerTargetsDocument(deserializer)
                VERSION_DESCRIPTOR.index -> builder.version = deserializeLong()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy