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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.DataMigrationDocumentDeserializer.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.DataMigration
import aws.sdk.kotlin.services.databasemigrationservice.model.MigrationTypeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.SourceDataSetting
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 deserializeDataMigrationDocument(deserializer: Deserializer): DataMigration {
    val builder = DataMigration.Builder()
    val DATAMIGRATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DataMigrationArn"))
    val DATAMIGRATIONCIDRBLOCKS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DataMigrationCidrBlocks"))
    val DATAMIGRATIONCREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("DataMigrationCreateTime"))
    val DATAMIGRATIONENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("DataMigrationEndTime"))
    val DATAMIGRATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DataMigrationName"))
    val DATAMIGRATIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DataMigrationSettings"))
    val DATAMIGRATIONSTARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("DataMigrationStartTime"))
    val DATAMIGRATIONSTATISTICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DataMigrationStatistics"))
    val DATAMIGRATIONSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DataMigrationStatus"))
    val DATAMIGRATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("DataMigrationType"))
    val LASTFAILUREMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LastFailureMessage"))
    val MIGRATIONPROJECTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MigrationProjectArn"))
    val PUBLICIPADDRESSES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PublicIpAddresses"))
    val SERVICEACCESSROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceAccessRoleArn"))
    val SOURCEDATASETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SourceDataSettings"))
    val STOPREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StopReason"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DATAMIGRATIONARN_DESCRIPTOR)
        field(DATAMIGRATIONCIDRBLOCKS_DESCRIPTOR)
        field(DATAMIGRATIONCREATETIME_DESCRIPTOR)
        field(DATAMIGRATIONENDTIME_DESCRIPTOR)
        field(DATAMIGRATIONNAME_DESCRIPTOR)
        field(DATAMIGRATIONSETTINGS_DESCRIPTOR)
        field(DATAMIGRATIONSTARTTIME_DESCRIPTOR)
        field(DATAMIGRATIONSTATISTICS_DESCRIPTOR)
        field(DATAMIGRATIONSTATUS_DESCRIPTOR)
        field(DATAMIGRATIONTYPE_DESCRIPTOR)
        field(LASTFAILUREMESSAGE_DESCRIPTOR)
        field(MIGRATIONPROJECTARN_DESCRIPTOR)
        field(PUBLICIPADDRESSES_DESCRIPTOR)
        field(SERVICEACCESSROLEARN_DESCRIPTOR)
        field(SOURCEDATASETTINGS_DESCRIPTOR)
        field(STOPREASON_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DATAMIGRATIONARN_DESCRIPTOR.index -> builder.dataMigrationArn = deserializeString()
                DATAMIGRATIONCIDRBLOCKS_DESCRIPTOR.index -> builder.dataMigrationCidrBlocks =
                    deserializer.deserializeList(DATAMIGRATIONCIDRBLOCKS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                DATAMIGRATIONCREATETIME_DESCRIPTOR.index -> builder.dataMigrationCreateTime = deserializeInstant(TimestampFormat.ISO_8601)
                DATAMIGRATIONENDTIME_DESCRIPTOR.index -> builder.dataMigrationEndTime = deserializeInstant(TimestampFormat.ISO_8601)
                DATAMIGRATIONNAME_DESCRIPTOR.index -> builder.dataMigrationName = deserializeString()
                DATAMIGRATIONSETTINGS_DESCRIPTOR.index -> builder.dataMigrationSettings = deserializeDataMigrationSettingsDocument(deserializer)
                DATAMIGRATIONSTARTTIME_DESCRIPTOR.index -> builder.dataMigrationStartTime = deserializeInstant(TimestampFormat.ISO_8601)
                DATAMIGRATIONSTATISTICS_DESCRIPTOR.index -> builder.dataMigrationStatistics = deserializeDataMigrationStatisticsDocument(deserializer)
                DATAMIGRATIONSTATUS_DESCRIPTOR.index -> builder.dataMigrationStatus = deserializeString()
                DATAMIGRATIONTYPE_DESCRIPTOR.index -> builder.dataMigrationType = deserializeString().let { MigrationTypeValue.fromValue(it) }
                LASTFAILUREMESSAGE_DESCRIPTOR.index -> builder.lastFailureMessage = deserializeString()
                MIGRATIONPROJECTARN_DESCRIPTOR.index -> builder.migrationProjectArn = deserializeString()
                PUBLICIPADDRESSES_DESCRIPTOR.index -> builder.publicIpAddresses =
                    deserializer.deserializeList(PUBLICIPADDRESSES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SERVICEACCESSROLEARN_DESCRIPTOR.index -> builder.serviceAccessRoleArn = deserializeString()
                SOURCEDATASETTINGS_DESCRIPTOR.index -> builder.sourceDataSettings =
                    deserializer.deserializeList(SOURCEDATASETTINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeSourceDataSettingDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                STOPREASON_DESCRIPTOR.index -> builder.stopReason = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy