commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.MongoDbDataProviderSettingsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databasemigrationservice-jvm Show documentation
Show all versions of databasemigrationservice-jvm Show documentation
The AWS SDK for Kotlin client for Database Migration Service
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.DmsSslModeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.MongoDbDataProviderSettings
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 deserializeMongoDbDataProviderSettingsDocument(deserializer: Deserializer): MongoDbDataProviderSettings {
val builder = MongoDbDataProviderSettings.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 CERTIFICATEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CertificateArn"))
val DATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatabaseName"))
val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Port"))
val SERVERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServerName"))
val SSLMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SslMode"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AUTHMECHANISM_DESCRIPTOR)
field(AUTHSOURCE_DESCRIPTOR)
field(AUTHTYPE_DESCRIPTOR)
field(CERTIFICATEARN_DESCRIPTOR)
field(DATABASENAME_DESCRIPTOR)
field(PORT_DESCRIPTOR)
field(SERVERNAME_DESCRIPTOR)
field(SSLMODE_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) }
CERTIFICATEARN_DESCRIPTOR.index -> builder.certificateArn = deserializeString()
DATABASENAME_DESCRIPTOR.index -> builder.databaseName = deserializeString()
PORT_DESCRIPTOR.index -> builder.port = deserializeInt()
SERVERNAME_DESCRIPTOR.index -> builder.serverName = deserializeString()
SSLMODE_DESCRIPTOR.index -> builder.sslMode = deserializeString().let { DmsSslModeValue.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy