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

commonMain.aws.sdk.kotlin.services.transfer.serde.As2ConnectorConfigDocumentDeserializer.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.As2ConnectorConfig
import aws.sdk.kotlin.services.transfer.model.CompressionEnum
import aws.sdk.kotlin.services.transfer.model.EncryptionAlg
import aws.sdk.kotlin.services.transfer.model.MdnResponse
import aws.sdk.kotlin.services.transfer.model.MdnSigningAlg
import aws.sdk.kotlin.services.transfer.model.SigningAlg
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 deserializeAs2ConnectorConfigDocument(deserializer: Deserializer): As2ConnectorConfig {
    val builder = As2ConnectorConfig.Builder()
    val BASICAUTHSECRETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BasicAuthSecretId"))
    val COMPRESSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Compression"))
    val ENCRYPTIONALGORITHM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EncryptionAlgorithm"))
    val LOCALPROFILEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LocalProfileId"))
    val MDNRESPONSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("MdnResponse"))
    val MDNSIGNINGALGORITHM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("MdnSigningAlgorithm"))
    val MESSAGESUBJECT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MessageSubject"))
    val PARTNERPROFILEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PartnerProfileId"))
    val SIGNINGALGORITHM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SigningAlgorithm"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(BASICAUTHSECRETID_DESCRIPTOR)
        field(COMPRESSION_DESCRIPTOR)
        field(ENCRYPTIONALGORITHM_DESCRIPTOR)
        field(LOCALPROFILEID_DESCRIPTOR)
        field(MDNRESPONSE_DESCRIPTOR)
        field(MDNSIGNINGALGORITHM_DESCRIPTOR)
        field(MESSAGESUBJECT_DESCRIPTOR)
        field(PARTNERPROFILEID_DESCRIPTOR)
        field(SIGNINGALGORITHM_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                BASICAUTHSECRETID_DESCRIPTOR.index -> builder.basicAuthSecretId = deserializeString()
                COMPRESSION_DESCRIPTOR.index -> builder.compression = deserializeString().let { CompressionEnum.fromValue(it) }
                ENCRYPTIONALGORITHM_DESCRIPTOR.index -> builder.encryptionAlgorithm = deserializeString().let { EncryptionAlg.fromValue(it) }
                LOCALPROFILEID_DESCRIPTOR.index -> builder.localProfileId = deserializeString()
                MDNRESPONSE_DESCRIPTOR.index -> builder.mdnResponse = deserializeString().let { MdnResponse.fromValue(it) }
                MDNSIGNINGALGORITHM_DESCRIPTOR.index -> builder.mdnSigningAlgorithm = deserializeString().let { MdnSigningAlg.fromValue(it) }
                MESSAGESUBJECT_DESCRIPTOR.index -> builder.messageSubject = deserializeString()
                PARTNERPROFILEID_DESCRIPTOR.index -> builder.partnerProfileId = deserializeString()
                SIGNINGALGORITHM_DESCRIPTOR.index -> builder.signingAlgorithm = deserializeString().let { SigningAlg.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy