commonMain.aws.sdk.kotlin.services.eventbridge.serde.RedshiftDataParametersDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eventbridge-jvm Show documentation
Show all versions of eventbridge-jvm Show documentation
The AWS SDK for Kotlin client for EventBridge
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.eventbridge.serde
import aws.sdk.kotlin.services.eventbridge.model.RedshiftDataParameters
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 kotlin.collections.mutableListOf
internal fun deserializeRedshiftDataParametersDocument(deserializer: Deserializer): RedshiftDataParameters {
val builder = RedshiftDataParameters.Builder()
val DATABASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Database"))
val DBUSER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DbUser"))
val SECRETMANAGERARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecretManagerArn"))
val SQL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Sql"))
val SQLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Sqls"))
val STATEMENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatementName"))
val WITHEVENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("WithEvent"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DATABASE_DESCRIPTOR)
field(DBUSER_DESCRIPTOR)
field(SECRETMANAGERARN_DESCRIPTOR)
field(SQL_DESCRIPTOR)
field(SQLS_DESCRIPTOR)
field(STATEMENTNAME_DESCRIPTOR)
field(WITHEVENT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DATABASE_DESCRIPTOR.index -> builder.database = deserializeString()
DBUSER_DESCRIPTOR.index -> builder.dbUser = deserializeString()
SECRETMANAGERARN_DESCRIPTOR.index -> builder.secretManagerArn = deserializeString()
SQL_DESCRIPTOR.index -> builder.sql = deserializeString()
SQLS_DESCRIPTOR.index -> builder.sqls =
deserializer.deserializeList(SQLS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STATEMENTNAME_DESCRIPTOR.index -> builder.statementName = deserializeString()
WITHEVENT_DESCRIPTOR.index -> builder.withEvent = deserializeBoolean()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}