commonMain.aws.sdk.kotlin.services.devopsguru.serde.PerformanceInsightsMetricsDetailDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of devopsguru-jvm Show documentation
Show all versions of devopsguru-jvm Show documentation
The AWS SDK for Kotlin client for DevOps Guru
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.devopsguru.serde
import aws.sdk.kotlin.services.devopsguru.model.PerformanceInsightsMetricsDetail
import aws.sdk.kotlin.services.devopsguru.model.PerformanceInsightsReferenceData
import aws.sdk.kotlin.services.devopsguru.model.PerformanceInsightsStat
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 kotlin.collections.mutableListOf
internal fun deserializePerformanceInsightsMetricsDetailDocument(deserializer: Deserializer): PerformanceInsightsMetricsDetail {
val builder = PerformanceInsightsMetricsDetail.Builder()
val METRICDISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MetricDisplayName"))
val METRICQUERY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MetricQuery"))
val REFERENCEDATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ReferenceData"))
val STATSATANOMALY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StatsAtAnomaly"))
val STATSATBASELINE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StatsAtBaseline"))
val UNIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Unit"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(METRICDISPLAYNAME_DESCRIPTOR)
field(METRICQUERY_DESCRIPTOR)
field(REFERENCEDATA_DESCRIPTOR)
field(STATSATANOMALY_DESCRIPTOR)
field(STATSATBASELINE_DESCRIPTOR)
field(UNIT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
METRICDISPLAYNAME_DESCRIPTOR.index -> builder.metricDisplayName = deserializeString()
METRICQUERY_DESCRIPTOR.index -> builder.metricQuery = deserializePerformanceInsightsMetricQueryDocument(deserializer)
REFERENCEDATA_DESCRIPTOR.index -> builder.referenceData =
deserializer.deserializeList(REFERENCEDATA_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializePerformanceInsightsReferenceDataDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STATSATANOMALY_DESCRIPTOR.index -> builder.statsAtAnomaly =
deserializer.deserializeList(STATSATANOMALY_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializePerformanceInsightsStatDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STATSATBASELINE_DESCRIPTOR.index -> builder.statsAtBaseline =
deserializer.deserializeList(STATSATBASELINE_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializePerformanceInsightsStatDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
UNIT_DESCRIPTOR.index -> builder.unit = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}