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

commonMain.aws.sdk.kotlin.services.elasticloadbalancingv2.serde.TargetGroupTupleDocumentDeserializer.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.TargetGroupTuple
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
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 deserializeTargetGroupTupleDocument(reader: XmlTagReader): TargetGroupTuple {
    val builder = TargetGroupTuple.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // TargetGroupArn com.amazonaws.elasticloadbalancingv2#TargetGroupTuple$TargetGroupArn
            "TargetGroupArn" -> builder.targetGroupArn = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.elasticloadbalancingv2#TargetGroupArn`)" }
            // Weight com.amazonaws.elasticloadbalancingv2#TargetGroupTuple$Weight
            "Weight" -> builder.weight = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.elasticloadbalancingv2#TargetGroupWeight`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy