commonMain.aws.sdk.kotlin.services.iotsitewise.serde.AssetModelSummaryDocumentDeserializer.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.AssetModelSummary
import aws.sdk.kotlin.services.iotsitewise.model.AssetModelType
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 deserializeAssetModelSummaryDocument(deserializer: Deserializer): AssetModelSummary {
val builder = AssetModelSummary.Builder()
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
val ASSETMODELTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("assetModelType"))
val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("creationDate"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
val EXTERNALID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("externalId"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
val LASTUPDATEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastUpdateDate"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("status"))
val VERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("version"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ARN_DESCRIPTOR)
field(ASSETMODELTYPE_DESCRIPTOR)
field(CREATIONDATE_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(EXTERNALID_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(LASTUPDATEDATE_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(VERSION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
ASSETMODELTYPE_DESCRIPTOR.index -> builder.assetModelType = deserializeString().let { AssetModelType.fromValue(it) }
CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
EXTERNALID_DESCRIPTOR.index -> builder.externalId = deserializeString()
ID_DESCRIPTOR.index -> builder.id = deserializeString()
LASTUPDATEDATE_DESCRIPTOR.index -> builder.lastUpdateDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeAssetModelStatusDocument(deserializer)
VERSION_DESCRIPTOR.index -> builder.version = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy