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

commonMain.aws.sdk.kotlin.services.autoscaling.serde.WarmPoolConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.autoscaling.serde

import aws.sdk.kotlin.services.autoscaling.model.WarmPoolConfiguration
import aws.sdk.kotlin.services.autoscaling.model.WarmPoolState
import aws.sdk.kotlin.services.autoscaling.model.WarmPoolStatus
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.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.serde.xml.XmlDeserializer
import aws.smithy.kotlin.runtime.serde.xml.XmlNamespace
import aws.smithy.kotlin.runtime.serde.xml.XmlSerialName

internal fun deserializeWarmPoolConfigurationDocument(deserializer: Deserializer): WarmPoolConfiguration {
    val builder = WarmPoolConfiguration.Builder()
    val INSTANCEREUSEPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("InstanceReusePolicy"))
    val MAXGROUPPREPAREDCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("MaxGroupPreparedCapacity"))
    val MINSIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("MinSize"))
    val POOLSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("PoolState"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("Status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(XmlSerialName("WarmPoolConfiguration"))
        trait(XmlNamespace("http://autoscaling.amazonaws.com/doc/2011-01-01/"))
        field(INSTANCEREUSEPOLICY_DESCRIPTOR)
        field(MAXGROUPPREPAREDCAPACITY_DESCRIPTOR)
        field(MINSIZE_DESCRIPTOR)
        field(POOLSTATE_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                INSTANCEREUSEPOLICY_DESCRIPTOR.index -> builder.instanceReusePolicy = deserializeInstanceReusePolicyDocument(deserializer)
                MAXGROUPPREPAREDCAPACITY_DESCRIPTOR.index -> builder.maxGroupPreparedCapacity = deserializeInt()
                MINSIZE_DESCRIPTOR.index -> builder.minSize = deserializeInt()
                POOLSTATE_DESCRIPTOR.index -> builder.poolState = deserializeString().let { WarmPoolState.fromValue(it) }
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { WarmPoolStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy