
commonMain.aws.sdk.kotlin.services.appmesh.serde.HttpRetryPolicyDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appmesh.serde
import aws.sdk.kotlin.services.appmesh.model.HttpRetryPolicy
import aws.sdk.kotlin.services.appmesh.model.TcpRetryPolicyEvent
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.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf
internal fun deserializeHttpRetryPolicyDocument(deserializer: Deserializer): HttpRetryPolicy {
val builder = HttpRetryPolicy.Builder()
val HTTPRETRYEVENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("httpRetryEvents"))
val MAXRETRIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("maxRetries"))
val PERRETRYTIMEOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("perRetryTimeout"))
val TCPRETRYEVENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("tcpRetryEvents"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(HTTPRETRYEVENTS_DESCRIPTOR)
field(MAXRETRIES_DESCRIPTOR)
field(PERRETRYTIMEOUT_DESCRIPTOR)
field(TCPRETRYEVENTS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
HTTPRETRYEVENTS_DESCRIPTOR.index -> builder.httpRetryEvents =
deserializer.deserializeList(HTTPRETRYEVENTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
MAXRETRIES_DESCRIPTOR.index -> builder.maxRetries = deserializeLong()
PERRETRYTIMEOUT_DESCRIPTOR.index -> builder.perRetryTimeout = deserializeDurationDocument(deserializer)
TCPRETRYEVENTS_DESCRIPTOR.index -> builder.tcpRetryEvents =
deserializer.deserializeList(TCPRETRYEVENTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { TcpRetryPolicyEvent.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy