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.76
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.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parseBoolean
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData

internal fun deserializeAutoScalingInstanceDetailsDocument(reader: XmlTagReader): AutoScalingInstanceDetails {
    val builder = AutoScalingInstanceDetails.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // InstanceId com.amazonaws.autoscaling#AutoScalingInstanceDetails$InstanceId
            "InstanceId" -> builder.instanceId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen19`)" }
            // InstanceType com.amazonaws.autoscaling#AutoScalingInstanceDetails$InstanceType
            "InstanceType" -> builder.instanceType = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
            // AutoScalingGroupName com.amazonaws.autoscaling#AutoScalingInstanceDetails$AutoScalingGroupName
            "AutoScalingGroupName" -> builder.autoScalingGroupName = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
            // AvailabilityZone com.amazonaws.autoscaling#AutoScalingInstanceDetails$AvailabilityZone
            "AvailabilityZone" -> builder.availabilityZone = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
            // LifecycleState com.amazonaws.autoscaling#AutoScalingInstanceDetails$LifecycleState
            "LifecycleState" -> builder.lifecycleState = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen32`)" }
            // HealthStatus com.amazonaws.autoscaling#AutoScalingInstanceDetails$HealthStatus
            "HealthStatus" -> builder.healthStatus = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen32`)" }
            // LaunchConfigurationName com.amazonaws.autoscaling#AutoScalingInstanceDetails$LaunchConfigurationName
            "LaunchConfigurationName" -> builder.launchConfigurationName = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
            // LaunchTemplate com.amazonaws.autoscaling#AutoScalingInstanceDetails$LaunchTemplate
            "LaunchTemplate" -> builder.launchTemplate = deserializeLaunchTemplateSpecificationDocument(curr)
            // ProtectedFromScaleIn com.amazonaws.autoscaling#AutoScalingInstanceDetails$ProtectedFromScaleIn
            "ProtectedFromScaleIn" -> builder.protectedFromScaleIn = curr.tryData()
                .parseBoolean()
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.autoscaling#InstanceProtected`)" }
            // WeightedCapacity com.amazonaws.autoscaling#AutoScalingInstanceDetails$WeightedCapacity
            "WeightedCapacity" -> builder.weightedCapacity = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen32`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy