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

commonMain.aws.sdk.kotlin.services.codepipeline.serde.ActionDeclarationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codepipeline.serde

import aws.sdk.kotlin.services.codepipeline.model.ActionDeclaration
import aws.sdk.kotlin.services.codepipeline.model.InputArtifact
import aws.sdk.kotlin.services.codepipeline.model.OutputArtifact
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 kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf

internal fun deserializeActionDeclarationDocument(deserializer: Deserializer): ActionDeclaration {
    val builder = ActionDeclaration.Builder()
    val ACTIONTYPEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("actionTypeId"))
    val COMMANDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("commands"))
    val CONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("configuration"))
    val INPUTARTIFACTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("inputArtifacts"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val NAMESPACE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespace"))
    val OUTPUTARTIFACTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("outputArtifacts"))
    val OUTPUTVARIABLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("outputVariables"))
    val REGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("region"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("roleArn"))
    val RUNORDER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("runOrder"))
    val TIMEOUTINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("timeoutInMinutes"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACTIONTYPEID_DESCRIPTOR)
        field(COMMANDS_DESCRIPTOR)
        field(CONFIGURATION_DESCRIPTOR)
        field(INPUTARTIFACTS_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(NAMESPACE_DESCRIPTOR)
        field(OUTPUTARTIFACTS_DESCRIPTOR)
        field(OUTPUTVARIABLES_DESCRIPTOR)
        field(REGION_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(RUNORDER_DESCRIPTOR)
        field(TIMEOUTINMINUTES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTIONTYPEID_DESCRIPTOR.index -> builder.actionTypeId = deserializeActionTypeIdDocument(deserializer)
                COMMANDS_DESCRIPTOR.index -> builder.commands =
                    deserializer.deserializeList(COMMANDS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CONFIGURATION_DESCRIPTOR.index -> builder.configuration =
                    deserializer.deserializeMap(CONFIGURATION_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                INPUTARTIFACTS_DESCRIPTOR.index -> builder.inputArtifacts =
                    deserializer.deserializeList(INPUTARTIFACTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeInputArtifactDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                NAMESPACE_DESCRIPTOR.index -> builder.namespace = deserializeString()
                OUTPUTARTIFACTS_DESCRIPTOR.index -> builder.outputArtifacts =
                    deserializer.deserializeList(OUTPUTARTIFACTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeOutputArtifactDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                OUTPUTVARIABLES_DESCRIPTOR.index -> builder.outputVariables =
                    deserializer.deserializeList(OUTPUTVARIABLES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                REGION_DESCRIPTOR.index -> builder.region = deserializeString()
                ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
                RUNORDER_DESCRIPTOR.index -> builder.runOrder = deserializeInt()
                TIMEOUTINMINUTES_DESCRIPTOR.index -> builder.timeoutInMinutes = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy