commonMain.aws.sdk.kotlin.services.redshift.serde.EncryptionContextMapShapeDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshift-jvm Show documentation
Show all versions of redshift-jvm Show documentation
The AWS SDK for Kotlin client for Redshift
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.redshift.serde
import aws.smithy.kotlin.runtime.serde.DeserializationException
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData
import kotlin.collections.MutableMap
internal fun deserializeEncryptionContextMapShape(reader: XmlTagReader): Map {
val result = mutableMapOf()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
"entry" -> {
deserializeEncryptionContextMapEntry(result, curr)
}
else -> {}
}
curr.drop()
}
return result
}
internal fun deserializeEncryptionContextMapEntry(dest: MutableMap, reader: XmlTagReader) {
var key: String? = null
var value: String? = null
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
"key" -> key = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
"value" -> value = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
else -> {}
}
curr.drop()
}
if (key == null) throw DeserializationException("missing key map entry")
if (value == null) throw DeserializationException("missing value map entry")
dest[key] = value
}