commonMain.aws.sdk.kotlin.services.firehose.serde.UpdateDestinationOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of firehose-jvm Show documentation
Show all versions of firehose-jvm Show documentation
The AWS SDK for Kotlin client for Firehose
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.firehose.serde
import aws.sdk.kotlin.services.firehose.model.AmazonOpenSearchServerlessDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.AmazonopensearchserviceDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.ElasticsearchDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.ExtendedS3DestinationUpdate
import aws.sdk.kotlin.services.firehose.model.HttpEndpointDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.IcebergDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.RedshiftDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.S3DestinationUpdate
import aws.sdk.kotlin.services.firehose.model.SnowflakeDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.SplunkDestinationUpdate
import aws.sdk.kotlin.services.firehose.model.UpdateDestinationRequest
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 UpdateDestinationOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: UpdateDestinationRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeUpdateDestinationOperationBody(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 serializeUpdateDestinationOperationBody(context: ExecutionContext, input: UpdateDestinationRequest): ByteArray {
val serializer = JsonSerializer()
val AMAZONOPENSEARCHSERVERLESSDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("AmazonOpenSearchServerlessDestinationUpdate"))
val AMAZONOPENSEARCHSERVICEDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("AmazonopensearchserviceDestinationUpdate"))
val CURRENTDELIVERYSTREAMVERSIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CurrentDeliveryStreamVersionId"))
val DELIVERYSTREAMNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DeliveryStreamName"))
val DESTINATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DestinationId"))
val ELASTICSEARCHDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ElasticsearchDestinationUpdate"))
val EXTENDEDS3DESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ExtendedS3DestinationUpdate"))
val HTTPENDPOINTDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("HttpEndpointDestinationUpdate"))
val ICEBERGDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("IcebergDestinationUpdate"))
val REDSHIFTDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RedshiftDestinationUpdate"))
val S3DESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("S3DestinationUpdate"))
val SNOWFLAKEDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SnowflakeDestinationUpdate"))
val SPLUNKDESTINATIONUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SplunkDestinationUpdate"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AMAZONOPENSEARCHSERVERLESSDESTINATIONUPDATE_DESCRIPTOR)
field(AMAZONOPENSEARCHSERVICEDESTINATIONUPDATE_DESCRIPTOR)
field(CURRENTDELIVERYSTREAMVERSIONID_DESCRIPTOR)
field(DELIVERYSTREAMNAME_DESCRIPTOR)
field(DESTINATIONID_DESCRIPTOR)
field(ELASTICSEARCHDESTINATIONUPDATE_DESCRIPTOR)
field(EXTENDEDS3DESTINATIONUPDATE_DESCRIPTOR)
field(HTTPENDPOINTDESTINATIONUPDATE_DESCRIPTOR)
field(ICEBERGDESTINATIONUPDATE_DESCRIPTOR)
field(REDSHIFTDESTINATIONUPDATE_DESCRIPTOR)
field(S3DESTINATIONUPDATE_DESCRIPTOR)
field(SNOWFLAKEDESTINATIONUPDATE_DESCRIPTOR)
field(SPLUNKDESTINATIONUPDATE_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.amazonOpenSearchServerlessDestinationUpdate?.let { field(AMAZONOPENSEARCHSERVERLESSDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeAmazonOpenSearchServerlessDestinationUpdateDocument) }
input.amazonopensearchserviceDestinationUpdate?.let { field(AMAZONOPENSEARCHSERVICEDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeAmazonopensearchserviceDestinationUpdateDocument) }
input.currentDeliveryStreamVersionId?.let { field(CURRENTDELIVERYSTREAMVERSIONID_DESCRIPTOR, it) }
input.deliveryStreamName?.let { field(DELIVERYSTREAMNAME_DESCRIPTOR, it) }
input.destinationId?.let { field(DESTINATIONID_DESCRIPTOR, it) }
input.elasticsearchDestinationUpdate?.let { field(ELASTICSEARCHDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeElasticsearchDestinationUpdateDocument) }
input.extendedS3DestinationUpdate?.let { field(EXTENDEDS3DESTINATIONUPDATE_DESCRIPTOR, it, ::serializeExtendedS3DestinationUpdateDocument) }
input.httpEndpointDestinationUpdate?.let { field(HTTPENDPOINTDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeHttpEndpointDestinationUpdateDocument) }
input.icebergDestinationUpdate?.let { field(ICEBERGDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeIcebergDestinationUpdateDocument) }
input.redshiftDestinationUpdate?.let { field(REDSHIFTDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeRedshiftDestinationUpdateDocument) }
input.s3DestinationUpdate?.let { field(S3DESTINATIONUPDATE_DESCRIPTOR, it, ::serializeS3DestinationUpdateDocument) }
input.snowflakeDestinationUpdate?.let { field(SNOWFLAKEDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeSnowflakeDestinationUpdateDocument) }
input.splunkDestinationUpdate?.let { field(SPLUNKDESTINATIONUPDATE_DESCRIPTOR, it, ::serializeSplunkDestinationUpdateDocument) }
}
return serializer.toByteArray()
}