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

commonMain.aws.sdk.kotlin.services.transfer.serde.DescribedServerDocumentDeserializer.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.DescribedServer
import aws.sdk.kotlin.services.transfer.model.Domain
import aws.sdk.kotlin.services.transfer.model.EndpointType
import aws.sdk.kotlin.services.transfer.model.IdentityProviderType
import aws.sdk.kotlin.services.transfer.model.Protocol
import aws.sdk.kotlin.services.transfer.model.State
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 deserializeDescribedServerDocument(deserializer: Deserializer): DescribedServer {
    val builder = DescribedServer.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
    val AS2SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("As2ServiceManagedEgressIpAddresses"))
    val CERTIFICATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Certificate"))
    val DOMAIN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Domain"))
    val ENDPOINTDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("EndpointDetails"))
    val ENDPOINTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EndpointType"))
    val HOSTKEYFINGERPRINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HostKeyFingerprint"))
    val IDENTITYPROVIDERDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("IdentityProviderDetails"))
    val IDENTITYPROVIDERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("IdentityProviderType"))
    val LOGGINGROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LoggingRole"))
    val POSTAUTHENTICATIONLOGINBANNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PostAuthenticationLoginBanner"))
    val PREAUTHENTICATIONLOGINBANNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PreAuthenticationLoginBanner"))
    val PROTOCOLDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ProtocolDetails"))
    val PROTOCOLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Protocols"))
    val S3STORAGEOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("S3StorageOptions"))
    val SECURITYPOLICYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityPolicyName"))
    val SERVERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServerId"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
    val STRUCTUREDLOGDESTINATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StructuredLogDestinations"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
    val USERCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("UserCount"))
    val WORKFLOWDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("WorkflowDetails"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(AS2SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR)
        field(CERTIFICATE_DESCRIPTOR)
        field(DOMAIN_DESCRIPTOR)
        field(ENDPOINTDETAILS_DESCRIPTOR)
        field(ENDPOINTTYPE_DESCRIPTOR)
        field(HOSTKEYFINGERPRINT_DESCRIPTOR)
        field(IDENTITYPROVIDERDETAILS_DESCRIPTOR)
        field(IDENTITYPROVIDERTYPE_DESCRIPTOR)
        field(LOGGINGROLE_DESCRIPTOR)
        field(POSTAUTHENTICATIONLOGINBANNER_DESCRIPTOR)
        field(PREAUTHENTICATIONLOGINBANNER_DESCRIPTOR)
        field(PROTOCOLDETAILS_DESCRIPTOR)
        field(PROTOCOLS_DESCRIPTOR)
        field(S3STORAGEOPTIONS_DESCRIPTOR)
        field(SECURITYPOLICYNAME_DESCRIPTOR)
        field(SERVERID_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(STRUCTUREDLOGDESTINATIONS_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(USERCOUNT_DESCRIPTOR)
        field(WORKFLOWDETAILS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                AS2SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR.index -> builder.as2ServiceManagedEgressIpAddresses =
                    deserializer.deserializeList(AS2SERVICEMANAGEDEGRESSIPADDRESSES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CERTIFICATE_DESCRIPTOR.index -> builder.certificate = deserializeString()
                DOMAIN_DESCRIPTOR.index -> builder.domain = deserializeString().let { Domain.fromValue(it) }
                ENDPOINTDETAILS_DESCRIPTOR.index -> builder.endpointDetails = deserializeEndpointDetailsDocument(deserializer)
                ENDPOINTTYPE_DESCRIPTOR.index -> builder.endpointType = deserializeString().let { EndpointType.fromValue(it) }
                HOSTKEYFINGERPRINT_DESCRIPTOR.index -> builder.hostKeyFingerprint = deserializeString()
                IDENTITYPROVIDERDETAILS_DESCRIPTOR.index -> builder.identityProviderDetails = deserializeIdentityProviderDetailsDocument(deserializer)
                IDENTITYPROVIDERTYPE_DESCRIPTOR.index -> builder.identityProviderType = deserializeString().let { IdentityProviderType.fromValue(it) }
                LOGGINGROLE_DESCRIPTOR.index -> builder.loggingRole = deserializeString()
                POSTAUTHENTICATIONLOGINBANNER_DESCRIPTOR.index -> builder.postAuthenticationLoginBanner = deserializeString()
                PREAUTHENTICATIONLOGINBANNER_DESCRIPTOR.index -> builder.preAuthenticationLoginBanner = deserializeString()
                PROTOCOLDETAILS_DESCRIPTOR.index -> builder.protocolDetails = deserializeProtocolDetailsDocument(deserializer)
                PROTOCOLS_DESCRIPTOR.index -> builder.protocols =
                    deserializer.deserializeList(PROTOCOLS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { Protocol.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                S3STORAGEOPTIONS_DESCRIPTOR.index -> builder.s3StorageOptions = deserializeS3StorageOptionsDocument(deserializer)
                SECURITYPOLICYNAME_DESCRIPTOR.index -> builder.securityPolicyName = deserializeString()
                SERVERID_DESCRIPTOR.index -> builder.serverId = deserializeString()
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { State.fromValue(it) }
                STRUCTUREDLOGDESTINATIONS_DESCRIPTOR.index -> builder.structuredLogDestinations =
                    deserializer.deserializeList(STRUCTUREDLOGDESTINATIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                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
                    }
                USERCOUNT_DESCRIPTOR.index -> builder.userCount = deserializeInt()
                WORKFLOWDETAILS_DESCRIPTOR.index -> builder.workflowDetails = deserializeWorkflowDetailsDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy