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

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

There is a newer version: 1.4.1
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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

import aws.sdk.kotlin.services.datasync.model.NetAppOntapVolume
import aws.sdk.kotlin.services.datasync.model.Recommendation
import aws.sdk.kotlin.services.datasync.model.RecommendationStatus
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 kotlin.collections.mutableListOf

internal fun deserializeNetAppOntapVolumeDocument(deserializer: Deserializer): NetAppOntapVolume {
    val builder = NetAppOntapVolume.Builder()
    val CAPACITYPROVISIONED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("CapacityProvisioned"))
    val CAPACITYUSED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("CapacityUsed"))
    val CIFSSHARECOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("CifsShareCount"))
    val LOGICALCAPACITYUSED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("LogicalCapacityUsed"))
    val LUNCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("LunCount"))
    val MAXP95PERFORMANCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MaxP95Performance"))
    val NFSEXPORTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("NfsExported"))
    val RECOMMENDATIONSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("RecommendationStatus"))
    val RECOMMENDATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Recommendations"))
    val RESOURCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceId"))
    val SECURITYSTYLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityStyle"))
    val SNAPSHOTCAPACITYUSED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("SnapshotCapacityUsed"))
    val SVMNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SvmName"))
    val SVMUUID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SvmUuid"))
    val VOLUMENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VolumeName"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CAPACITYPROVISIONED_DESCRIPTOR)
        field(CAPACITYUSED_DESCRIPTOR)
        field(CIFSSHARECOUNT_DESCRIPTOR)
        field(LOGICALCAPACITYUSED_DESCRIPTOR)
        field(LUNCOUNT_DESCRIPTOR)
        field(MAXP95PERFORMANCE_DESCRIPTOR)
        field(NFSEXPORTED_DESCRIPTOR)
        field(RECOMMENDATIONSTATUS_DESCRIPTOR)
        field(RECOMMENDATIONS_DESCRIPTOR)
        field(RESOURCEID_DESCRIPTOR)
        field(SECURITYSTYLE_DESCRIPTOR)
        field(SNAPSHOTCAPACITYUSED_DESCRIPTOR)
        field(SVMNAME_DESCRIPTOR)
        field(SVMUUID_DESCRIPTOR)
        field(VOLUMENAME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CAPACITYPROVISIONED_DESCRIPTOR.index -> builder.capacityProvisioned = deserializeLong()
                CAPACITYUSED_DESCRIPTOR.index -> builder.capacityUsed = deserializeLong()
                CIFSSHARECOUNT_DESCRIPTOR.index -> builder.cifsShareCount = deserializeLong()
                LOGICALCAPACITYUSED_DESCRIPTOR.index -> builder.logicalCapacityUsed = deserializeLong()
                LUNCOUNT_DESCRIPTOR.index -> builder.lunCount = deserializeLong()
                MAXP95PERFORMANCE_DESCRIPTOR.index -> builder.maxP95Performance = deserializeMaxP95PerformanceDocument(deserializer)
                NFSEXPORTED_DESCRIPTOR.index -> builder.nfsExported = deserializeBoolean()
                RECOMMENDATIONSTATUS_DESCRIPTOR.index -> builder.recommendationStatus = deserializeString().let { RecommendationStatus.fromValue(it) }
                RECOMMENDATIONS_DESCRIPTOR.index -> builder.recommendations =
                    deserializer.deserializeList(RECOMMENDATIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeRecommendationDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                RESOURCEID_DESCRIPTOR.index -> builder.resourceId = deserializeString()
                SECURITYSTYLE_DESCRIPTOR.index -> builder.securityStyle = deserializeString()
                SNAPSHOTCAPACITYUSED_DESCRIPTOR.index -> builder.snapshotCapacityUsed = deserializeLong()
                SVMNAME_DESCRIPTOR.index -> builder.svmName = deserializeString()
                SVMUUID_DESCRIPTOR.index -> builder.svmUuid = deserializeString()
                VOLUMENAME_DESCRIPTOR.index -> builder.volumeName = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy