
commonMain.aws.sdk.kotlin.services.iot.serde.SetLoggingOptionsOperationSerializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iot.serde
import aws.sdk.kotlin.services.iot.model.LoggingOptionsPayload
import aws.sdk.kotlin.services.iot.model.SetLoggingOptionsRequest
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.url
import aws.smithy.kotlin.runtime.operation.ExecutionContext
internal class SetLoggingOptionsOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: SetLoggingOptionsRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/loggingOptions"
}
if (input.loggingOptionsPayload != null) {
val payload = serializeLoggingOptionsPayloadPayload(input.loggingOptionsPayload)
builder.body = HttpBody.fromBytes(payload)
}
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/json")
}
if (input.loggingOptionsPayload == null) {
builder.body = HttpBody.fromBytes("{}".encodeToByteArray())
builder.headers.setMissing("Content-Type", "application/json")
}
return builder
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy