commonMain.aws.sdk.kotlin.services.sagemakermetrics.transform.RawMetricDataDocumentSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sagemakermetrics-jvm Show documentation
Show all versions of sagemakermetrics-jvm Show documentation
The AWS Kotlin client for SageMaker Metrics
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.sagemakermetrics.transform
import aws.sdk.kotlin.services.sagemakermetrics.model.RawMetricData
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
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun serializeRawMetricDataDocument(serializer: Serializer, input: RawMetricData) {
val METRICNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MetricName"))
val STEP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Step"))
val TIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("Timestamp"))
val VALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("Value"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(METRICNAME_DESCRIPTOR)
field(STEP_DESCRIPTOR)
field(TIMESTAMP_DESCRIPTOR)
field(VALUE_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.metricName?.let { field(METRICNAME_DESCRIPTOR, it) }
input.timestamp?.let { field(TIMESTAMP_DESCRIPTOR, it, TimestampFormat.EPOCH_SECONDS) }
input.step?.let { field(STEP_DESCRIPTOR, it) }
field(VALUE_DESCRIPTOR, input.value)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy