All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.bedrockagent.serde.FlowNodeConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.bedrockagent.serde

import aws.sdk.kotlin.services.bedrockagent.model.FlowNodeConfiguration
import aws.smithy.kotlin.runtime.serde.DeserializationException
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.IgnoreKey
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 deserializeFlowNodeConfigurationDocument(deserializer: Deserializer): FlowNodeConfiguration {
    var value: FlowNodeConfiguration? = null
    val AGENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("agent"))
    val COLLECTOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("collector"))
    val CONDITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("condition"))
    val INPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("input"))
    val ITERATOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("iterator"))
    val KNOWLEDGEBASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("knowledgeBase"))
    val LAMBDAFUNCTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("lambdaFunction"))
    val LEX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("lex"))
    val OUTPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("output"))
    val PROMPT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("prompt"))
    val RETRIEVAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("retrieval"))
    val STORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("storage"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(IgnoreKey("__type"))
        field(AGENT_DESCRIPTOR)
        field(COLLECTOR_DESCRIPTOR)
        field(CONDITION_DESCRIPTOR)
        field(INPUT_DESCRIPTOR)
        field(ITERATOR_DESCRIPTOR)
        field(KNOWLEDGEBASE_DESCRIPTOR)
        field(LAMBDAFUNCTION_DESCRIPTOR)
        field(LEX_DESCRIPTOR)
        field(OUTPUT_DESCRIPTOR)
        field(PROMPT_DESCRIPTOR)
        field(RETRIEVAL_DESCRIPTOR)
        field(STORAGE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while(true) {
            when(findNextFieldIndex()) {
                AGENT_DESCRIPTOR.index -> value = FlowNodeConfiguration.Agent(deserializeAgentFlowNodeConfigurationDocument(deserializer))
                COLLECTOR_DESCRIPTOR.index -> value = FlowNodeConfiguration.Collector(deserializeCollectorFlowNodeConfigurationDocument(deserializer))
                CONDITION_DESCRIPTOR.index -> value = FlowNodeConfiguration.Condition(deserializeConditionFlowNodeConfigurationDocument(deserializer))
                INPUT_DESCRIPTOR.index -> value = FlowNodeConfiguration.Input(deserializeInputFlowNodeConfigurationDocument(deserializer))
                ITERATOR_DESCRIPTOR.index -> value = FlowNodeConfiguration.Iterator(deserializeIteratorFlowNodeConfigurationDocument(deserializer))
                KNOWLEDGEBASE_DESCRIPTOR.index -> value = FlowNodeConfiguration.KnowledgeBase(deserializeKnowledgeBaseFlowNodeConfigurationDocument(deserializer))
                LAMBDAFUNCTION_DESCRIPTOR.index -> value = FlowNodeConfiguration.LambdaFunction(deserializeLambdaFunctionFlowNodeConfigurationDocument(deserializer))
                LEX_DESCRIPTOR.index -> value = FlowNodeConfiguration.Lex(deserializeLexFlowNodeConfigurationDocument(deserializer))
                OUTPUT_DESCRIPTOR.index -> value = FlowNodeConfiguration.Output(deserializeOutputFlowNodeConfigurationDocument(deserializer))
                PROMPT_DESCRIPTOR.index -> value = FlowNodeConfiguration.Prompt(deserializePromptFlowNodeConfigurationDocument(deserializer))
                RETRIEVAL_DESCRIPTOR.index -> value = FlowNodeConfiguration.Retrieval(deserializeRetrievalFlowNodeConfigurationDocument(deserializer))
                STORAGE_DESCRIPTOR.index -> value = FlowNodeConfiguration.Storage(deserializeStorageFlowNodeConfigurationDocument(deserializer))
                null -> break@loop
                else -> value = FlowNodeConfiguration.SdkUnknown.also { skipValue() }
            }
        }
    }
    return value ?: throw DeserializationException("Deserialized union value unexpectedly null: FlowNodeConfiguration")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy