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

commonMain.aws.sdk.kotlin.services.transfer.serde.ProtocolDetailsDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.79
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.transfer.serde

import aws.sdk.kotlin.services.transfer.model.As2Transport
import aws.sdk.kotlin.services.transfer.model.ProtocolDetails
import aws.sdk.kotlin.services.transfer.model.SetStatOption
import aws.sdk.kotlin.services.transfer.model.TlsSessionResumptionMode
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 kotlin.collections.mutableListOf

internal fun deserializeProtocolDetailsDocument(deserializer: Deserializer): ProtocolDetails {
    val builder = ProtocolDetails.Builder()
    val AS2TRANSPORTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("As2Transports"))
    val PASSIVEIP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PassiveIp"))
    val SETSTATOPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SetStatOption"))
    val TLSSESSIONRESUMPTIONMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TlsSessionResumptionMode"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AS2TRANSPORTS_DESCRIPTOR)
        field(PASSIVEIP_DESCRIPTOR)
        field(SETSTATOPTION_DESCRIPTOR)
        field(TLSSESSIONRESUMPTIONMODE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AS2TRANSPORTS_DESCRIPTOR.index -> builder.as2Transports =
                    deserializer.deserializeList(AS2TRANSPORTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { As2Transport.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PASSIVEIP_DESCRIPTOR.index -> builder.passiveIp = deserializeString()
                SETSTATOPTION_DESCRIPTOR.index -> builder.setStatOption = deserializeString().let { SetStatOption.fromValue(it) }
                TLSSESSIONRESUMPTIONMODE_DESCRIPTOR.index -> builder.tlsSessionResumptionMode = deserializeString().let { TlsSessionResumptionMode.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy