commonMain.aws.sdk.kotlin.services.codepipeline.serde.PipelineDeclarationDocumentSerializer.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.PipelineDeclaration
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.Serializer
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 serializePipelineDeclarationDocument(serializer: Serializer, input: PipelineDeclaration) {
val ARTIFACTSTORE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("artifactStore"))
val ARTIFACTSTORES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("artifactStores"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
val PIPELINETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("pipelineType"))
val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("roleArn"))
val STAGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("stages"))
val TRIGGERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("triggers"))
val VARIABLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("variables"))
val VERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("version"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ARTIFACTSTORE_DESCRIPTOR)
field(ARTIFACTSTORES_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(PIPELINETYPE_DESCRIPTOR)
field(ROLEARN_DESCRIPTOR)
field(STAGES_DESCRIPTOR)
field(TRIGGERS_DESCRIPTOR)
field(VARIABLES_DESCRIPTOR)
field(VERSION_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
field(NAME_DESCRIPTOR, input.name)
field(ROLEARN_DESCRIPTOR, input.roleArn)
input.artifactStore?.let { field(ARTIFACTSTORE_DESCRIPTOR, it, ::serializeArtifactStoreDocument) }
if (input.artifactStores != null) {
mapField(ARTIFACTSTORES_DESCRIPTOR) {
input.artifactStores.forEach { (key, value) -> entry(key, asSdkSerializable(value, ::serializeArtifactStoreDocument)) }
}
}
listField(STAGES_DESCRIPTOR) {
for (el0 in input.stages) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeStageDeclarationDocument))
}
}
input.version?.let { field(VERSION_DESCRIPTOR, it) }
input.pipelineType?.let { field(PIPELINETYPE_DESCRIPTOR, it.value) }
if (input.triggers != null) {
listField(TRIGGERS_DESCRIPTOR) {
for (el0 in input.triggers) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializePipelineTriggerDeclarationDocument))
}
}
}
if (input.variables != null) {
listField(VARIABLES_DESCRIPTOR) {
for (el0 in input.variables) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializePipelineVariableDeclarationDocument))
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy