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

commonMain.aws.sdk.kotlin.services.codepipeline.serde.RuleDeclarationDocumentSerializer.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.RuleDeclaration
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 serializeRuleDeclarationDocument(serializer: Serializer, input: RuleDeclaration) {
    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 REGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("region"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("roleArn"))
    val RULETYPEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ruleTypeId"))
    val TIMEOUTINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("timeoutInMinutes"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CONFIGURATION_DESCRIPTOR)
        field(INPUTARTIFACTS_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(REGION_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(RULETYPEID_DESCRIPTOR)
        field(TIMEOUTINMINUTES_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        field(NAME_DESCRIPTOR, input.name)
        input.ruleTypeId?.let { field(RULETYPEID_DESCRIPTOR, it, ::serializeRuleTypeIdDocument) }
        if (input.configuration != null) {
            mapField(CONFIGURATION_DESCRIPTOR) {
                input.configuration.forEach { (key, value) ->
                    entry(key, value)
                }
            }
        }
        if (input.inputArtifacts != null) {
            listField(INPUTARTIFACTS_DESCRIPTOR) {
                for (el0 in input.inputArtifacts) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeInputArtifactDocument))
                }
            }
        }
        input.roleArn?.let { field(ROLEARN_DESCRIPTOR, it) }
        input.region?.let { field(REGION_DESCRIPTOR, it) }
        input.timeoutInMinutes?.let { field(TIMEOUTINMINUTES_DESCRIPTOR, it) }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy