commonMain.aws.sdk.kotlin.services.chatbot.serde.SlackChannelConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.chatbot.serde
import aws.sdk.kotlin.services.chatbot.model.SlackChannelConfiguration
import aws.sdk.kotlin.services.chatbot.model.Tag
import aws.smithy.kotlin.runtime.serde.Deserializer
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.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf
internal fun deserializeSlackChannelConfigurationDocument(deserializer: Deserializer): SlackChannelConfiguration {
val builder = SlackChannelConfiguration.Builder()
val CHATCONFIGURATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ChatConfigurationArn"))
val CONFIGURATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigurationName"))
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 SLACKCHANNELID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SlackChannelId"))
val SLACKCHANNELNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SlackChannelName"))
val SLACKTEAMID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SlackTeamId"))
val SLACKTEAMNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SlackTeamName"))
val SNSTOPICARNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SnsTopicArns"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
val USERAUTHORIZATIONREQUIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("UserAuthorizationRequired"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CHATCONFIGURATIONARN_DESCRIPTOR)
field(CONFIGURATIONNAME_DESCRIPTOR)
field(GUARDRAILPOLICYARNS_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(LOGGINGLEVEL_DESCRIPTOR)
field(SLACKCHANNELID_DESCRIPTOR)
field(SLACKCHANNELNAME_DESCRIPTOR)
field(SLACKTEAMID_DESCRIPTOR)
field(SLACKTEAMNAME_DESCRIPTOR)
field(SNSTOPICARNS_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(USERAUTHORIZATIONREQUIRED_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CHATCONFIGURATIONARN_DESCRIPTOR.index -> builder.chatConfigurationArn = deserializeString()
CONFIGURATIONNAME_DESCRIPTOR.index -> builder.configurationName = deserializeString()
GUARDRAILPOLICYARNS_DESCRIPTOR.index -> builder.guardrailPolicyArns =
deserializer.deserializeList(GUARDRAILPOLICYARNS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
IAMROLEARN_DESCRIPTOR.index -> builder.iamRoleArn = deserializeString()
LOGGINGLEVEL_DESCRIPTOR.index -> builder.loggingLevel = deserializeString()
SLACKCHANNELID_DESCRIPTOR.index -> builder.slackChannelId = deserializeString()
SLACKCHANNELNAME_DESCRIPTOR.index -> builder.slackChannelName = deserializeString()
SLACKTEAMID_DESCRIPTOR.index -> builder.slackTeamId = deserializeString()
SLACKTEAMNAME_DESCRIPTOR.index -> builder.slackTeamName = deserializeString()
SNSTOPICARNS_DESCRIPTOR.index -> builder.snsTopicArns =
deserializer.deserializeList(SNSTOPICARNS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TAGS_DESCRIPTOR.index -> builder.tags =
deserializer.deserializeList(TAGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeTagDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
USERAUTHORIZATIONREQUIRED_DESCRIPTOR.index -> builder.userAuthorizationRequired = deserializeBoolean()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}