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

commonMain.aws.sdk.kotlin.services.finspacedata.serde.DatasetDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.finspacedata.serde

import aws.sdk.kotlin.services.finspacedata.model.Dataset
import aws.sdk.kotlin.services.finspacedata.model.DatasetKind
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 deserializeDatasetDocument(deserializer: Deserializer): Dataset {
    val builder = Dataset.Builder()
    val ALIAS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("alias"))
    val CREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("createTime"))
    val DATASETARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("datasetArn"))
    val DATASETDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("datasetDescription"))
    val DATASETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("datasetId"))
    val DATASETTITLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("datasetTitle"))
    val KIND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("kind"))
    val LASTMODIFIEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("lastModifiedTime"))
    val OWNERINFO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ownerInfo"))
    val SCHEMADEFINITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("schemaDefinition"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ALIAS_DESCRIPTOR)
        field(CREATETIME_DESCRIPTOR)
        field(DATASETARN_DESCRIPTOR)
        field(DATASETDESCRIPTION_DESCRIPTOR)
        field(DATASETID_DESCRIPTOR)
        field(DATASETTITLE_DESCRIPTOR)
        field(KIND_DESCRIPTOR)
        field(LASTMODIFIEDTIME_DESCRIPTOR)
        field(OWNERINFO_DESCRIPTOR)
        field(SCHEMADEFINITION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ALIAS_DESCRIPTOR.index -> builder.alias = deserializeString()
                CREATETIME_DESCRIPTOR.index -> builder.createTime = deserializeLong()
                DATASETARN_DESCRIPTOR.index -> builder.datasetArn = deserializeString()
                DATASETDESCRIPTION_DESCRIPTOR.index -> builder.datasetDescription = deserializeString()
                DATASETID_DESCRIPTOR.index -> builder.datasetId = deserializeString()
                DATASETTITLE_DESCRIPTOR.index -> builder.datasetTitle = deserializeString()
                KIND_DESCRIPTOR.index -> builder.kind = deserializeString().let { DatasetKind.fromValue(it) }
                LASTMODIFIEDTIME_DESCRIPTOR.index -> builder.lastModifiedTime = deserializeLong()
                OWNERINFO_DESCRIPTOR.index -> builder.ownerInfo = deserializeDatasetOwnerInfoDocument(deserializer)
                SCHEMADEFINITION_DESCRIPTOR.index -> builder.schemaDefinition = deserializeSchemaUnionDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy