
commonMain.aws.sdk.kotlin.services.codeguruprofiler.transform.AggregatedProfileTimeDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codeguruprofiler.transform
import aws.sdk.kotlin.services.codeguruprofiler.model.AggregatedProfileTime
import aws.sdk.kotlin.services.codeguruprofiler.model.AggregationPeriod
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
internal fun deserializeAggregatedProfileTimeDocument(deserializer: Deserializer): AggregatedProfileTime {
val builder = AggregatedProfileTime.Builder()
val PERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("period"))
val START_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("start"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(PERIOD_DESCRIPTOR)
field(START_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
PERIOD_DESCRIPTOR.index -> builder.period = deserializeString().let { AggregationPeriod.fromValue(it) }
START_DESCRIPTOR.index -> builder.start = deserializeString().let { Instant.fromIso8601(it) }
null -> break@loop
else -> skipValue()
}
}
}
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy