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

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

There is a newer version: 1.3.76
Show 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.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.Serializer
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

internal fun serializeSolutionConfigDocument(serializer: Serializer, input: SolutionConfig) {
    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)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.eventValueThreshold?.let { field(EVENTVALUETHRESHOLD_DESCRIPTOR, it) }
        input.hpoConfig?.let { field(HPOCONFIG_DESCRIPTOR, it, ::serializeHpoConfigDocument) }
        if (input.algorithmHyperParameters != null) {
            mapField(ALGORITHMHYPERPARAMETERS_DESCRIPTOR) {
                input.algorithmHyperParameters.forEach { (key, value) ->
                    entry(key, value)
                }
            }
        }
        if (input.featureTransformationParameters != null) {
            mapField(FEATURETRANSFORMATIONPARAMETERS_DESCRIPTOR) {
                input.featureTransformationParameters.forEach { (key, value) ->
                    entry(key, value)
                }
            }
        }
        input.autoMlConfig?.let { field(AUTOMLCONFIG_DESCRIPTOR, it, ::serializeAutoMlConfigDocument) }
        input.optimizationObjective?.let { field(OPTIMIZATIONOBJECTIVE_DESCRIPTOR, it, ::serializeOptimizationObjectiveDocument) }
        input.trainingDataConfig?.let { field(TRAININGDATACONFIG_DESCRIPTOR, it, ::serializeTrainingDataConfigDocument) }
        input.autoTrainingConfig?.let { field(AUTOTRAININGCONFIG_DESCRIPTOR, it, ::serializeAutoTrainingConfigDocument) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy