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

commonMain.aws.sdk.kotlin.services.mgn.transform.DataReplicationInfoDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.mgn.transform

import aws.sdk.kotlin.services.mgn.model.DataReplicationInfo
import aws.sdk.kotlin.services.mgn.model.DataReplicationInfoReplicatedDisk
import aws.sdk.kotlin.services.mgn.model.DataReplicationState
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 deserializeDataReplicationInfoDocument(deserializer: Deserializer): DataReplicationInfo {
    val builder = DataReplicationInfo.Builder()
    val DATAREPLICATIONERROR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("dataReplicationError"))
    val DATAREPLICATIONINITIATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("dataReplicationInitiation"))
    val DATAREPLICATIONSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dataReplicationState"))
    val ETADATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("etaDateTime"))
    val LAGDURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lagDuration"))
    val LASTSNAPSHOTDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lastSnapshotDateTime"))
    val REPLICATEDDISKS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("replicatedDisks"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DATAREPLICATIONERROR_DESCRIPTOR)
        field(DATAREPLICATIONINITIATION_DESCRIPTOR)
        field(DATAREPLICATIONSTATE_DESCRIPTOR)
        field(ETADATETIME_DESCRIPTOR)
        field(LAGDURATION_DESCRIPTOR)
        field(LASTSNAPSHOTDATETIME_DESCRIPTOR)
        field(REPLICATEDDISKS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DATAREPLICATIONERROR_DESCRIPTOR.index -> builder.dataReplicationError = deserializeDataReplicationErrorDocument(deserializer)
                DATAREPLICATIONINITIATION_DESCRIPTOR.index -> builder.dataReplicationInitiation = deserializeDataReplicationInitiationDocument(deserializer)
                DATAREPLICATIONSTATE_DESCRIPTOR.index -> builder.dataReplicationState = deserializeString().let { DataReplicationState.fromValue(it) }
                ETADATETIME_DESCRIPTOR.index -> builder.etaDateTime = deserializeString()
                LAGDURATION_DESCRIPTOR.index -> builder.lagDuration = deserializeString()
                LASTSNAPSHOTDATETIME_DESCRIPTOR.index -> builder.lastSnapshotDateTime = deserializeString()
                REPLICATEDDISKS_DESCRIPTOR.index -> builder.replicatedDisks =
                    deserializer.deserializeList(REPLICATEDDISKS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataReplicationInfoReplicatedDiskDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy