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

commonMain.aws.sdk.kotlin.services.transfer.serde.DescribedConnectorDocumentDeserializer.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.DescribedConnector
import aws.sdk.kotlin.services.transfer.model.Tag
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 deserializeDescribedConnectorDocument(deserializer: Deserializer): DescribedConnector {
    val builder = DescribedConnector.Builder()
    val ACCESSROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AccessRole"))
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
    val AS2CONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("As2Config"))
    val CONNECTORID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConnectorId"))
    val LOGGINGROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LoggingRole"))
    val SECURITYPOLICYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityPolicyName"))
    val SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ServiceManagedEgressIpAddresses"))
    val SFTPCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SftpConfig"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
    val URL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Url"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCESSROLE_DESCRIPTOR)
        field(ARN_DESCRIPTOR)
        field(AS2CONFIG_DESCRIPTOR)
        field(CONNECTORID_DESCRIPTOR)
        field(LOGGINGROLE_DESCRIPTOR)
        field(SECURITYPOLICYNAME_DESCRIPTOR)
        field(SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR)
        field(SFTPCONFIG_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(URL_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACCESSROLE_DESCRIPTOR.index -> builder.accessRole = deserializeString()
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                AS2CONFIG_DESCRIPTOR.index -> builder.as2Config = deserializeAs2ConnectorConfigDocument(deserializer)
                CONNECTORID_DESCRIPTOR.index -> builder.connectorId = deserializeString()
                LOGGINGROLE_DESCRIPTOR.index -> builder.loggingRole = deserializeString()
                SECURITYPOLICYNAME_DESCRIPTOR.index -> builder.securityPolicyName = deserializeString()
                SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR.index -> builder.serviceManagedEgressIpAddresses =
                    deserializer.deserializeList(SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SFTPCONFIG_DESCRIPTOR.index -> builder.sftpConfig = deserializeSftpConnectorConfigDocument(deserializer)
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeList(TAGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeTagDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                URL_DESCRIPTOR.index -> builder.url = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy