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

commonMain.aws.sdk.kotlin.services.personalize.serde.SolutionDocumentDeserializer.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.Solution
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat

internal fun deserializeSolutionDocument(deserializer: Deserializer): Solution {
    val builder = Solution.Builder()
    val AUTOMLRESULT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("autoMLResult"))
    val CREATIONDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("creationDateTime"))
    val DATASETGROUPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("datasetGroupArn"))
    val EVENTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("eventType"))
    val LASTUPDATEDDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastUpdatedDateTime"))
    val LATESTSOLUTIONVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("latestSolutionVersion"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val PERFORMAUTOML_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("performAutoML"))
    val PERFORMAUTOTRAINING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("performAutoTraining"))
    val PERFORMHPO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("performHPO"))
    val RECIPEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("recipeArn"))
    val SOLUTIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("solutionArn"))
    val SOLUTIONCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("solutionConfig"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AUTOMLRESULT_DESCRIPTOR)
        field(CREATIONDATETIME_DESCRIPTOR)
        field(DATASETGROUPARN_DESCRIPTOR)
        field(EVENTTYPE_DESCRIPTOR)
        field(LASTUPDATEDDATETIME_DESCRIPTOR)
        field(LATESTSOLUTIONVERSION_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PERFORMAUTOML_DESCRIPTOR)
        field(PERFORMAUTOTRAINING_DESCRIPTOR)
        field(PERFORMHPO_DESCRIPTOR)
        field(RECIPEARN_DESCRIPTOR)
        field(SOLUTIONARN_DESCRIPTOR)
        field(SOLUTIONCONFIG_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTOMLRESULT_DESCRIPTOR.index -> builder.autoMlResult = deserializeAutoMlResultDocument(deserializer)
                CREATIONDATETIME_DESCRIPTOR.index -> builder.creationDateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DATASETGROUPARN_DESCRIPTOR.index -> builder.datasetGroupArn = deserializeString()
                EVENTTYPE_DESCRIPTOR.index -> builder.eventType = deserializeString()
                LASTUPDATEDDATETIME_DESCRIPTOR.index -> builder.lastUpdatedDateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LATESTSOLUTIONVERSION_DESCRIPTOR.index -> builder.latestSolutionVersion = deserializeSolutionVersionSummaryDocument(deserializer)
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PERFORMAUTOML_DESCRIPTOR.index -> builder.performAutoMl = deserializeBoolean()
                PERFORMAUTOTRAINING_DESCRIPTOR.index -> builder.performAutoTraining = deserializeBoolean()
                PERFORMHPO_DESCRIPTOR.index -> builder.performHpo = deserializeBoolean()
                RECIPEARN_DESCRIPTOR.index -> builder.recipeArn = deserializeString()
                SOLUTIONARN_DESCRIPTOR.index -> builder.solutionArn = deserializeString()
                SOLUTIONCONFIG_DESCRIPTOR.index -> builder.solutionConfig = deserializeSolutionConfigDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy