commonMain.aws.sdk.kotlin.services.redshiftserverless.serde.NamespaceDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshiftserverless-jvm Show documentation
Show all versions of redshiftserverless-jvm Show documentation
The AWS SDK for Kotlin client for Redshift Serverless
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.redshiftserverless.serde
import aws.sdk.kotlin.services.redshiftserverless.model.LogExport
import aws.sdk.kotlin.services.redshiftserverless.model.Namespace
import aws.sdk.kotlin.services.redshiftserverless.model.NamespaceStatus
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 deserializeNamespaceDocument(deserializer: Deserializer): Namespace {
val builder = Namespace.Builder()
val ADMINPASSWORDSECRETARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("adminPasswordSecretArn"))
val ADMINPASSWORDSECRETKMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("adminPasswordSecretKmsKeyId"))
val ADMINUSERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("adminUsername"))
val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("creationDate"))
val DBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dbName"))
val DEFAULTIAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("defaultIamRoleArn"))
val IAMROLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("iamRoles"))
val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("kmsKeyId"))
val LOGEXPORTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("logExports"))
val NAMESPACEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceArn"))
val NAMESPACEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceId"))
val NAMESPACENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceName"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADMINPASSWORDSECRETARN_DESCRIPTOR)
field(ADMINPASSWORDSECRETKMSKEYID_DESCRIPTOR)
field(ADMINUSERNAME_DESCRIPTOR)
field(CREATIONDATE_DESCRIPTOR)
field(DBNAME_DESCRIPTOR)
field(DEFAULTIAMROLEARN_DESCRIPTOR)
field(IAMROLES_DESCRIPTOR)
field(KMSKEYID_DESCRIPTOR)
field(LOGEXPORTS_DESCRIPTOR)
field(NAMESPACEARN_DESCRIPTOR)
field(NAMESPACEID_DESCRIPTOR)
field(NAMESPACENAME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADMINPASSWORDSECRETARN_DESCRIPTOR.index -> builder.adminPasswordSecretArn = deserializeString()
ADMINPASSWORDSECRETKMSKEYID_DESCRIPTOR.index -> builder.adminPasswordSecretKmsKeyId = deserializeString()
ADMINUSERNAME_DESCRIPTOR.index -> builder.adminUsername = deserializeString()
CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeInstant(TimestampFormat.ISO_8601)
DBNAME_DESCRIPTOR.index -> builder.dbName = deserializeString()
DEFAULTIAMROLEARN_DESCRIPTOR.index -> builder.defaultIamRoleArn = deserializeString()
IAMROLES_DESCRIPTOR.index -> builder.iamRoles =
deserializer.deserializeList(IAMROLES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
KMSKEYID_DESCRIPTOR.index -> builder.kmsKeyId = deserializeString()
LOGEXPORTS_DESCRIPTOR.index -> builder.logExports =
deserializer.deserializeList(LOGEXPORTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { LogExport.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
NAMESPACEARN_DESCRIPTOR.index -> builder.namespaceArn = deserializeString()
NAMESPACEID_DESCRIPTOR.index -> builder.namespaceId = deserializeString()
NAMESPACENAME_DESCRIPTOR.index -> builder.namespaceName = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { NamespaceStatus.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}