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

commonMain.aws.sdk.kotlin.services.glue.serde.JobDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.serde

import aws.sdk.kotlin.services.glue.model.CodeGenConfigurationNode
import aws.sdk.kotlin.services.glue.model.ExecutionClass
import aws.sdk.kotlin.services.glue.model.Job
import aws.sdk.kotlin.services.glue.model.JobMode
import aws.sdk.kotlin.services.glue.model.WorkerType
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 deserializeJobDocument(deserializer: Deserializer): Job {
    val builder = Job.Builder()
    val ALLOCATEDCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("AllocatedCapacity"))
    val CODEGENCONFIGURATIONNODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("CodeGenConfigurationNodes"))
    val COMMAND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Command"))
    val CONNECTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Connections"))
    val CREATEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedOn"))
    val DEFAULTARGUMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("DefaultArguments"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val EXECUTIONCLASS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ExecutionClass"))
    val EXECUTIONPROPERTY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ExecutionProperty"))
    val GLUEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GlueVersion"))
    val JOBMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("JobMode"))
    val JOBRUNQUEUINGENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("JobRunQueuingEnabled"))
    val LASTMODIFIEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedOn"))
    val LOGURI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogUri"))
    val MAINTENANCEWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MaintenanceWindow"))
    val MAXCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("MaxCapacity"))
    val MAXRETRIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxRetries"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val NONOVERRIDABLEARGUMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("NonOverridableArguments"))
    val NOTIFICATIONPROPERTY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("NotificationProperty"))
    val NUMBEROFWORKERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumberOfWorkers"))
    val PROFILENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ProfileName"))
    val ROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Role"))
    val SECURITYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityConfiguration"))
    val SOURCECONTROLDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SourceControlDetails"))
    val TIMEOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Timeout"))
    val WORKERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("WorkerType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ALLOCATEDCAPACITY_DESCRIPTOR)
        field(CODEGENCONFIGURATIONNODES_DESCRIPTOR)
        field(COMMAND_DESCRIPTOR)
        field(CONNECTIONS_DESCRIPTOR)
        field(CREATEDON_DESCRIPTOR)
        field(DEFAULTARGUMENTS_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(EXECUTIONCLASS_DESCRIPTOR)
        field(EXECUTIONPROPERTY_DESCRIPTOR)
        field(GLUEVERSION_DESCRIPTOR)
        field(JOBMODE_DESCRIPTOR)
        field(JOBRUNQUEUINGENABLED_DESCRIPTOR)
        field(LASTMODIFIEDON_DESCRIPTOR)
        field(LOGURI_DESCRIPTOR)
        field(MAINTENANCEWINDOW_DESCRIPTOR)
        field(MAXCAPACITY_DESCRIPTOR)
        field(MAXRETRIES_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(NONOVERRIDABLEARGUMENTS_DESCRIPTOR)
        field(NOTIFICATIONPROPERTY_DESCRIPTOR)
        field(NUMBEROFWORKERS_DESCRIPTOR)
        field(PROFILENAME_DESCRIPTOR)
        field(ROLE_DESCRIPTOR)
        field(SECURITYCONFIGURATION_DESCRIPTOR)
        field(SOURCECONTROLDETAILS_DESCRIPTOR)
        field(TIMEOUT_DESCRIPTOR)
        field(WORKERTYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ALLOCATEDCAPACITY_DESCRIPTOR.index -> builder.allocatedCapacity = deserializeInt()
                CODEGENCONFIGURATIONNODES_DESCRIPTOR.index -> builder.codeGenConfigurationNodes =
                    deserializer.deserializeMap(CODEGENCONFIGURATIONNODES_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeCodeGenConfigurationNodeDocument(deserializer) } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                COMMAND_DESCRIPTOR.index -> builder.command = deserializeJobCommandDocument(deserializer)
                CONNECTIONS_DESCRIPTOR.index -> builder.connections = deserializeConnectionsListDocument(deserializer)
                CREATEDON_DESCRIPTOR.index -> builder.createdOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DEFAULTARGUMENTS_DESCRIPTOR.index -> builder.defaultArguments =
                    deserializer.deserializeMap(DEFAULTARGUMENTS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                EXECUTIONCLASS_DESCRIPTOR.index -> builder.executionClass = deserializeString().let { ExecutionClass.fromValue(it) }
                EXECUTIONPROPERTY_DESCRIPTOR.index -> builder.executionProperty = deserializeExecutionPropertyDocument(deserializer)
                GLUEVERSION_DESCRIPTOR.index -> builder.glueVersion = deserializeString()
                JOBMODE_DESCRIPTOR.index -> builder.jobMode = deserializeString().let { JobMode.fromValue(it) }
                JOBRUNQUEUINGENABLED_DESCRIPTOR.index -> builder.jobRunQueuingEnabled = deserializeBoolean()
                LASTMODIFIEDON_DESCRIPTOR.index -> builder.lastModifiedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LOGURI_DESCRIPTOR.index -> builder.logUri = deserializeString()
                MAINTENANCEWINDOW_DESCRIPTOR.index -> builder.maintenanceWindow = deserializeString()
                MAXCAPACITY_DESCRIPTOR.index -> builder.maxCapacity = deserializeDouble()
                MAXRETRIES_DESCRIPTOR.index -> builder.maxRetries = deserializeInt()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                NONOVERRIDABLEARGUMENTS_DESCRIPTOR.index -> builder.nonOverridableArguments =
                    deserializer.deserializeMap(NONOVERRIDABLEARGUMENTS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                NOTIFICATIONPROPERTY_DESCRIPTOR.index -> builder.notificationProperty = deserializeNotificationPropertyDocument(deserializer)
                NUMBEROFWORKERS_DESCRIPTOR.index -> builder.numberOfWorkers = deserializeInt()
                PROFILENAME_DESCRIPTOR.index -> builder.profileName = deserializeString()
                ROLE_DESCRIPTOR.index -> builder.role = deserializeString()
                SECURITYCONFIGURATION_DESCRIPTOR.index -> builder.securityConfiguration = deserializeString()
                SOURCECONTROLDETAILS_DESCRIPTOR.index -> builder.sourceControlDetails = deserializeSourceControlDetailsDocument(deserializer)
                TIMEOUT_DESCRIPTOR.index -> builder.timeout = deserializeInt()
                WORKERTYPE_DESCRIPTOR.index -> builder.workerType = deserializeString().let { WorkerType.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy