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

commonMain.aws.sdk.kotlin.services.glue.serde.StatementDocumentDeserializer.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.Statement
import aws.sdk.kotlin.services.glue.model.StatementState
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 deserializeStatementDocument(deserializer: Deserializer): Statement {
    val builder = Statement.Builder()
    val CODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Code"))
    val COMPLETEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("CompletedOn"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Id"))
    val OUTPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Output"))
    val PROGRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("Progress"))
    val STARTEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("StartedOn"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CODE_DESCRIPTOR)
        field(COMPLETEDON_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(OUTPUT_DESCRIPTOR)
        field(PROGRESS_DESCRIPTOR)
        field(STARTEDON_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CODE_DESCRIPTOR.index -> builder.code = deserializeString()
                COMPLETEDON_DESCRIPTOR.index -> builder.completedOn = deserializeLong()
                ID_DESCRIPTOR.index -> builder.id = deserializeInt()
                OUTPUT_DESCRIPTOR.index -> builder.output = deserializeStatementOutputDocument(deserializer)
                PROGRESS_DESCRIPTOR.index -> builder.progress = deserializeDouble()
                STARTEDON_DESCRIPTOR.index -> builder.startedOn = deserializeLong()
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { StatementState.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy