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

commonMain.aws.sdk.kotlin.services.glue.serde.ConnectionDocumentDeserializer.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.Connection
import aws.sdk.kotlin.services.glue.model.ConnectionPropertyKey
import aws.sdk.kotlin.services.glue.model.ConnectionStatus
import aws.sdk.kotlin.services.glue.model.ConnectionType
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
import kotlin.collections.mutableMapOf

internal fun deserializeConnectionDocument(deserializer: Deserializer): Connection {
    val builder = Connection.Builder()
    val ATHENAPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("AthenaProperties"))
    val AUTHENTICATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("AuthenticationConfiguration"))
    val CONNECTIONPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("ConnectionProperties"))
    val CONNECTIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ConnectionType"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val LASTCONNECTIONVALIDATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastConnectionValidationTime"))
    val LASTUPDATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LastUpdatedBy"))
    val LASTUPDATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdatedTime"))
    val MATCHCRITERIA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("MatchCriteria"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val PHYSICALCONNECTIONREQUIREMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("PhysicalConnectionRequirements"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val STATUSREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatusReason"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ATHENAPROPERTIES_DESCRIPTOR)
        field(AUTHENTICATIONCONFIGURATION_DESCRIPTOR)
        field(CONNECTIONPROPERTIES_DESCRIPTOR)
        field(CONNECTIONTYPE_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(LASTCONNECTIONVALIDATIONTIME_DESCRIPTOR)
        field(LASTUPDATEDBY_DESCRIPTOR)
        field(LASTUPDATEDTIME_DESCRIPTOR)
        field(MATCHCRITERIA_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PHYSICALCONNECTIONREQUIREMENTS_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(STATUSREASON_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ATHENAPROPERTIES_DESCRIPTOR.index -> builder.athenaProperties =
                    deserializer.deserializeMap(ATHENAPROPERTIES_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                AUTHENTICATIONCONFIGURATION_DESCRIPTOR.index -> builder.authenticationConfiguration = deserializeAuthenticationConfigurationDocument(deserializer)
                CONNECTIONPROPERTIES_DESCRIPTOR.index -> builder.connectionProperties =
                    deserializer.deserializeMap(CONNECTIONPROPERTIES_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = ConnectionPropertyKey.fromValue(key())
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                CONNECTIONTYPE_DESCRIPTOR.index -> builder.connectionType = deserializeString().let { ConnectionType.fromValue(it) }
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                LASTCONNECTIONVALIDATIONTIME_DESCRIPTOR.index -> builder.lastConnectionValidationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LASTUPDATEDBY_DESCRIPTOR.index -> builder.lastUpdatedBy = deserializeString()
                LASTUPDATEDTIME_DESCRIPTOR.index -> builder.lastUpdatedTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                MATCHCRITERIA_DESCRIPTOR.index -> builder.matchCriteria =
                    deserializer.deserializeList(MATCHCRITERIA_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PHYSICALCONNECTIONREQUIREMENTS_DESCRIPTOR.index -> builder.physicalConnectionRequirements = deserializePhysicalConnectionRequirementsDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ConnectionStatus.fromValue(it) }
                STATUSREASON_DESCRIPTOR.index -> builder.statusReason = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy