All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.configservice.serde.RemediationExecutionStatusDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.configservice.serde

import aws.sdk.kotlin.services.configservice.model.RemediationExecutionState
import aws.sdk.kotlin.services.configservice.model.RemediationExecutionStatus
import aws.sdk.kotlin.services.configservice.model.RemediationExecutionStep
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 kotlin.collections.mutableListOf

internal fun deserializeRemediationExecutionStatusDocument(deserializer: Deserializer): RemediationExecutionStatus {
    val builder = RemediationExecutionStatus.Builder()
    val INVOCATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("InvocationTime"))
    val LASTUPDATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdatedTime"))
    val RESOURCEKEY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ResourceKey"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
    val STEPDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StepDetails"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(INVOCATIONTIME_DESCRIPTOR)
        field(LASTUPDATEDTIME_DESCRIPTOR)
        field(RESOURCEKEY_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(STEPDETAILS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                INVOCATIONTIME_DESCRIPTOR.index -> builder.invocationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                LASTUPDATEDTIME_DESCRIPTOR.index -> builder.lastUpdatedTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                RESOURCEKEY_DESCRIPTOR.index -> builder.resourceKey = deserializeResourceKeyDocument(deserializer)
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { RemediationExecutionState.fromValue(it) }
                STEPDETAILS_DESCRIPTOR.index -> builder.stepDetails =
                    deserializer.deserializeList(STEPDETAILS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeRemediationExecutionStepDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy