commonMain.aws.sdk.kotlin.services.codepipeline.serde.PipelineExecutionDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codepipeline-jvm Show documentation
Show all versions of codepipeline-jvm Show documentation
The AWS SDK for Kotlin client for CodePipeline
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codepipeline.serde
import aws.sdk.kotlin.services.codepipeline.model.ArtifactRevision
import aws.sdk.kotlin.services.codepipeline.model.PipelineExecution
import aws.sdk.kotlin.services.codepipeline.model.PipelineExecutionStatus
import aws.sdk.kotlin.services.codepipeline.model.ResolvedPipelineVariable
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
internal fun deserializePipelineExecutionDocument(deserializer: Deserializer): PipelineExecution {
val builder = PipelineExecution.Builder()
val ARTIFACTREVISIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("artifactRevisions"))
val PIPELINEEXECUTIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("pipelineExecutionId"))
val PIPELINENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("pipelineName"))
val PIPELINEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("pipelineVersion"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val STATUSSUMMARY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("statusSummary"))
val TRIGGER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("trigger"))
val VARIABLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("variables"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ARTIFACTREVISIONS_DESCRIPTOR)
field(PIPELINEEXECUTIONID_DESCRIPTOR)
field(PIPELINENAME_DESCRIPTOR)
field(PIPELINEVERSION_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(STATUSSUMMARY_DESCRIPTOR)
field(TRIGGER_DESCRIPTOR)
field(VARIABLES_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ARTIFACTREVISIONS_DESCRIPTOR.index -> builder.artifactRevisions =
deserializer.deserializeList(ARTIFACTREVISIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeArtifactRevisionDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
PIPELINEEXECUTIONID_DESCRIPTOR.index -> builder.pipelineExecutionId = deserializeString()
PIPELINENAME_DESCRIPTOR.index -> builder.pipelineName = deserializeString()
PIPELINEVERSION_DESCRIPTOR.index -> builder.pipelineVersion = deserializeInt()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { PipelineExecutionStatus.fromValue(it) }
STATUSSUMMARY_DESCRIPTOR.index -> builder.statusSummary = deserializeString()
TRIGGER_DESCRIPTOR.index -> builder.trigger = deserializeExecutionTriggerDocument(deserializer)
VARIABLES_DESCRIPTOR.index -> builder.variables =
deserializer.deserializeList(VARIABLES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeResolvedPipelineVariableDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy