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

commonMain.aws.sdk.kotlin.services.entityresolution.serde.NamespaceRuleBasedPropertiesDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.entityresolution.serde

import aws.sdk.kotlin.services.entityresolution.model.AttributeMatchingModel
import aws.sdk.kotlin.services.entityresolution.model.IdMappingWorkflowRuleDefinitionType
import aws.sdk.kotlin.services.entityresolution.model.NamespaceRuleBasedProperties
import aws.sdk.kotlin.services.entityresolution.model.RecordMatchingModel
import aws.sdk.kotlin.services.entityresolution.model.Rule
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 deserializeNamespaceRuleBasedPropertiesDocument(deserializer: Deserializer): NamespaceRuleBasedProperties {
    val builder = NamespaceRuleBasedProperties.Builder()
    val ATTRIBUTEMATCHINGMODEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("attributeMatchingModel"))
    val RECORDMATCHINGMODELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("recordMatchingModels"))
    val RULEDEFINITIONTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ruleDefinitionTypes"))
    val RULES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("rules"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ATTRIBUTEMATCHINGMODEL_DESCRIPTOR)
        field(RECORDMATCHINGMODELS_DESCRIPTOR)
        field(RULEDEFINITIONTYPES_DESCRIPTOR)
        field(RULES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ATTRIBUTEMATCHINGMODEL_DESCRIPTOR.index -> builder.attributeMatchingModel = deserializeString().let { AttributeMatchingModel.fromValue(it) }
                RECORDMATCHINGMODELS_DESCRIPTOR.index -> builder.recordMatchingModels =
                    deserializer.deserializeList(RECORDMATCHINGMODELS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { RecordMatchingModel.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                RULEDEFINITIONTYPES_DESCRIPTOR.index -> builder.ruleDefinitionTypes =
                    deserializer.deserializeList(RULEDEFINITIONTYPES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { IdMappingWorkflowRuleDefinitionType.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                RULES_DESCRIPTOR.index -> builder.rules =
                    deserializer.deserializeList(RULES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeRuleDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy