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

commonMain.aws.sdk.kotlin.services.codedeploy.serde.InstanceInfoDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.78
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codedeploy.serde

import aws.sdk.kotlin.services.codedeploy.model.InstanceInfo
import aws.sdk.kotlin.services.codedeploy.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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf

internal fun deserializeInstanceInfoDocument(deserializer: Deserializer): InstanceInfo {
    val builder = InstanceInfo.Builder()
    val DEREGISTERTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("deregisterTime"))
    val IAMSESSIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("iamSessionArn"))
    val IAMUSERARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("iamUserArn"))
    val INSTANCEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("instanceArn"))
    val INSTANCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("instanceName"))
    val REGISTERTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("registerTime"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("tags"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DEREGISTERTIME_DESCRIPTOR)
        field(IAMSESSIONARN_DESCRIPTOR)
        field(IAMUSERARN_DESCRIPTOR)
        field(INSTANCEARN_DESCRIPTOR)
        field(INSTANCENAME_DESCRIPTOR)
        field(REGISTERTIME_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DEREGISTERTIME_DESCRIPTOR.index -> builder.deregisterTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                IAMSESSIONARN_DESCRIPTOR.index -> builder.iamSessionArn = deserializeString()
                IAMUSERARN_DESCRIPTOR.index -> builder.iamUserArn = deserializeString()
                INSTANCEARN_DESCRIPTOR.index -> builder.instanceArn = deserializeString()
                INSTANCENAME_DESCRIPTOR.index -> builder.instanceName = deserializeString()
                REGISTERTIME_DESCRIPTOR.index -> builder.registerTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                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
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy