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

commonMain.aws.sdk.kotlin.services.neptunegraph.serde.GraphDataSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.neptunegraph.serde

import aws.sdk.kotlin.services.neptunegraph.model.EdgeStructure
import aws.sdk.kotlin.services.neptunegraph.model.GraphDataSummary
import aws.sdk.kotlin.services.neptunegraph.model.NodeStructure
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
import kotlin.collections.mutableMapOf

internal fun deserializeGraphDataSummaryDocument(deserializer: Deserializer): GraphDataSummary {
    val builder = GraphDataSummary.Builder()
    val EDGELABELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("edgeLabels"))
    val EDGEPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("edgeProperties"))
    val EDGEPROPERTIES_C0_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map)
    val EDGESTRUCTURES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("edgeStructures"))
    val NODELABELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("nodeLabels"))
    val NODEPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("nodeProperties"))
    val NODEPROPERTIES_C0_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map)
    val NODESTRUCTURES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("nodeStructures"))
    val NUMEDGELABELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("numEdgeLabels"))
    val NUMEDGEPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("numEdgeProperties"))
    val NUMEDGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("numEdges"))
    val NUMNODELABELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("numNodeLabels"))
    val NUMNODEPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("numNodeProperties"))
    val NUMNODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("numNodes"))
    val TOTALEDGEPROPERTYVALUES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("totalEdgePropertyValues"))
    val TOTALNODEPROPERTYVALUES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("totalNodePropertyValues"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(EDGELABELS_DESCRIPTOR)
        field(EDGEPROPERTIES_DESCRIPTOR)
        field(EDGESTRUCTURES_DESCRIPTOR)
        field(NODELABELS_DESCRIPTOR)
        field(NODEPROPERTIES_DESCRIPTOR)
        field(NODESTRUCTURES_DESCRIPTOR)
        field(NUMEDGELABELS_DESCRIPTOR)
        field(NUMEDGEPROPERTIES_DESCRIPTOR)
        field(NUMEDGES_DESCRIPTOR)
        field(NUMNODELABELS_DESCRIPTOR)
        field(NUMNODEPROPERTIES_DESCRIPTOR)
        field(NUMNODES_DESCRIPTOR)
        field(TOTALEDGEPROPERTYVALUES_DESCRIPTOR)
        field(TOTALNODEPROPERTYVALUES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                EDGELABELS_DESCRIPTOR.index -> builder.edgeLabels =
                    deserializer.deserializeList(EDGELABELS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                EDGEPROPERTIES_DESCRIPTOR.index -> builder.edgeProperties =
                    deserializer.deserializeList(EDGEPROPERTIES_DESCRIPTOR) {
                        val col0 = mutableListOf>()
                        while (hasNextElement()) {
                            val el0 = deserializer.deserializeMap(EDGEPROPERTIES_C0_DESCRIPTOR) {
                                val map1 = mutableMapOf()
                                while (hasNextEntry()) {
                                    val k1 = key()
                                    val v1 = if (nextHasValue()) { deserializeLong() } else { deserializeNull(); continue }
                                    map1[k1] = v1
                                }
                                map1
                            }
                            col0.add(el0)
                        }
                        col0
                    }
                EDGESTRUCTURES_DESCRIPTOR.index -> builder.edgeStructures =
                    deserializer.deserializeList(EDGESTRUCTURES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeEdgeStructureDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                NODELABELS_DESCRIPTOR.index -> builder.nodeLabels =
                    deserializer.deserializeList(NODELABELS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                NODEPROPERTIES_DESCRIPTOR.index -> builder.nodeProperties =
                    deserializer.deserializeList(NODEPROPERTIES_DESCRIPTOR) {
                        val col0 = mutableListOf>()
                        while (hasNextElement()) {
                            val el0 = deserializer.deserializeMap(NODEPROPERTIES_C0_DESCRIPTOR) {
                                val map1 = mutableMapOf()
                                while (hasNextEntry()) {
                                    val k1 = key()
                                    val v1 = if (nextHasValue()) { deserializeLong() } else { deserializeNull(); continue }
                                    map1[k1] = v1
                                }
                                map1
                            }
                            col0.add(el0)
                        }
                        col0
                    }
                NODESTRUCTURES_DESCRIPTOR.index -> builder.nodeStructures =
                    deserializer.deserializeList(NODESTRUCTURES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeNodeStructureDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                NUMEDGELABELS_DESCRIPTOR.index -> builder.numEdgeLabels = deserializeLong()
                NUMEDGEPROPERTIES_DESCRIPTOR.index -> builder.numEdgeProperties = deserializeLong()
                NUMEDGES_DESCRIPTOR.index -> builder.numEdges = deserializeLong()
                NUMNODELABELS_DESCRIPTOR.index -> builder.numNodeLabels = deserializeLong()
                NUMNODEPROPERTIES_DESCRIPTOR.index -> builder.numNodeProperties = deserializeLong()
                NUMNODES_DESCRIPTOR.index -> builder.numNodes = deserializeLong()
                TOTALEDGEPROPERTYVALUES_DESCRIPTOR.index -> builder.totalEdgePropertyValues = deserializeLong()
                TOTALNODEPROPERTYVALUES_DESCRIPTOR.index -> builder.totalNodePropertyValues = deserializeLong()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy