commonMain.aws.sdk.kotlin.services.autoscaling.serde.AutoScalingInstanceDetailsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoscaling-jvm Show documentation
Show all versions of autoscaling-jvm Show documentation
The AWS SDK for Kotlin client for Auto Scaling
// 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()
}