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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.MigrationProjectDocumentDeserializer.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.DataProviderDescriptor
import aws.sdk.kotlin.services.databasemigrationservice.model.MigrationProject
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 deserializeMigrationProjectDocument(deserializer: Deserializer): MigrationProject {
    val builder = MigrationProject.Builder()
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val INSTANCEPROFILEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InstanceProfileArn"))
    val INSTANCEPROFILENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InstanceProfileName"))
    val MIGRATIONPROJECTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MigrationProjectArn"))
    val MIGRATIONPROJECTCREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("MigrationProjectCreationTime"))
    val MIGRATIONPROJECTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MigrationProjectName"))
    val SCHEMACONVERSIONAPPLICATIONATTRIBUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SchemaConversionApplicationAttributes"))
    val SOURCEDATAPROVIDERDESCRIPTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SourceDataProviderDescriptors"))
    val TARGETDATAPROVIDERDESCRIPTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TargetDataProviderDescriptors"))
    val TRANSFORMATIONRULES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TransformationRules"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DESCRIPTION_DESCRIPTOR)
        field(INSTANCEPROFILEARN_DESCRIPTOR)
        field(INSTANCEPROFILENAME_DESCRIPTOR)
        field(MIGRATIONPROJECTARN_DESCRIPTOR)
        field(MIGRATIONPROJECTCREATIONTIME_DESCRIPTOR)
        field(MIGRATIONPROJECTNAME_DESCRIPTOR)
        field(SCHEMACONVERSIONAPPLICATIONATTRIBUTES_DESCRIPTOR)
        field(SOURCEDATAPROVIDERDESCRIPTORS_DESCRIPTOR)
        field(TARGETDATAPROVIDERDESCRIPTORS_DESCRIPTOR)
        field(TRANSFORMATIONRULES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                INSTANCEPROFILEARN_DESCRIPTOR.index -> builder.instanceProfileArn = deserializeString()
                INSTANCEPROFILENAME_DESCRIPTOR.index -> builder.instanceProfileName = deserializeString()
                MIGRATIONPROJECTARN_DESCRIPTOR.index -> builder.migrationProjectArn = deserializeString()
                MIGRATIONPROJECTCREATIONTIME_DESCRIPTOR.index -> builder.migrationProjectCreationTime = deserializeInstant(TimestampFormat.ISO_8601)
                MIGRATIONPROJECTNAME_DESCRIPTOR.index -> builder.migrationProjectName = deserializeString()
                SCHEMACONVERSIONAPPLICATIONATTRIBUTES_DESCRIPTOR.index -> builder.schemaConversionApplicationAttributes = deserializeScApplicationAttributesDocument(deserializer)
                SOURCEDATAPROVIDERDESCRIPTORS_DESCRIPTOR.index -> builder.sourceDataProviderDescriptors =
                    deserializer.deserializeList(SOURCEDATAPROVIDERDESCRIPTORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataProviderDescriptorDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                TARGETDATAPROVIDERDESCRIPTORS_DESCRIPTOR.index -> builder.targetDataProviderDescriptors =
                    deserializer.deserializeList(TARGETDATAPROVIDERDESCRIPTORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataProviderDescriptorDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                TRANSFORMATIONRULES_DESCRIPTOR.index -> builder.transformationRules = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy