commonMain.aws.sdk.kotlin.services.chatbot.serde.UpdateMicrosoftTeamsChannelConfigurationOperationSerializer.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.UpdateMicrosoftTeamsChannelConfigurationRequest
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 UpdateMicrosoftTeamsChannelConfigurationOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: UpdateMicrosoftTeamsChannelConfigurationRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/update-ms-teams-channel-configuration"
}
val payload = serializeUpdateMicrosoftTeamsChannelConfigurationOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/json")
}
return builder
}
}
private fun serializeUpdateMicrosoftTeamsChannelConfigurationOperationBody(context: ExecutionContext, input: UpdateMicrosoftTeamsChannelConfigurationRequest): ByteArray {
val serializer = JsonSerializer()
val CHANNELID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ChannelId"))
val CHANNELNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ChannelName"))
val CHATCONFIGURATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ChatConfigurationArn"))
val GUARDRAILPOLICYARNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("GuardrailPolicyArns"))
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 USERAUTHORIZATIONREQUIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("UserAuthorizationRequired"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CHANNELID_DESCRIPTOR)
field(CHANNELNAME_DESCRIPTOR)
field(CHATCONFIGURATIONARN_DESCRIPTOR)
field(GUARDRAILPOLICYARNS_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(LOGGINGLEVEL_DESCRIPTOR)
field(SNSTOPICARNS_DESCRIPTOR)
field(USERAUTHORIZATIONREQUIRED_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.channelId?.let { field(CHANNELID_DESCRIPTOR, it) }
input.channelName?.let { field(CHANNELNAME_DESCRIPTOR, it) }
input.chatConfigurationArn?.let { field(CHATCONFIGURATIONARN_DESCRIPTOR, it) }
if (input.guardrailPolicyArns != null) {
listField(GUARDRAILPOLICYARNS_DESCRIPTOR) {
for (el0 in input.guardrailPolicyArns) {
serializeString(el0)
}
}
}
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)
}
}
}
input.userAuthorizationRequired?.let { field(USERAUTHORIZATIONREQUIRED_DESCRIPTOR, it) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy