commonMain.aws.sdk.kotlin.services.glue.serde.CrawlerMetricsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.CrawlerMetrics
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
internal fun deserializeCrawlerMetricsDocument(deserializer: Deserializer): CrawlerMetrics {
val builder = CrawlerMetrics.Builder()
val CRAWLERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CrawlerName"))
val LASTRUNTIMESECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("LastRuntimeSeconds"))
val MEDIANRUNTIMESECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("MedianRuntimeSeconds"))
val STILLESTIMATING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("StillEstimating"))
val TABLESCREATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("TablesCreated"))
val TABLESDELETED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("TablesDeleted"))
val TABLESUPDATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("TablesUpdated"))
val TIMELEFTSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("TimeLeftSeconds"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CRAWLERNAME_DESCRIPTOR)
field(LASTRUNTIMESECONDS_DESCRIPTOR)
field(MEDIANRUNTIMESECONDS_DESCRIPTOR)
field(STILLESTIMATING_DESCRIPTOR)
field(TABLESCREATED_DESCRIPTOR)
field(TABLESDELETED_DESCRIPTOR)
field(TABLESUPDATED_DESCRIPTOR)
field(TIMELEFTSECONDS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CRAWLERNAME_DESCRIPTOR.index -> builder.crawlerName = deserializeString()
LASTRUNTIMESECONDS_DESCRIPTOR.index -> builder.lastRuntimeSeconds = deserializeDouble()
MEDIANRUNTIMESECONDS_DESCRIPTOR.index -> builder.medianRuntimeSeconds = deserializeDouble()
STILLESTIMATING_DESCRIPTOR.index -> builder.stillEstimating = deserializeBoolean()
TABLESCREATED_DESCRIPTOR.index -> builder.tablesCreated = deserializeInt()
TABLESDELETED_DESCRIPTOR.index -> builder.tablesDeleted = deserializeInt()
TABLESUPDATED_DESCRIPTOR.index -> builder.tablesUpdated = deserializeInt()
TIMELEFTSECONDS_DESCRIPTOR.index -> builder.timeLeftSeconds = deserializeDouble()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}