commonMain.aws.sdk.kotlin.services.autoscaling.serde.InstanceMetadataOptionsDocumentDeserializer.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.InstanceMetadataEndpointState
import aws.sdk.kotlin.services.autoscaling.model.InstanceMetadataHttpTokensState
import aws.sdk.kotlin.services.autoscaling.model.InstanceMetadataOptions
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
import aws.smithy.kotlin.runtime.serde.parseInt
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData
internal fun deserializeInstanceMetadataOptionsDocument(reader: XmlTagReader): InstanceMetadataOptions {
val builder = InstanceMetadataOptions.Builder()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
// HttpTokens com.amazonaws.autoscaling#InstanceMetadataOptions$HttpTokens
"HttpTokens" -> builder.httpTokens = curr.tryData()
.parse { InstanceMetadataHttpTokensState.fromValue(it) }
.getOrDeserializeErr { "expected (enum: `com.amazonaws.autoscaling#InstanceMetadataHttpTokensState`)" }
// HttpPutResponseHopLimit com.amazonaws.autoscaling#InstanceMetadataOptions$HttpPutResponseHopLimit
"HttpPutResponseHopLimit" -> builder.httpPutResponseHopLimit = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#InstanceMetadataHttpPutResponseHopLimit`)" }
// HttpEndpoint com.amazonaws.autoscaling#InstanceMetadataOptions$HttpEndpoint
"HttpEndpoint" -> builder.httpEndpoint = curr.tryData()
.parse { InstanceMetadataEndpointState.fromValue(it) }
.getOrDeserializeErr { "expected (enum: `com.amazonaws.autoscaling#InstanceMetadataEndpointState`)" }
else -> {}
}
curr.drop()
}
builder.correctErrors()
return builder.build()
}