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

commonMain.aws.sdk.kotlin.services.wisdom.serde.ImportJobDataDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.wisdom.serde

import aws.sdk.kotlin.services.wisdom.model.ImportJobData
import aws.sdk.kotlin.services.wisdom.model.ImportJobStatus
import aws.sdk.kotlin.services.wisdom.model.ImportJobType
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableMapOf

internal fun deserializeImportJobDataDocument(deserializer: Deserializer): ImportJobData {
    val builder = ImportJobData.Builder()
    val CREATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdTime"))
    val EXTERNALSOURCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("externalSourceConfiguration"))
    val FAILEDRECORDREPORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("failedRecordReport"))
    val IMPORTJOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("importJobId"))
    val IMPORTJOBTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("importJobType"))
    val KNOWLEDGEBASEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("knowledgeBaseArn"))
    val KNOWLEDGEBASEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("knowledgeBaseId"))
    val LASTMODIFIEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModifiedTime"))
    val METADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("metadata"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val UPLOADID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("uploadId"))
    val URL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("url"))
    val URLEXPIRY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("urlExpiry"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATEDTIME_DESCRIPTOR)
        field(EXTERNALSOURCECONFIGURATION_DESCRIPTOR)
        field(FAILEDRECORDREPORT_DESCRIPTOR)
        field(IMPORTJOBID_DESCRIPTOR)
        field(IMPORTJOBTYPE_DESCRIPTOR)
        field(KNOWLEDGEBASEARN_DESCRIPTOR)
        field(KNOWLEDGEBASEID_DESCRIPTOR)
        field(LASTMODIFIEDTIME_DESCRIPTOR)
        field(METADATA_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(UPLOADID_DESCRIPTOR)
        field(URL_DESCRIPTOR)
        field(URLEXPIRY_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                EXTERNALSOURCECONFIGURATION_DESCRIPTOR.index -> builder.externalSourceConfiguration = deserializeExternalSourceConfigurationDocument(deserializer)
                FAILEDRECORDREPORT_DESCRIPTOR.index -> builder.failedRecordReport = deserializeString()
                IMPORTJOBID_DESCRIPTOR.index -> builder.importJobId = deserializeString()
                IMPORTJOBTYPE_DESCRIPTOR.index -> builder.importJobType = deserializeString().let { ImportJobType.fromValue(it) }
                KNOWLEDGEBASEARN_DESCRIPTOR.index -> builder.knowledgeBaseArn = deserializeString()
                KNOWLEDGEBASEID_DESCRIPTOR.index -> builder.knowledgeBaseId = deserializeString()
                LASTMODIFIEDTIME_DESCRIPTOR.index -> builder.lastModifiedTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                METADATA_DESCRIPTOR.index -> builder.metadata =
                    deserializer.deserializeMap(METADATA_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ImportJobStatus.fromValue(it) }
                UPLOADID_DESCRIPTOR.index -> builder.uploadId = deserializeString()
                URL_DESCRIPTOR.index -> builder.url = deserializeString()
                URLEXPIRY_DESCRIPTOR.index -> builder.urlExpiry = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy