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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.ReplicationDocumentDeserializer.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.MigrationTypeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.Replication
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 deserializeReplicationDocument(deserializer: Deserializer): Replication {
    val builder = Replication.Builder()
    val CDCSTARTPOSITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CdcStartPosition"))
    val CDCSTARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CdcStartTime"))
    val CDCSTOPPOSITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CdcStopPosition"))
    val FAILUREMESSAGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("FailureMessages"))
    val PROVISIONDATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ProvisionData"))
    val RECOVERYCHECKPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RecoveryCheckpoint"))
    val REPLICATIONCONFIGARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationConfigArn"))
    val REPLICATIONCONFIGIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationConfigIdentifier"))
    val REPLICATIONCREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ReplicationCreateTime"))
    val REPLICATIONDEPROVISIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ReplicationDeprovisionTime"))
    val REPLICATIONLASTSTOPTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ReplicationLastStopTime"))
    val REPLICATIONSTATS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ReplicationStats"))
    val REPLICATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ReplicationType"))
    val REPLICATIONUPDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ReplicationUpdateTime"))
    val SOURCEENDPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceEndpointArn"))
    val STARTREPLICATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StartReplicationType"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Status"))
    val STOPREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StopReason"))
    val TARGETENDPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetEndpointArn"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CDCSTARTPOSITION_DESCRIPTOR)
        field(CDCSTARTTIME_DESCRIPTOR)
        field(CDCSTOPPOSITION_DESCRIPTOR)
        field(FAILUREMESSAGES_DESCRIPTOR)
        field(PROVISIONDATA_DESCRIPTOR)
        field(RECOVERYCHECKPOINT_DESCRIPTOR)
        field(REPLICATIONCONFIGARN_DESCRIPTOR)
        field(REPLICATIONCONFIGIDENTIFIER_DESCRIPTOR)
        field(REPLICATIONCREATETIME_DESCRIPTOR)
        field(REPLICATIONDEPROVISIONTIME_DESCRIPTOR)
        field(REPLICATIONLASTSTOPTIME_DESCRIPTOR)
        field(REPLICATIONSTATS_DESCRIPTOR)
        field(REPLICATIONTYPE_DESCRIPTOR)
        field(REPLICATIONUPDATETIME_DESCRIPTOR)
        field(SOURCEENDPOINTARN_DESCRIPTOR)
        field(STARTREPLICATIONTYPE_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(STOPREASON_DESCRIPTOR)
        field(TARGETENDPOINTARN_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CDCSTARTPOSITION_DESCRIPTOR.index -> builder.cdcStartPosition = deserializeString()
                CDCSTARTTIME_DESCRIPTOR.index -> builder.cdcStartTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                CDCSTOPPOSITION_DESCRIPTOR.index -> builder.cdcStopPosition = deserializeString()
                FAILUREMESSAGES_DESCRIPTOR.index -> builder.failureMessages =
                    deserializer.deserializeList(FAILUREMESSAGES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PROVISIONDATA_DESCRIPTOR.index -> builder.provisionData = deserializeProvisionDataDocument(deserializer)
                RECOVERYCHECKPOINT_DESCRIPTOR.index -> builder.recoveryCheckpoint = deserializeString()
                REPLICATIONCONFIGARN_DESCRIPTOR.index -> builder.replicationConfigArn = deserializeString()
                REPLICATIONCONFIGIDENTIFIER_DESCRIPTOR.index -> builder.replicationConfigIdentifier = deserializeString()
                REPLICATIONCREATETIME_DESCRIPTOR.index -> builder.replicationCreateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REPLICATIONDEPROVISIONTIME_DESCRIPTOR.index -> builder.replicationDeprovisionTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REPLICATIONLASTSTOPTIME_DESCRIPTOR.index -> builder.replicationLastStopTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REPLICATIONSTATS_DESCRIPTOR.index -> builder.replicationStats = deserializeReplicationStatsDocument(deserializer)
                REPLICATIONTYPE_DESCRIPTOR.index -> builder.replicationType = deserializeString().let { MigrationTypeValue.fromValue(it) }
                REPLICATIONUPDATETIME_DESCRIPTOR.index -> builder.replicationUpdateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                SOURCEENDPOINTARN_DESCRIPTOR.index -> builder.sourceEndpointArn = deserializeString()
                STARTREPLICATIONTYPE_DESCRIPTOR.index -> builder.startReplicationType = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
                STOPREASON_DESCRIPTOR.index -> builder.stopReason = deserializeString()
                TARGETENDPOINTARN_DESCRIPTOR.index -> builder.targetEndpointArn = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy