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

commonMain.aws.sdk.kotlin.services.personalize.serde.SolutionConfigDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.personalize.serde

import aws.sdk.kotlin.services.personalize.model.SolutionConfig
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.mutableMapOf

internal fun deserializeSolutionConfigDocument(deserializer: Deserializer): SolutionConfig {
    val builder = SolutionConfig.Builder()
    val ALGORITHMHYPERPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("algorithmHyperParameters"))
    val AUTOMLCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("autoMLConfig"))
    val AUTOTRAININGCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("autoTrainingConfig"))
    val EVENTVALUETHRESHOLD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("eventValueThreshold"))
    val FEATURETRANSFORMATIONPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("featureTransformationParameters"))
    val HPOCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("hpoConfig"))
    val OPTIMIZATIONOBJECTIVE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("optimizationObjective"))
    val TRAININGDATACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("trainingDataConfig"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ALGORITHMHYPERPARAMETERS_DESCRIPTOR)
        field(AUTOMLCONFIG_DESCRIPTOR)
        field(AUTOTRAININGCONFIG_DESCRIPTOR)
        field(EVENTVALUETHRESHOLD_DESCRIPTOR)
        field(FEATURETRANSFORMATIONPARAMETERS_DESCRIPTOR)
        field(HPOCONFIG_DESCRIPTOR)
        field(OPTIMIZATIONOBJECTIVE_DESCRIPTOR)
        field(TRAININGDATACONFIG_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ALGORITHMHYPERPARAMETERS_DESCRIPTOR.index -> builder.algorithmHyperParameters =
                    deserializer.deserializeMap(ALGORITHMHYPERPARAMETERS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                AUTOMLCONFIG_DESCRIPTOR.index -> builder.autoMlConfig = deserializeAutoMlConfigDocument(deserializer)
                AUTOTRAININGCONFIG_DESCRIPTOR.index -> builder.autoTrainingConfig = deserializeAutoTrainingConfigDocument(deserializer)
                EVENTVALUETHRESHOLD_DESCRIPTOR.index -> builder.eventValueThreshold = deserializeString()
                FEATURETRANSFORMATIONPARAMETERS_DESCRIPTOR.index -> builder.featureTransformationParameters =
                    deserializer.deserializeMap(FEATURETRANSFORMATIONPARAMETERS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                HPOCONFIG_DESCRIPTOR.index -> builder.hpoConfig = deserializeHpoConfigDocument(deserializer)
                OPTIMIZATIONOBJECTIVE_DESCRIPTOR.index -> builder.optimizationObjective = deserializeOptimizationObjectiveDocument(deserializer)
                TRAININGDATACONFIG_DESCRIPTOR.index -> builder.trainingDataConfig = deserializeTrainingDataConfigDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy