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

commonMain.aws.sdk.kotlin.services.timestreamwrite.serde.BatchLoadTaskDescriptionDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.timestreamwrite.serde

import aws.sdk.kotlin.services.timestreamwrite.model.BatchLoadStatus
import aws.sdk.kotlin.services.timestreamwrite.model.BatchLoadTaskDescription
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 deserializeBatchLoadTaskDescriptionDocument(deserializer: Deserializer): BatchLoadTaskDescription {
    val builder = BatchLoadTaskDescription.Builder()
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val DATAMODELCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DataModelConfiguration"))
    val DATASOURCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DataSourceConfiguration"))
    val ERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorMessage"))
    val LASTUPDATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdatedTime"))
    val PROGRESSREPORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ProgressReport"))
    val RECORDVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("RecordVersion"))
    val REPORTCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ReportConfiguration"))
    val RESUMABLEUNTIL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("ResumableUntil"))
    val TARGETDATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetDatabaseName"))
    val TARGETTABLENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetTableName"))
    val TASKID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TaskId"))
    val TASKSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TaskStatus"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATIONTIME_DESCRIPTOR)
        field(DATAMODELCONFIGURATION_DESCRIPTOR)
        field(DATASOURCECONFIGURATION_DESCRIPTOR)
        field(ERRORMESSAGE_DESCRIPTOR)
        field(LASTUPDATEDTIME_DESCRIPTOR)
        field(PROGRESSREPORT_DESCRIPTOR)
        field(RECORDVERSION_DESCRIPTOR)
        field(REPORTCONFIGURATION_DESCRIPTOR)
        field(RESUMABLEUNTIL_DESCRIPTOR)
        field(TARGETDATABASENAME_DESCRIPTOR)
        field(TARGETTABLENAME_DESCRIPTOR)
        field(TASKID_DESCRIPTOR)
        field(TASKSTATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DATAMODELCONFIGURATION_DESCRIPTOR.index -> builder.dataModelConfiguration = deserializeDataModelConfigurationDocument(deserializer)
                DATASOURCECONFIGURATION_DESCRIPTOR.index -> builder.dataSourceConfiguration = deserializeDataSourceConfigurationDocument(deserializer)
                ERRORMESSAGE_DESCRIPTOR.index -> builder.errorMessage = deserializeString()
                LASTUPDATEDTIME_DESCRIPTOR.index -> builder.lastUpdatedTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                PROGRESSREPORT_DESCRIPTOR.index -> builder.progressReport = deserializeBatchLoadProgressReportDocument(deserializer)
                RECORDVERSION_DESCRIPTOR.index -> builder.recordVersion = deserializeLong()
                REPORTCONFIGURATION_DESCRIPTOR.index -> builder.reportConfiguration = deserializeReportConfigurationDocument(deserializer)
                RESUMABLEUNTIL_DESCRIPTOR.index -> builder.resumableUntil = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                TARGETDATABASENAME_DESCRIPTOR.index -> builder.targetDatabaseName = deserializeString()
                TARGETTABLENAME_DESCRIPTOR.index -> builder.targetTableName = deserializeString()
                TASKID_DESCRIPTOR.index -> builder.taskId = deserializeString()
                TASKSTATUS_DESCRIPTOR.index -> builder.taskStatus = deserializeString().let { BatchLoadStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy