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

commonMain.aws.sdk.kotlin.services.redshiftserverless.serde.SnapshotDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.redshiftserverless.serde

import aws.sdk.kotlin.services.redshiftserverless.model.Snapshot
import aws.sdk.kotlin.services.redshiftserverless.model.SnapshotStatus
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 deserializeSnapshotDocument(deserializer: Deserializer): Snapshot {
    val builder = Snapshot.Builder()
    val ACCOUNTSWITHPROVISIONEDRESTOREACCESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("accountsWithProvisionedRestoreAccess"))
    val ACCOUNTSWITHRESTOREACCESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("accountsWithRestoreAccess"))
    val ACTUALINCREMENTALBACKUPSIZEINMEGABYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("actualIncrementalBackupSizeInMegaBytes"))
    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 BACKUPPROGRESSINMEGABYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("backupProgressInMegaBytes"))
    val CURRENTBACKUPRATEINMEGABYTESPERSECOND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("currentBackupRateInMegaBytesPerSecond"))
    val ELAPSEDTIMEINSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("elapsedTimeInSeconds"))
    val ESTIMATEDSECONDSTOCOMPLETION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("estimatedSecondsToCompletion"))
    val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("kmsKeyId"))
    val NAMESPACEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceArn"))
    val NAMESPACENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceName"))
    val OWNERACCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ownerAccount"))
    val SNAPSHOTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("snapshotArn"))
    val SNAPSHOTCREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("snapshotCreateTime"))
    val SNAPSHOTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("snapshotName"))
    val SNAPSHOTREMAININGDAYS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("snapshotRemainingDays"))
    val SNAPSHOTRETENTIONPERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("snapshotRetentionPeriod"))
    val SNAPSHOTRETENTIONSTARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("snapshotRetentionStartTime"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val TOTALBACKUPSIZEINMEGABYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("totalBackupSizeInMegaBytes"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCOUNTSWITHPROVISIONEDRESTOREACCESS_DESCRIPTOR)
        field(ACCOUNTSWITHRESTOREACCESS_DESCRIPTOR)
        field(ACTUALINCREMENTALBACKUPSIZEINMEGABYTES_DESCRIPTOR)
        field(ADMINPASSWORDSECRETARN_DESCRIPTOR)
        field(ADMINPASSWORDSECRETKMSKEYID_DESCRIPTOR)
        field(ADMINUSERNAME_DESCRIPTOR)
        field(BACKUPPROGRESSINMEGABYTES_DESCRIPTOR)
        field(CURRENTBACKUPRATEINMEGABYTESPERSECOND_DESCRIPTOR)
        field(ELAPSEDTIMEINSECONDS_DESCRIPTOR)
        field(ESTIMATEDSECONDSTOCOMPLETION_DESCRIPTOR)
        field(KMSKEYID_DESCRIPTOR)
        field(NAMESPACEARN_DESCRIPTOR)
        field(NAMESPACENAME_DESCRIPTOR)
        field(OWNERACCOUNT_DESCRIPTOR)
        field(SNAPSHOTARN_DESCRIPTOR)
        field(SNAPSHOTCREATETIME_DESCRIPTOR)
        field(SNAPSHOTNAME_DESCRIPTOR)
        field(SNAPSHOTREMAININGDAYS_DESCRIPTOR)
        field(SNAPSHOTRETENTIONPERIOD_DESCRIPTOR)
        field(SNAPSHOTRETENTIONSTARTTIME_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TOTALBACKUPSIZEINMEGABYTES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACCOUNTSWITHPROVISIONEDRESTOREACCESS_DESCRIPTOR.index -> builder.accountsWithProvisionedRestoreAccess =
                    deserializer.deserializeList(ACCOUNTSWITHPROVISIONEDRESTOREACCESS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ACCOUNTSWITHRESTOREACCESS_DESCRIPTOR.index -> builder.accountsWithRestoreAccess =
                    deserializer.deserializeList(ACCOUNTSWITHRESTOREACCESS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ACTUALINCREMENTALBACKUPSIZEINMEGABYTES_DESCRIPTOR.index -> builder.actualIncrementalBackupSizeInMegaBytes = deserializeDouble()
                ADMINPASSWORDSECRETARN_DESCRIPTOR.index -> builder.adminPasswordSecretArn = deserializeString()
                ADMINPASSWORDSECRETKMSKEYID_DESCRIPTOR.index -> builder.adminPasswordSecretKmsKeyId = deserializeString()
                ADMINUSERNAME_DESCRIPTOR.index -> builder.adminUsername = deserializeString()
                BACKUPPROGRESSINMEGABYTES_DESCRIPTOR.index -> builder.backupProgressInMegaBytes = deserializeDouble()
                CURRENTBACKUPRATEINMEGABYTESPERSECOND_DESCRIPTOR.index -> builder.currentBackupRateInMegaBytesPerSecond = deserializeDouble()
                ELAPSEDTIMEINSECONDS_DESCRIPTOR.index -> builder.elapsedTimeInSeconds = deserializeLong()
                ESTIMATEDSECONDSTOCOMPLETION_DESCRIPTOR.index -> builder.estimatedSecondsToCompletion = deserializeLong()
                KMSKEYID_DESCRIPTOR.index -> builder.kmsKeyId = deserializeString()
                NAMESPACEARN_DESCRIPTOR.index -> builder.namespaceArn = deserializeString()
                NAMESPACENAME_DESCRIPTOR.index -> builder.namespaceName = deserializeString()
                OWNERACCOUNT_DESCRIPTOR.index -> builder.ownerAccount = deserializeString()
                SNAPSHOTARN_DESCRIPTOR.index -> builder.snapshotArn = deserializeString()
                SNAPSHOTCREATETIME_DESCRIPTOR.index -> builder.snapshotCreateTime = deserializeInstant(TimestampFormat.ISO_8601)
                SNAPSHOTNAME_DESCRIPTOR.index -> builder.snapshotName = deserializeString()
                SNAPSHOTREMAININGDAYS_DESCRIPTOR.index -> builder.snapshotRemainingDays = deserializeInt()
                SNAPSHOTRETENTIONPERIOD_DESCRIPTOR.index -> builder.snapshotRetentionPeriod = deserializeInt()
                SNAPSHOTRETENTIONSTARTTIME_DESCRIPTOR.index -> builder.snapshotRetentionStartTime = deserializeInstant(TimestampFormat.ISO_8601)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { SnapshotStatus.fromValue(it) }
                TOTALBACKUPSIZEINMEGABYTES_DESCRIPTOR.index -> builder.totalBackupSizeInMegaBytes = deserializeDouble()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy