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

commonMain.aws.sdk.kotlin.services.datasync.serde.NetAppOntapsvmDocumentDeserializer.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.NetAppOntapsvm
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 deserializeNetAppOntapsvmDocument(deserializer: Deserializer): NetAppOntapsvm {
    val builder = NetAppOntapsvm.Builder()
    val CIFSSHARECOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("CifsShareCount"))
    val CLUSTERUUID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ClusterUuid"))
    val ENABLEDPROTOCOLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("EnabledProtocols"))
    val LUNCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("LunCount"))
    val MAXP95PERFORMANCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MaxP95Performance"))
    val NFSEXPORTEDVOLUMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("NfsExportedVolumes"))
    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 SVMNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SvmName"))
    val TOTALCAPACITYPROVISIONED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("TotalCapacityProvisioned"))
    val TOTALCAPACITYUSED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("TotalCapacityUsed"))
    val TOTALLOGICALCAPACITYUSED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("TotalLogicalCapacityUsed"))
    val TOTALSNAPSHOTCAPACITYUSED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("TotalSnapshotCapacityUsed"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CIFSSHARECOUNT_DESCRIPTOR)
        field(CLUSTERUUID_DESCRIPTOR)
        field(ENABLEDPROTOCOLS_DESCRIPTOR)
        field(LUNCOUNT_DESCRIPTOR)
        field(MAXP95PERFORMANCE_DESCRIPTOR)
        field(NFSEXPORTEDVOLUMES_DESCRIPTOR)
        field(RECOMMENDATIONSTATUS_DESCRIPTOR)
        field(RECOMMENDATIONS_DESCRIPTOR)
        field(RESOURCEID_DESCRIPTOR)
        field(SVMNAME_DESCRIPTOR)
        field(TOTALCAPACITYPROVISIONED_DESCRIPTOR)
        field(TOTALCAPACITYUSED_DESCRIPTOR)
        field(TOTALLOGICALCAPACITYUSED_DESCRIPTOR)
        field(TOTALSNAPSHOTCAPACITYUSED_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CIFSSHARECOUNT_DESCRIPTOR.index -> builder.cifsShareCount = deserializeLong()
                CLUSTERUUID_DESCRIPTOR.index -> builder.clusterUuid = deserializeString()
                ENABLEDPROTOCOLS_DESCRIPTOR.index -> builder.enabledProtocols =
                    deserializer.deserializeList(ENABLEDPROTOCOLS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                LUNCOUNT_DESCRIPTOR.index -> builder.lunCount = deserializeLong()
                MAXP95PERFORMANCE_DESCRIPTOR.index -> builder.maxP95Performance = deserializeMaxP95PerformanceDocument(deserializer)
                NFSEXPORTEDVOLUMES_DESCRIPTOR.index -> builder.nfsExportedVolumes = deserializeLong()
                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()
                SVMNAME_DESCRIPTOR.index -> builder.svmName = deserializeString()
                TOTALCAPACITYPROVISIONED_DESCRIPTOR.index -> builder.totalCapacityProvisioned = deserializeLong()
                TOTALCAPACITYUSED_DESCRIPTOR.index -> builder.totalCapacityUsed = deserializeLong()
                TOTALLOGICALCAPACITYUSED_DESCRIPTOR.index -> builder.totalLogicalCapacityUsed = deserializeLong()
                TOTALSNAPSHOTCAPACITYUSED_DESCRIPTOR.index -> builder.totalSnapshotCapacityUsed = deserializeLong()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy