lexmodels

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const LatestVersion = "$LATEST"

LatestVersion is the alias used for the working draft of a Lex resource.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service is the cloudmock implementation of the AWS lex service.

func New

func New(accountID, region string) *Service

New returns a new lexmodels Service.

func (*Service) Actions

func (s *Service) Actions() []service.Action

Actions returns all supported API actions.

func (*Service) HandleRequest

func (s *Service) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes a request to the appropriate handler.

func (*Service) HealthCheck

func (s *Service) HealthCheck() error

HealthCheck always returns nil.

func (*Service) Name

func (s *Service) Name() string

Name returns the AWS service name used for request routing.

type Store

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

Store is the in-memory data store for Lex Models V1.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates an empty Store.

func (*Store) AddUtterance

func (s *Store) AddUtterance(botName, utterance string)

AddUtterance appends a sample utterance for the given bot.

func (*Store) CreateBotVersion

func (s *Store) CreateBotVersion(name string) (*StoredBot, *service.AWSError)

CreateBotVersion snapshots $LATEST into a new numeric version.

func (*Store) CreateIntentVersion

func (s *Store) CreateIntentVersion(name string) (*StoredIntent, *service.AWSError)

CreateIntentVersion snapshots $LATEST.

func (*Store) CreateSlotTypeVersion

func (s *Store) CreateSlotTypeVersion(name string) (*StoredSlotType, *service.AWSError)

func (*Store) DeleteBot

func (s *Store) DeleteBot(name string) *service.AWSError

DeleteBot removes a bot and every version. Also cleans up aliases and channel associations rooted on that bot.

func (*Store) DeleteBotAlias

func (s *Store) DeleteBotAlias(botName, aliasName string) *service.AWSError

func (*Store) DeleteBotVersion

func (s *Store) DeleteBotVersion(name, version string) *service.AWSError

DeleteBotVersion removes a single numeric version. $LATEST cannot be deleted.

func (*Store) DeleteChannelAssoc

func (s *Store) DeleteChannelAssoc(botName, alias, name string) *service.AWSError

func (*Store) DeleteIntent

func (s *Store) DeleteIntent(name string) *service.AWSError

func (*Store) DeleteIntentVersion

func (s *Store) DeleteIntentVersion(name, version string) *service.AWSError

func (*Store) DeleteSlotType

func (s *Store) DeleteSlotType(name string) *service.AWSError

func (*Store) DeleteSlotTypeVersion

func (s *Store) DeleteSlotTypeVersion(name, version string) *service.AWSError

func (*Store) DeleteUtterances

func (s *Store) DeleteUtterances(botName string)

DeleteUtterances drops recorded utterances for a bot.

func (*Store) GetBot

func (s *Store) GetBot(name, version string) (*StoredBot, *service.AWSError)

GetBot returns a stored bot version. Pass "$LATEST" or a numeric string.

func (*Store) GetBotAlias

func (s *Store) GetBotAlias(botName, aliasName string) (*StoredBotAlias, *service.AWSError)

func (*Store) GetChannelAssoc

func (s *Store) GetChannelAssoc(botName, alias, name string) (*StoredChannelAssoc, *service.AWSError)

func (*Store) GetImport

func (s *Store) GetImport(id string) (*StoredImport, *service.AWSError)

func (*Store) GetIntent

func (s *Store) GetIntent(name, version string) (*StoredIntent, *service.AWSError)

func (*Store) GetMigration

func (s *Store) GetMigration(id string) (*StoredMigration, *service.AWSError)

func (*Store) GetSlotType

func (s *Store) GetSlotType(name, version string) (*StoredSlotType, *service.AWSError)

func (*Store) GetUtterances

func (s *Store) GetUtterances(botName string) []string

GetUtterances returns recorded utterances for a bot.

func (*Store) ListBotAliases

func (s *Store) ListBotAliases(botName, nameContains string) []*StoredBotAlias

func (*Store) ListBotVersions

func (s *Store) ListBotVersions(name string) ([]*StoredBot, *service.AWSError)

ListBotVersions returns every version of a single bot.

func (*Store) ListBots

func (s *Store) ListBots(nameContains string) []*StoredBot

ListBots returns one summary per bot (the highest available version).

func (*Store) ListChannelAssocs

func (s *Store) ListChannelAssocs(botName, alias, nameContains string) []*StoredChannelAssoc

func (*Store) ListIntentVersions

func (s *Store) ListIntentVersions(name string) ([]*StoredIntent, *service.AWSError)

func (*Store) ListIntents

func (s *Store) ListIntents(nameContains string) []*StoredIntent

func (*Store) ListMigrations

func (s *Store) ListMigrations() []*StoredMigration

func (*Store) ListSlotTypeVersions

func (s *Store) ListSlotTypeVersions(name string) ([]*StoredSlotType, *service.AWSError)

func (*Store) ListSlotTypes

func (s *Store) ListSlotTypes(nameContains string) []*StoredSlotType

func (*Store) ListTags

func (s *Store) ListTags(arn string) map[string]string

func (*Store) PutBot

func (s *Store) PutBot(b *StoredBot) (*StoredBot, *service.AWSError)

PutBot creates or updates the $LATEST version of a bot. If createVersion is set on the bot, a numeric version snapshot is also produced.

func (*Store) PutBotAlias

func (s *Store) PutBotAlias(a *StoredBotAlias) (*StoredBotAlias, *service.AWSError)

func (*Store) PutChannelAssoc

func (s *Store) PutChannelAssoc(a *StoredChannelAssoc) (*StoredChannelAssoc, *service.AWSError)

func (*Store) PutIntent

func (s *Store) PutIntent(in *StoredIntent) (*StoredIntent, *service.AWSError)

PutIntent creates or updates the $LATEST version of an intent.

func (*Store) PutSlotType

func (s *Store) PutSlotType(st *StoredSlotType) (*StoredSlotType, *service.AWSError)

func (*Store) Reset

func (s *Store) Reset()

Reset clears all in-memory state. Satisfies the Resettable interface used by the admin API.

func (*Store) StartImport

func (s *Store) StartImport(name, resourceType, mergeStrategy string, tags map[string]string) *StoredImport

func (*Store) StartMigration

func (s *Store) StartMigration(strategy, v1Name, v1Version, v2Name, v2Role string) *StoredMigration

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string)

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, keys []string)

type StoredBot

type StoredBot struct {
	Name                         string
	Version                      string
	Description                  string
	Locale                       string
	VoiceID                      string
	ProcessBehavior              string
	Status                       string
	FailureReason                string
	Checksum                     string
	IdleSessionTTLInSeconds      int
	NluIntentConfidenceThreshold float64
	ChildDirected                bool
	DetectSentiment              bool
	EnableModelImprovements      bool
	CreateVersion                bool
	Intents                      []map[string]any
	ClarificationPrompt          map[string]any
	AbortStatement               map[string]any
	CreatedAt                    time.Time
	LastUpdatedAt                time.Time
}

StoredBot is the persisted shape of a Lex bot version.

type StoredBotAlias

type StoredBotAlias struct {
	Name             string
	BotName          string
	BotVersion       string
	Description      string
	Checksum         string
	ConversationLogs map[string]any
	CreatedAt        time.Time
	LastUpdatedAt    time.Time
}

StoredBotAlias is the persisted shape of a Lex bot alias.

type StoredChannelAssoc

type StoredChannelAssoc struct {
	Name             string
	BotName          string
	BotAlias         string
	Description      string
	Type             string
	Status           string
	FailureReason    string
	BotConfiguration map[string]string
	CreatedAt        time.Time
}

StoredChannelAssoc is the persisted shape of a bot channel association.

type StoredImport

type StoredImport struct {
	ImportID      string
	Name          string
	ResourceType  string
	MergeStrategy string
	Status        string
	FailureReason []string
	Tags          map[string]string
	CreatedAt     time.Time
}

StoredImport models an asynchronous resource import job.

type StoredIntent

type StoredIntent struct {
	Name                  string
	Version               string
	Description           string
	Checksum              string
	ParentIntentSignature string
	Slots                 []map[string]any
	SampleUtterances      []string
	ConfirmationPrompt    map[string]any
	RejectionStatement    map[string]any
	FollowUpPrompt        map[string]any
	ConclusionStatement   map[string]any
	DialogCodeHook        map[string]any
	FulfillmentActivity   map[string]any
	InputContexts         []map[string]any
	OutputContexts        []map[string]any
	KendraConfiguration   map[string]any
	CreatedAt             time.Time
	LastUpdatedAt         time.Time
}

StoredIntent is the persisted shape of a Lex intent version.

type StoredMigration

type StoredMigration struct {
	MigrationID       string
	MigrationStrategy string
	Status            string
	V1BotName         string
	V1BotVersion      string
	V1BotLocale       string
	V2BotID           string
	V2BotRole         string
	StartedAt         time.Time
	Alerts            []map[string]any
}

StoredMigration models an async v1 → v2 bot migration job.

type StoredSlotType

type StoredSlotType struct {
	Name                    string
	Version                 string
	Description             string
	Checksum                string
	ValueSelectionStrategy  string
	ParentSlotTypeSignature string
	EnumerationValues       []map[string]any
	SlotTypeConfigurations  []map[string]any
	CreatedAt               time.Time
	LastUpdatedAt           time.Time
}

StoredSlotType is the persisted shape of a Lex slot type version.

Jump to

Keyboard shortcuts

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