
commonMain.aws.sdk.kotlin.services.s3.serde.DeleteObjectsOperationSerializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.s3.serde
import aws.sdk.kotlin.services.s3.model.ChecksumAlgorithm
import aws.sdk.kotlin.services.s3.model.Delete
import aws.sdk.kotlin.services.s3.model.DeleteObjectsRequest
import aws.sdk.kotlin.services.s3.model.RequestPayer
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.operation.HttpSerialize
import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
import aws.smithy.kotlin.runtime.http.request.headers
import aws.smithy.kotlin.runtime.http.request.url
import aws.smithy.kotlin.runtime.operation.ExecutionContext
internal class DeleteObjectsOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: DeleteObjectsRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.trailingSlash = true
parameters.decodedParameters {
add("delete", "")
add("x-id", "DeleteObjects")
}
}
builder.headers {
if (input.bypassGovernanceRetention != null) append("x-amz-bypass-governance-retention", "${input.bypassGovernanceRetention}")
if (input.checksumAlgorithm != null) append("x-amz-sdk-checksum-algorithm", input.checksumAlgorithm.value)
if (input.expectedBucketOwner?.isNotEmpty() == true) append("x-amz-expected-bucket-owner", input.expectedBucketOwner)
if (input.mfa?.isNotEmpty() == true) append("x-amz-mfa", input.mfa)
if (input.requestPayer != null) append("x-amz-request-payer", input.requestPayer.value)
}
if (input.delete != null) {
val payload = serializeDeletePayloadWithXmlNameDelete(input.delete)
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