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

commonMain.aws.sdk.kotlin.services.glue.serde.StatisticSummaryDocumentDeserializer.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.StatisticEvaluationLevel
import aws.sdk.kotlin.services.glue.model.StatisticSummary
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 deserializeStatisticSummaryDocument(deserializer: Deserializer): StatisticSummary {
    val builder = StatisticSummary.Builder()
    val COLUMNSREFERENCED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ColumnsReferenced"))
    val DOUBLEVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("DoubleValue"))
    val EVALUATIONLEVEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EvaluationLevel"))
    val INCLUSIONANNOTATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("InclusionAnnotation"))
    val PROFILEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ProfileId"))
    val RECORDEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("RecordedOn"))
    val REFERENCEDDATASETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ReferencedDatasets"))
    val RUNIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RunIdentifier"))
    val STATISTICID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatisticId"))
    val STATISTICNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatisticName"))
    val STATISTICPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("StatisticProperties"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COLUMNSREFERENCED_DESCRIPTOR)
        field(DOUBLEVALUE_DESCRIPTOR)
        field(EVALUATIONLEVEL_DESCRIPTOR)
        field(INCLUSIONANNOTATION_DESCRIPTOR)
        field(PROFILEID_DESCRIPTOR)
        field(RECORDEDON_DESCRIPTOR)
        field(REFERENCEDDATASETS_DESCRIPTOR)
        field(RUNIDENTIFIER_DESCRIPTOR)
        field(STATISTICID_DESCRIPTOR)
        field(STATISTICNAME_DESCRIPTOR)
        field(STATISTICPROPERTIES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COLUMNSREFERENCED_DESCRIPTOR.index -> builder.columnsReferenced =
                    deserializer.deserializeList(COLUMNSREFERENCED_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                DOUBLEVALUE_DESCRIPTOR.index -> builder.doubleValue = deserializeDouble()
                EVALUATIONLEVEL_DESCRIPTOR.index -> builder.evaluationLevel = deserializeString().let { StatisticEvaluationLevel.fromValue(it) }
                INCLUSIONANNOTATION_DESCRIPTOR.index -> builder.inclusionAnnotation = deserializeTimestampedInclusionAnnotationDocument(deserializer)
                PROFILEID_DESCRIPTOR.index -> builder.profileId = deserializeString()
                RECORDEDON_DESCRIPTOR.index -> builder.recordedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REFERENCEDDATASETS_DESCRIPTOR.index -> builder.referencedDatasets =
                    deserializer.deserializeList(REFERENCEDDATASETS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                RUNIDENTIFIER_DESCRIPTOR.index -> builder.runIdentifier = deserializeRunIdentifierDocument(deserializer)
                STATISTICID_DESCRIPTOR.index -> builder.statisticId = deserializeString()
                STATISTICNAME_DESCRIPTOR.index -> builder.statisticName = deserializeString()
                STATISTICPROPERTIES_DESCRIPTOR.index -> builder.statisticProperties =
                    deserializer.deserializeMap(STATISTICPROPERTIES_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy