
commonMain.aws.sdk.kotlin.services.xray.serde.InsightEventDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.xray.serde
import aws.sdk.kotlin.services.xray.model.AnomalousService
import aws.sdk.kotlin.services.xray.model.InsightEvent
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 kotlin.collections.mutableListOf
internal fun deserializeInsightEventDocument(deserializer: Deserializer): InsightEvent {
val builder = InsightEvent.Builder()
val CLIENTREQUESTIMPACTSTATISTICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ClientRequestImpactStatistics"))
val EVENTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EventTime"))
val ROOTCAUSESERVICEREQUESTIMPACTSTATISTICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RootCauseServiceRequestImpactStatistics"))
val SUMMARY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Summary"))
val TOPANOMALOUSSERVICES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TopAnomalousServices"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CLIENTREQUESTIMPACTSTATISTICS_DESCRIPTOR)
field(EVENTTIME_DESCRIPTOR)
field(ROOTCAUSESERVICEREQUESTIMPACTSTATISTICS_DESCRIPTOR)
field(SUMMARY_DESCRIPTOR)
field(TOPANOMALOUSSERVICES_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CLIENTREQUESTIMPACTSTATISTICS_DESCRIPTOR.index -> builder.clientRequestImpactStatistics = deserializeRequestImpactStatisticsDocument(deserializer)
EVENTTIME_DESCRIPTOR.index -> builder.eventTime = deserializeString().let { Instant.fromEpochSeconds(it) }
ROOTCAUSESERVICEREQUESTIMPACTSTATISTICS_DESCRIPTOR.index -> builder.rootCauseServiceRequestImpactStatistics = deserializeRequestImpactStatisticsDocument(deserializer)
SUMMARY_DESCRIPTOR.index -> builder.summary = deserializeString()
TOPANOMALOUSSERVICES_DESCRIPTOR.index -> builder.topAnomalousServices =
deserializer.deserializeList(TOPANOMALOUSSERVICES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeAnomalousServiceDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy