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

commonMain.aws.sdk.kotlin.services.bedrockagent.serde.AgentActionGroupDocumentDeserializer.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.ActionGroupSignature
import aws.sdk.kotlin.services.bedrockagent.model.ActionGroupState
import aws.sdk.kotlin.services.bedrockagent.model.AgentActionGroup
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat

internal fun deserializeAgentActionGroupDocument(deserializer: Deserializer): AgentActionGroup {
    val builder = AgentActionGroup.Builder()
    val ACTIONGROUPEXECUTOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("actionGroupExecutor"))
    val ACTIONGROUPID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("actionGroupId"))
    val ACTIONGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("actionGroupName"))
    val ACTIONGROUPSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("actionGroupState"))
    val AGENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("agentId"))
    val AGENTVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("agentVersion"))
    val APISCHEMA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("apiSchema"))
    val CLIENTTOKEN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("clientToken"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val FUNCTIONSCHEMA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("functionSchema"))
    val PARENTACTIONSIGNATURE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("parentActionSignature"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACTIONGROUPEXECUTOR_DESCRIPTOR)
        field(ACTIONGROUPID_DESCRIPTOR)
        field(ACTIONGROUPNAME_DESCRIPTOR)
        field(ACTIONGROUPSTATE_DESCRIPTOR)
        field(AGENTID_DESCRIPTOR)
        field(AGENTVERSION_DESCRIPTOR)
        field(APISCHEMA_DESCRIPTOR)
        field(CLIENTTOKEN_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(FUNCTIONSCHEMA_DESCRIPTOR)
        field(PARENTACTIONSIGNATURE_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTIONGROUPEXECUTOR_DESCRIPTOR.index -> builder.actionGroupExecutor = deserializeActionGroupExecutorDocument(deserializer)
                ACTIONGROUPID_DESCRIPTOR.index -> builder.actionGroupId = deserializeString()
                ACTIONGROUPNAME_DESCRIPTOR.index -> builder.actionGroupName = deserializeString()
                ACTIONGROUPSTATE_DESCRIPTOR.index -> builder.actionGroupState = deserializeString().let { ActionGroupState.fromValue(it) }
                AGENTID_DESCRIPTOR.index -> builder.agentId = deserializeString()
                AGENTVERSION_DESCRIPTOR.index -> builder.agentVersion = deserializeString()
                APISCHEMA_DESCRIPTOR.index -> builder.apiSchema = deserializeApiSchemaDocument(deserializer)
                CLIENTTOKEN_DESCRIPTOR.index -> builder.clientToken = deserializeString()
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.ISO_8601)
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                FUNCTIONSCHEMA_DESCRIPTOR.index -> builder.functionSchema = deserializeFunctionSchemaDocument(deserializer)
                PARENTACTIONSIGNATURE_DESCRIPTOR.index -> builder.parentActionSignature = deserializeString().let { ActionGroupSignature.fromValue(it) }
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.ISO_8601)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy