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

commonMain.aws.sdk.kotlin.services.appmesh.serde.HttpRetryPolicyDocumentSerializer.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.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.Serializer
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

internal fun serializeHttpRetryPolicyDocument(serializer: Serializer, input: HttpRetryPolicy) {
    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)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.perRetryTimeout?.let { field(PERRETRYTIMEOUT_DESCRIPTOR, it, ::serializeDurationDocument) }
        field(MAXRETRIES_DESCRIPTOR, input.maxRetries)
        if (input.httpRetryEvents != null) {
            listField(HTTPRETRYEVENTS_DESCRIPTOR) {
                for (el0 in input.httpRetryEvents) {
                    serializeString(el0)
                }
            }
        }
        if (input.tcpRetryEvents != null) {
            listField(TCPRETRYEVENTS_DESCRIPTOR) {
                for (el0 in input.tcpRetryEvents) {
                    serializeString(el0.value)
                }
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy