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

commonMain.aws.sdk.kotlin.services.lexmodelbuildingservice.serde.MigrationSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lexmodelbuildingservice.serde

import aws.sdk.kotlin.services.lexmodelbuildingservice.model.Locale
import aws.sdk.kotlin.services.lexmodelbuildingservice.model.MigrationStatus
import aws.sdk.kotlin.services.lexmodelbuildingservice.model.MigrationStrategy
import aws.sdk.kotlin.services.lexmodelbuildingservice.model.MigrationSummary
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 deserializeMigrationSummaryDocument(deserializer: Deserializer): MigrationSummary {
    val builder = MigrationSummary.Builder()
    val MIGRATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("migrationId"))
    val MIGRATIONSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("migrationStatus"))
    val MIGRATIONSTRATEGY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("migrationStrategy"))
    val MIGRATIONTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("migrationTimestamp"))
    val V1BOTLOCALE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("v1BotLocale"))
    val V1BOTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("v1BotName"))
    val V1BOTVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("v1BotVersion"))
    val V2BOTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("v2BotId"))
    val V2BOTROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("v2BotRole"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(MIGRATIONID_DESCRIPTOR)
        field(MIGRATIONSTATUS_DESCRIPTOR)
        field(MIGRATIONSTRATEGY_DESCRIPTOR)
        field(MIGRATIONTIMESTAMP_DESCRIPTOR)
        field(V1BOTLOCALE_DESCRIPTOR)
        field(V1BOTNAME_DESCRIPTOR)
        field(V1BOTVERSION_DESCRIPTOR)
        field(V2BOTID_DESCRIPTOR)
        field(V2BOTROLE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                MIGRATIONID_DESCRIPTOR.index -> builder.migrationId = deserializeString()
                MIGRATIONSTATUS_DESCRIPTOR.index -> builder.migrationStatus = deserializeString().let { MigrationStatus.fromValue(it) }
                MIGRATIONSTRATEGY_DESCRIPTOR.index -> builder.migrationStrategy = deserializeString().let { MigrationStrategy.fromValue(it) }
                MIGRATIONTIMESTAMP_DESCRIPTOR.index -> builder.migrationTimestamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                V1BOTLOCALE_DESCRIPTOR.index -> builder.v1BotLocale = deserializeString().let { Locale.fromValue(it) }
                V1BOTNAME_DESCRIPTOR.index -> builder.v1BotName = deserializeString()
                V1BOTVERSION_DESCRIPTOR.index -> builder.v1BotVersion = deserializeString()
                V2BOTID_DESCRIPTOR.index -> builder.v2BotId = deserializeString()
                V2BOTROLE_DESCRIPTOR.index -> builder.v2BotRole = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy