commonMain.aws.sdk.kotlin.services.bedrockagent.serde.ChatPromptTemplateConfigurationDocumentDeserializer.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.ChatPromptTemplateConfiguration
import aws.sdk.kotlin.services.bedrockagent.model.Message
import aws.sdk.kotlin.services.bedrockagent.model.PromptInputVariable
import aws.sdk.kotlin.services.bedrockagent.model.SystemContentBlock
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 deserializeChatPromptTemplateConfigurationDocument(deserializer: Deserializer): ChatPromptTemplateConfiguration {
val builder = ChatPromptTemplateConfiguration.Builder()
val INPUTVARIABLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("inputVariables"))
val MESSAGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("messages"))
val SYSTEM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("system"))
val TOOLCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("toolConfiguration"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(INPUTVARIABLES_DESCRIPTOR)
field(MESSAGES_DESCRIPTOR)
field(SYSTEM_DESCRIPTOR)
field(TOOLCONFIGURATION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
INPUTVARIABLES_DESCRIPTOR.index -> builder.inputVariables =
deserializer.deserializeList(INPUTVARIABLES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializePromptInputVariableDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
MESSAGES_DESCRIPTOR.index -> builder.messages =
deserializer.deserializeList(MESSAGES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeMessageDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SYSTEM_DESCRIPTOR.index -> builder.system =
deserializer.deserializeList(SYSTEM_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeSystemContentBlockDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TOOLCONFIGURATION_DESCRIPTOR.index -> builder.toolConfiguration = deserializeToolConfigurationDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy