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

commonMain.aws.sdk.kotlin.services.s3.serde.QueueConfigurationDocumentDeserializer.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.Event
import aws.sdk.kotlin.services.s3.model.QueueConfiguration
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 deserializeQueueConfigurationDocument(reader: XmlTagReader): QueueConfiguration {
    val builder = QueueConfiguration.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // Id com.amazonaws.s3#QueueConfiguration$Id
            "Id" -> builder.id = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.s3#NotificationId`)" }
            // QueueArn com.amazonaws.s3#QueueConfiguration$QueueArn
            "Queue" -> builder.queueArn = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.s3#QueueArn`)" }
            // Events com.amazonaws.s3#QueueConfiguration$Events
            "Event" -> builder.events = run {
                val el = curr.tryData()
                    .parse { Event.fromValue(it) }
                    .getOrDeserializeErr { "expected (enum: `com.amazonaws.s3#Event`)" }
                createOrAppend(builder.events, el)
            }
            // Filter com.amazonaws.s3#QueueConfiguration$Filter
            "Filter" -> builder.filter = deserializeNotificationConfigurationFilterDocument(curr)
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy