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

commonMain.aws.sdk.kotlin.services.s3control.serde.ReplicationRuleDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.s3control.serde

import aws.sdk.kotlin.services.s3control.model.ReplicationRule
import aws.sdk.kotlin.services.s3control.model.ReplicationRuleStatus
import aws.smithy.kotlin.runtime.serde.Deserializer
import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.serde.xml.XmlDeserializer
import aws.smithy.kotlin.runtime.serde.xml.XmlNamespace
import aws.smithy.kotlin.runtime.serde.xml.XmlSerialName

internal fun deserializeReplicationRuleDocument(deserializer: Deserializer): ReplicationRule {
    val builder = ReplicationRule.Builder()
    val BUCKET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Bucket"))
    val DELETEMARKERREPLICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("DeleteMarkerReplication"))
    val DESTINATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("Destination"))
    val EXISTINGOBJECTREPLICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("ExistingObjectReplication"))
    val FILTER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("Filter"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("ID"))
    val PREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Prefix"))
    val PRIORITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("Priority"))
    val SOURCESELECTIONCRITERIA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("SourceSelectionCriteria"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("Status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(XmlSerialName("ReplicationRule"))
        trait(XmlNamespace("http://awss3control.amazonaws.com/doc/2018-08-20/"))
        field(BUCKET_DESCRIPTOR)
        field(DELETEMARKERREPLICATION_DESCRIPTOR)
        field(DESTINATION_DESCRIPTOR)
        field(EXISTINGOBJECTREPLICATION_DESCRIPTOR)
        field(FILTER_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(PREFIX_DESCRIPTOR)
        field(PRIORITY_DESCRIPTOR)
        field(SOURCESELECTIONCRITERIA_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                BUCKET_DESCRIPTOR.index -> builder.bucket = deserializeString()
                DELETEMARKERREPLICATION_DESCRIPTOR.index -> builder.deleteMarkerReplication = deserializeDeleteMarkerReplicationDocument(deserializer)
                DESTINATION_DESCRIPTOR.index -> builder.destination = deserializeDestinationDocument(deserializer)
                EXISTINGOBJECTREPLICATION_DESCRIPTOR.index -> builder.existingObjectReplication = deserializeExistingObjectReplicationDocument(deserializer)
                FILTER_DESCRIPTOR.index -> builder.filter = deserializeReplicationRuleFilterDocument(deserializer)
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                PREFIX_DESCRIPTOR.index -> builder.prefix = deserializeString()
                PRIORITY_DESCRIPTOR.index -> builder.priority = deserializeInt()
                SOURCESELECTIONCRITERIA_DESCRIPTOR.index -> builder.sourceSelectionCriteria = deserializeSourceSelectionCriteriaDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ReplicationRuleStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy