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

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

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

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

import aws.sdk.kotlin.services.autoscaling.model.AutoScalingInstanceDetails
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 deserializeAutoScalingInstanceDetailsDocument(deserializer: Deserializer): AutoScalingInstanceDetails {
    val builder = AutoScalingInstanceDetails.Builder()
    val AUTOSCALINGGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AutoScalingGroupName"))
    val AVAILABILITYZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AvailabilityZone"))
    val HEALTHSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("HealthStatus"))
    val INSTANCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("InstanceId"))
    val INSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("InstanceType"))
    val LAUNCHCONFIGURATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("LaunchConfigurationName"))
    val LAUNCHTEMPLATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("LaunchTemplate"))
    val LIFECYCLESTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("LifecycleState"))
    val PROTECTEDFROMSCALEIN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, XmlSerialName("ProtectedFromScaleIn"))
    val WEIGHTEDCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("WeightedCapacity"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(XmlSerialName("AutoScalingInstanceDetails"))
        trait(XmlNamespace("http://autoscaling.amazonaws.com/doc/2011-01-01/"))
        field(AUTOSCALINGGROUPNAME_DESCRIPTOR)
        field(AVAILABILITYZONE_DESCRIPTOR)
        field(HEALTHSTATUS_DESCRIPTOR)
        field(INSTANCEID_DESCRIPTOR)
        field(INSTANCETYPE_DESCRIPTOR)
        field(LAUNCHCONFIGURATIONNAME_DESCRIPTOR)
        field(LAUNCHTEMPLATE_DESCRIPTOR)
        field(LIFECYCLESTATE_DESCRIPTOR)
        field(PROTECTEDFROMSCALEIN_DESCRIPTOR)
        field(WEIGHTEDCAPACITY_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTOSCALINGGROUPNAME_DESCRIPTOR.index -> builder.autoScalingGroupName = deserializeString()
                AVAILABILITYZONE_DESCRIPTOR.index -> builder.availabilityZone = deserializeString()
                HEALTHSTATUS_DESCRIPTOR.index -> builder.healthStatus = deserializeString()
                INSTANCEID_DESCRIPTOR.index -> builder.instanceId = deserializeString()
                INSTANCETYPE_DESCRIPTOR.index -> builder.instanceType = deserializeString()
                LAUNCHCONFIGURATIONNAME_DESCRIPTOR.index -> builder.launchConfigurationName = deserializeString()
                LAUNCHTEMPLATE_DESCRIPTOR.index -> builder.launchTemplate = deserializeLaunchTemplateSpecificationDocument(deserializer)
                LIFECYCLESTATE_DESCRIPTOR.index -> builder.lifecycleState = deserializeString()
                PROTECTEDFROMSCALEIN_DESCRIPTOR.index -> builder.protectedFromScaleIn = deserializeBoolean()
                WEIGHTEDCAPACITY_DESCRIPTOR.index -> builder.weightedCapacity = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy