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