
commonMain.aws.sdk.kotlin.services.kafka.serde.TopicReplicationDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kafka.serde
import aws.sdk.kotlin.services.kafka.model.TopicReplication
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.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf
internal fun deserializeTopicReplicationDocument(deserializer: Deserializer): TopicReplication {
val builder = TopicReplication.Builder()
val COPYACCESSCONTROLLISTSFORTOPICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("copyAccessControlListsForTopics"))
val COPYTOPICCONFIGURATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("copyTopicConfigurations"))
val DETECTANDCOPYNEWTOPICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("detectAndCopyNewTopics"))
val STARTINGPOSITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("startingPosition"))
val TOPICNAMECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("topicNameConfiguration"))
val TOPICSTOEXCLUDE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("topicsToExclude"))
val TOPICSTOREPLICATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("topicsToReplicate"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(COPYACCESSCONTROLLISTSFORTOPICS_DESCRIPTOR)
field(COPYTOPICCONFIGURATIONS_DESCRIPTOR)
field(DETECTANDCOPYNEWTOPICS_DESCRIPTOR)
field(STARTINGPOSITION_DESCRIPTOR)
field(TOPICNAMECONFIGURATION_DESCRIPTOR)
field(TOPICSTOEXCLUDE_DESCRIPTOR)
field(TOPICSTOREPLICATE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
COPYACCESSCONTROLLISTSFORTOPICS_DESCRIPTOR.index -> builder.copyAccessControlListsForTopics = deserializeBoolean()
COPYTOPICCONFIGURATIONS_DESCRIPTOR.index -> builder.copyTopicConfigurations = deserializeBoolean()
DETECTANDCOPYNEWTOPICS_DESCRIPTOR.index -> builder.detectAndCopyNewTopics = deserializeBoolean()
STARTINGPOSITION_DESCRIPTOR.index -> builder.startingPosition = deserializeReplicationStartingPositionDocument(deserializer)
TOPICNAMECONFIGURATION_DESCRIPTOR.index -> builder.topicNameConfiguration = deserializeReplicationTopicNameConfigurationDocument(deserializer)
TOPICSTOEXCLUDE_DESCRIPTOR.index -> builder.topicsToExclude =
deserializer.deserializeList(TOPICSTOEXCLUDE_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TOPICSTOREPLICATE_DESCRIPTOR.index -> builder.topicsToReplicate =
deserializer.deserializeList(TOPICSTOREPLICATE_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy