commonMain.aws.sdk.kotlin.services.pinpointemail.serde.EventDestinationDefinitionDocumentSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pinpointemail-jvm Show documentation
Show all versions of pinpointemail-jvm Show documentation
The AWS SDK for Kotlin client for Pinpoint Email
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.pinpointemail.serde
import aws.sdk.kotlin.services.pinpointemail.model.EventDestinationDefinition
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 serializeEventDestinationDefinitionDocument(serializer: Serializer, input: EventDestinationDefinition) {
val CLOUDWATCHDESTINATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CloudWatchDestination"))
val ENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Enabled"))
val KINESISFIREHOSEDESTINATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KinesisFirehoseDestination"))
val MATCHINGEVENTTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("MatchingEventTypes"))
val PINPOINTDESTINATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("PinpointDestination"))
val SNSDESTINATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SnsDestination"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CLOUDWATCHDESTINATION_DESCRIPTOR)
field(ENABLED_DESCRIPTOR)
field(KINESISFIREHOSEDESTINATION_DESCRIPTOR)
field(MATCHINGEVENTTYPES_DESCRIPTOR)
field(PINPOINTDESTINATION_DESCRIPTOR)
field(SNSDESTINATION_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.enabled != false) field(ENABLED_DESCRIPTOR, input.enabled)
if (input.matchingEventTypes != null) {
listField(MATCHINGEVENTTYPES_DESCRIPTOR) {
for (el0 in input.matchingEventTypes) {
serializeString(el0.value)
}
}
}
input.kinesisFirehoseDestination?.let { field(KINESISFIREHOSEDESTINATION_DESCRIPTOR, it, ::serializeKinesisFirehoseDestinationDocument) }
input.cloudWatchDestination?.let { field(CLOUDWATCHDESTINATION_DESCRIPTOR, it, ::serializeCloudWatchDestinationDocument) }
input.snsDestination?.let { field(SNSDESTINATION_DESCRIPTOR, it, ::serializeSnsDestinationDocument) }
input.pinpointDestination?.let { field(PINPOINTDESTINATION_DESCRIPTOR, it, ::serializePinpointDestinationDocument) }
}
}