
commonMain.aws.sdk.kotlin.services.iot.serde.DetectMitigationActionExecutionDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iot.serde
import aws.sdk.kotlin.services.iot.model.DetectMitigationActionExecution
import aws.sdk.kotlin.services.iot.model.DetectMitigationActionExecutionStatus
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 deserializeDetectMitigationActionExecutionDocument(deserializer: Deserializer): DetectMitigationActionExecution {
val builder = DetectMitigationActionExecution.Builder()
val ACTIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("actionName"))
val ERRORCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("errorCode"))
val EXECUTIONENDDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("executionEndDate"))
val EXECUTIONSTARTDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("executionStartDate"))
val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("message"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val TASKID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("taskId"))
val THINGNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("thingName"))
val VIOLATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("violationId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACTIONNAME_DESCRIPTOR)
field(ERRORCODE_DESCRIPTOR)
field(EXECUTIONENDDATE_DESCRIPTOR)
field(EXECUTIONSTARTDATE_DESCRIPTOR)
field(MESSAGE_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TASKID_DESCRIPTOR)
field(THINGNAME_DESCRIPTOR)
field(VIOLATIONID_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACTIONNAME_DESCRIPTOR.index -> builder.actionName = deserializeString()
ERRORCODE_DESCRIPTOR.index -> builder.errorCode = deserializeString()
EXECUTIONENDDATE_DESCRIPTOR.index -> builder.executionEndDate = deserializeString().let { Instant.fromEpochSeconds(it) }
EXECUTIONSTARTDATE_DESCRIPTOR.index -> builder.executionStartDate = deserializeString().let { Instant.fromEpochSeconds(it) }
MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { DetectMitigationActionExecutionStatus.fromValue(it) }
TASKID_DESCRIPTOR.index -> builder.taskId = deserializeString()
THINGNAME_DESCRIPTOR.index -> builder.thingName = deserializeString()
VIOLATIONID_DESCRIPTOR.index -> builder.violationId = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy