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

commonMain.aws.sdk.kotlin.services.glue.serde.StatisticModelResultDocumentDeserializer.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.InclusionAnnotationValue
import aws.sdk.kotlin.services.glue.model.StatisticModelResult
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

internal fun deserializeStatisticModelResultDocument(deserializer: Deserializer): StatisticModelResult {
    val builder = StatisticModelResult.Builder()
    val ACTUALVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("ActualValue"))
    val DATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("Date"))
    val INCLUSIONANNOTATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("InclusionAnnotation"))
    val LOWERBOUND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("LowerBound"))
    val PREDICTEDVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("PredictedValue"))
    val UPPERBOUND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("UpperBound"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACTUALVALUE_DESCRIPTOR)
        field(DATE_DESCRIPTOR)
        field(INCLUSIONANNOTATION_DESCRIPTOR)
        field(LOWERBOUND_DESCRIPTOR)
        field(PREDICTEDVALUE_DESCRIPTOR)
        field(UPPERBOUND_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTUALVALUE_DESCRIPTOR.index -> builder.actualValue = deserializeDouble()
                DATE_DESCRIPTOR.index -> builder.date = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                INCLUSIONANNOTATION_DESCRIPTOR.index -> builder.inclusionAnnotation = deserializeString().let { InclusionAnnotationValue.fromValue(it) }
                LOWERBOUND_DESCRIPTOR.index -> builder.lowerBound = deserializeDouble()
                PREDICTEDVALUE_DESCRIPTOR.index -> builder.predictedValue = deserializeDouble()
                UPPERBOUND_DESCRIPTOR.index -> builder.upperBound = deserializeDouble()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy