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

commonMain.aws.sdk.kotlin.services.firehose.serde.CreateDeliveryStreamOperationSerializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.78
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.firehose.serde

import aws.sdk.kotlin.services.firehose.model.AmazonOpenSearchServerlessDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.AmazonopensearchserviceDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.CreateDeliveryStreamRequest
import aws.sdk.kotlin.services.firehose.model.DeliveryStreamEncryptionConfigurationInput
import aws.sdk.kotlin.services.firehose.model.DeliveryStreamType
import aws.sdk.kotlin.services.firehose.model.ElasticsearchDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.ExtendedS3DestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.HttpEndpointDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.IcebergDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.KinesisStreamSourceConfiguration
import aws.sdk.kotlin.services.firehose.model.MskSourceConfiguration
import aws.sdk.kotlin.services.firehose.model.RedshiftDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.S3DestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.SnowflakeDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.SplunkDestinationConfiguration
import aws.sdk.kotlin.services.firehose.model.Tag
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.operation.HttpSerializer
import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
import aws.smithy.kotlin.runtime.http.request.url
import aws.smithy.kotlin.runtime.operation.ExecutionContext
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.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.json.JsonSerializer
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct


internal class CreateDeliveryStreamOperationSerializer: HttpSerializer.NonStreaming {
    override fun serialize(context: ExecutionContext, input: CreateDeliveryStreamRequest): HttpRequestBuilder {
        val builder = HttpRequestBuilder()
        builder.method = HttpMethod.POST

        builder.url {
            path.encoded = "/"
        }

        val payload = serializeCreateDeliveryStreamOperationBody(context, input)
        builder.body = HttpBody.fromBytes(payload)
        if (builder.body !is HttpBody.Empty) {
            builder.headers.setMissing("Content-Type", "application/x-amz-json-1.1")
        }
        return builder
    }
}

private fun serializeCreateDeliveryStreamOperationBody(context: ExecutionContext, input: CreateDeliveryStreamRequest): ByteArray {
    val serializer = JsonSerializer()
    val AMAZONOPENSEARCHSERVERLESSDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("AmazonOpenSearchServerlessDestinationConfiguration"))
    val AMAZONOPENSEARCHSERVICEDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("AmazonopensearchserviceDestinationConfiguration"))
    val DELIVERYSTREAMENCRYPTIONCONFIGURATIONINPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DeliveryStreamEncryptionConfigurationInput"))
    val DELIVERYSTREAMNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DeliveryStreamName"))
    val DELIVERYSTREAMTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("DeliveryStreamType"))
    val ELASTICSEARCHDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ElasticsearchDestinationConfiguration"))
    val EXTENDEDS3DESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ExtendedS3DestinationConfiguration"))
    val HTTPENDPOINTDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("HttpEndpointDestinationConfiguration"))
    val ICEBERGDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("IcebergDestinationConfiguration"))
    val KINESISSTREAMSOURCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KinesisStreamSourceConfiguration"))
    val MSKSOURCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MSKSourceConfiguration"))
    val REDSHIFTDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RedshiftDestinationConfiguration"))
    val S3DESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("S3DestinationConfiguration"))
    val SNOWFLAKEDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SnowflakeDestinationConfiguration"))
    val SPLUNKDESTINATIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SplunkDestinationConfiguration"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AMAZONOPENSEARCHSERVERLESSDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(AMAZONOPENSEARCHSERVICEDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(DELIVERYSTREAMENCRYPTIONCONFIGURATIONINPUT_DESCRIPTOR)
        field(DELIVERYSTREAMNAME_DESCRIPTOR)
        field(DELIVERYSTREAMTYPE_DESCRIPTOR)
        field(ELASTICSEARCHDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(EXTENDEDS3DESTINATIONCONFIGURATION_DESCRIPTOR)
        field(HTTPENDPOINTDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(ICEBERGDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(KINESISSTREAMSOURCECONFIGURATION_DESCRIPTOR)
        field(MSKSOURCECONFIGURATION_DESCRIPTOR)
        field(REDSHIFTDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(S3DESTINATIONCONFIGURATION_DESCRIPTOR)
        field(SNOWFLAKEDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(SPLUNKDESTINATIONCONFIGURATION_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.amazonOpenSearchServerlessDestinationConfiguration?.let { field(AMAZONOPENSEARCHSERVERLESSDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeAmazonOpenSearchServerlessDestinationConfigurationDocument) }
        input.amazonopensearchserviceDestinationConfiguration?.let { field(AMAZONOPENSEARCHSERVICEDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeAmazonopensearchserviceDestinationConfigurationDocument) }
        input.deliveryStreamEncryptionConfigurationInput?.let { field(DELIVERYSTREAMENCRYPTIONCONFIGURATIONINPUT_DESCRIPTOR, it, ::serializeDeliveryStreamEncryptionConfigurationInputDocument) }
        input.deliveryStreamName?.let { field(DELIVERYSTREAMNAME_DESCRIPTOR, it) }
        input.deliveryStreamType?.let { field(DELIVERYSTREAMTYPE_DESCRIPTOR, it.value) }
        input.elasticsearchDestinationConfiguration?.let { field(ELASTICSEARCHDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeElasticsearchDestinationConfigurationDocument) }
        input.extendedS3DestinationConfiguration?.let { field(EXTENDEDS3DESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeExtendedS3DestinationConfigurationDocument) }
        input.httpEndpointDestinationConfiguration?.let { field(HTTPENDPOINTDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeHttpEndpointDestinationConfigurationDocument) }
        input.icebergDestinationConfiguration?.let { field(ICEBERGDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeIcebergDestinationConfigurationDocument) }
        input.kinesisStreamSourceConfiguration?.let { field(KINESISSTREAMSOURCECONFIGURATION_DESCRIPTOR, it, ::serializeKinesisStreamSourceConfigurationDocument) }
        input.mskSourceConfiguration?.let { field(MSKSOURCECONFIGURATION_DESCRIPTOR, it, ::serializeMskSourceConfigurationDocument) }
        input.redshiftDestinationConfiguration?.let { field(REDSHIFTDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeRedshiftDestinationConfigurationDocument) }
        input.s3DestinationConfiguration?.let { field(S3DESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeS3DestinationConfigurationDocument) }
        input.snowflakeDestinationConfiguration?.let { field(SNOWFLAKEDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeSnowflakeDestinationConfigurationDocument) }
        input.splunkDestinationConfiguration?.let { field(SPLUNKDESTINATIONCONFIGURATION_DESCRIPTOR, it, ::serializeSplunkDestinationConfigurationDocument) }
        if (input.tags != null) {
            listField(TAGS_DESCRIPTOR) {
                for (el0 in input.tags) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
                }
            }
        }
    }
    return serializer.toByteArray()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy