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

commonMain.aws.sdk.kotlin.services.emr.transform.JobFlowDetailDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.emr.transform

import aws.sdk.kotlin.services.emr.model.BootstrapActionDetail
import aws.sdk.kotlin.services.emr.model.JobFlowDetail
import aws.sdk.kotlin.services.emr.model.ScaleDownBehavior
import aws.sdk.kotlin.services.emr.model.StepDetail
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

internal fun deserializeJobFlowDetailDocument(deserializer: Deserializer): JobFlowDetail {
    val builder = JobFlowDetail.Builder()
    val AMIVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AmiVersion"))
    val AUTOSCALINGROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AutoScalingRole"))
    val BOOTSTRAPACTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("BootstrapActions"))
    val EXECUTIONSTATUSDETAIL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ExecutionStatusDetail"))
    val INSTANCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Instances"))
    val JOBFLOWID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobFlowId"))
    val JOBFLOWROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobFlowRole"))
    val LOGENCRYPTIONKMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogEncryptionKmsKeyId"))
    val LOGURI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogUri"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val SCALEDOWNBEHAVIOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ScaleDownBehavior"))
    val SERVICEROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceRole"))
    val STEPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Steps"))
    val SUPPORTEDPRODUCTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SupportedProducts"))
    val VISIBLETOALLUSERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("VisibleToAllUsers"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AMIVERSION_DESCRIPTOR)
        field(AUTOSCALINGROLE_DESCRIPTOR)
        field(BOOTSTRAPACTIONS_DESCRIPTOR)
        field(EXECUTIONSTATUSDETAIL_DESCRIPTOR)
        field(INSTANCES_DESCRIPTOR)
        field(JOBFLOWID_DESCRIPTOR)
        field(JOBFLOWROLE_DESCRIPTOR)
        field(LOGENCRYPTIONKMSKEYID_DESCRIPTOR)
        field(LOGURI_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(SCALEDOWNBEHAVIOR_DESCRIPTOR)
        field(SERVICEROLE_DESCRIPTOR)
        field(STEPS_DESCRIPTOR)
        field(SUPPORTEDPRODUCTS_DESCRIPTOR)
        field(VISIBLETOALLUSERS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AMIVERSION_DESCRIPTOR.index -> builder.amiVersion = deserializeString()
                AUTOSCALINGROLE_DESCRIPTOR.index -> builder.autoScalingRole = deserializeString()
                BOOTSTRAPACTIONS_DESCRIPTOR.index -> builder.bootstrapActions =
                    deserializer.deserializeList(BOOTSTRAPACTIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeBootstrapActionDetailDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                EXECUTIONSTATUSDETAIL_DESCRIPTOR.index -> builder.executionStatusDetail = deserializeJobFlowExecutionStatusDetailDocument(deserializer)
                INSTANCES_DESCRIPTOR.index -> builder.instances = deserializeJobFlowInstancesDetailDocument(deserializer)
                JOBFLOWID_DESCRIPTOR.index -> builder.jobFlowId = deserializeString()
                JOBFLOWROLE_DESCRIPTOR.index -> builder.jobFlowRole = deserializeString()
                LOGENCRYPTIONKMSKEYID_DESCRIPTOR.index -> builder.logEncryptionKmsKeyId = deserializeString()
                LOGURI_DESCRIPTOR.index -> builder.logUri = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                SCALEDOWNBEHAVIOR_DESCRIPTOR.index -> builder.scaleDownBehavior = deserializeString().let { ScaleDownBehavior.fromValue(it) }
                SERVICEROLE_DESCRIPTOR.index -> builder.serviceRole = deserializeString()
                STEPS_DESCRIPTOR.index -> builder.steps =
                    deserializer.deserializeList(STEPS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeStepDetailDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SUPPORTEDPRODUCTS_DESCRIPTOR.index -> builder.supportedProducts =
                    deserializer.deserializeList(SUPPORTEDPRODUCTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                VISIBLETOALLUSERS_DESCRIPTOR.index -> builder.visibleToAllUsers = deserializeBoolean()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy