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

commonMain.aws.sdk.kotlin.services.glue.serde.MappingDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.serde

import aws.sdk.kotlin.services.glue.model.Mapping
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 serializeMappingDocument(serializer: Serializer, input: Mapping) {
    val CHILDREN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Children"))
    val DROPPED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Dropped"))
    val FROMPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("FromPath"))
    val FROMTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FromType"))
    val TOKEY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ToKey"))
    val TOTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ToType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CHILDREN_DESCRIPTOR)
        field(DROPPED_DESCRIPTOR)
        field(FROMPATH_DESCRIPTOR)
        field(FROMTYPE_DESCRIPTOR)
        field(TOKEY_DESCRIPTOR)
        field(TOTYPE_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.toKey?.let { field(TOKEY_DESCRIPTOR, it) }
        if (input.fromPath != null) {
            listField(FROMPATH_DESCRIPTOR) {
                for (el0 in input.fromPath) {
                    serializeString(el0)
                }
            }
        }
        input.fromType?.let { field(FROMTYPE_DESCRIPTOR, it) }
        input.toType?.let { field(TOTYPE_DESCRIPTOR, it) }
        input.dropped?.let { field(DROPPED_DESCRIPTOR, it) }
        if (input.children != null) {
            listField(CHILDREN_DESCRIPTOR) {
                for (el0 in input.children) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeMappingDocument))
                }
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy