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

commonMain.aws.sdk.kotlin.services.mgn.transform.ReplicationConfigurationReplicatedDiskDocumentDeserializer.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.ReplicationConfigurationReplicatedDisk
import aws.sdk.kotlin.services.mgn.model.ReplicationConfigurationReplicatedDiskStagingDiskType
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 deserializeReplicationConfigurationReplicatedDiskDocument(deserializer: Deserializer): ReplicationConfigurationReplicatedDisk {
    val builder = ReplicationConfigurationReplicatedDisk.Builder()
    val DEVICENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deviceName"))
    val IOPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("iops"))
    val ISBOOTDISK_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isBootDisk"))
    val STAGINGDISKTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("stagingDiskType"))
    val THROUGHPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("throughput"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DEVICENAME_DESCRIPTOR)
        field(IOPS_DESCRIPTOR)
        field(ISBOOTDISK_DESCRIPTOR)
        field(STAGINGDISKTYPE_DESCRIPTOR)
        field(THROUGHPUT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DEVICENAME_DESCRIPTOR.index -> builder.deviceName = deserializeString()
                IOPS_DESCRIPTOR.index -> builder.iops = deserializeLong()
                ISBOOTDISK_DESCRIPTOR.index -> builder.isBootDisk = deserializeBoolean()
                STAGINGDISKTYPE_DESCRIPTOR.index -> builder.stagingDiskType = deserializeString().let { ReplicationConfigurationReplicatedDiskStagingDiskType.fromValue(it) }
                THROUGHPUT_DESCRIPTOR.index -> builder.throughput = deserializeLong()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy