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

commonMain.aws.sdk.kotlin.services.mgn.transform.ReplicationConfigurationTemplateDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.mgn.transform

import aws.sdk.kotlin.services.mgn.model.ReplicationConfigurationDataPlaneRouting
import aws.sdk.kotlin.services.mgn.model.ReplicationConfigurationDefaultLargeStagingDiskType
import aws.sdk.kotlin.services.mgn.model.ReplicationConfigurationEbsEncryption
import aws.sdk.kotlin.services.mgn.model.ReplicationConfigurationTemplate
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 deserializeReplicationConfigurationTemplateDocument(deserializer: Deserializer): ReplicationConfigurationTemplate {
    val builder = ReplicationConfigurationTemplate.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val ASSOCIATEDEFAULTSECURITYGROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("associateDefaultSecurityGroup"))
    val BANDWIDTHTHROTTLING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("bandwidthThrottling"))
    val CREATEPUBLICIP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("createPublicIP"))
    val DATAPLANEROUTING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dataPlaneRouting"))
    val DEFAULTLARGESTAGINGDISKTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("defaultLargeStagingDiskType"))
    val EBSENCRYPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ebsEncryption"))
    val EBSENCRYPTIONKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ebsEncryptionKeyArn"))
    val REPLICATIONCONFIGURATIONTEMPLATEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("replicationConfigurationTemplateID"))
    val REPLICATIONSERVERINSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("replicationServerInstanceType"))
    val REPLICATIONSERVERSSECURITYGROUPSIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("replicationServersSecurityGroupsIDs"))
    val STAGINGAREASUBNETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("stagingAreaSubnetId"))
    val STAGINGAREATAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("stagingAreaTags"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
    val USEDEDICATEDREPLICATIONSERVER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("useDedicatedReplicationServer"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(ASSOCIATEDEFAULTSECURITYGROUP_DESCRIPTOR)
        field(BANDWIDTHTHROTTLING_DESCRIPTOR)
        field(CREATEPUBLICIP_DESCRIPTOR)
        field(DATAPLANEROUTING_DESCRIPTOR)
        field(DEFAULTLARGESTAGINGDISKTYPE_DESCRIPTOR)
        field(EBSENCRYPTION_DESCRIPTOR)
        field(EBSENCRYPTIONKEYARN_DESCRIPTOR)
        field(REPLICATIONCONFIGURATIONTEMPLATEID_DESCRIPTOR)
        field(REPLICATIONSERVERINSTANCETYPE_DESCRIPTOR)
        field(REPLICATIONSERVERSSECURITYGROUPSIDS_DESCRIPTOR)
        field(STAGINGAREASUBNETID_DESCRIPTOR)
        field(STAGINGAREATAGS_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(USEDEDICATEDREPLICATIONSERVER_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                ASSOCIATEDEFAULTSECURITYGROUP_DESCRIPTOR.index -> builder.associateDefaultSecurityGroup = deserializeBoolean()
                BANDWIDTHTHROTTLING_DESCRIPTOR.index -> builder.bandwidthThrottling = deserializeLong()
                CREATEPUBLICIP_DESCRIPTOR.index -> builder.createPublicIp = deserializeBoolean()
                DATAPLANEROUTING_DESCRIPTOR.index -> builder.dataPlaneRouting = deserializeString().let { ReplicationConfigurationDataPlaneRouting.fromValue(it) }
                DEFAULTLARGESTAGINGDISKTYPE_DESCRIPTOR.index -> builder.defaultLargeStagingDiskType = deserializeString().let { ReplicationConfigurationDefaultLargeStagingDiskType.fromValue(it) }
                EBSENCRYPTION_DESCRIPTOR.index -> builder.ebsEncryption = deserializeString().let { ReplicationConfigurationEbsEncryption.fromValue(it) }
                EBSENCRYPTIONKEYARN_DESCRIPTOR.index -> builder.ebsEncryptionKeyArn = deserializeString()
                REPLICATIONCONFIGURATIONTEMPLATEID_DESCRIPTOR.index -> builder.replicationConfigurationTemplateId = deserializeString()
                REPLICATIONSERVERINSTANCETYPE_DESCRIPTOR.index -> builder.replicationServerInstanceType = deserializeString()
                REPLICATIONSERVERSSECURITYGROUPSIDS_DESCRIPTOR.index -> builder.replicationServersSecurityGroupsIDs =
                    deserializer.deserializeList(REPLICATIONSERVERSSECURITYGROUPSIDS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                STAGINGAREASUBNETID_DESCRIPTOR.index -> builder.stagingAreaSubnetId = deserializeString()
                STAGINGAREATAGS_DESCRIPTOR.index -> builder.stagingAreaTags =
                    deserializer.deserializeMap(STAGINGAREATAGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeMap(TAGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                USEDEDICATEDREPLICATIONSERVER_DESCRIPTOR.index -> builder.useDedicatedReplicationServer = deserializeBoolean()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy