commonMain.aws.sdk.kotlin.services.timestreamwrite.serde.DataModelDocumentSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreamwrite-jvm Show documentation
Show all versions of timestreamwrite-jvm Show documentation
The AWS SDK for Kotlin client for Timestream Write
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.timestreamwrite.serde
import aws.sdk.kotlin.services.timestreamwrite.model.DataModel
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 serializeDataModelDocument(serializer: Serializer, input: DataModel) {
val DIMENSIONMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DimensionMappings"))
val MEASURENAMECOLUMN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MeasureNameColumn"))
val MIXEDMEASUREMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("MixedMeasureMappings"))
val MULTIMEASUREMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MultiMeasureMappings"))
val TIMECOLUMN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TimeColumn"))
val TIMEUNIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TimeUnit"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DIMENSIONMAPPINGS_DESCRIPTOR)
field(MEASURENAMECOLUMN_DESCRIPTOR)
field(MIXEDMEASUREMAPPINGS_DESCRIPTOR)
field(MULTIMEASUREMAPPINGS_DESCRIPTOR)
field(TIMECOLUMN_DESCRIPTOR)
field(TIMEUNIT_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.timeColumn?.let { field(TIMECOLUMN_DESCRIPTOR, it) }
input.timeUnit?.let { field(TIMEUNIT_DESCRIPTOR, it.value) }
listField(DIMENSIONMAPPINGS_DESCRIPTOR) {
for (el0 in input.dimensionMappings) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeDimensionMappingDocument))
}
}
input.multiMeasureMappings?.let { field(MULTIMEASUREMAPPINGS_DESCRIPTOR, it, ::serializeMultiMeasureMappingsDocument) }
if (input.mixedMeasureMappings != null) {
listField(MIXEDMEASUREMAPPINGS_DESCRIPTOR) {
for (el0 in input.mixedMeasureMappings) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeMixedMeasureMappingDocument))
}
}
}
input.measureNameColumn?.let { field(MEASURENAMECOLUMN_DESCRIPTOR, it) }
}
}