
commonMain.aws.sdk.kotlin.services.s3.serde.GrantDocumentDeserializer.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.Grant
import aws.sdk.kotlin.services.s3.model.Permission
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 deserializeGrantDocument(reader: XmlTagReader): Grant {
val builder = Grant.Builder()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
// Grantee com.amazonaws.s3#Grant$Grantee
"Grantee" -> builder.grantee = deserializeGranteeDocument(curr)
// Permission com.amazonaws.s3#Grant$Permission
"Permission" -> builder.permission = curr.tryData()
.parse { Permission.fromValue(it) }
.getOrDeserializeErr { "expected (enum: `com.amazonaws.s3#Permission`)" }
else -> {}
}
curr.drop()
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy