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

commonMain.aws.sdk.kotlin.services.glue.serde.JobRunDocumentDeserializer.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.ExecutionClass
import aws.sdk.kotlin.services.glue.model.JobMode
import aws.sdk.kotlin.services.glue.model.JobRun
import aws.sdk.kotlin.services.glue.model.JobRunState
import aws.sdk.kotlin.services.glue.model.Predecessor
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.mutableListOf
import kotlin.collections.mutableMapOf

internal fun deserializeJobRunDocument(deserializer: Deserializer): JobRun {
    val builder = JobRun.Builder()
    val ALLOCATEDCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("AllocatedCapacity"))
    val ARGUMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Arguments"))
    val ATTEMPT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Attempt"))
    val COMPLETEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletedOn"))
    val DPUSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("DPUSeconds"))
    val ERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorMessage"))
    val EXECUTIONCLASS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ExecutionClass"))
    val EXECUTIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("ExecutionTime"))
    val GLUEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GlueVersion"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Id"))
    val JOBMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("JobMode"))
    val JOBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobName"))
    val JOBRUNQUEUINGENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("JobRunQueuingEnabled"))
    val JOBRUNSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("JobRunState"))
    val LASTMODIFIEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedOn"))
    val LOGGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogGroupName"))
    val MAINTENANCEWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MaintenanceWindow"))
    val MAXCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("MaxCapacity"))
    val NOTIFICATIONPROPERTY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("NotificationProperty"))
    val NUMBEROFWORKERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumberOfWorkers"))
    val PREDECESSORRUNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PredecessorRuns"))
    val PREVIOUSRUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PreviousRunId"))
    val PROFILENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ProfileName"))
    val SECURITYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityConfiguration"))
    val STARTEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartedOn"))
    val STATEDETAIL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StateDetail"))
    val TIMEOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Timeout"))
    val TRIGGERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TriggerName"))
    val WORKERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("WorkerType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ALLOCATEDCAPACITY_DESCRIPTOR)
        field(ARGUMENTS_DESCRIPTOR)
        field(ATTEMPT_DESCRIPTOR)
        field(COMPLETEDON_DESCRIPTOR)
        field(DPUSECONDS_DESCRIPTOR)
        field(ERRORMESSAGE_DESCRIPTOR)
        field(EXECUTIONCLASS_DESCRIPTOR)
        field(EXECUTIONTIME_DESCRIPTOR)
        field(GLUEVERSION_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(JOBMODE_DESCRIPTOR)
        field(JOBNAME_DESCRIPTOR)
        field(JOBRUNQUEUINGENABLED_DESCRIPTOR)
        field(JOBRUNSTATE_DESCRIPTOR)
        field(LASTMODIFIEDON_DESCRIPTOR)
        field(LOGGROUPNAME_DESCRIPTOR)
        field(MAINTENANCEWINDOW_DESCRIPTOR)
        field(MAXCAPACITY_DESCRIPTOR)
        field(NOTIFICATIONPROPERTY_DESCRIPTOR)
        field(NUMBEROFWORKERS_DESCRIPTOR)
        field(PREDECESSORRUNS_DESCRIPTOR)
        field(PREVIOUSRUNID_DESCRIPTOR)
        field(PROFILENAME_DESCRIPTOR)
        field(SECURITYCONFIGURATION_DESCRIPTOR)
        field(STARTEDON_DESCRIPTOR)
        field(STATEDETAIL_DESCRIPTOR)
        field(TIMEOUT_DESCRIPTOR)
        field(TRIGGERNAME_DESCRIPTOR)
        field(WORKERTYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ALLOCATEDCAPACITY_DESCRIPTOR.index -> builder.allocatedCapacity = deserializeInt()
                ARGUMENTS_DESCRIPTOR.index -> builder.arguments =
                    deserializer.deserializeMap(ARGUMENTS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                ATTEMPT_DESCRIPTOR.index -> builder.attempt = deserializeInt()
                COMPLETEDON_DESCRIPTOR.index -> builder.completedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DPUSECONDS_DESCRIPTOR.index -> builder.dpuSeconds = deserializeDouble()
                ERRORMESSAGE_DESCRIPTOR.index -> builder.errorMessage = deserializeString()
                EXECUTIONCLASS_DESCRIPTOR.index -> builder.executionClass = deserializeString().let { ExecutionClass.fromValue(it) }
                EXECUTIONTIME_DESCRIPTOR.index -> builder.executionTime = deserializeInt()
                GLUEVERSION_DESCRIPTOR.index -> builder.glueVersion = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                JOBMODE_DESCRIPTOR.index -> builder.jobMode = deserializeString().let { JobMode.fromValue(it) }
                JOBNAME_DESCRIPTOR.index -> builder.jobName = deserializeString()
                JOBRUNQUEUINGENABLED_DESCRIPTOR.index -> builder.jobRunQueuingEnabled = deserializeBoolean()
                JOBRUNSTATE_DESCRIPTOR.index -> builder.jobRunState = deserializeString().let { JobRunState.fromValue(it) }
                LASTMODIFIEDON_DESCRIPTOR.index -> builder.lastModifiedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LOGGROUPNAME_DESCRIPTOR.index -> builder.logGroupName = deserializeString()
                MAINTENANCEWINDOW_DESCRIPTOR.index -> builder.maintenanceWindow = deserializeString()
                MAXCAPACITY_DESCRIPTOR.index -> builder.maxCapacity = deserializeDouble()
                NOTIFICATIONPROPERTY_DESCRIPTOR.index -> builder.notificationProperty = deserializeNotificationPropertyDocument(deserializer)
                NUMBEROFWORKERS_DESCRIPTOR.index -> builder.numberOfWorkers = deserializeInt()
                PREDECESSORRUNS_DESCRIPTOR.index -> builder.predecessorRuns =
                    deserializer.deserializeList(PREDECESSORRUNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializePredecessorDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PREVIOUSRUNID_DESCRIPTOR.index -> builder.previousRunId = deserializeString()
                PROFILENAME_DESCRIPTOR.index -> builder.profileName = deserializeString()
                SECURITYCONFIGURATION_DESCRIPTOR.index -> builder.securityConfiguration = deserializeString()
                STARTEDON_DESCRIPTOR.index -> builder.startedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                STATEDETAIL_DESCRIPTOR.index -> builder.stateDetail = deserializeString()
                TIMEOUT_DESCRIPTOR.index -> builder.timeout = deserializeInt()
                TRIGGERNAME_DESCRIPTOR.index -> builder.triggerName = deserializeString()
                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