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

commonMain.aws.sdk.kotlin.services.neptunegraph.serde.GraphSummaryDocumentDeserializer.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.GraphStatus
import aws.sdk.kotlin.services.neptunegraph.model.GraphSummary
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 deserializeGraphSummaryDocument(deserializer: Deserializer): GraphSummary {
    val builder = GraphSummary.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val DELETIONPROTECTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("deletionProtection"))
    val ENDPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("endpoint"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
    val KMSKEYIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("kmsKeyIdentifier"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val PROVISIONEDMEMORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("provisionedMemory"))
    val PUBLICCONNECTIVITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("publicConnectivity"))
    val REPLICACOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("replicaCount"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(DELETIONPROTECTION_DESCRIPTOR)
        field(ENDPOINT_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(KMSKEYIDENTIFIER_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PROVISIONEDMEMORY_DESCRIPTOR)
        field(PUBLICCONNECTIVITY_DESCRIPTOR)
        field(REPLICACOUNT_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                DELETIONPROTECTION_DESCRIPTOR.index -> builder.deletionProtection = deserializeBoolean()
                ENDPOINT_DESCRIPTOR.index -> builder.endpoint = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                KMSKEYIDENTIFIER_DESCRIPTOR.index -> builder.kmsKeyIdentifier = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PROVISIONEDMEMORY_DESCRIPTOR.index -> builder.provisionedMemory = deserializeInt()
                PUBLICCONNECTIVITY_DESCRIPTOR.index -> builder.publicConnectivity = deserializeBoolean()
                REPLICACOUNT_DESCRIPTOR.index -> builder.replicaCount = deserializeInt()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { GraphStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy