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

commonMain.aws.sdk.kotlin.services.elasticloadbalancingv2.serde.TargetGroupStickinessConfigDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.elasticloadbalancingv2.serde

import aws.sdk.kotlin.services.elasticloadbalancingv2.model.TargetGroupStickinessConfig
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parseBoolean
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 deserializeTargetGroupStickinessConfigDocument(reader: XmlTagReader): TargetGroupStickinessConfig {
    val builder = TargetGroupStickinessConfig.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // Enabled com.amazonaws.elasticloadbalancingv2#TargetGroupStickinessConfig$Enabled
            "Enabled" -> builder.enabled = curr.tryData()
                .parseBoolean()
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.elasticloadbalancingv2#TargetGroupStickinessEnabled`)" }
            // DurationSeconds com.amazonaws.elasticloadbalancingv2#TargetGroupStickinessConfig$DurationSeconds
            "DurationSeconds" -> builder.durationSeconds = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.elasticloadbalancingv2#TargetGroupStickinessDurationSeconds`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy