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

commonMain.aws.sdk.kotlin.services.cleanrooms.serde.AnalysisRuleAggregationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cleanrooms.serde

import aws.sdk.kotlin.services.cleanrooms.model.AdditionalAnalyses
import aws.sdk.kotlin.services.cleanrooms.model.AggregateColumn
import aws.sdk.kotlin.services.cleanrooms.model.AggregationConstraint
import aws.sdk.kotlin.services.cleanrooms.model.AnalysisRuleAggregation
import aws.sdk.kotlin.services.cleanrooms.model.JoinOperator
import aws.sdk.kotlin.services.cleanrooms.model.JoinRequiredOption
import aws.sdk.kotlin.services.cleanrooms.model.ScalarFunctions
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 deserializeAnalysisRuleAggregationDocument(deserializer: Deserializer): AnalysisRuleAggregation {
    val builder = AnalysisRuleAggregation.Builder()
    val ADDITIONALANALYSES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("additionalAnalyses"))
    val AGGREGATECOLUMNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("aggregateColumns"))
    val ALLOWEDJOINOPERATORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("allowedJoinOperators"))
    val DIMENSIONCOLUMNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("dimensionColumns"))
    val JOINCOLUMNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("joinColumns"))
    val JOINREQUIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("joinRequired"))
    val OUTPUTCONSTRAINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("outputConstraints"))
    val SCALARFUNCTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("scalarFunctions"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ADDITIONALANALYSES_DESCRIPTOR)
        field(AGGREGATECOLUMNS_DESCRIPTOR)
        field(ALLOWEDJOINOPERATORS_DESCRIPTOR)
        field(DIMENSIONCOLUMNS_DESCRIPTOR)
        field(JOINCOLUMNS_DESCRIPTOR)
        field(JOINREQUIRED_DESCRIPTOR)
        field(OUTPUTCONSTRAINTS_DESCRIPTOR)
        field(SCALARFUNCTIONS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ADDITIONALANALYSES_DESCRIPTOR.index -> builder.additionalAnalyses = deserializeString().let { AdditionalAnalyses.fromValue(it) }
                AGGREGATECOLUMNS_DESCRIPTOR.index -> builder.aggregateColumns =
                    deserializer.deserializeList(AGGREGATECOLUMNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeAggregateColumnDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ALLOWEDJOINOPERATORS_DESCRIPTOR.index -> builder.allowedJoinOperators =
                    deserializer.deserializeList(ALLOWEDJOINOPERATORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { JoinOperator.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                DIMENSIONCOLUMNS_DESCRIPTOR.index -> builder.dimensionColumns =
                    deserializer.deserializeList(DIMENSIONCOLUMNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                JOINCOLUMNS_DESCRIPTOR.index -> builder.joinColumns =
                    deserializer.deserializeList(JOINCOLUMNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                JOINREQUIRED_DESCRIPTOR.index -> builder.joinRequired = deserializeString().let { JoinRequiredOption.fromValue(it) }
                OUTPUTCONSTRAINTS_DESCRIPTOR.index -> builder.outputConstraints =
                    deserializer.deserializeList(OUTPUTCONSTRAINTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeAggregationConstraintDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SCALARFUNCTIONS_DESCRIPTOR.index -> builder.scalarFunctions =
                    deserializer.deserializeList(SCALARFUNCTIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { ScalarFunctions.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy