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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.RecommendationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.databasemigrationservice.serde

import aws.sdk.kotlin.services.databasemigrationservice.model.Recommendation
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

internal fun deserializeRecommendationDocument(deserializer: Deserializer): Recommendation {
    val builder = Recommendation.Builder()
    val CREATEDDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CreatedDate"))
    val DATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Data"))
    val DATABASEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatabaseId"))
    val ENGINENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EngineName"))
    val PREFERRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Preferred"))
    val SETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Settings"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATEDDATE_DESCRIPTOR)
        field(DATA_DESCRIPTOR)
        field(DATABASEID_DESCRIPTOR)
        field(ENGINENAME_DESCRIPTOR)
        field(PREFERRED_DESCRIPTOR)
        field(SETTINGS_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATEDDATE_DESCRIPTOR.index -> builder.createdDate = deserializeString()
                DATA_DESCRIPTOR.index -> builder.data = deserializeRecommendationDataDocument(deserializer)
                DATABASEID_DESCRIPTOR.index -> builder.databaseId = deserializeString()
                ENGINENAME_DESCRIPTOR.index -> builder.engineName = deserializeString()
                PREFERRED_DESCRIPTOR.index -> builder.preferred = deserializeBoolean()
                SETTINGS_DESCRIPTOR.index -> builder.settings = deserializeRecommendationSettingsDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy