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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.ComputeConfigDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.databasemigrationservice.serde

import aws.sdk.kotlin.services.databasemigrationservice.model.ComputeConfig
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 deserializeComputeConfigDocument(deserializer: Deserializer): ComputeConfig {
    val builder = ComputeConfig.Builder()
    val AVAILABILITYZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AvailabilityZone"))
    val DNSNAMESERVERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DnsNameServers"))
    val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyId"))
    val MAXCAPACITYUNITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxCapacityUnits"))
    val MINCAPACITYUNITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MinCapacityUnits"))
    val MULTIAZ_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("MultiAZ"))
    val PREFERREDMAINTENANCEWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PreferredMaintenanceWindow"))
    val REPLICATIONSUBNETGROUPID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationSubnetGroupId"))
    val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("VpcSecurityGroupIds"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AVAILABILITYZONE_DESCRIPTOR)
        field(DNSNAMESERVERS_DESCRIPTOR)
        field(KMSKEYID_DESCRIPTOR)
        field(MAXCAPACITYUNITS_DESCRIPTOR)
        field(MINCAPACITYUNITS_DESCRIPTOR)
        field(MULTIAZ_DESCRIPTOR)
        field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
        field(REPLICATIONSUBNETGROUPID_DESCRIPTOR)
        field(VPCSECURITYGROUPIDS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AVAILABILITYZONE_DESCRIPTOR.index -> builder.availabilityZone = deserializeString()
                DNSNAMESERVERS_DESCRIPTOR.index -> builder.dnsNameServers = deserializeString()
                KMSKEYID_DESCRIPTOR.index -> builder.kmsKeyId = deserializeString()
                MAXCAPACITYUNITS_DESCRIPTOR.index -> builder.maxCapacityUnits = deserializeInt()
                MINCAPACITYUNITS_DESCRIPTOR.index -> builder.minCapacityUnits = deserializeInt()
                MULTIAZ_DESCRIPTOR.index -> builder.multiAz = deserializeBoolean()
                PREFERREDMAINTENANCEWINDOW_DESCRIPTOR.index -> builder.preferredMaintenanceWindow = deserializeString()
                REPLICATIONSUBNETGROUPID_DESCRIPTOR.index -> builder.replicationSubnetGroupId = deserializeString()
                VPCSECURITYGROUPIDS_DESCRIPTOR.index -> builder.vpcSecurityGroupIds =
                    deserializer.deserializeList(VPCSECURITYGROUPIDS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy