
commonMain.aws.sdk.kotlin.services.cloudfront.serde.CreateFieldLevelEncryptionConfigOperationSerializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudfront.serde
import aws.sdk.kotlin.services.cloudfront.model.CreateFieldLevelEncryptionConfigRequest
import aws.sdk.kotlin.services.cloudfront.model.FieldLevelEncryptionConfig
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
internal class CreateFieldLevelEncryptionConfigOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: CreateFieldLevelEncryptionConfigRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/2020-05-31/field-level-encryption"
}
if (input.fieldLevelEncryptionConfig != null) {
val payload = serializeFieldLevelEncryptionConfigPayloadWithXmlNameFieldLevelEncryptionConfig(input.fieldLevelEncryptionConfig)
builder.body = HttpBody.fromBytes(payload)
}
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/xml")
}
return builder
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy