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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.InstanceProfileDocumentDeserializer.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.InstanceProfile
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf

internal fun deserializeInstanceProfileDocument(deserializer: Deserializer): InstanceProfile {
    val builder = InstanceProfile.Builder()
    val AVAILABILITYZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AvailabilityZone"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val INSTANCEPROFILEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InstanceProfileArn"))
    val INSTANCEPROFILECREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("InstanceProfileCreationTime"))
    val INSTANCEPROFILENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InstanceProfileName"))
    val KMSKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyArn"))
    val NETWORKTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("NetworkType"))
    val PUBLICLYACCESSIBLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("PubliclyAccessible"))
    val SUBNETGROUPIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SubnetGroupIdentifier"))
    val VPCSECURITYGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("VpcSecurityGroups"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AVAILABILITYZONE_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(INSTANCEPROFILEARN_DESCRIPTOR)
        field(INSTANCEPROFILECREATIONTIME_DESCRIPTOR)
        field(INSTANCEPROFILENAME_DESCRIPTOR)
        field(KMSKEYARN_DESCRIPTOR)
        field(NETWORKTYPE_DESCRIPTOR)
        field(PUBLICLYACCESSIBLE_DESCRIPTOR)
        field(SUBNETGROUPIDENTIFIER_DESCRIPTOR)
        field(VPCSECURITYGROUPS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AVAILABILITYZONE_DESCRIPTOR.index -> builder.availabilityZone = deserializeString()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                INSTANCEPROFILEARN_DESCRIPTOR.index -> builder.instanceProfileArn = deserializeString()
                INSTANCEPROFILECREATIONTIME_DESCRIPTOR.index -> builder.instanceProfileCreationTime = deserializeInstant(TimestampFormat.ISO_8601)
                INSTANCEPROFILENAME_DESCRIPTOR.index -> builder.instanceProfileName = deserializeString()
                KMSKEYARN_DESCRIPTOR.index -> builder.kmsKeyArn = deserializeString()
                NETWORKTYPE_DESCRIPTOR.index -> builder.networkType = deserializeString()
                PUBLICLYACCESSIBLE_DESCRIPTOR.index -> builder.publiclyAccessible = deserializeBoolean()
                SUBNETGROUPIDENTIFIER_DESCRIPTOR.index -> builder.subnetGroupIdentifier = deserializeString()
                VPCSECURITYGROUPS_DESCRIPTOR.index -> builder.vpcSecurityGroups =
                    deserializer.deserializeList(VPCSECURITYGROUPS_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