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

commonMain.aws.sdk.kotlin.services.cloudsearch.transform.IndexFieldDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.cloudsearch.transform

import aws.sdk.kotlin.services.cloudsearch.model.IndexField
import aws.sdk.kotlin.services.cloudsearch.model.IndexFieldType
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 deserializeIndexFieldDocument(deserializer: Deserializer): IndexField {
    val builder = IndexField.Builder()
    val DATEARRAYOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("DateArrayOptions"))
    val DATEOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("DateOptions"))
    val DOUBLEARRAYOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("DoubleArrayOptions"))
    val DOUBLEOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("DoubleOptions"))
    val INDEXFIELDNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("IndexFieldName"))
    val INDEXFIELDTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("IndexFieldType"))
    val INTARRAYOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("IntArrayOptions"))
    val INTOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("IntOptions"))
    val LATLONOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("LatLonOptions"))
    val LITERALARRAYOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("LiteralArrayOptions"))
    val LITERALOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("LiteralOptions"))
    val TEXTARRAYOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("TextArrayOptions"))
    val TEXTOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("TextOptions"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(XmlSerialName("IndexField"))
        trait(XmlNamespace("http://cloudsearch.amazonaws.com/doc/2013-01-01/"))
        field(DATEARRAYOPTIONS_DESCRIPTOR)
        field(DATEOPTIONS_DESCRIPTOR)
        field(DOUBLEARRAYOPTIONS_DESCRIPTOR)
        field(DOUBLEOPTIONS_DESCRIPTOR)
        field(INDEXFIELDNAME_DESCRIPTOR)
        field(INDEXFIELDTYPE_DESCRIPTOR)
        field(INTARRAYOPTIONS_DESCRIPTOR)
        field(INTOPTIONS_DESCRIPTOR)
        field(LATLONOPTIONS_DESCRIPTOR)
        field(LITERALARRAYOPTIONS_DESCRIPTOR)
        field(LITERALOPTIONS_DESCRIPTOR)
        field(TEXTARRAYOPTIONS_DESCRIPTOR)
        field(TEXTOPTIONS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DATEARRAYOPTIONS_DESCRIPTOR.index -> builder.dateArrayOptions = deserializeDateArrayOptionsDocument(deserializer)
                DATEOPTIONS_DESCRIPTOR.index -> builder.dateOptions = deserializeDateOptionsDocument(deserializer)
                DOUBLEARRAYOPTIONS_DESCRIPTOR.index -> builder.doubleArrayOptions = deserializeDoubleArrayOptionsDocument(deserializer)
                DOUBLEOPTIONS_DESCRIPTOR.index -> builder.doubleOptions = deserializeDoubleOptionsDocument(deserializer)
                INDEXFIELDNAME_DESCRIPTOR.index -> builder.indexFieldName = deserializeString()
                INDEXFIELDTYPE_DESCRIPTOR.index -> builder.indexFieldType = deserializeString().let { IndexFieldType.fromValue(it) }
                INTARRAYOPTIONS_DESCRIPTOR.index -> builder.intArrayOptions = deserializeIntArrayOptionsDocument(deserializer)
                INTOPTIONS_DESCRIPTOR.index -> builder.intOptions = deserializeIntOptionsDocument(deserializer)
                LATLONOPTIONS_DESCRIPTOR.index -> builder.latLonOptions = deserializeLatLonOptionsDocument(deserializer)
                LITERALARRAYOPTIONS_DESCRIPTOR.index -> builder.literalArrayOptions = deserializeLiteralArrayOptionsDocument(deserializer)
                LITERALOPTIONS_DESCRIPTOR.index -> builder.literalOptions = deserializeLiteralOptionsDocument(deserializer)
                TEXTARRAYOPTIONS_DESCRIPTOR.index -> builder.textArrayOptions = deserializeTextArrayOptionsDocument(deserializer)
                TEXTOPTIONS_DESCRIPTOR.index -> builder.textOptions = deserializeTextOptionsDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy