commonMain.aws.sdk.kotlin.services.iotsitewise.serde.TimeSeriesSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotsitewise-jvm Show documentation
Show all versions of iotsitewise-jvm Show documentation
The AWS SDK for Kotlin client for IoTSiteWise
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iotsitewise.serde
import aws.sdk.kotlin.services.iotsitewise.model.PropertyDataType
import aws.sdk.kotlin.services.iotsitewise.model.TimeSeriesSummary
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 aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun deserializeTimeSeriesSummaryDocument(deserializer: Deserializer): TimeSeriesSummary {
val builder = TimeSeriesSummary.Builder()
val ALIAS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("alias"))
val ASSETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("assetId"))
val DATATYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("dataType"))
val DATATYPESPEC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dataTypeSpec"))
val PROPERTYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("propertyId"))
val TIMESERIESARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("timeSeriesArn"))
val TIMESERIESCREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("timeSeriesCreationDate"))
val TIMESERIESID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("timeSeriesId"))
val TIMESERIESLASTUPDATEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("timeSeriesLastUpdateDate"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ALIAS_DESCRIPTOR)
field(ASSETID_DESCRIPTOR)
field(DATATYPE_DESCRIPTOR)
field(DATATYPESPEC_DESCRIPTOR)
field(PROPERTYID_DESCRIPTOR)
field(TIMESERIESARN_DESCRIPTOR)
field(TIMESERIESCREATIONDATE_DESCRIPTOR)
field(TIMESERIESID_DESCRIPTOR)
field(TIMESERIESLASTUPDATEDATE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ALIAS_DESCRIPTOR.index -> builder.alias = deserializeString()
ASSETID_DESCRIPTOR.index -> builder.assetId = deserializeString()
DATATYPE_DESCRIPTOR.index -> builder.dataType = deserializeString().let { PropertyDataType.fromValue(it) }
DATATYPESPEC_DESCRIPTOR.index -> builder.dataTypeSpec = deserializeString()
PROPERTYID_DESCRIPTOR.index -> builder.propertyId = deserializeString()
TIMESERIESARN_DESCRIPTOR.index -> builder.timeSeriesArn = deserializeString()
TIMESERIESCREATIONDATE_DESCRIPTOR.index -> builder.timeSeriesCreationDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
TIMESERIESID_DESCRIPTOR.index -> builder.timeSeriesId = deserializeString()
TIMESERIESLASTUPDATEDATE_DESCRIPTOR.index -> builder.timeSeriesLastUpdateDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy