commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.EngineVersionDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databasemigrationservice-jvm Show documentation
Show all versions of databasemigrationservice-jvm Show documentation
The AWS SDK for Kotlin client for Database Migration Service
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.EngineVersion
import aws.sdk.kotlin.services.databasemigrationservice.model.ReleaseStatusValues
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
import kotlin.collections.mutableListOf
internal fun deserializeEngineVersionDocument(deserializer: Deserializer): EngineVersion {
val builder = EngineVersion.Builder()
val AUTOUPGRADEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("AutoUpgradeDate"))
val AVAILABLEUPGRADES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AvailableUpgrades"))
val DEPRECATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("DeprecationDate"))
val FORCEUPGRADEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ForceUpgradeDate"))
val LAUNCHDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LaunchDate"))
val LIFECYCLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Lifecycle"))
val RELEASESTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ReleaseStatus"))
val VERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Version"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AUTOUPGRADEDATE_DESCRIPTOR)
field(AVAILABLEUPGRADES_DESCRIPTOR)
field(DEPRECATIONDATE_DESCRIPTOR)
field(FORCEUPGRADEDATE_DESCRIPTOR)
field(LAUNCHDATE_DESCRIPTOR)
field(LIFECYCLE_DESCRIPTOR)
field(RELEASESTATUS_DESCRIPTOR)
field(VERSION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
AUTOUPGRADEDATE_DESCRIPTOR.index -> builder.autoUpgradeDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
AVAILABLEUPGRADES_DESCRIPTOR.index -> builder.availableUpgrades =
deserializer.deserializeList(AVAILABLEUPGRADES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
DEPRECATIONDATE_DESCRIPTOR.index -> builder.deprecationDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
FORCEUPGRADEDATE_DESCRIPTOR.index -> builder.forceUpgradeDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LAUNCHDATE_DESCRIPTOR.index -> builder.launchDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LIFECYCLE_DESCRIPTOR.index -> builder.lifecycle = deserializeString()
RELEASESTATUS_DESCRIPTOR.index -> builder.releaseStatus = deserializeString().let { ReleaseStatusValues.fromValue(it) }
VERSION_DESCRIPTOR.index -> builder.version = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy