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

commonMain.aws.sdk.kotlin.services.glue.serde.CrawlerHistoryDocumentDeserializer.kt Maven / Gradle / Ivy

The 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.CrawlerHistory
import aws.sdk.kotlin.services.glue.model.CrawlerHistoryState
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 deserializeCrawlerHistoryDocument(deserializer: Deserializer): CrawlerHistory {
    val builder = CrawlerHistory.Builder()
    val CRAWLID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CrawlId"))
    val DPUHOUR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("DPUHour"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EndTime"))
    val ERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorMessage"))
    val LOGGROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogGroup"))
    val LOGSTREAM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogStream"))
    val MESSAGEPREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MessagePrefix"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartTime"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
    val SUMMARY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Summary"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CRAWLID_DESCRIPTOR)
        field(DPUHOUR_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(ERRORMESSAGE_DESCRIPTOR)
        field(LOGGROUP_DESCRIPTOR)
        field(LOGSTREAM_DESCRIPTOR)
        field(MESSAGEPREFIX_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(SUMMARY_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CRAWLID_DESCRIPTOR.index -> builder.crawlId = deserializeString()
                DPUHOUR_DESCRIPTOR.index -> builder.dpuHour = deserializeDouble()
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                ERRORMESSAGE_DESCRIPTOR.index -> builder.errorMessage = deserializeString()
                LOGGROUP_DESCRIPTOR.index -> builder.logGroup = deserializeString()
                LOGSTREAM_DESCRIPTOR.index -> builder.logStream = deserializeString()
                MESSAGEPREFIX_DESCRIPTOR.index -> builder.messagePrefix = deserializeString()
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { CrawlerHistoryState.fromValue(it) }
                SUMMARY_DESCRIPTOR.index -> builder.summary = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy