commonMain.aws.sdk.kotlin.services.applicationsignals.serde.ServiceLevelIndicatorMetricConfigDocumentSerializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.applicationsignals.serde
import aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorMetricConfig
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.Serializer
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 serializeServiceLevelIndicatorMetricConfigDocument(serializer: Serializer, input: ServiceLevelIndicatorMetricConfig) {
val KEYATTRIBUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("KeyAttributes"))
val METRICDATAQUERIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("MetricDataQueries"))
val METRICTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("MetricType"))
val OPERATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OperationName"))
val PERIODSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("PeriodSeconds"))
val STATISTIC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Statistic"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(KEYATTRIBUTES_DESCRIPTOR)
field(METRICDATAQUERIES_DESCRIPTOR)
field(METRICTYPE_DESCRIPTOR)
field(OPERATIONNAME_DESCRIPTOR)
field(PERIODSECONDS_DESCRIPTOR)
field(STATISTIC_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.keyAttributes != null) {
mapField(KEYATTRIBUTES_DESCRIPTOR) {
input.keyAttributes.forEach { (key, value) ->
entry(key, value)
}
}
}
input.operationName?.let { field(OPERATIONNAME_DESCRIPTOR, it) }
input.metricType?.let { field(METRICTYPE_DESCRIPTOR, it.value) }
input.statistic?.let { field(STATISTIC_DESCRIPTOR, it) }
input.periodSeconds?.let { field(PERIODSECONDS_DESCRIPTOR, it) }
if (input.metricDataQueries != null) {
listField(METRICDATAQUERIES_DESCRIPTOR) {
for (el0 in input.metricDataQueries) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeMetricDataQueryDocument))
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy