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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.MongoDbSettingsDocumentDeserializer.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.AuthMechanismValue
import aws.sdk.kotlin.services.databasemigrationservice.model.AuthTypeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.MongoDbSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.NestingLevelValue
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

internal fun deserializeMongoDbSettingsDocument(deserializer: Deserializer): MongoDbSettings {
    val builder = MongoDbSettings.Builder()
    val AUTHMECHANISM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AuthMechanism"))
    val AUTHSOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AuthSource"))
    val AUTHTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AuthType"))
    val DATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatabaseName"))
    val DOCSTOINVESTIGATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DocsToInvestigate"))
    val EXTRACTDOCID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ExtractDocId"))
    val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyId"))
    val NESTINGLEVEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("NestingLevel"))
    val PASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Password"))
    val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Port"))
    val REPLICATESHARDCOLLECTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("ReplicateShardCollections"))
    val SECRETSMANAGERACCESSROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecretsManagerAccessRoleArn"))
    val SECRETSMANAGERSECRETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecretsManagerSecretId"))
    val SERVERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServerName"))
    val USEUPDATELOOKUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("UseUpdateLookUp"))
    val USERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Username"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AUTHMECHANISM_DESCRIPTOR)
        field(AUTHSOURCE_DESCRIPTOR)
        field(AUTHTYPE_DESCRIPTOR)
        field(DATABASENAME_DESCRIPTOR)
        field(DOCSTOINVESTIGATE_DESCRIPTOR)
        field(EXTRACTDOCID_DESCRIPTOR)
        field(KMSKEYID_DESCRIPTOR)
        field(NESTINGLEVEL_DESCRIPTOR)
        field(PASSWORD_DESCRIPTOR)
        field(PORT_DESCRIPTOR)
        field(REPLICATESHARDCOLLECTIONS_DESCRIPTOR)
        field(SECRETSMANAGERACCESSROLEARN_DESCRIPTOR)
        field(SECRETSMANAGERSECRETID_DESCRIPTOR)
        field(SERVERNAME_DESCRIPTOR)
        field(USEUPDATELOOKUP_DESCRIPTOR)
        field(USERNAME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTHMECHANISM_DESCRIPTOR.index -> builder.authMechanism = deserializeString().let { AuthMechanismValue.fromValue(it) }
                AUTHSOURCE_DESCRIPTOR.index -> builder.authSource = deserializeString()
                AUTHTYPE_DESCRIPTOR.index -> builder.authType = deserializeString().let { AuthTypeValue.fromValue(it) }
                DATABASENAME_DESCRIPTOR.index -> builder.databaseName = deserializeString()
                DOCSTOINVESTIGATE_DESCRIPTOR.index -> builder.docsToInvestigate = deserializeString()
                EXTRACTDOCID_DESCRIPTOR.index -> builder.extractDocId = deserializeString()
                KMSKEYID_DESCRIPTOR.index -> builder.kmsKeyId = deserializeString()
                NESTINGLEVEL_DESCRIPTOR.index -> builder.nestingLevel = deserializeString().let { NestingLevelValue.fromValue(it) }
                PASSWORD_DESCRIPTOR.index -> builder.password = deserializeString()
                PORT_DESCRIPTOR.index -> builder.port = deserializeInt()
                REPLICATESHARDCOLLECTIONS_DESCRIPTOR.index -> builder.replicateShardCollections = deserializeBoolean()
                SECRETSMANAGERACCESSROLEARN_DESCRIPTOR.index -> builder.secretsManagerAccessRoleArn = deserializeString()
                SECRETSMANAGERSECRETID_DESCRIPTOR.index -> builder.secretsManagerSecretId = deserializeString()
                SERVERNAME_DESCRIPTOR.index -> builder.serverName = deserializeString()
                USEUPDATELOOKUP_DESCRIPTOR.index -> builder.useUpdateLookUp = deserializeBoolean()
                USERNAME_DESCRIPTOR.index -> builder.username = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy