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

commonMain.aws.sdk.kotlin.services.s3.serde.IntelligentTieringConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.s3.serde

import aws.sdk.kotlin.services.s3.model.IntelligentTieringConfiguration
import aws.sdk.kotlin.services.s3.model.IntelligentTieringStatus
import aws.smithy.kotlin.runtime.collections.createOrAppend
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData

internal fun deserializeIntelligentTieringConfigurationDocument(reader: XmlTagReader): IntelligentTieringConfiguration {
    val builder = IntelligentTieringConfiguration.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // Id com.amazonaws.s3#IntelligentTieringConfiguration$Id
            "Id" -> builder.id = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.s3#IntelligentTieringId`)" }
            // Filter com.amazonaws.s3#IntelligentTieringConfiguration$Filter
            "Filter" -> builder.filter = deserializeIntelligentTieringFilterDocument(curr)
            // Status com.amazonaws.s3#IntelligentTieringConfiguration$Status
            "Status" -> builder.status = curr.tryData()
                .parse { IntelligentTieringStatus.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.s3#IntelligentTieringStatus`)" }
            // Tierings com.amazonaws.s3#IntelligentTieringConfiguration$Tierings
            "Tiering" -> builder.tierings = run {
                val el = deserializeTieringDocument(curr)
                createOrAppend(builder.tierings, el)
            }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy