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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.ReplicationConfigDocumentDeserializer.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.ReplicationConfig
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 deserializeReplicationConfigDocument(deserializer: Deserializer): ReplicationConfig {
    val builder = ReplicationConfig.Builder()
    val COMPUTECONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ComputeConfig"))
    val REPLICATIONCONFIGARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationConfigArn"))
    val REPLICATIONCONFIGCREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ReplicationConfigCreateTime"))
    val REPLICATIONCONFIGIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationConfigIdentifier"))
    val REPLICATIONCONFIGUPDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ReplicationConfigUpdateTime"))
    val REPLICATIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationSettings"))
    val REPLICATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ReplicationType"))
    val SOURCEENDPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceEndpointArn"))
    val SUPPLEMENTALSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SupplementalSettings"))
    val TABLEMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TableMappings"))
    val TARGETENDPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetEndpointArn"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COMPUTECONFIG_DESCRIPTOR)
        field(REPLICATIONCONFIGARN_DESCRIPTOR)
        field(REPLICATIONCONFIGCREATETIME_DESCRIPTOR)
        field(REPLICATIONCONFIGIDENTIFIER_DESCRIPTOR)
        field(REPLICATIONCONFIGUPDATETIME_DESCRIPTOR)
        field(REPLICATIONSETTINGS_DESCRIPTOR)
        field(REPLICATIONTYPE_DESCRIPTOR)
        field(SOURCEENDPOINTARN_DESCRIPTOR)
        field(SUPPLEMENTALSETTINGS_DESCRIPTOR)
        field(TABLEMAPPINGS_DESCRIPTOR)
        field(TARGETENDPOINTARN_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COMPUTECONFIG_DESCRIPTOR.index -> builder.computeConfig = deserializeComputeConfigDocument(deserializer)
                REPLICATIONCONFIGARN_DESCRIPTOR.index -> builder.replicationConfigArn = deserializeString()
                REPLICATIONCONFIGCREATETIME_DESCRIPTOR.index -> builder.replicationConfigCreateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REPLICATIONCONFIGIDENTIFIER_DESCRIPTOR.index -> builder.replicationConfigIdentifier = deserializeString()
                REPLICATIONCONFIGUPDATETIME_DESCRIPTOR.index -> builder.replicationConfigUpdateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REPLICATIONSETTINGS_DESCRIPTOR.index -> builder.replicationSettings = deserializeString()
                REPLICATIONTYPE_DESCRIPTOR.index -> builder.replicationType = deserializeString().let { MigrationTypeValue.fromValue(it) }
                SOURCEENDPOINTARN_DESCRIPTOR.index -> builder.sourceEndpointArn = deserializeString()
                SUPPLEMENTALSETTINGS_DESCRIPTOR.index -> builder.supplementalSettings = deserializeString()
                TABLEMAPPINGS_DESCRIPTOR.index -> builder.tableMappings = deserializeString()
                TARGETENDPOINTARN_DESCRIPTOR.index -> builder.targetEndpointArn = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy