commonMain.aws.sdk.kotlin.services.bedrockagent.serde.DataSourceConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.serde
import aws.sdk.kotlin.services.bedrockagent.model.DataSourceConfiguration
import aws.sdk.kotlin.services.bedrockagent.model.DataSourceType
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
internal fun deserializeDataSourceConfigurationDocument(deserializer: Deserializer): DataSourceConfiguration {
val builder = DataSourceConfiguration.Builder()
val CONFLUENCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("confluenceConfiguration"))
val S3CONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("s3Configuration"))
val SALESFORCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("salesforceConfiguration"))
val SHAREPOINTCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("sharePointConfiguration"))
val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("type"))
val WEBCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("webConfiguration"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONFLUENCECONFIGURATION_DESCRIPTOR)
field(S3CONFIGURATION_DESCRIPTOR)
field(SALESFORCECONFIGURATION_DESCRIPTOR)
field(SHAREPOINTCONFIGURATION_DESCRIPTOR)
field(TYPE_DESCRIPTOR)
field(WEBCONFIGURATION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONFLUENCECONFIGURATION_DESCRIPTOR.index -> builder.confluenceConfiguration = deserializeConfluenceDataSourceConfigurationDocument(deserializer)
S3CONFIGURATION_DESCRIPTOR.index -> builder.s3Configuration = deserializeS3DataSourceConfigurationDocument(deserializer)
SALESFORCECONFIGURATION_DESCRIPTOR.index -> builder.salesforceConfiguration = deserializeSalesforceDataSourceConfigurationDocument(deserializer)
SHAREPOINTCONFIGURATION_DESCRIPTOR.index -> builder.sharePointConfiguration = deserializeSharePointDataSourceConfigurationDocument(deserializer)
TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { DataSourceType.fromValue(it) }
WEBCONFIGURATION_DESCRIPTOR.index -> builder.webConfiguration = deserializeWebDataSourceConfigurationDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}