personalize

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 21 Imported by: 0

README

Personalize

Parity grade: A · SDK aws-sdk-go-v2/service/personalize@v1.50.4 · last audited 2026-08-13 (12cf224d)

Coverage

Metric Value
Operations audited 73 (73 ok)
Feature families 8 (8 ok)
Known gaps none
Deferred items 0
Resource leaks clean

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested resource is absent.
	ErrNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource name already exists.
	ErrAlreadyExists = awserr.New("ResourceAlreadyExistsException", awserr.ErrAlreadyExists)
	// ErrValidation is returned when a request is invalid.
	ErrValidation = awserr.New("InvalidInputException", awserr.ErrInvalidParameter)
	// ErrInUse is returned when a resource cannot be deleted because it is in use.
	ErrInUse = awserr.New("ResourceInUseException", awserr.ErrConflict)
)
View Source
var ErrNilAppContext = errors.New("personalize: nil AppContext")

ErrNilAppContext is returned when Provider.Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AutoMLConfig added in v1.3.1

type AutoMLConfig struct {
	MetricName string   `json:"metricName,omitempty"`
	RecipeList []string `json:"recipeList,omitempty"`
}

AutoMLConfig mirrors types.AutoMLConfig (types.go:68).

type AutoTrainingConfig added in v1.3.1

type AutoTrainingConfig struct {
	SchedulingExpression string `json:"schedulingExpression,omitempty"`
}

AutoTrainingConfig mirrors types.AutoTrainingConfig (types.go:92).

type BatchInferenceJob

type BatchInferenceJob struct {
	CreationDateTime     time.Time
	LastUpdatedDateTime  time.Time
	JobInput             map[string]any
	JobOutput            map[string]any
	BatchInferenceJobArn string
	SolutionVersionArn   string
	JobName              string
	RoleArn              string
	Status               string
}

BatchInferenceJob stores an async batch inference job.

type BatchSegmentJob

type BatchSegmentJob struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	JobInput            map[string]any
	JobOutput           map[string]any
	BatchSegmentJobArn  string
	SolutionVersionArn  string
	JobName             string
	RoleArn             string
	Status              string
}

BatchSegmentJob stores an async batch segment job.

type Campaign

type Campaign struct {
	CreationDateTime     time.Time
	LastUpdatedDateTime  time.Time
	CampaignConfig       *CampaignConfig
	LatestCampaignUpdate map[string]any
	CampaignArn          string
	SolutionVersionArn   string
	Name                 string
	Status               string
	MinProvisionedTPS    int32
}

Campaign stores an Amazon Personalize campaign.

type CampaignConfig added in v1.3.1

type CampaignConfig struct {
	ItemExplorationConfig             map[string]string  `json:"itemExplorationConfig,omitempty"`
	RankingInfluence                  map[string]float64 `json:"rankingInfluence,omitempty"`
	EnableMetadataWithRecommendations *bool              `json:"enableMetadataWithRecommendations,omitempty"`
	SyncWithLatestSolutionVersion     *bool              `json:"syncWithLatestSolutionVersion,omitempty"`
}

CampaignConfig mirrors types.CampaignConfig (types.go:433).

type CategoricalHyperParameterRange added in v1.3.1

type CategoricalHyperParameterRange struct {
	Name   string   `json:"name,omitempty"`
	Values []string `json:"values,omitempty"`
}

CategoricalHyperParameterRange mirrors types.CategoricalHyperParameterRange (types.go:548).

type ContinuousHyperParameterRange added in v1.3.1

type ContinuousHyperParameterRange struct {
	Name     string  `json:"name,omitempty"`
	MaxValue float64 `json:"maxValue,omitempty"`
	MinValue float64 `json:"minValue,omitempty"`
}

ContinuousHyperParameterRange mirrors types.ContinuousHyperParameterRange (types.go:560).

type DataDeletionJob

type DataDeletionJob struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	DataSource          map[string]any
	DataDeletionJobArn  string
	DatasetGroupArn     string
	JobName             string
	RoleArn             string
	Status              string
	NumDeleted          int32
}

DataDeletionJob stores an async data deletion job.

type Dataset

type Dataset struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	DatasetArn          string
	DatasetGroupArn     string
	SchemaArn           string
	Name                string
	DatasetType         string
	Status              string
}

Dataset stores an Amazon Personalize dataset.

type DatasetExportJob

type DatasetExportJob struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	JobOutput           map[string]any
	DatasetExportJobArn string
	DatasetArn          string
	JobName             string
	RoleArn             string
	Status              string
}

DatasetExportJob stores an async dataset export job.

type DatasetGroup

type DatasetGroup struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	DatasetGroupArn     string
	Name                string
	Domain              string
	KmsKeyArn           string
	RoleArn             string
	FailureReason       string
	Status              string
}

DatasetGroup stores an Amazon Personalize dataset group.

type DatasetImportJob

type DatasetImportJob struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	DataSource          map[string]any
	DatasetImportJobArn string
	DatasetArn          string
	JobName             string
	RoleArn             string
	Status              string
}

DatasetImportJob stores an async dataset import job.

type EventParameters added in v1.3.1

type EventParameters struct {
	EventType           string  `json:"eventType,omitempty"`
	EventValueThreshold float64 `json:"eventValueThreshold,omitempty"`
	Weight              float64 `json:"weight,omitempty"`
}

EventParameters mirrors types.EventParameters (types.go:1197).

type EventTracker

type EventTracker struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	EventTrackerArn     string
	DatasetGroupArn     string
	Name                string
	TrackingID          string
	Status              string
}

EventTracker stores an Amazon Personalize event tracker.

type EventsConfig added in v1.3.1

type EventsConfig struct {
	EventParametersList []EventParameters `json:"eventParametersList,omitempty"`
}

EventsConfig mirrors types.EventsConfig (types.go:1214).

type Filter

type Filter struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	FilterArn           string
	DatasetGroupArn     string
	Name                string
	FilterExpression    string
	Status              string
}

Filter stores an Amazon Personalize filter.

type HPOConfig added in v1.3.1

type HPOConfig struct {
	AlgorithmHyperParameterRanges *HyperParameterRanges `json:"algorithmHyperParameterRanges,omitempty"`
	HpoObjective                  *HPOObjective         `json:"hpoObjective,omitempty"`
	HpoResourceConfig             *HPOResourceConfig    `json:"hpoResourceConfig,omitempty"`
}

HPOConfig mirrors types.HPOConfig (types.go:1397).

type HPOObjective added in v1.3.1

type HPOObjective struct {
	MetricName  string `json:"metricName,omitempty"`
	MetricRegex string `json:"metricRegex,omitempty"`
	Type        string `json:"type,omitempty"`
}

HPOObjective mirrors types.HPOObjective (types.go:1416).

type HPOResourceConfig added in v1.3.1

type HPOResourceConfig struct {
	MaxNumberOfTrainingJobs string `json:"maxNumberOfTrainingJobs,omitempty"`
	MaxParallelTrainingJobs string `json:"maxParallelTrainingJobs,omitempty"`
}

HPOResourceConfig mirrors types.HPOResourceConfig (types.go:1431).

type Handler

type Handler struct {
	Backend *InMemoryBackend
	// contains filtered or unexported fields
}

Handler serves Amazon Personalize JSON operations.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a Personalize handler backed by in-memory state.

func (*Handler) ChaosOperations

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

ChaosOperations returns fault-injectable operations.

func (*Handler) ChaosRegions

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

ChaosRegions returns configured service region.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns service key for fault matching.

func (*Handler) ExtractOperation

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

ExtractOperation returns the operation name from the request target, or (for a real personalizeruntime request, which carries no X-Amz-Target at all) from the literal REST path.

func (*Handler) ExtractResource

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

ExtractResource returns an empty string (no generic resource identifier).

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns all implemented operation names.

func (*Handler) Handler

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

Handler returns the Echo HTTP handler.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns header matching priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all backend state for the /_gopherstack/reset test hook.

func (*Handler) Restore

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

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

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

RouteMatcher matches Personalize's fabricated X-Amz-Target headers (classic Personalize's real dispatch mechanism, and the AmazonPersonalizeRuntime prefix no real client ever sends) plus personalizeruntime's real REST-JSON1 literal paths -- see personalizeRuntimeRecommendationsPath/personalizeRuntimeRankingPath.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend. Before this, Handler had no Snapshot/Restore of its own and InMemoryBackend had no persistence at all -- Personalize was entirely excluded from Gopherstack's persistence.Manager (it type-asserts each service's Registerable to persistence.Persistable). This is the Phase 3.3 dead-wiring fix: Personalize now round-trips full state like every other converted service.

type HyperParameterRanges added in v1.3.1

type HyperParameterRanges struct {
	CategoricalHyperParameterRanges []CategoricalHyperParameterRange `json:"categoricalHyperParameterRanges,omitempty"`
	ContinuousHyperParameterRanges  []ContinuousHyperParameterRange  `json:"continuousHyperParameterRanges,omitempty"`
	IntegerHyperParameterRanges     []IntegerHyperParameterRange     `json:"integerHyperParameterRanges,omitempty"`
}

HyperParameterRanges mirrors types.HyperParameterRanges (types.go:1446).

type InMemoryBackend

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

InMemoryBackend stores Amazon Personalize state.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend returns a stateful Amazon Personalize backend.

func (*InMemoryBackend) AccountID added in v1.3.1

func (b *InMemoryBackend) AccountID() string

AccountID returns the configured account ID.

func (*InMemoryBackend) CreateBatchInferenceJob

func (b *InMemoryBackend) CreateBatchInferenceJob(
	jobName, solutionVersionArn, roleArn string,
	jobInput, jobOutput map[string]any,
	tags map[string]string,
) (*BatchInferenceJob, error)

CreateBatchInferenceJob creates a new batch inference job.

func (*InMemoryBackend) CreateBatchSegmentJob

func (b *InMemoryBackend) CreateBatchSegmentJob(
	jobName, solutionVersionArn, roleArn string,
	jobInput, jobOutput map[string]any,
	tags map[string]string,
) (*BatchSegmentJob, error)

CreateBatchSegmentJob creates a new batch segment job.

func (*InMemoryBackend) CreateCampaign

func (b *InMemoryBackend) CreateCampaign(
	name, solutionVersionArn string,
	minProvisionedTPS int32,
	campaignConfig *CampaignConfig,
	tags map[string]string,
) (*Campaign, error)

CreateCampaign creates a new campaign.

func (*InMemoryBackend) CreateDataDeletionJob

func (b *InMemoryBackend) CreateDataDeletionJob(
	jobName, datasetGroupArn, roleArn string,
	dataSource map[string]any,
	tags map[string]string,
) (*DataDeletionJob, error)

CreateDataDeletionJob creates a new data deletion job.

func (*InMemoryBackend) CreateDataset

func (b *InMemoryBackend) CreateDataset(
	name, datasetGroupArn, datasetType, schemaArn string,
	tags map[string]string,
) (*Dataset, error)

CreateDataset creates a new dataset.

func (*InMemoryBackend) CreateDatasetExportJob

func (b *InMemoryBackend) CreateDatasetExportJob(
	jobName, datasetArn, roleArn string,
	jobOutput map[string]any,
	tags map[string]string,
) (*DatasetExportJob, error)

CreateDatasetExportJob creates a new dataset export job.

func (*InMemoryBackend) CreateDatasetGroup

func (b *InMemoryBackend) CreateDatasetGroup(
	name, domain, kmsKeyArn, roleArn string,
	tags map[string]string,
) (*DatasetGroup, error)

CreateDatasetGroup creates a new dataset group.

func (*InMemoryBackend) CreateDatasetImportJob

func (b *InMemoryBackend) CreateDatasetImportJob(
	jobName, datasetArn, roleArn string,
	dataSource map[string]any,
	tags map[string]string,
) (*DatasetImportJob, error)

CreateDatasetImportJob creates a new dataset import job.

func (*InMemoryBackend) CreateEventTracker

func (b *InMemoryBackend) CreateEventTracker(
	name, datasetGroupArn string,
	tags map[string]string,
) (*EventTracker, error)

CreateEventTracker creates a new event tracker.

func (*InMemoryBackend) CreateFilter

func (b *InMemoryBackend) CreateFilter(
	name, datasetGroupArn, filterExpression string,
	tags map[string]string,
) (*Filter, error)

CreateFilter creates a new filter.

func (*InMemoryBackend) CreateMetricAttribution

func (b *InMemoryBackend) CreateMetricAttribution(
	name, datasetGroupArn string,
	metrics []MetricAttribute,
	metricsOutputConfig map[string]any,
	tags map[string]string,
) (*MetricAttribution, error)

CreateMetricAttribution creates a new metric attribution. metrics is a required field on the real CreateMetricAttribution API (a list of the event-type/expression pairs to track), not an optional passthrough.

func (*InMemoryBackend) CreateRecommender

func (b *InMemoryBackend) CreateRecommender(
	name, datasetGroupArn, recipeArn string,
	minRPS int32,
	recommenderConfig *RecommenderConfig,
	tags map[string]string,
) (*Recommender, error)

CreateRecommender creates a new recommender.

func (*InMemoryBackend) CreateSchema

func (b *InMemoryBackend) CreateSchema(name, schema, domain string) (*Schema, error)

CreateSchema creates a new schema.

func (*InMemoryBackend) CreateSolution

func (b *InMemoryBackend) CreateSolution(
	name, datasetGroupArn, recipeArn, eventType string,
	performAutoML, performHPO, performAutoTraining, performIncrementalUpdate bool,
	solutionConfig *SolutionConfig,
	tags map[string]string,
) (*Solution, error)

CreateSolution creates a new solution. performAutoTraining defaults to true in the real API when the caller omits it, so it is passed as an already caller-resolved bool rather than re-defaulted here.

func (*InMemoryBackend) CreateSolutionVersion

func (b *InMemoryBackend) CreateSolutionVersion(
	solutionArn, trainingMode string,
	tags map[string]string,
) (*SolutionVersion, error)

CreateSolutionVersion creates a new solution version.

func (*InMemoryBackend) DeleteCampaign

func (b *InMemoryBackend) DeleteCampaign(nameOrArn string) error

DeleteCampaign removes a campaign.

func (*InMemoryBackend) DeleteDataset

func (b *InMemoryBackend) DeleteDataset(nameOrArn string) error

DeleteDataset removes a dataset.

func (*InMemoryBackend) DeleteDatasetGroup

func (b *InMemoryBackend) DeleteDatasetGroup(nameOrArn string) error

DeleteDatasetGroup removes a dataset group.

func (*InMemoryBackend) DeleteEventTracker

func (b *InMemoryBackend) DeleteEventTracker(nameOrArn string) error

DeleteEventTracker removes an event tracker.

func (*InMemoryBackend) DeleteFilter

func (b *InMemoryBackend) DeleteFilter(nameOrArn string) error

DeleteFilter removes a filter.

func (*InMemoryBackend) DeleteMetricAttribution

func (b *InMemoryBackend) DeleteMetricAttribution(nameOrArn string) error

DeleteMetricAttribution removes a metric attribution.

func (*InMemoryBackend) DeleteRecommender

func (b *InMemoryBackend) DeleteRecommender(nameOrArn string) error

DeleteRecommender removes a recommender.

func (*InMemoryBackend) DeleteSchema

func (b *InMemoryBackend) DeleteSchema(nameOrArn string) error

DeleteSchema removes a schema.

func (*InMemoryBackend) DeleteSolution

func (b *InMemoryBackend) DeleteSolution(nameOrArn string) error

DeleteSolution removes a solution.

func (*InMemoryBackend) DescribeBatchInferenceJob

func (b *InMemoryBackend) DescribeBatchInferenceJob(jobArn string) (*BatchInferenceJob, error)

DescribeBatchInferenceJob returns a batch inference job by ARN.

func (*InMemoryBackend) DescribeBatchSegmentJob

func (b *InMemoryBackend) DescribeBatchSegmentJob(jobArn string) (*BatchSegmentJob, error)

DescribeBatchSegmentJob returns a batch segment job by ARN.

func (*InMemoryBackend) DescribeCampaign

func (b *InMemoryBackend) DescribeCampaign(nameOrArn string) (*Campaign, error)

DescribeCampaign returns a campaign by name or ARN.

func (*InMemoryBackend) DescribeDataDeletionJob

func (b *InMemoryBackend) DescribeDataDeletionJob(jobArn string) (*DataDeletionJob, error)

DescribeDataDeletionJob returns a data deletion job by ARN.

func (*InMemoryBackend) DescribeDataset

func (b *InMemoryBackend) DescribeDataset(nameOrArn string) (*Dataset, error)

DescribeDataset returns a dataset by name or ARN.

func (*InMemoryBackend) DescribeDatasetExportJob

func (b *InMemoryBackend) DescribeDatasetExportJob(jobArn string) (*DatasetExportJob, error)

DescribeDatasetExportJob returns a dataset export job by ARN.

func (*InMemoryBackend) DescribeDatasetGroup

func (b *InMemoryBackend) DescribeDatasetGroup(nameOrArn string) (*DatasetGroup, error)

DescribeDatasetGroup returns a dataset group by name or ARN.

func (*InMemoryBackend) DescribeDatasetImportJob

func (b *InMemoryBackend) DescribeDatasetImportJob(jobArn string) (*DatasetImportJob, error)

DescribeDatasetImportJob returns a dataset import job by ARN.

func (*InMemoryBackend) DescribeEventTracker

func (b *InMemoryBackend) DescribeEventTracker(nameOrArn string) (*EventTracker, error)

DescribeEventTracker returns an event tracker by name or ARN.

func (*InMemoryBackend) DescribeFilter

func (b *InMemoryBackend) DescribeFilter(nameOrArn string) (*Filter, error)

DescribeFilter returns a filter by name or ARN.

func (*InMemoryBackend) DescribeMetricAttribution

func (b *InMemoryBackend) DescribeMetricAttribution(nameOrArn string) (*MetricAttribution, error)

DescribeMetricAttribution returns a metric attribution by name or ARN.

func (*InMemoryBackend) DescribeRecommender

func (b *InMemoryBackend) DescribeRecommender(nameOrArn string) (*Recommender, error)

DescribeRecommender returns a recommender by name or ARN.

func (*InMemoryBackend) DescribeSchema

func (b *InMemoryBackend) DescribeSchema(nameOrArn string) (*Schema, error)

DescribeSchema returns a schema by name or ARN.

func (*InMemoryBackend) DescribeSolution

func (b *InMemoryBackend) DescribeSolution(nameOrArn string) (*Solution, error)

DescribeSolution returns a solution by name or ARN.

func (*InMemoryBackend) DescribeSolutionVersion

func (b *InMemoryBackend) DescribeSolutionVersion(svArn string) (*SolutionVersion, error)

DescribeSolutionVersion returns a solution version by ARN.

func (*InMemoryBackend) GetFeatureTransformation

func (b *InMemoryBackend) GetFeatureTransformation(arnOrName string) (*storedFeatureTransformation, error)

GetFeatureTransformation looks up a feature transformation by ARN or name.

func (*InMemoryBackend) GetSolutionMetrics

func (b *InMemoryBackend) GetSolutionMetrics(svArn string) (map[string]any, error)

GetSolutionMetrics returns deterministic accuracy metrics for a solution version. Values are derived from the ARN hash so each solution version gets distinct (but stable) metrics.

func (*InMemoryBackend) LatestSolutionVersion added in v1.3.1

func (b *InMemoryBackend) LatestSolutionVersion(solutionArn string) *SolutionVersion

LatestSolutionVersion returns the most recently created solution version for solutionArn, or nil if none exist yet. Populates Solution.latestSolutionVersion (types.SolutionVersionSummary, types.go:2164) on DescribeSolution -- confirmed against deserializers.go:15334, which maps the "latestSolutionVersion" key to that summary type, not the full SolutionVersion.

func (*InMemoryBackend) ListBatchInferenceJobs

func (b *InMemoryBackend) ListBatchInferenceJobs(
	solutionVersionArn string,
	maxResults int,
	nextToken string,
) ([]*BatchInferenceJob, string)

ListBatchInferenceJobs returns batch inference jobs, optionally filtered by solution version ARN.

func (*InMemoryBackend) ListBatchSegmentJobs

func (b *InMemoryBackend) ListBatchSegmentJobs(
	solutionVersionArn string,
	maxResults int,
	nextToken string,
) ([]*BatchSegmentJob, string)

ListBatchSegmentJobs returns batch segment jobs, optionally filtered by solution version ARN.

func (*InMemoryBackend) ListCampaigns

func (b *InMemoryBackend) ListCampaigns(solutionArn string, maxResults int, nextToken string) ([]*Campaign, string)

ListCampaigns returns campaigns, optionally filtered by solution ARN.

func (*InMemoryBackend) ListDataDeletionJobs

func (b *InMemoryBackend) ListDataDeletionJobs(
	datasetGroupArn string,
	maxResults int,
	nextToken string,
) ([]*DataDeletionJob, string)

ListDataDeletionJobs returns data deletion jobs, optionally filtered by dataset group ARN.

func (*InMemoryBackend) ListDatasetExportJobs

func (b *InMemoryBackend) ListDatasetExportJobs(
	datasetArn string,
	maxResults int,
	nextToken string,
) ([]*DatasetExportJob, string)

ListDatasetExportJobs returns export jobs, optionally filtered by dataset ARN.

func (*InMemoryBackend) ListDatasetGroups

func (b *InMemoryBackend) ListDatasetGroups(maxResults int, nextToken string) ([]*DatasetGroup, string)

ListDatasetGroups returns all dataset groups.

func (*InMemoryBackend) ListDatasetImportJobs

func (b *InMemoryBackend) ListDatasetImportJobs(
	datasetArn string,
	maxResults int,
	nextToken string,
) ([]*DatasetImportJob, string)

ListDatasetImportJobs returns import jobs, optionally filtered by dataset ARN.

func (*InMemoryBackend) ListDatasets

func (b *InMemoryBackend) ListDatasets(datasetGroupArn string, maxResults int, nextToken string) ([]*Dataset, string)

ListDatasets returns datasets, optionally filtered by dataset group ARN.

func (*InMemoryBackend) ListEventTrackers

func (b *InMemoryBackend) ListEventTrackers(
	datasetGroupArn string,
	maxResults int,
	nextToken string,
) ([]*EventTracker, string)

ListEventTrackers returns event trackers, optionally filtered by dataset group ARN.

func (*InMemoryBackend) ListFilters

func (b *InMemoryBackend) ListFilters(datasetGroupArn string, maxResults int, nextToken string) ([]*Filter, string)

ListFilters returns filters, optionally filtered by dataset group ARN.

func (*InMemoryBackend) ListMetricAttributionMetrics

func (b *InMemoryBackend) ListMetricAttributionMetrics(
	metricAttributionArn string,
	maxResults int,
	nextToken string,
) ([]MetricAttribute, string, error)

ListMetricAttributionMetrics returns the metric attribution's own tracked metrics (as configured via CreateMetricAttribution/UpdateMetricAttribution) with pagination, rather than a fabricated static list.

func (*InMemoryBackend) ListMetricAttributions

func (b *InMemoryBackend) ListMetricAttributions(
	datasetGroupArn string,
	maxResults int,
	nextToken string,
) ([]*MetricAttribution, string)

ListMetricAttributions returns metric attributions, optionally filtered by dataset group ARN.

func (*InMemoryBackend) ListRecommenders

func (b *InMemoryBackend) ListRecommenders(
	datasetGroupArn string,
	maxResults int,
	nextToken string,
) ([]*Recommender, string)

ListRecommenders returns recommenders, optionally filtered by dataset group ARN.

func (*InMemoryBackend) ListSchemas

func (b *InMemoryBackend) ListSchemas(maxResults int, nextToken string) ([]*Schema, string)

ListSchemas returns all schemas.

func (*InMemoryBackend) ListSolutionVersions

func (b *InMemoryBackend) ListSolutionVersions(
	solutionArn string,
	maxResults int,
	nextToken string,
) ([]*SolutionVersion, string)

ListSolutionVersions returns solution versions for a given solution ARN.

func (*InMemoryBackend) ListSolutions

func (b *InMemoryBackend) ListSolutions(
	datasetGroupArn string,
	maxResults int,
	nextToken string,
) ([]*Solution, string)

ListSolutions returns solutions, optionally filtered by dataset group ARN.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(resourceArn string) (map[string]string, error)

ListTagsForResource returns tags for a resource.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the configured region.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory Personalize state for the /_gopherstack/reset test hook so suites start from a clean slate.

func (*InMemoryBackend) Restore

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

Restore deserializes state from JSON. It implements persistence.Persistable.

func (*InMemoryBackend) Snapshot

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

Snapshot serializes current state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartRecommender

func (b *InMemoryBackend) StartRecommender(recommenderArn string) (*Recommender, error)

StartRecommender transitions a recommender to ACTIVE.

func (*InMemoryBackend) StopRecommender

func (b *InMemoryBackend) StopRecommender(recommenderArn string) (*Recommender, error)

StopRecommender transitions a recommender to INACTIVE.

func (*InMemoryBackend) StopSolutionVersionCreation

func (b *InMemoryBackend) StopSolutionVersionCreation(svArn string) error

StopSolutionVersionCreation transitions a solution version to CREATE STOPPED.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceArn string, newTags map[string]string) error

TagResource adds tags to a resource identified by ARN.

func (*InMemoryBackend) TaggedResources added in v1.3.1

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every Personalize resource ARN that currently has at least one tag applied via TagResource.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceArn string, keys []string) error

UntagResource removes tags from a resource.

func (*InMemoryBackend) UpdateCampaign

func (b *InMemoryBackend) UpdateCampaign(
	nameOrArn, solutionVersionArn string,
	minProvisionedTPS int32,
	campaignConfig *CampaignConfig,
) (*Campaign, error)

UpdateCampaign updates a campaign's solution version, TPS, or config. Every successful call records a types.CampaignUpdateSummary-shaped snapshot on LatestCampaignUpdate -- the real API only populates that field once the campaign has had at least one update.

func (*InMemoryBackend) UpdateDataset

func (b *InMemoryBackend) UpdateDataset(nameOrArn, schemaArn string) (*Dataset, error)

UpdateDataset updates a dataset's schema.

func (*InMemoryBackend) UpdateMetricAttribution

func (b *InMemoryBackend) UpdateMetricAttribution(
	nameOrArn string,
	addMetrics []MetricAttribute,
	removeMetrics []string,
	metricsOutputConfig map[string]any,
) (*MetricAttribution, error)

UpdateMetricAttribution updates a metric attribution's tracked metrics and/or output config. The real UpdateMetricAttribution API has no single "metrics" replacement field -- it mutates the existing metric list via addMetrics/removeMetrics (by metricName), matching AddMetrics/RemoveMetrics on the request.

func (*InMemoryBackend) UpdateRecommender

func (b *InMemoryBackend) UpdateRecommender(
	nameOrArn string,
	minRPS int32,
	recommenderConfig *RecommenderConfig,
) (*Recommender, error)

UpdateRecommender updates a recommender's configuration. recommenderConfig is required on the real UpdateRecommenderInput; every successful call records a types.RecommenderUpdateSummary-shaped snapshot on LatestRecommenderUpdate, matching real AWS which only populates that field once the recommender has had at least one update.

func (*InMemoryBackend) UpdateSolution

func (b *InMemoryBackend) UpdateSolution(
	nameOrArn string,
	performAutoTraining, performIncrementalUpdate *bool,
) (*Solution, error)

UpdateSolution updates a solution's automatic-training configuration. The real UpdateSolution API only mutates performAutoTraining and performIncrementalUpdate (performAutoML/performHPO are immutable, creation-only fields) -- nil means "not specified in the request", leaving the current value untouched, matching the optional *bool request members.

func (*InMemoryBackend) ValidateCampaign

func (b *InMemoryBackend) ValidateCampaign(campaignArn string) error

ValidateCampaign returns nil if campaignArn resolves to an existing campaign.

func (*InMemoryBackend) ValidateCampaignOrRecommender

func (b *InMemoryBackend) ValidateCampaignOrRecommender(campaignArn, recommenderArn string) error

ValidateCampaignOrRecommender returns nil if either campaignArn or recommenderArn resolves to an existing resource. Returns ErrNotFound if neither exists.

type IntegerHyperParameterRange added in v1.3.1

type IntegerHyperParameterRange struct {
	Name     string `json:"name,omitempty"`
	MaxValue int32  `json:"maxValue,omitempty"`
	MinValue int32  `json:"minValue,omitempty"`
}

IntegerHyperParameterRange mirrors types.IntegerHyperParameterRange (types.go:1461).

type MetricAttribute

type MetricAttribute struct {
	EventType  string
	Expression string
	MetricName string
}

MetricAttribute describes a single tracked metric within a metric attribution: an event type and the expression (SUM()/SAMPLECOUNT()) used to compute it.

type MetricAttribution

type MetricAttribution struct {
	CreationDateTime     time.Time
	LastUpdatedDateTime  time.Time
	MetricsOutputConfig  map[string]any
	MetricAttributionArn string
	DatasetGroupArn      string
	Name                 string
	Status               string
	Metrics              []MetricAttribute
}

MetricAttribution stores an Amazon Personalize metric attribution.

type OptimizationObjective added in v1.3.1

type OptimizationObjective struct {
	ItemAttribute        string `json:"itemAttribute,omitempty"`
	ObjectiveSensitivity string `json:"objectiveSensitivity,omitempty"`
}

OptimizationObjective mirrors types.OptimizationObjective (types.go:1586).

type Provider

type Provider struct{}

Provider implements service.Provider for the Personalize service.

func (*Provider) Init

Init initializes the Personalize backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type Recommender

type Recommender struct {
	CreationDateTime                   time.Time
	LastUpdatedDateTime                time.Time
	RecommenderConfig                  *RecommenderConfig
	LatestRecommenderUpdate            map[string]any
	RecommenderArn                     string
	DatasetGroupArn                    string
	RecipeArn                          string
	Name                               string
	Status                             string
	MinRecommendationRequestsPerSecond int32
}

Recommender stores an Amazon Personalize recommender.

type RecommenderConfig added in v1.3.1

type RecommenderConfig struct {
	TrainingDataConfig                 *TrainingDataConfig `json:"trainingDataConfig,omitempty"`
	ItemExplorationConfig              map[string]string   `json:"itemExplorationConfig,omitempty"`
	EnableMetadataWithRecommendations  *bool               `json:"enableMetadataWithRecommendations,omitempty"`
	MinRecommendationRequestsPerSecond *int32              `json:"minRecommendationRequestsPerSecond,omitempty"`
}

RecommenderConfig mirrors types.RecommenderConfig (types.go:1728).

type Schema

type Schema struct {
	CreationDateTime    time.Time
	LastUpdatedDateTime time.Time
	SchemaArn           string
	Name                string
	Schema              string
	Domain              string
}

Schema stores an Amazon Personalize schema.

type Solution

type Solution struct {
	LastUpdatedDateTime      time.Time
	CreationDateTime         time.Time
	SolutionConfig           *SolutionConfig
	AutoMLResult             map[string]any
	LatestSolutionUpdate     map[string]any
	DatasetGroupArn          string
	EventType                string
	Status                   string
	RecipeArn                string
	Name                     string
	SolutionArn              string
	PerformAutoML            bool
	PerformHPO               bool
	PerformAutoTraining      bool
	PerformIncrementalUpdate bool
}

Solution stores an Amazon Personalize solution.

type SolutionConfig added in v1.3.1

type SolutionConfig struct {
	AutoMLConfig                    *AutoMLConfig          `json:"autoMLConfig,omitempty"`
	AutoTrainingConfig              *AutoTrainingConfig    `json:"autoTrainingConfig,omitempty"`
	EventsConfig                    *EventsConfig          `json:"eventsConfig,omitempty"`
	HpoConfig                       *HPOConfig             `json:"hpoConfig,omitempty"`
	OptimizationObjective           *OptimizationObjective `json:"optimizationObjective,omitempty"`
	TrainingDataConfig              *TrainingDataConfig    `json:"trainingDataConfig,omitempty"`
	AlgorithmHyperParameters        map[string]string      `json:"algorithmHyperParameters,omitempty"`
	FeatureTransformationParameters map[string]string      `json:"featureTransformationParameters,omitempty"`
	EventValueThreshold             string                 `json:"eventValueThreshold,omitempty"`
}

SolutionConfig mirrors aws-sdk-go-v2/service/personalize/types.SolutionConfig (types.go:1945).

type SolutionVersion

type SolutionVersion struct {
	CreationDateTime         time.Time
	LastUpdatedDateTime      time.Time
	SolutionConfig           *SolutionConfig
	SolutionVersionArn       string
	SolutionArn              string
	DatasetGroupArn          string
	EventType                string
	RecipeArn                string
	FailureReason            string
	Status                   string
	TrainingMode             string
	TrainingHours            float64
	PerformAutoML            bool
	PerformHPO               bool
	PerformIncrementalUpdate bool
}

SolutionVersion stores a trained Amazon Personalize solution version.

DatasetGroupArn/EventType/PerformAutoML/PerformHPO/PerformIncrementalUpdate/ RecipeArn are copied from the parent Solution at CreateSolutionVersion time (types.SolutionVersion, types.go:2074) -- a later UpdateSolution call must not retroactively change an already-created version's values, so these are snapshotted plain fields, not a live lookup through SolutionArn.

type TaggedEntry added in v1.3.1

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tags.

type TrainingDataConfig added in v1.3.1

type TrainingDataConfig struct {
	ExcludedDatasetColumns map[string][]string `json:"excludedDatasetColumns,omitempty"`
	IncludedDatasetColumns map[string][]string `json:"includedDatasetColumns,omitempty"`
}

TrainingDataConfig mirrors types.TrainingDataConfig (types.go:2232).

Jump to

Keyboard shortcuts

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