commonMain.aws.sdk.kotlin.services.deadline.serde.StatisticsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deadline-jvm Show documentation
Show all versions of deadline-jvm Show documentation
The AWS SDK for Kotlin client for deadline
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.deadline.serde
import aws.sdk.kotlin.services.deadline.model.Statistics
import aws.sdk.kotlin.services.deadline.model.UsageType
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 deserializeStatisticsDocument(deserializer: Deserializer): Statistics {
val builder = Statistics.Builder()
val AGGREGATIONENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("aggregationEndTime"))
val AGGREGATIONSTARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("aggregationStartTime"))
val COSTINUSD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("costInUsd"))
val COUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("count"))
val FLEETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("fleetId"))
val INSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("instanceType"))
val JOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("jobId"))
val JOBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("jobName"))
val LICENSEPRODUCT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("licenseProduct"))
val QUEUEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("queueId"))
val RUNTIMEINSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("runtimeInSeconds"))
val USAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("usageType"))
val USERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("userId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AGGREGATIONENDTIME_DESCRIPTOR)
field(AGGREGATIONSTARTTIME_DESCRIPTOR)
field(COSTINUSD_DESCRIPTOR)
field(COUNT_DESCRIPTOR)
field(FLEETID_DESCRIPTOR)
field(INSTANCETYPE_DESCRIPTOR)
field(JOBID_DESCRIPTOR)
field(JOBNAME_DESCRIPTOR)
field(LICENSEPRODUCT_DESCRIPTOR)
field(QUEUEID_DESCRIPTOR)
field(RUNTIMEINSECONDS_DESCRIPTOR)
field(USAGETYPE_DESCRIPTOR)
field(USERID_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
AGGREGATIONENDTIME_DESCRIPTOR.index -> builder.aggregationEndTime = deserializeInstant(TimestampFormat.ISO_8601)
AGGREGATIONSTARTTIME_DESCRIPTOR.index -> builder.aggregationStartTime = deserializeInstant(TimestampFormat.ISO_8601)
COSTINUSD_DESCRIPTOR.index -> builder.costInUsd = deserializeStatsDocument(deserializer)
COUNT_DESCRIPTOR.index -> builder.count = deserializeInt()
FLEETID_DESCRIPTOR.index -> builder.fleetId = deserializeString()
INSTANCETYPE_DESCRIPTOR.index -> builder.instanceType = deserializeString()
JOBID_DESCRIPTOR.index -> builder.jobId = deserializeString()
JOBNAME_DESCRIPTOR.index -> builder.jobName = deserializeString()
LICENSEPRODUCT_DESCRIPTOR.index -> builder.licenseProduct = deserializeString()
QUEUEID_DESCRIPTOR.index -> builder.queueId = deserializeString()
RUNTIMEINSECONDS_DESCRIPTOR.index -> builder.runtimeInSeconds = deserializeStatsDocument(deserializer)
USAGETYPE_DESCRIPTOR.index -> builder.usageType = deserializeString().let { UsageType.fromValue(it) }
USERID_DESCRIPTOR.index -> builder.userId = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}