commonMain.aws.sdk.kotlin.services.iot.transform.JobExecutionDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iot Show documentation
Show all versions of iot Show documentation
The AWS SDK for Kotlin client for IoT
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iot.transform
import aws.sdk.kotlin.services.iot.model.JobExecution
import aws.sdk.kotlin.services.iot.model.JobExecutionStatus
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
internal fun deserializeJobExecutionDocument(deserializer: Deserializer): JobExecution {
val builder = JobExecution.Builder()
val APPROXIMATESECONDSBEFORETIMEDOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("approximateSecondsBeforeTimedOut"))
val EXECUTIONNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("executionNumber"))
val FORCECANCELED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("forceCanceled"))
val JOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("jobId"))
val LASTUPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastUpdatedAt"))
val QUEUEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("queuedAt"))
val STARTEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("startedAt"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val STATUSDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("statusDetails"))
val THINGARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("thingArn"))
val VERSIONNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("versionNumber"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPROXIMATESECONDSBEFORETIMEDOUT_DESCRIPTOR)
field(EXECUTIONNUMBER_DESCRIPTOR)
field(FORCECANCELED_DESCRIPTOR)
field(JOBID_DESCRIPTOR)
field(LASTUPDATEDAT_DESCRIPTOR)
field(QUEUEDAT_DESCRIPTOR)
field(STARTEDAT_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(STATUSDETAILS_DESCRIPTOR)
field(THINGARN_DESCRIPTOR)
field(VERSIONNUMBER_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APPROXIMATESECONDSBEFORETIMEDOUT_DESCRIPTOR.index -> builder.approximateSecondsBeforeTimedOut = deserializeLong()
EXECUTIONNUMBER_DESCRIPTOR.index -> builder.executionNumber = deserializeLong()
FORCECANCELED_DESCRIPTOR.index -> builder.forceCanceled = deserializeBoolean()
JOBID_DESCRIPTOR.index -> builder.jobId = deserializeString()
LASTUPDATEDAT_DESCRIPTOR.index -> builder.lastUpdatedAt = deserializeString().let { Instant.fromEpochSeconds(it) }
QUEUEDAT_DESCRIPTOR.index -> builder.queuedAt = deserializeString().let { Instant.fromEpochSeconds(it) }
STARTEDAT_DESCRIPTOR.index -> builder.startedAt = deserializeString().let { Instant.fromEpochSeconds(it) }
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { JobExecutionStatus.fromValue(it) }
STATUSDETAILS_DESCRIPTOR.index -> builder.statusDetails = deserializeJobExecutionStatusDetailsDocument(deserializer)
THINGARN_DESCRIPTOR.index -> builder.thingArn = deserializeString()
VERSIONNUMBER_DESCRIPTOR.index -> builder.versionNumber = deserializeLong()
null -> break@loop
else -> skipValue()
}
}
}
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy