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

commonMain.aws.sdk.kotlin.services.athena.serde.CalculationResultDocumentDeserializer.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.athena.serde

import aws.sdk.kotlin.services.athena.model.CalculationResult
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

internal fun deserializeCalculationResultDocument(deserializer: Deserializer): CalculationResult {
    val builder = CalculationResult.Builder()
    val RESULTS3URI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResultS3Uri"))
    val RESULTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResultType"))
    val STDERRORS3URI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StdErrorS3Uri"))
    val STDOUTS3URI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StdOutS3Uri"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(RESULTS3URI_DESCRIPTOR)
        field(RESULTTYPE_DESCRIPTOR)
        field(STDERRORS3URI_DESCRIPTOR)
        field(STDOUTS3URI_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                RESULTS3URI_DESCRIPTOR.index -> builder.resultS3Uri = deserializeString()
                RESULTTYPE_DESCRIPTOR.index -> builder.resultType = deserializeString()
                STDERRORS3URI_DESCRIPTOR.index -> builder.stdErrorS3Uri = deserializeString()
                STDOUTS3URI_DESCRIPTOR.index -> builder.stdOutS3Uri = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy