commonMain.aws.sdk.kotlin.services.appflow.serde.TaskDocumentSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appflow-jvm Show documentation
Show all versions of appflow-jvm Show documentation
The AWS SDK for Kotlin client for Appflow
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appflow.serde
import aws.sdk.kotlin.services.appflow.model.Task
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 serializeTaskDocument(serializer: Serializer, input: Task) {
val CONNECTOROPERATOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("connectorOperator"))
val DESTINATIONFIELD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("destinationField"))
val SOURCEFIELDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("sourceFields"))
val TASKPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("taskProperties"))
val TASKTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("taskType"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONNECTOROPERATOR_DESCRIPTOR)
field(DESTINATIONFIELD_DESCRIPTOR)
field(SOURCEFIELDS_DESCRIPTOR)
field(TASKPROPERTIES_DESCRIPTOR)
field(TASKTYPE_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
listField(SOURCEFIELDS_DESCRIPTOR) {
for (el0 in input.sourceFields) {
serializeString(el0)
}
}
input.connectorOperator?.let { field(CONNECTOROPERATOR_DESCRIPTOR, it, ::serializeConnectorOperatorDocument) }
input.destinationField?.let { field(DESTINATIONFIELD_DESCRIPTOR, it) }
field(TASKTYPE_DESCRIPTOR, input.taskType.value)
if (input.taskProperties != null) {
mapField(TASKPROPERTIES_DESCRIPTOR) {
input.taskProperties.forEach { (key, value) ->
entry(key.value, value)
}
}
}
}
}