commonMain.aws.sdk.kotlin.services.chatbot.serde.CreateChimeWebhookConfigurationOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chatbot-jvm Show documentation
Show all versions of chatbot-jvm Show documentation
The AWS SDK for Kotlin client for chatbot
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.chatbot.serde
import aws.sdk.kotlin.services.chatbot.model.CreateChimeWebhookConfigurationRequest
import aws.sdk.kotlin.services.chatbot.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 CreateChimeWebhookConfigurationOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: CreateChimeWebhookConfigurationRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/create-chime-webhook-configuration"
}
val payload = serializeCreateChimeWebhookConfigurationOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/json")
}
return builder
}
}
private fun serializeCreateChimeWebhookConfigurationOperationBody(context: ExecutionContext, input: CreateChimeWebhookConfigurationRequest): ByteArray {
val serializer = JsonSerializer()
val CONFIGURATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigurationName"))
val IAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IamRoleArn"))
val LOGGINGLEVEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LoggingLevel"))
val SNSTOPICARNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SnsTopicArns"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
val WEBHOOKDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("WebhookDescription"))
val WEBHOOKURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("WebhookUrl"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONFIGURATIONNAME_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(LOGGINGLEVEL_DESCRIPTOR)
field(SNSTOPICARNS_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(WEBHOOKDESCRIPTION_DESCRIPTOR)
field(WEBHOOKURL_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.configurationName?.let { field(CONFIGURATIONNAME_DESCRIPTOR, it) }
input.iamRoleArn?.let { field(IAMROLEARN_DESCRIPTOR, it) }
input.loggingLevel?.let { field(LOGGINGLEVEL_DESCRIPTOR, it) }
if (input.snsTopicArns != null) {
listField(SNSTOPICARNS_DESCRIPTOR) {
for (el0 in input.snsTopicArns) {
serializeString(el0)
}
}
}
if (input.tags != null) {
listField(TAGS_DESCRIPTOR) {
for (el0 in input.tags) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
}
}
}
input.webhookDescription?.let { field(WEBHOOKDESCRIPTION_DESCRIPTOR, it) }
input.webhookUrl?.let { field(WEBHOOKURL_DESCRIPTOR, it) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy