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

commonMain.aws.sdk.kotlin.services.kendra.serde.BoxConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kendra.serde

import aws.sdk.kotlin.services.kendra.model.BoxConfiguration
import aws.sdk.kotlin.services.kendra.model.DataSourceToIndexFieldMapping
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 deserializeBoxConfigurationDocument(deserializer: Deserializer): BoxConfiguration {
    val builder = BoxConfiguration.Builder()
    val COMMENTFIELDMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("CommentFieldMappings"))
    val CRAWLCOMMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("CrawlComments"))
    val CRAWLTASKS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("CrawlTasks"))
    val CRAWLWEBLINKS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("CrawlWebLinks"))
    val ENTERPRISEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EnterpriseId"))
    val EXCLUSIONPATTERNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ExclusionPatterns"))
    val FILEFIELDMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("FileFieldMappings"))
    val INCLUSIONPATTERNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("InclusionPatterns"))
    val SECRETARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecretArn"))
    val TASKFIELDMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TaskFieldMappings"))
    val USECHANGELOG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("UseChangeLog"))
    val VPCCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VpcConfiguration"))
    val WEBLINKFIELDMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("WebLinkFieldMappings"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COMMENTFIELDMAPPINGS_DESCRIPTOR)
        field(CRAWLCOMMENTS_DESCRIPTOR)
        field(CRAWLTASKS_DESCRIPTOR)
        field(CRAWLWEBLINKS_DESCRIPTOR)
        field(ENTERPRISEID_DESCRIPTOR)
        field(EXCLUSIONPATTERNS_DESCRIPTOR)
        field(FILEFIELDMAPPINGS_DESCRIPTOR)
        field(INCLUSIONPATTERNS_DESCRIPTOR)
        field(SECRETARN_DESCRIPTOR)
        field(TASKFIELDMAPPINGS_DESCRIPTOR)
        field(USECHANGELOG_DESCRIPTOR)
        field(VPCCONFIGURATION_DESCRIPTOR)
        field(WEBLINKFIELDMAPPINGS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COMMENTFIELDMAPPINGS_DESCRIPTOR.index -> builder.commentFieldMappings =
                    deserializer.deserializeList(COMMENTFIELDMAPPINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataSourceToIndexFieldMappingDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CRAWLCOMMENTS_DESCRIPTOR.index -> builder.crawlComments = deserializeBoolean()
                CRAWLTASKS_DESCRIPTOR.index -> builder.crawlTasks = deserializeBoolean()
                CRAWLWEBLINKS_DESCRIPTOR.index -> builder.crawlWebLinks = deserializeBoolean()
                ENTERPRISEID_DESCRIPTOR.index -> builder.enterpriseId = deserializeString()
                EXCLUSIONPATTERNS_DESCRIPTOR.index -> builder.exclusionPatterns =
                    deserializer.deserializeList(EXCLUSIONPATTERNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                FILEFIELDMAPPINGS_DESCRIPTOR.index -> builder.fileFieldMappings =
                    deserializer.deserializeList(FILEFIELDMAPPINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataSourceToIndexFieldMappingDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                INCLUSIONPATTERNS_DESCRIPTOR.index -> builder.inclusionPatterns =
                    deserializer.deserializeList(INCLUSIONPATTERNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SECRETARN_DESCRIPTOR.index -> builder.secretArn = deserializeString()
                TASKFIELDMAPPINGS_DESCRIPTOR.index -> builder.taskFieldMappings =
                    deserializer.deserializeList(TASKFIELDMAPPINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataSourceToIndexFieldMappingDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                USECHANGELOG_DESCRIPTOR.index -> builder.useChangeLog = deserializeBoolean()
                VPCCONFIGURATION_DESCRIPTOR.index -> builder.vpcConfiguration = deserializeDataSourceVpcConfigurationDocument(deserializer)
                WEBLINKFIELDMAPPINGS_DESCRIPTOR.index -> builder.webLinkFieldMappings =
                    deserializer.deserializeList(WEBLINKFIELDMAPPINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataSourceToIndexFieldMappingDocument(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