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

commonMain.aws.sdk.kotlin.services.databrew.transform.JobDocumentDeserializer.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.databrew.transform

import aws.sdk.kotlin.services.databrew.model.DataCatalogOutput
import aws.sdk.kotlin.services.databrew.model.DatabaseOutput
import aws.sdk.kotlin.services.databrew.model.EncryptionMode
import aws.sdk.kotlin.services.databrew.model.Job
import aws.sdk.kotlin.services.databrew.model.JobType
import aws.sdk.kotlin.services.databrew.model.LogSubscription
import aws.sdk.kotlin.services.databrew.model.Output
import aws.sdk.kotlin.services.databrew.model.ValidationConfiguration
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

internal fun deserializeJobDocument(deserializer: Deserializer): Job {
    val builder = Job.Builder()
    val ACCOUNTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AccountId"))
    val CREATEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreateDate"))
    val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CreatedBy"))
    val DATACATALOGOUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DataCatalogOutputs"))
    val DATABASEOUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DatabaseOutputs"))
    val DATASETNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatasetName"))
    val ENCRYPTIONKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EncryptionKeyArn"))
    val ENCRYPTIONMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EncryptionMode"))
    val JOBSAMPLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("JobSample"))
    val LASTMODIFIEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LastModifiedBy"))
    val LASTMODIFIEDDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedDate"))
    val LOGSUBSCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogSubscription"))
    val MAXCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxCapacity"))
    val MAXRETRIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxRetries"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val OUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Outputs"))
    val PROJECTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ProjectName"))
    val RECIPEREFERENCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RecipeReference"))
    val RESOURCEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceArn"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleArn"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Tags"))
    val TIMEOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Timeout"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Type"))
    val VALIDATIONCONFIGURATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ValidationConfigurations"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCOUNTID_DESCRIPTOR)
        field(CREATEDATE_DESCRIPTOR)
        field(CREATEDBY_DESCRIPTOR)
        field(DATACATALOGOUTPUTS_DESCRIPTOR)
        field(DATABASEOUTPUTS_DESCRIPTOR)
        field(DATASETNAME_DESCRIPTOR)
        field(ENCRYPTIONKEYARN_DESCRIPTOR)
        field(ENCRYPTIONMODE_DESCRIPTOR)
        field(JOBSAMPLE_DESCRIPTOR)
        field(LASTMODIFIEDBY_DESCRIPTOR)
        field(LASTMODIFIEDDATE_DESCRIPTOR)
        field(LOGSUBSCRIPTION_DESCRIPTOR)
        field(MAXCAPACITY_DESCRIPTOR)
        field(MAXRETRIES_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(OUTPUTS_DESCRIPTOR)
        field(PROJECTNAME_DESCRIPTOR)
        field(RECIPEREFERENCE_DESCRIPTOR)
        field(RESOURCEARN_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(TIMEOUT_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
        field(VALIDATIONCONFIGURATIONS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACCOUNTID_DESCRIPTOR.index -> builder.accountId = deserializeString()
                CREATEDATE_DESCRIPTOR.index -> builder.createDate = deserializeString().let { Instant.fromEpochSeconds(it) }
                CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
                DATACATALOGOUTPUTS_DESCRIPTOR.index -> builder.dataCatalogOutputs =
                    deserializer.deserializeList(DATACATALOGOUTPUTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataCatalogOutputDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                DATABASEOUTPUTS_DESCRIPTOR.index -> builder.databaseOutputs =
                    deserializer.deserializeList(DATABASEOUTPUTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDatabaseOutputDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                DATASETNAME_DESCRIPTOR.index -> builder.datasetName = deserializeString()
                ENCRYPTIONKEYARN_DESCRIPTOR.index -> builder.encryptionKeyArn = deserializeString()
                ENCRYPTIONMODE_DESCRIPTOR.index -> builder.encryptionMode = deserializeString().let { EncryptionMode.fromValue(it) }
                JOBSAMPLE_DESCRIPTOR.index -> builder.jobSample = deserializeJobSampleDocument(deserializer)
                LASTMODIFIEDBY_DESCRIPTOR.index -> builder.lastModifiedBy = deserializeString()
                LASTMODIFIEDDATE_DESCRIPTOR.index -> builder.lastModifiedDate = deserializeString().let { Instant.fromEpochSeconds(it) }
                LOGSUBSCRIPTION_DESCRIPTOR.index -> builder.logSubscription = deserializeString().let { LogSubscription.fromValue(it) }
                MAXCAPACITY_DESCRIPTOR.index -> builder.maxCapacity = deserializeInt()
                MAXRETRIES_DESCRIPTOR.index -> builder.maxRetries = deserializeInt()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                OUTPUTS_DESCRIPTOR.index -> builder.outputs =
                    deserializer.deserializeList(OUTPUTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeOutputDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PROJECTNAME_DESCRIPTOR.index -> builder.projectName = deserializeString()
                RECIPEREFERENCE_DESCRIPTOR.index -> builder.recipeReference = deserializeRecipeReferenceDocument(deserializer)
                RESOURCEARN_DESCRIPTOR.index -> builder.resourceArn = deserializeString()
                ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeMap(TAGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                TIMEOUT_DESCRIPTOR.index -> builder.timeout = deserializeInt()
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { JobType.fromValue(it) }
                VALIDATIONCONFIGURATIONS_DESCRIPTOR.index -> builder.validationConfigurations =
                    deserializer.deserializeList(VALIDATIONCONFIGURATIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeValidationConfigurationDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy