bedrockagent

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 24 Imported by: 0

README

Bedrock Agent

Parity grade: A · SDK aws-sdk-go-v2/service/bedrockagent@v1.58.4 · last audited 2026-09-18 (e33627d17)

Coverage

Metric Value
PARITY entries audited 77 (77 ok)
Feature families 3 (3 ok)
Known gaps 5
Deferred items 2
Resource leaks clean
Known gaps
  • DeleteAgentActionGroup.SkipResourceInUseCheck is accepted and ignored: action groups are DRAFT-only and aliases route to numbered versions holding their own copy, so no in-use reference can exist.
  • ValidateFlowDefinition covers only top-level graph structure (see its ops row); cycle, unreachable-node, node-type and expression validation are not modeled.
  • FailureReasons and StatusReason are unmodeled: no FAILED state paths exist in this backend.
  • Stored and echoed only, no runtime applies them: AliasInvocationState, FlowAlias ConcurrencyConfiguration, ParentActionGroupSignature(Params), CustomOrchestration, PromptOverrideConfiguration, CustomerEncryptionKeyArn (no KMS).
  • ClientToken replay is honoured for Create/Update members whose resource carries it (agent, action group, alias, collaborator, knowledge base, data source, ingestion job, flow, flow version, flow alias, prompt, prompt version); tokens on KB, data source, ingestion job, flow, flow version, flow alias and prompt resources are not persisted across restart, and Ingest/DeleteKnowledgeBaseDocuments ClientToken is not tracked.
Deferred
  • "KBDocument/DataSource nested configuration blobs (dataSourceConfiguration, vectorIngestionConfiguration, knowledgeBaseConfiguration, storageConfiguration, actionGroupExecutor, apiSchema, functionSchema, guardrailConfiguration, memoryConfiguration, promptOverrideConfiguration) are passed through as opaque map[string]any/JSON blobs rather than typed + validated against the SDK's nested shape unions. This is consistent with how this service already treats them; deep-shape validation of these blobs was out of scope this sweep (unchanged). RE-ASSESSED (gopherstack-rvyd follow-up, 2026-08-08): confirmed genuinely out of scope, not just deferred by default. Read the real SDK shapes for the three most plausible bounded candidates — types.ActionGroupExecutor, types.APISchema, types.FunctionSchema (types/types.go) — and all three are Smithy tagged unions (Go interface + one struct per member, e.g. ActionGroupExecutor is ActionGroupExecutorMemberLambda XOR ActionGroupExecutorMemberCustomControl) requiring XOR-presence validation, per-member wire-key discovery from serializers.go, and (for FunctionSchema) validating a nested []Function list with its own required/optional sub-fields. There are ten such blob families across this service, not one; validating a single one (even the simplest, ActionGroupExecutor) while leaving the other nine opaque would produce an inconsistent, arbitrarily-partial validation surface with no corresponding bug report or wire-shape failure driving the choice — unlike every other fix in this file, which closed a concrete, demonstrated gap. No functional gap is caused by the current opaque pass-through (requests round-trip correctly; this is a permissive-emulator design choice already used consistently across the service). Left unchanged."
  • "IngestionJobStatistics' NumberOfDocumentsDeleted/NumberOfDocumentsFailed/ NumberOfModifiedDocumentsIndexed/NumberOfMetadataDocumentsScanned/ NumberOfMetadataDocumentsModified stay zero always (fixed this sweep: NumberOfDocumentsScanned/NumberOfNewDocumentsIndexed now reflect the real per-data-source document count). Reporting non-zero on the other five would require tracking a prior-job document snapshot to diff against, which this backend does not do — reporting a number there would be fabricated, not read from real state, so left at zero rather than invented. Also unmodeled: data sources backed by a real crawler type (S3/web/Confluence/etc.) have no actual external content for this emulator to scan, so their statistics are always zero regardless of the dataSourceConfiguration blob — only documents pushed via the separate IngestKnowledgeBaseDocuments custom-content API are counted. Re-confirmed accurate and unchanged this sweep (gopherstack-rvyd, 2026-08-07) — still no prior-job snapshot mechanism to diff against, so still correctly zero rather than fabricated. RE-VERIFIED (gopherstack-rvyd follow-up, 2026-08-08), reading IngestKnowledgeBaseDocuments/KBDocumentDetail directly rather than trusting the prior note: it is not merely that no prior-job snapshot is tracked -- the raw material for these counters is not retained at all. KBDocumentDetail (models.go) stores only DocumentID/KnowledgeBaseID/DataSourceID/Status; IngestKnowledgeBaseDocuments receives each KBDocument's Content and Metadata (models.go: KBDocument has both) and discards both on every call, so there is no stored content/hash to diff for NumberOfModifiedDocumentsIndexed and no stored metadata at all for NumberOfMetadataDocumentsScanned/NumberOfMetadataDocumentsModified -- these two would be fabricated even with a diffing mechanism, since there is nothing to scan. NumberOfDocumentsDeleted/NumberOfDocumentsFailed are the only two of the five that a bounded, non-fabricated fix could theoretically reach (by snapshotting the live document-ID set into each IngestionJob and diffing on the next run), but doing so for 2 of 5 fields while the other 3 stay permanently unreachable was judged not worth the asymmetry it would introduce into a single response object one sweep after the counters were added; the honest zero for all five remains the correct behavior until (if ever) content/metadata retention is added as a real feature. Left unchanged."

More

Documentation

Overview

Package bedrockagent provides a local stub for the Amazon Bedrock Agent service.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested resource does not exist.
	ErrNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource with the given name already exists.
	ErrAlreadyExists = awserr.New("ConflictException", awserr.ErrAlreadyExists)
	// ErrValidation is returned for invalid request parameters.
	ErrValidation = awserr.New("ValidationException", awserr.ErrInvalidParameter)
	// ErrResourceInUse is returned when deletion is blocked because a
	// dependent resource (e.g. an alias) still references the target, and
	// the caller did not pass skipResourceInUseCheck=true.
	ErrResourceInUse = awserr.New("ConflictException", awserr.ErrConflict)
)
View Source
var ErrNilAppContext = errors.New("bedrockagent: AppContext must not be nil")

ErrNilAppContext is returned when a nil AppContext is passed to Provider.Init.

Functions

This section is empty.

Types

type ActionGroupConfig

type ActionGroupConfig struct {
	ActionGroupExecutor              map[string]any
	APISchema                        map[string]any
	FunctionSchema                   map[string]any
	ParentActionGroupSignatureParams map[string]string
	ClientToken                      string
	ParentActionGroupSignature       string
	ActionGroupName                  string
	Description                      string
	ActionGroupState                 string
}

ActionGroupConfig holds fields for creating or updating an AgentActionGroup.

type ActionGroupSummary

type ActionGroupSummary struct {
	UpdatedAt        time.Time `json:"updatedAt"`
	ActionGroupID    string    `json:"actionGroupId"`
	ActionGroupName  string    `json:"actionGroupName"`
	ActionGroupState string    `json:"actionGroupState"`
	Description      string    `json:"description,omitempty"`
}

ActionGroupSummary is used in list responses.

UpdatedAt is real types.ActionGroupSummary's required "updatedAt" (deserializers.go) -- previously not a field on this struct at all (gopherstack-r80d batch 7).

type Agent

type Agent struct {
	CreatedAt                   time.Time      `json:"createdAt"`
	UpdatedAt                   time.Time      `json:"updatedAt"`
	PreparedAt                  *time.Time     `json:"preparedAt,omitempty"`
	Guardrail                   map[string]any `json:"guardrailConfiguration,omitempty"`
	Memory                      map[string]any `json:"memoryConfiguration,omitempty"`
	PromptOverrideConfiguration map[string]any `json:"promptOverrideConfiguration"`
	CustomOrchestration         map[string]any `json:"customOrchestration,omitempty"`
	AgentID                     string         `json:"agentId"`
	AgentARN                    string         `json:"agentArn"`
	AgentName                   string         `json:"agentName"`
	AgentVersion                string         `json:"agentVersion"`
	AgentStatus                 string         `json:"agentStatus"`
	Collaboration               string         `json:"agentCollaboration"`
	ClientToken                 string         `json:"clientToken,omitempty"`
	CustomerEncryptionKeyArn    string         `json:"customerEncryptionKeyArn,omitempty"`
	Description                 string         `json:"description,omitempty"`
	FoundationModel             string         `json:"foundationModel,omitempty"`
	Instruction                 string         `json:"instruction,omitempty"`
	// RoleARN is real types.Agent's required "agentResourceRoleArn"
	// (deserializers.go) despite CreateAgentInput.AgentResourceRoleArn being
	// optional -- previously tagged omitempty, so an agent created without a
	// role dropped the key entirely instead of emitting an empty string, a
	// required field a real client decodes as missing (gopherstack-r80d
	// batch 7).
	RoleARN                 string `json:"agentResourceRoleArn"`
	OrchestrationType       string `json:"orchestrationType"`
	IdleSessionTTLInSeconds int    `json:"idleSessionTTLInSeconds"`
}

Agent represents a Bedrock Agent.

Tags are deliberately NOT a field here: the real aws-sdk-go-v2 types.Agent (returned by CreateAgent/GetAgent/UpdateAgent) has no "tags" member -- tags are write-only on CreateAgentInput and only ever read back via ListTagsForResource. gopherstack used to echo an invented "tags" key in these responses; that struct field is gone, and CreateAgent seeds b.tags[AgentARN] directly instead (see agents.go).

type AgentActionGroup

type AgentActionGroup struct {
	CreatedAt                        time.Time         `json:"createdAt"`
	UpdatedAt                        time.Time         `json:"updatedAt"`
	ActionGroupExecutor              map[string]any    `json:"actionGroupExecutor,omitempty"`
	APISchema                        map[string]any    `json:"apiSchema,omitempty"`
	FunctionSchema                   map[string]any    `json:"functionSchema,omitempty"`
	ParentActionGroupSignatureParams map[string]string `json:"parentActionGroupSignatureParams,omitempty"`
	ClientToken                      string            `json:"clientToken,omitempty"`
	ParentActionSignature            string            `json:"parentActionSignature,omitempty"`
	ActionGroupID                    string            `json:"actionGroupId"`
	ActionGroupName                  string            `json:"actionGroupName"`
	AgentID                          string            `json:"agentId"`
	AgentVersion                     string            `json:"agentVersion"`
	ActionGroupState                 string            `json:"actionGroupState"`
	Description                      string            `json:"description,omitempty"`
}

AgentActionGroup is an action group attached to an agent version.

type AgentAlias

type AgentAlias struct {
	CreatedAt            time.Time      `json:"createdAt"`
	UpdatedAt            time.Time      `json:"updatedAt"`
	AgentAliasID         string         `json:"agentAliasId"`
	AgentAliasARN        string         `json:"agentAliasArn"`
	AgentAliasName       string         `json:"agentAliasName"`
	AgentAliasStatus     string         `json:"agentAliasStatus"`
	AgentID              string         `json:"agentId"`
	Description          string         `json:"description,omitempty"`
	ClientToken          string         `json:"clientToken,omitempty"`
	AliasInvocationState string         `json:"aliasInvocationState,omitempty"`
	RoutingConfiguration []AliasRouting `json:"routingConfiguration"`
}

AgentAlias routes traffic to a specific agent version. Tags are deliberately NOT a field here -- the real types.AgentAlias has no "tags" member; CreateAgentAlias seeds b.tags[AgentAliasARN] directly instead.

type AgentAliasSummary

type AgentAliasSummary struct {
	CreatedAt            time.Time      `json:"createdAt"`
	UpdatedAt            time.Time      `json:"updatedAt"`
	AgentAliasID         string         `json:"agentAliasId"`
	AgentAliasName       string         `json:"agentAliasName"`
	AgentAliasStatus     string         `json:"agentAliasStatus"`
	Description          string         `json:"description,omitempty"`
	AliasInvocationState string         `json:"aliasInvocationState,omitempty"`
	RoutingConfiguration []AliasRouting `json:"routingConfiguration"`
}

AgentAliasSummary is used in list responses.

CreatedAt and UpdatedAt are real types.AgentAliasSummary's required "createdAt"/"updatedAt" (deserializers.go) -- previously not fields on this struct at all (gopherstack-r80d batch 7).

RoutingConfiguration is real types.AgentAliasSummary's required "routingConfiguration" (deserializers.go) -- previously dropped entirely from the list item despite the singular AgentAlias carrying it.

type AgentCollaborator

type AgentCollaborator struct {
	CreatedAt                time.Time      `json:"createdAt"`
	UpdatedAt                time.Time      `json:"lastUpdatedAt"`
	AgentDescriptor          map[string]any `json:"agentDescriptor,omitempty"`
	AgentID                  string         `json:"agentId"`
	AgentVersion             string         `json:"agentVersion"`
	CollaboratorID           string         `json:"collaboratorId"`
	CollaboratorName         string         `json:"collaboratorName"`
	CollaborationInstruction string         `json:"collaborationInstruction,omitempty"`
	RelayConversationHistory string         `json:"relayConversationHistory,omitempty"`
	CollaboratorStatus       string         `json:"collaboratorStatus"`
	ClientToken              string         `json:"clientToken,omitempty"`
}

AgentCollaborator links two agents for multi-agent collaboration.

UpdatedAt is real types.AgentCollaborator/AgentCollaboratorSummary's required "lastUpdatedAt" (deserializers.go) -- this struct previously tagged it "updatedAt", a key no real deserializer for this shape reads, so a real client's LastUpdatedAt decoded nil on every op in this family (Associate/Get/Update/ListAgentCollaborators all share this struct) (gopherstack-r80d batch 7).

type AgentConfig

type AgentConfig struct {
	Tags                        map[string]string
	Guardrail                   map[string]any
	Memory                      map[string]any
	CustomOrchestration         map[string]any
	PromptOverrideConfiguration map[string]any
	ClientToken                 string
	CustomerEncryptionKeyArn    string
	AgentName                   string
	Collaboration               string
	Description                 string
	FoundationModel             string
	Instruction                 string
	RoleARN                     string
	OrchestrationType           string
	IdleSessionTTLInSeconds     int
}

AgentConfig holds fields for creating or updating an Agent.

type AgentKnowledgeBase

type AgentKnowledgeBase struct {
	CreatedAt       time.Time `json:"createdAt"`
	UpdatedAt       time.Time `json:"updatedAt"`
	AgentID         string    `json:"agentId"`
	AgentVersion    string    `json:"agentVersion"`
	KnowledgeBaseID string    `json:"knowledgeBaseId"`
	KBState         string    `json:"knowledgeBaseState"`
	Description     string    `json:"description,omitempty"`
}

AgentKnowledgeBase is the association between an agent and a knowledge base.

type AgentKnowledgeBaseSummary added in v1.3.1

type AgentKnowledgeBaseSummary struct {
	UpdatedAt       time.Time `json:"updatedAt"`
	KnowledgeBaseID string    `json:"knowledgeBaseId"`
	KBState         string    `json:"knowledgeBaseState"`
	Description     string    `json:"description,omitempty"`
}

AgentKnowledgeBaseSummary is used in list responses. Real types.AgentKnowledgeBaseSummary (bedrockagent@v1.58.4, types/types.go) has no AgentId/AgentVersion/CreatedAt members -- those are Get-only.

type AgentSummary

type AgentSummary struct {
	UpdatedAt              time.Time      `json:"updatedAt"`
	GuardrailConfiguration map[string]any `json:"guardrailConfiguration,omitempty"`
	AgentID                string         `json:"agentId"`
	AgentName              string         `json:"agentName"`
	AgentStatus            string         `json:"agentStatus"`
	Description            string         `json:"description,omitempty"`
	LatestAgentVersion     string         `json:"latestAgentVersion,omitempty"`
}

AgentSummary is the condensed agent representation used in list responses.

GuardrailConfiguration and LatestAgentVersion were previously absent -- types.AgentSummary carries both (deserializers.go), but LatestAgentVersion has no counterpart on the singular types.Agent (GetAgent's "agentVersion" is the version being described, e.g. DRAFT, not the highest numbered version), so it cannot be derived from the Agent struct's own fields.

type AgentVersion

type AgentVersion struct {
	CreatedAt                   time.Time      `json:"createdAt"`
	UpdatedAt                   time.Time      `json:"updatedAt"`
	Guardrail                   map[string]any `json:"guardrailConfiguration,omitempty"`
	Memory                      map[string]any `json:"memoryConfiguration,omitempty"`
	PromptOverrideConfiguration map[string]any `json:"promptOverrideConfiguration"`
	AgentID                     string         `json:"agentId"`
	AgentARN                    string         `json:"agentArn"`
	AgentName                   string         `json:"agentName"`
	AgentStatus                 string         `json:"agentStatus"`
	AgentVersion                string         `json:"agentVersion"`
	Collaboration               string         `json:"agentCollaboration"`
	CustomerEncryptionKeyArn    string         `json:"customerEncryptionKeyArn,omitempty"`
	Description                 string         `json:"description,omitempty"`
	FoundationModel             string         `json:"foundationModel,omitempty"`
	Instruction                 string         `json:"instruction,omitempty"`
	RoleARN                     string         `json:"agentResourceRoleArn"`
	IdleSessionTTLInSeconds     int            `json:"idleSessionTTLInSeconds"`
}

AgentVersion holds a snapshot version of an agent.

IdleSessionTTLInSeconds is real types.AgentVersion's required "idleSessionTTLInSeconds" (deserializers.go) -- previously not a field on this struct at all, the "member with no struct field" class. RoleARN is real types.AgentVersion's required "agentResourceRoleArn" despite CreateAgentInput.AgentResourceRoleArn being optional -- previously tagged omitempty, same class as Agent's own fix above (gopherstack-r80d batch 7).

Collaboration, Guardrail, Memory and PromptOverrideConfiguration are real types.AgentVersion's "agentCollaboration"/"guardrailConfiguration"/ "memoryConfiguration"/"promptOverrideConfiguration" (deserializers.go) -- previously absent, so a numbered version never carried forward the parent agent's config it was snapshotted from (newAgentVersionLocked).

type AgentVersionSummary

type AgentVersionSummary struct {
	CreatedAt              time.Time      `json:"createdAt"`
	UpdatedAt              time.Time      `json:"updatedAt"`
	GuardrailConfiguration map[string]any `json:"guardrailConfiguration,omitempty"`
	AgentName              string         `json:"agentName"`
	AgentStatus            string         `json:"agentStatus"`
	AgentVersion           string         `json:"agentVersion"`
	Description            string         `json:"description,omitempty"`
}

AgentVersionSummary is used in list-agent-versions responses.

CreatedAt is real types.AgentVersionSummary's required "createdAt" (deserializers.go) -- previously not a field on this struct at all (gopherstack-r80d batch 7).

type AliasConfig

type AliasConfig struct {
	Tags                 map[string]string
	ClientToken          string
	AliasInvocationState string
	AliasName            string
	Description          string
	RoutingConfiguration []AliasRouting
}

AliasConfig holds fields for creating or updating an AgentAlias.

type AliasRouting

type AliasRouting struct {
	AgentVersion string `json:"agentVersion"`
}

AliasRouting maps an alias to an agent version.

type CollaboratorConfig

type CollaboratorConfig struct {
	AgentDescriptor          map[string]any
	ClientToken              string
	CollaboratorName         string
	CollaborationInstruction string
	RelayConversationHistory string
}

CollaboratorConfig holds fields for an AgentCollaborator.

type DataSource

type DataSource struct {
	CreatedAt               time.Time      `json:"createdAt"`
	UpdatedAt               time.Time      `json:"updatedAt"`
	DataSourceConfiguration map[string]any `json:"dataSourceConfiguration,omitempty"`
	VectorIngestionConfig   map[string]any `json:"vectorIngestionConfiguration,omitempty"`
	ServerSideEncryption    map[string]any `json:"serverSideEncryptionConfiguration,omitempty"`
	ClientToken             string         `json:"-"`
	DataSourceID            string         `json:"dataSourceId"`
	KnowledgeBaseID         string         `json:"knowledgeBaseId"`
	Name                    string         `json:"name"`
	// DataSourceStatus's wire key is "status", not "dataSourceStatus" --
	// confirmed against awsRestjson1_deserializeDocumentDataSource
	// (deserializers.go); the Go field name is DataSourceStatus, but the
	// case switch it reads only matches "status".
	DataSourceStatus   string `json:"status"`
	Description        string `json:"description,omitempty"`
	DataDeletionPolicy string `json:"dataDeletionPolicy,omitempty"`
}

DataSource is a knowledge base data source.

func (*DataSource) UnmarshalJSON

func (d *DataSource) UnmarshalJSON(data []byte) error

UnmarshalJSON reads the legacy "dataSourceStatus" key (the wire tag before gopherstack-21my's retag to the real "status") when "status" is absent, so a persisted Version-3 snapshot's DataSource rows keep their Status on restore instead of silently decoding empty.

type DataSourceConfig

type DataSourceConfig struct {
	DataSourceConfiguration           map[string]any
	VectorIngestionConfig             map[string]any
	ServerSideEncryptionConfiguration map[string]any
	ClientToken                       string
	Name                              string
	Description                       string
	DataDeletionPolicy                string
}

DataSourceConfig holds fields for creating or updating a DataSource.

type DataSourceSummary

type DataSourceSummary struct {
	UpdatedAt       time.Time `json:"updatedAt"`
	DataSourceID    string    `json:"dataSourceId"`
	KnowledgeBaseID string    `json:"knowledgeBaseId"`
	Name            string    `json:"name"`
	// same "status" wire key as DataSource, see its comment above.
	DataSourceStatus string `json:"status"`
	Description      string `json:"description,omitempty"`
}

DataSourceSummary is used in list responses.

type Flow

type Flow struct {
	CreatedAt   time.Time      `json:"createdAt"`
	UpdatedAt   time.Time      `json:"updatedAt"`
	Definition  map[string]any `json:"definition,omitempty"`
	FlowID      string         `json:"id"`
	FlowARN     string         `json:"arn"`
	Name        string         `json:"name"`
	Status      string         `json:"status"`
	Description string         `json:"description,omitempty"`
	RoleARN     string         `json:"executionRoleArn,omitempty"`
	Version     string         `json:"version"`
	KMSKeyARN   string         `json:"customerEncryptionKeyArn,omitempty"`
	ClientToken string         `json:"-"`
}

Flow is a Bedrock prompt flow. Tags are deliberately NOT a field here -- the real GetFlowOutput/CreateFlowOutput has no "tags" member; CreateFlow seeds b.tags[FlowARN] directly instead.

type FlowAlias

type FlowAlias struct {
	CreatedAt            time.Time          `json:"createdAt"`
	UpdatedAt            time.Time          `json:"updatedAt"`
	Concurrency          map[string]any     `json:"concurrencyConfiguration,omitempty"`
	AliasID              string             `json:"id"`
	AliasARN             string             `json:"arn"`
	FlowID               string             `json:"flowId"`
	Name                 string             `json:"name"`
	Description          string             `json:"description,omitempty"`
	ClientToken          string             `json:"-"`
	RoutingConfiguration []FlowAliasRouting `json:"routingConfiguration,omitempty"`
}

FlowAlias routes traffic to a specific flow version. Tags are deliberately NOT a field here -- the real CreateFlowAliasOutput has no "tags" member; CreateFlowAlias seeds b.tags[AliasARN] directly instead.

type FlowAliasConfig

type FlowAliasConfig struct {
	Tags                     map[string]string
	ConcurrencyConfiguration map[string]any
	ClientToken              string
	Name                     string
	Description              string
	RoutingConfiguration     []FlowAliasRouting
}

FlowAliasConfig holds fields for creating or updating a FlowAlias.

type FlowAliasRouting

type FlowAliasRouting struct {
	FlowVersion string `json:"flowVersion"`
}

FlowAliasRouting maps a flow alias to a specific flow version.

type FlowAliasSummary

type FlowAliasSummary struct {
	CreatedAt            time.Time          `json:"createdAt"`
	UpdatedAt            time.Time          `json:"updatedAt"`
	AliasID              string             `json:"id"`
	AliasARN             string             `json:"arn"`
	FlowID               string             `json:"flowId"`
	Name                 string             `json:"name"`
	Description          string             `json:"description,omitempty"`
	RoutingConfiguration []FlowAliasRouting `json:"routingConfiguration"`
}

FlowAliasSummary is used in list responses.

RoutingConfiguration is real types.FlowAliasSummary's required "routingConfiguration" (deserializers.go) -- previously dropped entirely from the list item despite the singular FlowAlias carrying it.

type FlowConfig

type FlowConfig struct {
	Tags                     map[string]string
	Definition               map[string]any
	ClientToken              string
	CustomerEncryptionKeyArn string
	Name                     string
	Description              string
	RoleARN                  string
}

FlowConfig holds fields for creating or updating a Flow.

type FlowSummary

type FlowSummary struct {
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
	FlowID      string    `json:"id"`
	FlowARN     string    `json:"arn"`
	Name        string    `json:"name"`
	Status      string    `json:"status"`
	Description string    `json:"description,omitempty"`
	Version     string    `json:"version"`
}

FlowSummary is used in list responses.

Arn and CreatedAt are real types.FlowSummary required members (deserializers.go, awsRestjson1_deserializeDocumentFlowSummary) -- previously not fields on this struct at all, the "member with no struct field" class (gopherstack-r80d batch 7).

type FlowValidationError

type FlowValidationError struct {
	Details  map[string]any `json:"details,omitempty"`
	Message  string         `json:"message"`
	Severity string         `json:"severity"`
	Type     string         `json:"type,omitempty"`
}

FlowValidationError is a flow definition validation error.

type FlowVersion

type FlowVersion struct {
	CreatedAt   time.Time      `json:"createdAt"`
	Definition  map[string]any `json:"definition,omitempty"`
	FlowARN     string         `json:"arn"`
	FlowID      string         `json:"id"`
	Name        string         `json:"name"`
	Status      string         `json:"status"`
	Version     string         `json:"version"`
	Description string         `json:"description,omitempty"`
	RoleARN     string         `json:"executionRoleArn"`
	KMSKeyARN   string         `json:"customerEncryptionKeyArn,omitempty"`
	ClientToken string         `json:"-"`
}

FlowVersion is a snapshot of a flow.

RoleARN is real Create/GetFlowVersionOutput's required "executionRoleArn" (api_op_CreateFlowVersion.go/api_op_GetFlowVersion.go) -- previously not a field on this struct at all, the "member with no struct field" class (gopherstack-r80d batch 7). Populated by snapshotting the parent Flow's already-stored RoleARN at version-creation time, not fabricated.

type FlowVersionSummary

type FlowVersionSummary struct {
	CreatedAt time.Time `json:"createdAt"`
	Arn       string    `json:"arn"`
	FlowID    string    `json:"id"`
	Status    string    `json:"status"`
	Version   string    `json:"version"`
}

FlowVersionSummary is used in list responses. Real types.FlowVersionSummary (bedrockagent@v1.58.4, types/types.go) has no Name/Description members -- those are Get-only, carried on FlowVersion instead.

type Handler

type Handler struct {
	Backend StorageBackend

	AccountID     string
	DefaultRegion string
	// contains filtered or unexported fields
}

Handler is the HTTP handler for the Bedrock Agent REST API.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Bedrock Agent handler.

func (*Handler) BackendFor

func (h *Handler) BackendFor(region string) StorageBackend

BackendFor returns the backend serving region: the home backend, or the sibling built on first use.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns the supported regions.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the chaos service name.

func (*Handler) EnableRegions

func (h *Handler) EnableRegions()

EnableRegions makes h serve every other region through lazily built per-region siblings.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation determines the operation name from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts an agent or flow ID from the request path.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) RegionBackends

func (h *Handler) RegionBackends() []StorageBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) RegionHandler

func (h *Handler) RegionHandler(region string) *Handler

RegionHandler returns the handler serving region: h itself for the home region, else its sibling.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears handler state (delegates to backend).

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function matching Bedrock Agent requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable; other regions ride in an additive "regions" key.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend implements StorageBackend with in-memory maps, isolated by region.

Phase 3.3 datalayer conversion: every map[string]*T resource collection is a *store.Table[T] registered on b.registry, with a *store.Index[T] added where a parent-scoped List/bulk-delete previously did a linear key-prefix scan (see store_setup.go's registerAllTables). Resources with a real, globally-unique identity field (agents, knowledgeBases, flows, prompts) are registered directly by that ID; resources whose ID is only unique within a parent (agent/flow/knowledge-base versions, action groups, aliases, collaborators, associations, data sources, ingestion jobs, KB documents) keep the same "parent/child[/grandchild]" composite key the original map already used, matching the composite-key rule in .claude/memories/parity-principles.md.

agentsByName, kbsByName, flowsByName, and promptsByName are left as plain map[string]string reverse-lookup caches (name -> ID): their values are bare strings, not *T, so there is nothing for store.Table to key on. agentVersionCtrs, flowVersionCtrs, and promptVersionCtrs (map[string]int) are likewise left raw for the same reason. tags (map[string]map[string]string) is the one remaining grouping map with a non-*T value.

func NewInMemoryBackend

func NewInMemoryBackend(region, accountID string) *InMemoryBackend

NewInMemoryBackend creates and initialises an InMemoryBackend.

func (*InMemoryBackend) AssociateAgentCollaborator

func (b *InMemoryBackend) AssociateAgentCollaborator(
	_ context.Context, agentID, agentVersion string, cfg CollaboratorConfig,
) (*AgentCollaborator, error)

AssociateAgentCollaborator creates a collaborator association.

Real AWS constrains the {agentVersion} URI path parameter to the literal "DRAFT" (fixed length 5, pattern `DRAFT`, per the AssociateAgentCollaborator API reference) -- same constraint as CreateAgentActionGroup.

func (*InMemoryBackend) AssociateAgentKnowledgeBase

func (b *InMemoryBackend) AssociateAgentKnowledgeBase(
	_ context.Context, agentID, agentVersion, kbID, description, kbState string,
) (*AgentKnowledgeBase, error)

AssociateAgentKnowledgeBase creates an agent–KB association.

Real AWS constrains the {agentVersion} URI path parameter to the literal "DRAFT" (fixed length 5, pattern `DRAFT`, per the AssociateAgentKnowledgeBase API reference) -- same constraint as CreateAgentActionGroup.

func (*InMemoryBackend) CreateAgent

func (b *InMemoryBackend) CreateAgent(ctx context.Context, cfg AgentConfig) (*Agent, error)

CreateAgent creates a new agent.

func (*InMemoryBackend) CreateAgentActionGroup

func (b *InMemoryBackend) CreateAgentActionGroup(
	_ context.Context, agentID, agentVersion string, cfg ActionGroupConfig,
) (*AgentActionGroup, error)

CreateAgentActionGroup creates an action group for an agent version.

Real AWS constrains the {agentVersion} URI path parameter to the literal "DRAFT" (fixed length 5, pattern `DRAFT`, per the CreateAgentActionGroup API reference) -- action groups can only ever be created against the mutable DRAFT version; numbered versions are immutable snapshots. A request path with any other value fails validation.

func (*InMemoryBackend) CreateAgentAlias

func (b *InMemoryBackend) CreateAgentAlias(
	ctx context.Context, agentID string, cfg AliasConfig,
) (*AgentAlias, error)

CreateAgentAlias creates an alias for an agent.

func (*InMemoryBackend) CreateAgentVersion

func (b *InMemoryBackend) CreateAgentVersion(
	_ context.Context, agentID, description string,
) (*AgentVersion, error)

CreateAgentVersion creates a numbered snapshot of an agent.

Note: real Bedrock Agents has no CreateAgentVersion wire operation -- numbered agent versions are created as a side effect of CreateAgentAlias when called with no routingConfiguration (see the doAgentAlias helper in CreateAgentAlias below, which calls newAgentVersionLocked directly while already holding b.mu). This method stays exported on InMemoryBackend/ StorageBackend for internal/programmatic use (e.g. tests seeding a version directly) but is deliberately not reachable from any HTTP route.

func (*InMemoryBackend) CreateDataSource

func (b *InMemoryBackend) CreateDataSource(
	_ context.Context, kbID string, cfg DataSourceConfig,
) (*DataSource, error)

CreateDataSource creates a data source in a knowledge base.

func (*InMemoryBackend) CreateFlow

func (b *InMemoryBackend) CreateFlow(ctx context.Context, cfg FlowConfig) (*Flow, error)

CreateFlow creates a new flow.

func (*InMemoryBackend) CreateFlowAlias

func (b *InMemoryBackend) CreateFlowAlias(
	ctx context.Context, flowID string, cfg FlowAliasConfig,
) (*FlowAlias, error)

CreateFlowAlias creates a flow alias.

func (*InMemoryBackend) CreateFlowVersion

func (b *InMemoryBackend) CreateFlowVersion(
	_ context.Context, flowID string, cfg VersionConfig,
) (*FlowVersion, error)

CreateFlowVersion creates a numbered snapshot of a flow.

func (*InMemoryBackend) CreateKnowledgeBase

func (b *InMemoryBackend) CreateKnowledgeBase(
	ctx context.Context, cfg KnowledgeBaseConfig,
) (*KnowledgeBase, error)

CreateKnowledgeBase creates a new knowledge base.

func (*InMemoryBackend) CreatePrompt

func (b *InMemoryBackend) CreatePrompt(ctx context.Context, cfg PromptConfig) (*Prompt, error)

CreatePrompt creates a new prompt.

func (*InMemoryBackend) CreatePromptVersion

func (b *InMemoryBackend) CreatePromptVersion(
	_ context.Context, promptID string, cfg VersionConfig,
) (*PromptVersion, error)

CreatePromptVersion creates a versioned snapshot of a prompt.

func (*InMemoryBackend) DeleteAgent

func (b *InMemoryBackend) DeleteAgent(_ context.Context, agentID string, skipResourceInUseCheck bool) error

DeleteAgent deletes an agent.

Note: this only removes the agent itself, its name-lookup entry, its versions (agentVersions), its version counter, every action group / agent collaborator / KB association scoped under any of those versions (including DRAFT), every alias, and the agent's own tags entry.

This used to leave every one of those behind as ghost rows (documented historically as a "preserved as-is" no-op cleanup bug from the pre-Phase-3.3 map-based backend) -- fixed here: actionGroups, agentCollaborators, and agentKBAssocs are indexed by the composite "agentID/agentVersion" scope, so cascading them requires walking DRAFT plus every numbered AgentVersion row and clearing each scope; agentAliases carries a plain byAgent index so no version walk is needed there.

Real AWS (api_op_DeleteAgent.go): "By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use." An agent is "in use" when it has any alias at all -- an alias always routes to a numbered snapshot of this agent (CreateAgentAlias), so any alias existing means a caller-visible reference into this agent would otherwise be cascade-deleted out from under them. Same wire-visible-relationship reasoning as DeleteAgentVersion's per-version alias check.

func (*InMemoryBackend) DeleteAgentActionGroup

func (b *InMemoryBackend) DeleteAgentActionGroup(
	_ context.Context, agentID, agentVersion, actionGroupID string,
) error

DeleteAgentActionGroup deletes an action group.

Real AWS constrains {agentVersion} to the literal "DRAFT" here too (API reference: Pattern `DRAFT`, fixed length 5) -- numbered versions are immutable snapshots, so this must reject them same as Create.

func (*InMemoryBackend) DeleteAgentAlias

func (b *InMemoryBackend) DeleteAgentAlias(_ context.Context, agentID, aliasID string) error

DeleteAgentAlias deletes an agent alias and its tags map entry.

func (*InMemoryBackend) DeleteAgentVersion

func (b *InMemoryBackend) DeleteAgentVersion(
	_ context.Context, agentID, agentVersion string, skipResourceInUseCheck bool,
) error

DeleteAgentVersion deletes an agent version. See the not-found precedence note on GetAgentVersion.

Real AWS (api_op_DeleteAgentVersion.go): "By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use." An agent version is "in use" when an alias's routingConfiguration still points at it (types.AgentAliasRoutingConfigurationListItem.AgentVersion) -- that reference is the only wire-visible relationship a version participates in, so it is the only one this check can honor without inventing AWS behavior the SDK doesn't state.

func (*InMemoryBackend) DeleteDataSource

func (b *InMemoryBackend) DeleteDataSource(_ context.Context, kbID, dsID string) error

DeleteDataSource deletes a data source, cascade-cleaning every ingestion job and ingested KB document scoped under it.

func (*InMemoryBackend) DeleteFlow

func (b *InMemoryBackend) DeleteFlow(_ context.Context, flowID string, skipResourceInUseCheck bool) error

DeleteFlow deletes a flow.

Real AWS (api_op_DeleteFlow.go): "By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use." A flow is "in use" when it has any alias at all -- mirrors DeleteAgent's equivalent check, and DeleteFlowVersion's per-version alias check below.

func (*InMemoryBackend) DeleteFlowAlias

func (b *InMemoryBackend) DeleteFlowAlias(_ context.Context, flowID, aliasID string) error

DeleteFlowAlias deletes a flow alias.

func (*InMemoryBackend) DeleteFlowVersion

func (b *InMemoryBackend) DeleteFlowVersion(
	_ context.Context, flowID, flowVersion string, skipResourceInUseCheck bool,
) error

DeleteFlowVersion deletes a flow version.

Real AWS (api_op_DeleteFlowVersion.go): "By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use." A flow version is "in use" when a flow alias's routingConfiguration still points at it (types.FlowAliasRoutingConfigurationListItem.FlowVersion) -- the only wire-visible relationship a flow version participates in.

func (*InMemoryBackend) DeleteKnowledgeBase

func (b *InMemoryBackend) DeleteKnowledgeBase(_ context.Context, kbID string) error

DeleteKnowledgeBase deletes a knowledge base and cascade-cleans every resource scoped under it: data sources, and (per data source) ingestion jobs and ingested KB documents, plus the KB's own tags and its resource policy (bedrock-agent's PutResourcePolicy/GetResourcePolicy/ DeleteResourcePolicy attach only to knowledge bases -- see resource_policy.go). Without this, a deleted-and-recreated KB with the same auto-incremented ID space would never actually observe empty child collections, and the tags/resourcePolicies maps would keep a permanent ghost entry keyed by the now-invalid ARN.

func (*InMemoryBackend) DeleteKnowledgeBaseDocuments

func (b *InMemoryBackend) DeleteKnowledgeBaseDocuments(
	_ context.Context, kbID, dsID string, ids []KBDocumentIdentifier,
) ([]KBDocumentDetail, error)

DeleteKnowledgeBaseDocuments deletes documents from a knowledge base data source.

func (*InMemoryBackend) DeletePrompt

func (b *InMemoryBackend) DeletePrompt(_ context.Context, promptID string) error

DeletePrompt deletes a prompt.

func (*InMemoryBackend) DeletePromptVersion

func (b *InMemoryBackend) DeletePromptVersion(
	_ context.Context, promptID, version string,
) error

DeletePromptVersion deletes a prompt version.

func (*InMemoryBackend) DeleteResourcePolicy added in v1.2.0

func (b *InMemoryBackend) DeleteResourcePolicy(
	_ context.Context, resourceArn, expectedRevisionID string,
) (string, error)

DeleteResourcePolicy removes the resource policy attached to a knowledge base ARN, returning the revision ID the deleted policy had -- AWS's documented DeleteResourcePolicyOutput.revisionId is "the revision identifier after the resource policy was deleted", which this backend interprets as the last revision the (now-removed) policy carried, matching how PutResourcePolicy's response documents "[u]se this value in the expectedRevisionId field of a subsequent ... DeleteResourcePolicy request" -- i.e. revisionId is a handle on a specific policy revision, not a live counter that keeps advancing after the row is gone. See this file's package doc comment for expectedRevisionID semantics.

func (*InMemoryBackend) DisassociateAgentCollaborator

func (b *InMemoryBackend) DisassociateAgentCollaborator(
	_ context.Context, agentID, agentVersion, collaboratorID string,
) error

DisassociateAgentCollaborator removes a collaborator.

Real AWS constrains {agentVersion} to the literal "DRAFT" here too (API reference: Pattern `DRAFT`, fixed length 5) -- numbered versions are immutable snapshots, so this must reject them same as Associate.

func (*InMemoryBackend) DisassociateAgentKnowledgeBase

func (b *InMemoryBackend) DisassociateAgentKnowledgeBase(
	_ context.Context, agentID, agentVersion, kbID string,
) error

DisassociateAgentKnowledgeBase removes an agent–KB association.

Real AWS constrains {agentVersion} to the literal "DRAFT" here too (API reference: Pattern `DRAFT`, fixed length 5) -- numbered versions are immutable snapshots, so this must reject them same as Associate.

func (*InMemoryBackend) GetAgent

func (b *InMemoryBackend) GetAgent(_ context.Context, agentID string) (*Agent, error)

GetAgent returns an agent by ID.

func (*InMemoryBackend) GetAgentActionGroup

func (b *InMemoryBackend) GetAgentActionGroup(
	_ context.Context, agentID, agentVersion, actionGroupID string,
) (*AgentActionGroup, error)

GetAgentActionGroup returns an action group.

func (*InMemoryBackend) GetAgentAlias

func (b *InMemoryBackend) GetAgentAlias(_ context.Context, agentID, aliasID string) (*AgentAlias, error)

GetAgentAlias returns an agent alias.

func (*InMemoryBackend) GetAgentCollaborator

func (b *InMemoryBackend) GetAgentCollaborator(
	_ context.Context, agentID, agentVersion, collaboratorID string,
) (*AgentCollaborator, error)

GetAgentCollaborator returns a collaborator by ID.

func (*InMemoryBackend) GetAgentKnowledgeBase

func (b *InMemoryBackend) GetAgentKnowledgeBase(
	_ context.Context, agentID, agentVersion, kbID string,
) (*AgentKnowledgeBase, error)

GetAgentKnowledgeBase returns an agent–KB association.

func (*InMemoryBackend) GetAgentVersion

func (b *InMemoryBackend) GetAgentVersion(
	_ context.Context, agentID, agentVersion string,
) (*AgentVersion, error)

GetAgentVersion returns a specific agent version.

Not-found precedence note: the pre-Phase-3.3 map checked for the presence of the per-agent inner map (created lazily by the first CreateAgentVersion call and never removed except by DeleteAgent) to decide between "agent not found" and "agent version not found". That inner-map presence check is not reproducible with a flat store.Table + secondary Index (an Index prunes a group the moment its last member is deleted, see pkgs/store's Index.remove), so this checks b.agents.Has(agentID) instead -- identical result in every case except the one where every version of a still-existing agent has been deleted via DeleteAgentVersion, where the pre-conversion code returned "agent not found" (arguably itself a mislabeled error) and this returns "agent version not found".

func (*InMemoryBackend) GetDataSource

func (b *InMemoryBackend) GetDataSource(_ context.Context, kbID, dsID string) (*DataSource, error)

GetDataSource returns a data source.

func (*InMemoryBackend) GetFlow

func (b *InMemoryBackend) GetFlow(_ context.Context, flowID string) (*Flow, error)

GetFlow returns a flow.

func (*InMemoryBackend) GetFlowAlias

func (b *InMemoryBackend) GetFlowAlias(_ context.Context, flowID, aliasID string) (*FlowAlias, error)

GetFlowAlias returns a flow alias.

func (*InMemoryBackend) GetFlowVersion

func (b *InMemoryBackend) GetFlowVersion(
	_ context.Context, flowID, flowVersion string,
) (*FlowVersion, error)

GetFlowVersion returns a flow version. See the not-found precedence note on GetAgentVersion in the Agent version CRUD section above -- the same b.flows.Has(flowID)-instead-of-inner-map-presence reasoning applies here.

func (*InMemoryBackend) GetIngestionJob

func (b *InMemoryBackend) GetIngestionJob(
	_ context.Context, kbID, dsID, jobID string,
) (*IngestionJob, error)

GetIngestionJob returns an ingestion job.

func (*InMemoryBackend) GetKnowledgeBase

func (b *InMemoryBackend) GetKnowledgeBase(_ context.Context, kbID string) (*KnowledgeBase, error)

GetKnowledgeBase returns a knowledge base.

func (*InMemoryBackend) GetKnowledgeBaseDocuments

func (b *InMemoryBackend) GetKnowledgeBaseDocuments(
	_ context.Context, kbID, dsID string, ids []KBDocumentIdentifier,
) ([]KBDocumentDetail, error)

GetKnowledgeBaseDocuments retrieves document details.

func (*InMemoryBackend) GetPrompt

func (b *InMemoryBackend) GetPrompt(_ context.Context, promptID string) (*Prompt, error)

GetPrompt returns a prompt.

func (*InMemoryBackend) GetPromptVersion

func (b *InMemoryBackend) GetPromptVersion(
	_ context.Context, promptID, version string,
) (*PromptVersion, error)

GetPromptVersion returns a specific prompt version. See the not-found precedence note on GetAgentVersion in the Agent version CRUD section above -- the same b.prompts.Has(promptID)-instead-of-inner-map-presence reasoning applies here.

func (*InMemoryBackend) GetResourcePolicy added in v1.2.0

func (b *InMemoryBackend) GetResourcePolicy(_ context.Context, resourceArn string) (*ResourcePolicy, error)

GetResourcePolicy returns the resource policy attached to a knowledge base ARN.

func (*InMemoryBackend) IngestKnowledgeBaseDocuments

func (b *InMemoryBackend) IngestKnowledgeBaseDocuments(
	_ context.Context, kbID, dsID string, docs []KBDocument,
) ([]KBDocumentDetail, error)

IngestKnowledgeBaseDocuments ingests documents into a knowledge base data source.

func (*InMemoryBackend) ListAgentActionGroups

func (b *InMemoryBackend) ListAgentActionGroups(
	_ context.Context, agentID, agentVersion string, maxResults int, nextToken string,
) ([]*ActionGroupSummary, string, error)

ListAgentActionGroups returns all action groups for an agent version.

func (*InMemoryBackend) ListAgentAliases

func (b *InMemoryBackend) ListAgentAliases(
	_ context.Context, agentID string, maxResults int, nextToken string,
) ([]*AgentAliasSummary, string, error)

ListAgentAliases returns paginated alias summaries for an agent.

func (*InMemoryBackend) ListAgentCollaborators

func (b *InMemoryBackend) ListAgentCollaborators(
	_ context.Context, agentID, agentVersion string, maxResults int, nextToken string,
) ([]*AgentCollaborator, string, error)

ListAgentCollaborators returns paginated collaborators.

func (*InMemoryBackend) ListAgentKnowledgeBases

func (b *InMemoryBackend) ListAgentKnowledgeBases(
	_ context.Context, agentID, agentVersion string, maxResults int, nextToken string,
) ([]*AgentKnowledgeBaseSummary, string, error)

ListAgentKnowledgeBases returns paginated agent–KB associations.

func (*InMemoryBackend) ListAgentVersions

func (b *InMemoryBackend) ListAgentVersions(
	_ context.Context, agentID string, maxResults int, nextToken string,
) ([]*AgentVersionSummary, string, error)

ListAgentVersions returns paginated agent version summaries.

func (*InMemoryBackend) ListAgents

func (b *InMemoryBackend) ListAgents(
	_ context.Context, maxResults int, nextToken string,
) ([]*AgentSummary, string, error)

ListAgents returns a paginated list of agent summaries.

func (*InMemoryBackend) ListDataSources

func (b *InMemoryBackend) ListDataSources(
	_ context.Context, kbID string, maxResults int, nextToken string,
) ([]*DataSourceSummary, string, error)

ListDataSources returns paginated data source summaries.

func (*InMemoryBackend) ListFlowAliases

func (b *InMemoryBackend) ListFlowAliases(
	_ context.Context, flowID string, maxResults int, nextToken string,
) ([]*FlowAliasSummary, string, error)

ListFlowAliases returns paginated flow alias summaries.

func (*InMemoryBackend) ListFlowVersions

func (b *InMemoryBackend) ListFlowVersions(
	_ context.Context, flowID string, maxResults int, nextToken string,
) ([]*FlowVersionSummary, string, error)

ListFlowVersions returns paginated flow version summaries.

func (*InMemoryBackend) ListFlows

func (b *InMemoryBackend) ListFlows(
	_ context.Context, maxResults int, nextToken string,
) ([]*FlowSummary, string, error)

ListFlows returns paginated flow summaries.

func (*InMemoryBackend) ListIngestionJobs

func (b *InMemoryBackend) ListIngestionJobs(
	_ context.Context, kbID, dsID string, filters []IngestionJobFilter, sortBy *IngestionJobSortBy,
	maxResults int, nextToken string,
) ([]*IngestionJob, string, error)

ListIngestionJobs returns paginated ingestion job summaries, filtered by filters and sorted by sortBy.

func (*InMemoryBackend) ListKnowledgeBaseDocuments

func (b *InMemoryBackend) ListKnowledgeBaseDocuments(
	_ context.Context, kbID, dsID string, maxResults int, nextToken string,
) ([]KBDocumentDetail, string, error)

ListKnowledgeBaseDocuments returns paginated document details.

func (*InMemoryBackend) ListKnowledgeBases

func (b *InMemoryBackend) ListKnowledgeBases(
	_ context.Context, maxResults int, nextToken string,
) ([]*KnowledgeBaseSummary, string, error)

ListKnowledgeBases returns paginated knowledge base summaries.

func (*InMemoryBackend) ListPrompts

func (b *InMemoryBackend) ListPrompts(
	_ context.Context, promptIdentifier string, maxResults int, nextToken string,
) ([]*PromptSummary, string, error)

ListPrompts returns paginated prompt summaries.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(
	_ context.Context, resourceARN string,
) (map[string]string, error)

ListTagsForResource returns tags for a resource ARN.

func (*InMemoryBackend) PrepareAgent

func (b *InMemoryBackend) PrepareAgent(_ context.Context, agentID string) (*Agent, error)

PrepareAgent transitions agent to PREPARED status.

func (*InMemoryBackend) PrepareFlow

func (b *InMemoryBackend) PrepareFlow(_ context.Context, flowID string) (*Flow, error)

PrepareFlow transitions a flow to prepared status.

func (*InMemoryBackend) PutResourcePolicy added in v1.2.0

func (b *InMemoryBackend) PutResourcePolicy(
	_ context.Context, resourceArn, policy, expectedRevisionID string,
) (*ResourcePolicy, error)

PutResourcePolicy creates or replaces the resource policy attached to a knowledge base ARN. resourceArn must match the real, documented knowledge-base-only ARN pattern AND resolve to a knowledge base this backend actually has -- a policy must not attach to a nonexistent resource. See this file's package doc comment for expectedRevisionID semantics.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all backend state (used in tests).

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serializes the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartIngestionJob

func (b *InMemoryBackend) StartIngestionJob(
	_ context.Context, kbID, dsID, description, clientToken string,
) (*IngestionJob, error)

StartIngestionJob creates and starts a new ingestion job.

func (*InMemoryBackend) StopIngestionJob

func (b *InMemoryBackend) StopIngestionJob(
	_ context.Context, kbID, dsID, jobID string,
) (*IngestionJob, error)

StopIngestionJob stops an ingestion job.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(
	_ context.Context, resourceARN string, tags map[string]string,
) error

TagResource adds or updates tags on a resource.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(
	_ context.Context, resourceARN string, tagKeys []string,
) error

UntagResource removes tags from a resource.

func (*InMemoryBackend) UpdateAgent

func (b *InMemoryBackend) UpdateAgent(_ context.Context, agentID string, cfg AgentConfig) (*Agent, error)

UpdateAgent updates an existing agent.

func (*InMemoryBackend) UpdateAgentActionGroup

func (b *InMemoryBackend) UpdateAgentActionGroup(
	_ context.Context, agentID, agentVersion, actionGroupID string, cfg ActionGroupConfig,
) (*AgentActionGroup, error)

UpdateAgentActionGroup updates an action group.

Real AWS constrains {agentVersion} to the literal "DRAFT" here too (API reference: Pattern `DRAFT`, fixed length 5) -- numbered versions are immutable snapshots, so this must reject them same as Create.

func (*InMemoryBackend) UpdateAgentAlias

func (b *InMemoryBackend) UpdateAgentAlias(
	_ context.Context, agentID, aliasID string, cfg AliasConfig,
) (*AgentAlias, error)

UpdateAgentAlias updates an agent alias.

func (*InMemoryBackend) UpdateAgentCollaborator

func (b *InMemoryBackend) UpdateAgentCollaborator(
	_ context.Context, agentID, agentVersion, collaboratorID string, cfg CollaboratorConfig,
) (*AgentCollaborator, error)

UpdateAgentCollaborator updates a collaborator.

Real AWS constrains {agentVersion} to the literal "DRAFT" here too (API reference: Pattern `DRAFT`, fixed length 5) -- numbered versions are immutable snapshots, so this must reject them same as Associate.

func (*InMemoryBackend) UpdateAgentKnowledgeBase

func (b *InMemoryBackend) UpdateAgentKnowledgeBase(
	_ context.Context, agentID, agentVersion, kbID, description, kbState string,
) (*AgentKnowledgeBase, error)

UpdateAgentKnowledgeBase updates an agent–KB association.

Real AWS constrains {agentVersion} to the literal "DRAFT" here too (API reference: Pattern `DRAFT`, fixed length 5) -- numbered versions are immutable snapshots, so this must reject them same as Associate.

func (*InMemoryBackend) UpdateDataSource

func (b *InMemoryBackend) UpdateDataSource(
	_ context.Context, kbID, dsID string, cfg DataSourceConfig,
) (*DataSource, error)

UpdateDataSource updates a data source.

func (*InMemoryBackend) UpdateFlow

func (b *InMemoryBackend) UpdateFlow(_ context.Context, flowID string, cfg FlowConfig) (*Flow, error)

UpdateFlow updates a flow.

func (*InMemoryBackend) UpdateFlowAlias

func (b *InMemoryBackend) UpdateFlowAlias(
	_ context.Context, flowID, aliasID string, cfg FlowAliasConfig,
) (*FlowAlias, error)

UpdateFlowAlias updates a flow alias.

func (*InMemoryBackend) UpdateKnowledgeBase

func (b *InMemoryBackend) UpdateKnowledgeBase(
	_ context.Context, kbID string, cfg KnowledgeBaseConfig,
) (*KnowledgeBase, error)

UpdateKnowledgeBase updates a knowledge base.

func (*InMemoryBackend) UpdatePrompt

func (b *InMemoryBackend) UpdatePrompt(
	_ context.Context, promptID string, cfg PromptConfig,
) (*Prompt, error)

UpdatePrompt updates a prompt.

func (*InMemoryBackend) ValidateFlowDefinition

func (b *InMemoryBackend) ValidateFlowDefinition(
	_ context.Context, definition map[string]any,
) ([]FlowValidationError, error)

ValidateFlowDefinition reports structural problems in a flow definition's top-level graph.

type IngestionJob

type IngestionJob struct {
	StartedAt       time.Time               `json:"startedAt"`
	UpdatedAt       time.Time               `json:"updatedAt"`
	Statistics      *IngestionJobStatistics `json:"statistics,omitempty"`
	IngestionJobID  string                  `json:"ingestionJobId"`
	KnowledgeBaseID string                  `json:"knowledgeBaseId"`
	DataSourceID    string                  `json:"dataSourceId"`
	Status          string                  `json:"status"`
	Description     string                  `json:"description,omitempty"`
	ClientToken     string                  `json:"-"`
}

IngestionJob is a knowledge base data ingestion job.

type IngestionJobFilter

type IngestionJobFilter struct {
	Attribute string
	Operator  string
	Values    []string
}

IngestionJobFilter mirrors types.IngestionJobFilter. The real SDK's only defined Attribute/Operator values are STATUS/EQ (types/enums.go) -- no other attribute or operator exists to honor.

type IngestionJobSortBy

type IngestionJobSortBy struct {
	Attribute string
	Order     string
}

IngestionJobSortBy mirrors types.IngestionJobSortBy. Valid AttributeName values are STATUS and STARTED_AT (types/enums.go); Order is ASCENDING or DESCENDING (types.SortOrder -- not the short ASC/DESC used by some of this service's other sort-order enums).

type IngestionJobStatistics added in v1.2.0

type IngestionJobStatistics struct {
	NumberOfDocumentsScanned          int64 `json:"numberOfDocumentsScanned"`
	NumberOfMetadataDocumentsScanned  int64 `json:"numberOfMetadataDocumentsScanned"`
	NumberOfNewDocumentsIndexed       int64 `json:"numberOfNewDocumentsIndexed"`
	NumberOfModifiedDocumentsIndexed  int64 `json:"numberOfModifiedDocumentsIndexed"`
	NumberOfMetadataDocumentsModified int64 `json:"numberOfMetadataDocumentsModified"`
	NumberOfDocumentsDeleted          int64 `json:"numberOfDocumentsDeleted"`
	NumberOfDocumentsFailed           int64 `json:"numberOfDocumentsFailed"`
}

IngestionJobStatistics holds document-count statistics for an ingestion job. Field names match the real aws-sdk-go-v2 wire shape exactly (see awsRestjson1_deserializeDocumentIngestionJobStatistics in the SDK's deserializers.go): plain PrimitiveLong integers, not epoch timestamps.

type KBCustomDocumentIdentifier added in v1.3.1

type KBCustomDocumentIdentifier struct {
	ID string `json:"id"`
}

KBCustomDocumentIdentifier identifies a document in a custom data source.

type KBDocument

type KBDocument struct {
	Metadata   map[string]any
	Identifier KBDocumentIdentifier
}

KBDocument is a knowledge base document for ingestion.

type KBDocumentDetail

type KBDocumentDetail struct {
	UpdatedAt       *time.Time           `json:"updatedAt,omitempty"`
	Identifier      KBDocumentIdentifier `json:"identifier"`
	KnowledgeBaseID string               `json:"knowledgeBaseId"`
	DataSourceID    string               `json:"dataSourceId"`
	Status          string               `json:"status"`
}

KBDocumentDetail is the status of a knowledge base document operation. Real AWS (types.KnowledgeBaseDocumentDetail) nests the document identity under "identifier" -- there is no flat "documentId" member on the wire. StatusReason is left unmodeled: it describes why a document is FAILED, a status this backend's ingest path never produces (always INDEXED).

type KBDocumentIdentifier added in v1.3.1

type KBDocumentIdentifier struct {
	Custom         *KBCustomDocumentIdentifier `json:"custom,omitempty"`
	S3             *KBS3Location               `json:"s3,omitempty"`
	DataSourceType string                      `json:"dataSourceType"`
}

KBDocumentIdentifier identifies a knowledge base document. Real AWS (types.DocumentIdentifier) discriminates by DataSourceType: CUSTOM documents are identified by Custom.ID, S3 documents by S3.URI -- there is no flat string document ID on the wire.

type KBS3Location added in v1.3.1

type KBS3Location struct {
	URI string `json:"uri"`
}

KBS3Location identifies a document in an S3 data source by its URI.

type KnowledgeBase

type KnowledgeBase struct {
	CreatedAt            time.Time      `json:"createdAt"`
	UpdatedAt            time.Time      `json:"updatedAt"`
	KBConfiguration      map[string]any `json:"knowledgeBaseConfiguration,omitempty"`
	StorageConfiguration map[string]any `json:"storageConfiguration,omitempty"`
	KnowledgeBaseID      string         `json:"knowledgeBaseId"`
	KnowledgeBaseARN     string         `json:"knowledgeBaseArn"`
	Name                 string         `json:"name"`
	Status               string         `json:"status"`
	Description          string         `json:"description,omitempty"`
	RoleARN              string         `json:"roleArn,omitempty"`
	ClientToken          string         `json:"-"`
}

KnowledgeBase is a Bedrock Knowledge Base. Tags are deliberately NOT a field here -- the real types.KnowledgeBase has no "tags" member; CreateKnowledgeBase seeds b.tags[KnowledgeBaseARN] directly instead.

type KnowledgeBaseConfig

type KnowledgeBaseConfig struct {
	Tags                 map[string]string
	KBConfiguration      map[string]any
	StorageConfiguration map[string]any
	ClientToken          string
	Name                 string
	Description          string
	RoleARN              string
}

KnowledgeBaseConfig holds fields for creating or updating a KnowledgeBase.

type KnowledgeBaseSummary

type KnowledgeBaseSummary struct {
	UpdatedAt       time.Time `json:"updatedAt"`
	KnowledgeBaseID string    `json:"knowledgeBaseId"`
	Name            string    `json:"name"`
	Status          string    `json:"status"`
	Description     string    `json:"description,omitempty"`
}

KnowledgeBaseSummary is used in list responses.

type Prompt

type Prompt struct {
	CreatedAt      time.Time        `json:"createdAt"`
	UpdatedAt      time.Time        `json:"updatedAt"`
	PromptID       string           `json:"id"`
	PromptARN      string           `json:"arn"`
	Name           string           `json:"name"`
	Description    string           `json:"description,omitempty"`
	DefaultVariant string           `json:"defaultVariant,omitempty"`
	Version        string           `json:"version"`
	KMSKeyARN      string           `json:"customerEncryptionKeyArn,omitempty"`
	ClientToken    string           `json:"-"`
	Variants       []map[string]any `json:"variants,omitempty"`
}

Prompt is a Bedrock Prompt resource. Tags are deliberately NOT a field here -- the real GetPromptOutput/CreatePromptOutput has no "tags" member; CreatePrompt seeds b.tags[PromptARN] directly instead.

type PromptConfig

type PromptConfig struct {
	Tags                     map[string]string
	ClientToken              string
	CustomerEncryptionKeyArn string
	Name                     string
	Description              string
	DefaultVariant           string
	Variants                 []map[string]any
}

PromptConfig holds fields for creating or updating a Prompt.

type PromptSummary

type PromptSummary struct {
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
	PromptID    string    `json:"id"`
	PromptARN   string    `json:"arn"`
	Name        string    `json:"name"`
	Description string    `json:"description,omitempty"`
	Version     string    `json:"version"`
}

PromptSummary is used in list responses.

type PromptVersion

type PromptVersion struct {
	CreatedAt      time.Time        `json:"createdAt"`
	UpdatedAt      time.Time        `json:"updatedAt"`
	PromptARN      string           `json:"arn"`
	PromptID       string           `json:"id"`
	Name           string           `json:"name"`
	Version        string           `json:"version"`
	Description    string           `json:"description,omitempty"`
	DefaultVariant string           `json:"defaultVariant,omitempty"`
	KMSKeyARN      string           `json:"customerEncryptionKeyArn,omitempty"`
	ClientToken    string           `json:"-"`
	Variants       []map[string]any `json:"variants,omitempty"`
}

PromptVersion is an immutable snapshot of a prompt.

UpdatedAt is real CreatePromptVersionOutput/GetPromptVersionOutput's required "updatedAt" (api_op_CreatePromptVersion.go) -- previously not a field on this struct at all, the "member with no struct field" class (gopherstack-r80d batch 7). Set equal to CreatedAt at creation time, since a prompt version is an immutable snapshot that's never updated afterward.

type Provider

type Provider struct{}

Provider implements service.Provider for the Bedrock Agent service.

func (*Provider) Init

Init initialises the Bedrock Agent backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ResourcePolicy added in v1.2.0

type ResourcePolicy struct {
	CreatedAt   time.Time
	UpdatedAt   time.Time
	ResourceArn string
	Policy      string
	RevisionID  string
}

ResourcePolicy is the resource-based policy attached to a knowledge base (bedrock-agent's PutResourcePolicy/GetResourcePolicy/DeleteResourcePolicy -- see resource_policy.go's package doc comment for why this family is scoped to knowledge bases only). CreatedAt/UpdatedAt are internal bookkeeping only; the real wire response never exposes them (see handler_resource_policy.go's response structs), only "policy"/ "resourceArn"/"revisionId".

type StorageBackend

type StorageBackend interface {
	// Snapshot and Restore implement persistence.Persistable. Handler
	// delegates to them (see persistence.go) so cli.go's generic
	// setupPersistence picks BedrockAgent up. Before Phase 3.3, BedrockAgent
	// had no persistence at all: neither Handler nor InMemoryBackend
	// implemented Snapshot/Restore, so state never survived a restart. This
	// is the dead-wiring fix in scope for the Phase 3.3 datalayer
	// conversion, built from scratch following the codecommit/cleanrooms
	// pattern (see persistence.go).
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error

	// Agent operations.
	CreateAgent(ctx context.Context, cfg AgentConfig) (*Agent, error)
	GetAgent(ctx context.Context, agentID string) (*Agent, error)
	UpdateAgent(ctx context.Context, agentID string, cfg AgentConfig) (*Agent, error)
	DeleteAgent(ctx context.Context, agentID string, skipResourceInUseCheck bool) error
	ListAgents(ctx context.Context, maxResults int, nextToken string) ([]*AgentSummary, string, error)
	PrepareAgent(ctx context.Context, agentID string) (*Agent, error)

	// Agent version operations.
	CreateAgentVersion(ctx context.Context, agentID, description string) (*AgentVersion, error)
	GetAgentVersion(ctx context.Context, agentID, agentVersion string) (*AgentVersion, error)
	DeleteAgentVersion(ctx context.Context, agentID, agentVersion string, skipResourceInUseCheck bool) error
	ListAgentVersions(
		ctx context.Context, agentID string, maxResults int, nextToken string,
	) ([]*AgentVersionSummary, string, error)

	// Agent action group operations.
	CreateAgentActionGroup(
		ctx context.Context, agentID, agentVersion string, cfg ActionGroupConfig,
	) (*AgentActionGroup, error)
	GetAgentActionGroup(
		ctx context.Context, agentID, agentVersion, actionGroupID string,
	) (*AgentActionGroup, error)
	UpdateAgentActionGroup(
		ctx context.Context, agentID, agentVersion, actionGroupID string, cfg ActionGroupConfig,
	) (*AgentActionGroup, error)
	DeleteAgentActionGroup(
		ctx context.Context, agentID, agentVersion, actionGroupID string,
	) error
	ListAgentActionGroups(
		ctx context.Context, agentID, agentVersion string, maxResults int, nextToken string,
	) ([]*ActionGroupSummary, string, error)

	// Agent alias operations.
	CreateAgentAlias(ctx context.Context, agentID string, cfg AliasConfig) (*AgentAlias, error)
	GetAgentAlias(ctx context.Context, agentID, agentAliasID string) (*AgentAlias, error)
	UpdateAgentAlias(ctx context.Context, agentID, agentAliasID string, cfg AliasConfig) (*AgentAlias, error)
	DeleteAgentAlias(ctx context.Context, agentID, agentAliasID string) error
	ListAgentAliases(
		ctx context.Context, agentID string, maxResults int, nextToken string,
	) ([]*AgentAliasSummary, string, error)

	// Agent collaborator operations.
	AssociateAgentCollaborator(
		ctx context.Context, agentID, agentVersion string, cfg CollaboratorConfig,
	) (*AgentCollaborator, error)
	GetAgentCollaborator(
		ctx context.Context, agentID, agentVersion, collaboratorID string,
	) (*AgentCollaborator, error)
	UpdateAgentCollaborator(
		ctx context.Context, agentID, agentVersion, collaboratorID string, cfg CollaboratorConfig,
	) (*AgentCollaborator, error)
	DisassociateAgentCollaborator(
		ctx context.Context, agentID, agentVersion, collaboratorID string,
	) error
	ListAgentCollaborators(
		ctx context.Context, agentID, agentVersion string, maxResults int, nextToken string,
	) ([]*AgentCollaborator, string, error)

	// Knowledge base operations.
	CreateKnowledgeBase(ctx context.Context, cfg KnowledgeBaseConfig) (*KnowledgeBase, error)
	GetKnowledgeBase(ctx context.Context, kbID string) (*KnowledgeBase, error)
	UpdateKnowledgeBase(ctx context.Context, kbID string, cfg KnowledgeBaseConfig) (*KnowledgeBase, error)
	DeleteKnowledgeBase(ctx context.Context, kbID string) error
	ListKnowledgeBases(ctx context.Context, maxResults int, nextToken string) ([]*KnowledgeBaseSummary, string, error)

	// Agent–knowledge base association operations.
	AssociateAgentKnowledgeBase(
		ctx context.Context, agentID, agentVersion, kbID, description, kbState string,
	) (*AgentKnowledgeBase, error)
	GetAgentKnowledgeBase(
		ctx context.Context, agentID, agentVersion, kbID string,
	) (*AgentKnowledgeBase, error)
	UpdateAgentKnowledgeBase(
		ctx context.Context, agentID, agentVersion, kbID, description, kbState string,
	) (*AgentKnowledgeBase, error)
	DisassociateAgentKnowledgeBase(
		ctx context.Context, agentID, agentVersion, kbID string,
	) error
	ListAgentKnowledgeBases(
		ctx context.Context, agentID, agentVersion string, maxResults int, nextToken string,
	) ([]*AgentKnowledgeBaseSummary, string, error)

	// Data source operations.
	CreateDataSource(ctx context.Context, kbID string, cfg DataSourceConfig) (*DataSource, error)
	GetDataSource(ctx context.Context, kbID, dataSourceID string) (*DataSource, error)
	UpdateDataSource(ctx context.Context, kbID, dataSourceID string, cfg DataSourceConfig) (*DataSource, error)
	DeleteDataSource(ctx context.Context, kbID, dataSourceID string) error
	ListDataSources(
		ctx context.Context, kbID string, maxResults int, nextToken string,
	) ([]*DataSourceSummary, string, error)

	// Ingestion job operations.
	StartIngestionJob(ctx context.Context, kbID, dataSourceID, description, clientToken string) (*IngestionJob, error)
	GetIngestionJob(ctx context.Context, kbID, dataSourceID, ingestionJobID string) (*IngestionJob, error)
	StopIngestionJob(ctx context.Context, kbID, dataSourceID, ingestionJobID string) (*IngestionJob, error)
	ListIngestionJobs(
		ctx context.Context, kbID, dataSourceID string, filters []IngestionJobFilter, sortBy *IngestionJobSortBy,
		maxResults int, nextToken string,
	) ([]*IngestionJob, string, error)

	// Flow operations.
	CreateFlow(ctx context.Context, cfg FlowConfig) (*Flow, error)
	GetFlow(ctx context.Context, flowID string) (*Flow, error)
	UpdateFlow(ctx context.Context, flowID string, cfg FlowConfig) (*Flow, error)
	DeleteFlow(ctx context.Context, flowID string, skipResourceInUseCheck bool) error
	ListFlows(ctx context.Context, maxResults int, nextToken string) ([]*FlowSummary, string, error)
	PrepareFlow(ctx context.Context, flowID string) (*Flow, error)
	ValidateFlowDefinition(ctx context.Context, definition map[string]any) ([]FlowValidationError, error)

	// Flow version operations.
	CreateFlowVersion(ctx context.Context, flowID string, cfg VersionConfig) (*FlowVersion, error)
	GetFlowVersion(ctx context.Context, flowID, flowVersion string) (*FlowVersion, error)
	DeleteFlowVersion(ctx context.Context, flowID, flowVersion string, skipResourceInUseCheck bool) error
	ListFlowVersions(
		ctx context.Context, flowID string, maxResults int, nextToken string,
	) ([]*FlowVersionSummary, string, error)

	// Flow alias operations.
	CreateFlowAlias(ctx context.Context, flowID string, cfg FlowAliasConfig) (*FlowAlias, error)
	GetFlowAlias(ctx context.Context, flowID, aliasID string) (*FlowAlias, error)
	UpdateFlowAlias(ctx context.Context, flowID, aliasID string, cfg FlowAliasConfig) (*FlowAlias, error)
	DeleteFlowAlias(ctx context.Context, flowID, aliasID string) error
	ListFlowAliases(
		ctx context.Context, flowID string, maxResults int, nextToken string,
	) ([]*FlowAliasSummary, string, error)

	// Prompt operations.
	CreatePrompt(ctx context.Context, cfg PromptConfig) (*Prompt, error)
	GetPrompt(ctx context.Context, promptID string) (*Prompt, error)
	UpdatePrompt(ctx context.Context, promptID string, cfg PromptConfig) (*Prompt, error)
	DeletePrompt(ctx context.Context, promptID string) error
	ListPrompts(
		ctx context.Context, promptIdentifier string, maxResults int, nextToken string,
	) ([]*PromptSummary, string, error)

	// Prompt version operations.
	CreatePromptVersion(ctx context.Context, promptID string, cfg VersionConfig) (*PromptVersion, error)
	GetPromptVersion(ctx context.Context, promptID, version string) (*PromptVersion, error)
	DeletePromptVersion(ctx context.Context, promptID, version string) error

	// Knowledge base document operations.
	IngestKnowledgeBaseDocuments(
		ctx context.Context, kbID, dataSourceID string, docs []KBDocument,
	) ([]KBDocumentDetail, error)
	GetKnowledgeBaseDocuments(
		ctx context.Context, kbID, dataSourceID string, ids []KBDocumentIdentifier,
	) ([]KBDocumentDetail, error)
	DeleteKnowledgeBaseDocuments(
		ctx context.Context, kbID, dataSourceID string, ids []KBDocumentIdentifier,
	) ([]KBDocumentDetail, error)
	ListKnowledgeBaseDocuments(
		ctx context.Context, kbID, dataSourceID string, maxResults int, nextToken string,
	) ([]KBDocumentDetail, string, error)

	// Tagging operations.
	ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
	TagResource(ctx context.Context, resourceARN string, tags map[string]string) error
	UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error

	// Resource policy operations (knowledge bases only -- see
	// resource_policy.go's package doc comment).
	PutResourcePolicy(ctx context.Context, resourceArn, policy, expectedRevisionID string) (*ResourcePolicy, error)
	GetResourcePolicy(ctx context.Context, resourceArn string) (*ResourcePolicy, error)
	DeleteResourcePolicy(ctx context.Context, resourceArn, expectedRevisionID string) (string, error)
}

StorageBackend defines all persistence operations for the Bedrock Agent service.

type VersionConfig

type VersionConfig struct {
	Tags        map[string]string
	Description string
	ClientToken string
}

VersionConfig holds the optional members of CreateFlowVersion and CreatePromptVersion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL