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

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

The 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.JobRunAttemptSummary
import aws.sdk.kotlin.services.emrserverless.model.JobRunMode
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 aws.smithy.kotlin.runtime.time.TimestampFormat

internal fun deserializeJobRunAttemptSummaryDocument(deserializer: Deserializer): JobRunAttemptSummary {
    val builder = JobRunAttemptSummary.Builder()
    val APPLICATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationId"))
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val ATTEMPT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("attempt"))
    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 ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
    val JOBCREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("jobCreatedAt"))
    val MODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("mode"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    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 TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("type"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(APPLICATIONID_DESCRIPTOR)
        field(ARN_DESCRIPTOR)
        field(ATTEMPT_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(CREATEDBY_DESCRIPTOR)
        field(EXECUTIONROLE_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(JOBCREATEDAT_DESCRIPTOR)
        field(MODE_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(RELEASELABEL_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(STATEDETAILS_DESCRIPTOR)
        field(TYPE_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()
                ATTEMPT_DESCRIPTOR.index -> builder.attempt = deserializeInt()
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
                EXECUTIONROLE_DESCRIPTOR.index -> builder.executionRole = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                JOBCREATEDAT_DESCRIPTOR.index -> builder.jobCreatedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                MODE_DESCRIPTOR.index -> builder.mode = deserializeString().let { JobRunMode.fromValue(it) }
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                RELEASELABEL_DESCRIPTOR.index -> builder.releaseLabel = deserializeString()
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { JobRunState.fromValue(it) }
                STATEDETAILS_DESCRIPTOR.index -> builder.stateDetails = deserializeString()
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString()
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy