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

commonMain.aws.sdk.kotlin.services.redshiftserverless.serde.TableRestoreStatusDocumentDeserializer.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.TableRestoreStatus
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

internal fun deserializeTableRestoreStatusDocument(deserializer: Deserializer): TableRestoreStatus {
    val builder = TableRestoreStatus.Builder()
    val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("message"))
    val NAMESPACENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceName"))
    val NEWTABLENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("newTableName"))
    val PROGRESSINMEGABYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("progressInMegaBytes"))
    val RECOVERYPOINTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("recoveryPointId"))
    val REQUESTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("requestTime"))
    val SNAPSHOTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("snapshotName"))
    val SOURCEDATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceDatabaseName"))
    val SOURCESCHEMANAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceSchemaName"))
    val SOURCETABLENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceTableName"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val TABLERESTOREREQUESTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("tableRestoreRequestId"))
    val TARGETDATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("targetDatabaseName"))
    val TARGETSCHEMANAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("targetSchemaName"))
    val TOTALDATAINMEGABYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("totalDataInMegaBytes"))
    val WORKGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("workgroupName"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(MESSAGE_DESCRIPTOR)
        field(NAMESPACENAME_DESCRIPTOR)
        field(NEWTABLENAME_DESCRIPTOR)
        field(PROGRESSINMEGABYTES_DESCRIPTOR)
        field(RECOVERYPOINTID_DESCRIPTOR)
        field(REQUESTTIME_DESCRIPTOR)
        field(SNAPSHOTNAME_DESCRIPTOR)
        field(SOURCEDATABASENAME_DESCRIPTOR)
        field(SOURCESCHEMANAME_DESCRIPTOR)
        field(SOURCETABLENAME_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TABLERESTOREREQUESTID_DESCRIPTOR)
        field(TARGETDATABASENAME_DESCRIPTOR)
        field(TARGETSCHEMANAME_DESCRIPTOR)
        field(TOTALDATAINMEGABYTES_DESCRIPTOR)
        field(WORKGROUPNAME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
                NAMESPACENAME_DESCRIPTOR.index -> builder.namespaceName = deserializeString()
                NEWTABLENAME_DESCRIPTOR.index -> builder.newTableName = deserializeString()
                PROGRESSINMEGABYTES_DESCRIPTOR.index -> builder.progressInMegaBytes = deserializeLong()
                RECOVERYPOINTID_DESCRIPTOR.index -> builder.recoveryPointId = deserializeString()
                REQUESTTIME_DESCRIPTOR.index -> builder.requestTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                SNAPSHOTNAME_DESCRIPTOR.index -> builder.snapshotName = deserializeString()
                SOURCEDATABASENAME_DESCRIPTOR.index -> builder.sourceDatabaseName = deserializeString()
                SOURCESCHEMANAME_DESCRIPTOR.index -> builder.sourceSchemaName = deserializeString()
                SOURCETABLENAME_DESCRIPTOR.index -> builder.sourceTableName = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
                TABLERESTOREREQUESTID_DESCRIPTOR.index -> builder.tableRestoreRequestId = deserializeString()
                TARGETDATABASENAME_DESCRIPTOR.index -> builder.targetDatabaseName = deserializeString()
                TARGETSCHEMANAME_DESCRIPTOR.index -> builder.targetSchemaName = deserializeString()
                TOTALDATAINMEGABYTES_DESCRIPTOR.index -> builder.totalDataInMegaBytes = deserializeLong()
                WORKGROUPNAME_DESCRIPTOR.index -> builder.workgroupName = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy