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

commonMain.aws.sdk.kotlin.services.emrserverless.serde.JobRunDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.emrserverless.serde

import aws.sdk.kotlin.services.emrserverless.model.JobRun
import aws.sdk.kotlin.services.emrserverless.model.JobRunState
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 kotlin.collections.mutableMapOf

internal fun deserializeJobRunDocument(deserializer: Deserializer): JobRun {
    val builder = JobRun.Builder()
    val APPLICATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationId"))
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val BILLEDRESOURCEUTILIZATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("billedResourceUtilization"))
    val CONFIGURATIONOVERRIDES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("configurationOverrides"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("createdBy"))
    val EXECUTIONROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("executionRole"))
    val EXECUTIONTIMEOUTMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("executionTimeoutMinutes"))
    val JOBDRIVER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("jobDriver"))
    val JOBRUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("jobRunId"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val NETWORKCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("networkConfiguration"))
    val RELEASELABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("releaseLabel"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("state"))
    val STATEDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("stateDetails"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
    val TOTALEXECUTIONDURATIONSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("totalExecutionDurationSeconds"))
    val TOTALRESOURCEUTILIZATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("totalResourceUtilization"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(APPLICATIONID_DESCRIPTOR)
        field(ARN_DESCRIPTOR)
        field(BILLEDRESOURCEUTILIZATION_DESCRIPTOR)
        field(CONFIGURATIONOVERRIDES_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(CREATEDBY_DESCRIPTOR)
        field(EXECUTIONROLE_DESCRIPTOR)
        field(EXECUTIONTIMEOUTMINUTES_DESCRIPTOR)
        field(JOBDRIVER_DESCRIPTOR)
        field(JOBRUNID_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(NETWORKCONFIGURATION_DESCRIPTOR)
        field(RELEASELABEL_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(STATEDETAILS_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(TOTALEXECUTIONDURATIONSECONDS_DESCRIPTOR)
        field(TOTALRESOURCEUTILIZATION_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                APPLICATIONID_DESCRIPTOR.index -> builder.applicationId = deserializeString()
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                BILLEDRESOURCEUTILIZATION_DESCRIPTOR.index -> builder.billedResourceUtilization = deserializeResourceUtilizationDocument(deserializer)
                CONFIGURATIONOVERRIDES_DESCRIPTOR.index -> builder.configurationOverrides = deserializeConfigurationOverridesDocument(deserializer)
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeString().let { Instant.fromEpochSeconds(it) }
                CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
                EXECUTIONROLE_DESCRIPTOR.index -> builder.executionRole = deserializeString()
                EXECUTIONTIMEOUTMINUTES_DESCRIPTOR.index -> builder.executionTimeoutMinutes = deserializeLong()
                JOBDRIVER_DESCRIPTOR.index -> builder.jobDriver = deserializeJobDriverDocument(deserializer)
                JOBRUNID_DESCRIPTOR.index -> builder.jobRunId = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                NETWORKCONFIGURATION_DESCRIPTOR.index -> builder.networkConfiguration = deserializeNetworkConfigurationDocument(deserializer)
                RELEASELABEL_DESCRIPTOR.index -> builder.releaseLabel = deserializeString()
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { JobRunState.fromValue(it) }
                STATEDETAILS_DESCRIPTOR.index -> builder.stateDetails = 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
                    }
                TOTALEXECUTIONDURATIONSECONDS_DESCRIPTOR.index -> builder.totalExecutionDurationSeconds = deserializeInt()
                TOTALRESOURCEUTILIZATION_DESCRIPTOR.index -> builder.totalResourceUtilization = deserializeTotalResourceUtilizationDocument(deserializer)
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeString().let { Instant.fromEpochSeconds(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy