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

commonMain.aws.sdk.kotlin.services.elasticloadbalancingv2.serde.TrustStoreDocumentDeserializer.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.TrustStore
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.TrustStoreStatus
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.parseLong
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData

internal fun deserializeTrustStoreDocument(reader: XmlTagReader): TrustStore {
    val builder = TrustStore.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // Name com.amazonaws.elasticloadbalancingv2#TrustStore$Name
            "Name" -> builder.name = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.elasticloadbalancingv2#TrustStoreName`)" }
            // TrustStoreArn com.amazonaws.elasticloadbalancingv2#TrustStore$TrustStoreArn
            "TrustStoreArn" -> builder.trustStoreArn = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.elasticloadbalancingv2#TrustStoreArn`)" }
            // Status com.amazonaws.elasticloadbalancingv2#TrustStore$Status
            "Status" -> builder.status = curr.tryData()
                .parse { TrustStoreStatus.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.elasticloadbalancingv2#TrustStoreStatus`)" }
            // NumberOfCaCertificates com.amazonaws.elasticloadbalancingv2#TrustStore$NumberOfCaCertificates
            "NumberOfCaCertificates" -> builder.numberOfCaCertificates = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.elasticloadbalancingv2#NumberOfCaCertificates`)" }
            // TotalRevokedEntries com.amazonaws.elasticloadbalancingv2#TrustStore$TotalRevokedEntries
            "TotalRevokedEntries" -> builder.totalRevokedEntries = curr.tryData()
                .parseLong()
                .getOrDeserializeErr { "expected (long: `com.amazonaws.elasticloadbalancingv2#TotalRevokedEntries`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy