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

commonMain.aws.sdk.kotlin.services.glue.serde.ColumnStatisticsTaskRunDocumentDeserializer.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.glue.serde

import aws.sdk.kotlin.services.glue.model.ColumnStatisticsState
import aws.sdk.kotlin.services.glue.model.ColumnStatisticsTaskRun
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 deserializeColumnStatisticsTaskRunDocument(deserializer: Deserializer): ColumnStatisticsTaskRun {
    val builder = ColumnStatisticsTaskRun.Builder()
    val CATALOGID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CatalogID"))
    val COLUMNNAMELIST_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ColumnNameList"))
    val COLUMNSTATISTICSTASKRUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ColumnStatisticsTaskRunId"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val CUSTOMERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CustomerId"))
    val DPUSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("DPUSeconds"))
    val DATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatabaseName"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EndTime"))
    val ERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorMessage"))
    val LASTUPDATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdated"))
    val NUMBEROFWORKERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumberOfWorkers"))
    val ROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Role"))
    val SAMPLESIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("SampleSize"))
    val SECURITYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityConfiguration"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartTime"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val TABLENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TableName"))
    val WORKERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("WorkerType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CATALOGID_DESCRIPTOR)
        field(COLUMNNAMELIST_DESCRIPTOR)
        field(COLUMNSTATISTICSTASKRUNID_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(CUSTOMERID_DESCRIPTOR)
        field(DPUSECONDS_DESCRIPTOR)
        field(DATABASENAME_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(ERRORMESSAGE_DESCRIPTOR)
        field(LASTUPDATED_DESCRIPTOR)
        field(NUMBEROFWORKERS_DESCRIPTOR)
        field(ROLE_DESCRIPTOR)
        field(SAMPLESIZE_DESCRIPTOR)
        field(SECURITYCONFIGURATION_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TABLENAME_DESCRIPTOR)
        field(WORKERTYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CATALOGID_DESCRIPTOR.index -> builder.catalogId = deserializeString()
                COLUMNNAMELIST_DESCRIPTOR.index -> builder.columnNameList =
                    deserializer.deserializeList(COLUMNNAMELIST_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                COLUMNSTATISTICSTASKRUNID_DESCRIPTOR.index -> builder.columnStatisticsTaskRunId = deserializeString()
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                CUSTOMERID_DESCRIPTOR.index -> builder.customerId = deserializeString()
                DPUSECONDS_DESCRIPTOR.index -> builder.dpuSeconds = deserializeDouble()
                DATABASENAME_DESCRIPTOR.index -> builder.databaseName = deserializeString()
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                ERRORMESSAGE_DESCRIPTOR.index -> builder.errorMessage = deserializeString()
                LASTUPDATED_DESCRIPTOR.index -> builder.lastUpdated = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                NUMBEROFWORKERS_DESCRIPTOR.index -> builder.numberOfWorkers = deserializeInt()
                ROLE_DESCRIPTOR.index -> builder.role = deserializeString()
                SAMPLESIZE_DESCRIPTOR.index -> builder.sampleSize = deserializeDouble()
                SECURITYCONFIGURATION_DESCRIPTOR.index -> builder.securityConfiguration = deserializeString()
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ColumnStatisticsState.fromValue(it) }
                TABLENAME_DESCRIPTOR.index -> builder.tableName = deserializeString()
                WORKERTYPE_DESCRIPTOR.index -> builder.workerType = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy