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

commonMain.aws.sdk.kotlin.services.datasync.serde.TaskExecutionResultDetailDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.datasync.serde

import aws.sdk.kotlin.services.datasync.model.PhaseStatus
import aws.sdk.kotlin.services.datasync.model.TaskExecutionResultDetail
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

internal fun deserializeTaskExecutionResultDetailDocument(deserializer: Deserializer): TaskExecutionResultDetail {
    val builder = TaskExecutionResultDetail.Builder()
    val ERRORCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorCode"))
    val ERRORDETAIL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorDetail"))
    val PREPAREDURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("PrepareDuration"))
    val PREPARESTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("PrepareStatus"))
    val TOTALDURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("TotalDuration"))
    val TRANSFERDURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("TransferDuration"))
    val TRANSFERSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TransferStatus"))
    val VERIFYDURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("VerifyDuration"))
    val VERIFYSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("VerifyStatus"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ERRORCODE_DESCRIPTOR)
        field(ERRORDETAIL_DESCRIPTOR)
        field(PREPAREDURATION_DESCRIPTOR)
        field(PREPARESTATUS_DESCRIPTOR)
        field(TOTALDURATION_DESCRIPTOR)
        field(TRANSFERDURATION_DESCRIPTOR)
        field(TRANSFERSTATUS_DESCRIPTOR)
        field(VERIFYDURATION_DESCRIPTOR)
        field(VERIFYSTATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ERRORCODE_DESCRIPTOR.index -> builder.errorCode = deserializeString()
                ERRORDETAIL_DESCRIPTOR.index -> builder.errorDetail = deserializeString()
                PREPAREDURATION_DESCRIPTOR.index -> builder.prepareDuration = deserializeLong()
                PREPARESTATUS_DESCRIPTOR.index -> builder.prepareStatus = deserializeString().let { PhaseStatus.fromValue(it) }
                TOTALDURATION_DESCRIPTOR.index -> builder.totalDuration = deserializeLong()
                TRANSFERDURATION_DESCRIPTOR.index -> builder.transferDuration = deserializeLong()
                TRANSFERSTATUS_DESCRIPTOR.index -> builder.transferStatus = deserializeString().let { PhaseStatus.fromValue(it) }
                VERIFYDURATION_DESCRIPTOR.index -> builder.verifyDuration = deserializeLong()
                VERIFYSTATUS_DESCRIPTOR.index -> builder.verifyStatus = deserializeString().let { PhaseStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy