pinpoint

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 25 Imported by: 0

README

Pinpoint

Parity grade: A · SDK aws-sdk-go-v2/service/pinpoint@v1.39.19 · last audited 2026-07-12 (321bfb06)

Coverage

Metric Value
Operations audited 16 (7 ok, 8 partial, 1 gap)
Feature families 10 (10 ok)
Known gaps 3
Deferred items 3
Resource leaks clean
Known gaps
  • VoiceTemplateResponse missing LastModifiedDate/TemplateDescription/Version/VoiceId/DefaultSubstitutions/LanguageCode fields (CreateVoiceTemplate/GetVoiceTemplate/UpdateVoiceTemplate) — low traffic, deferred (file a bd issue before next pinpoint pass)
  • persistence.go's persistRegistry() intentionally excludes voiceTemplates, endpoints, eventStreams, channels, campaignVersions, segmentVersions, templateVersionHistory, campaignActivities, journeyRuns, appEvents, sentMessages, otpCodes, appSettings from snapshot/restore — a restart loses all endpoint/channel/voice-template/version-history state even with persistence enabled. This predates this pass (documented in persistence.go's own comments as a deliberate 'preserve existing behaviour' choice from the recent persistence-wiring commit), but it is a real parity gap per parity-principles.md rule 1 ("every routed SDK op must ... persist when persistence is enabled"). voiceTemplates/endpoints/eventStreams/channels are already store.Table-backed so wiring them into persistRegistry is mechanical; the map-shaped state (versions/activities/runs/events/counters) needs a DTO. Left out of this pass as a scope call — flagged for bd issue + dedicated follow-up rather than folded into an already-large bug-fix diff.
  • GetCampaignVersion/GetSegmentVersion (singular) silently fall back to the current resource when the requested version number isn't in history, instead of returning NotFoundException. Not fixed this pass (low confidence on whether this is intentional leniency vs a bug — flag for next auditor to weigh AWS-behavior evidence before changing).
Deferred
  • SMS channel PromotionalMessagesPerSecond/TransactionalMessagesPerSecond are response-only fields in the real SDK (not on SMSChannelRequest) but gopherstack accepts them from the request body; harmless (real clients never send them) but worth tightening for hygiene
  • GetApplicationDateRangeKpi/GetCampaignDateRangeKpi/GetJourneyDateRangeKpi always return an empty KpiResult.Rows — acceptable stub-shaped-but-real-state pattern (queries real backend, returns AWS-accurate empty analytics), not re-flagged
  • SendMessages has zero direct HTTP-level test coverage before this pass; added TestAudit6_SendMessages_ResponseEnvelope this pass but broader message-content assertions (per-channel-type SMS/EMAIL/push payload shape) are still untested

More

Documentation

Index

Constants

View Source
const (
	// ChannelTypeADM is the Amazon Device Messaging channel.
	ChannelTypeADM = "ADM"
	// ChannelTypeAPNS is the Apple Push Notification service channel.
	ChannelTypeAPNS = "APNS"
	// ChannelTypeAPNSSandbox is the APNS Sandbox channel.
	ChannelTypeAPNSSandbox = "APNS_SANDBOX"
	// ChannelTypeAPNSVoip is the APNS VoIP channel.
	ChannelTypeAPNSVoip = "APNS_VOIP"
	// ChannelTypeAPNSVoipSandbox is the APNS VoIP Sandbox channel.
	ChannelTypeAPNSVoipSandbox = "APNS_VOIP_SANDBOX"
	// ChannelTypeBaidu is the Baidu Cloud Push channel.
	ChannelTypeBaidu = "BAIDU"
	// ChannelTypeEmail is the Email channel.
	ChannelTypeEmail = "EMAIL"
	// ChannelTypeGCM is the Google Cloud Messaging / FCM channel.
	ChannelTypeGCM = "GCM"
	// ChannelTypeSMS is the SMS channel.
	ChannelTypeSMS = "SMS"
	// ChannelTypeVoice is the Voice channel.
	ChannelTypeVoice = "VOICE"
	// ChannelTypeInApp is the In-App channel.
	ChannelTypeInApp = "IN_APP"
	// ChannelTypeCustom is the Custom channel.
	ChannelTypeCustom = "CUSTOM"
	// ChannelTypePush is the generic push channel.
	ChannelTypePush = "PUSH"
)

Variables

View Source
var (
	// ErrAppNotFound is returned when a Pinpoint application is not found.
	ErrAppNotFound = awserr.New("NotFoundException: app not found", awserr.ErrNotFound)
	// ErrValidation is returned when request parameters fail validation.
	ErrValidation = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
	// ErrAlreadyExists is returned when a resource with the same key already exists.
	ErrAlreadyExists = awserr.New("ConflictException: resource already exists", awserr.ErrConflict)
	// ErrJourneyActive is returned when attempting to modify an ACTIVE journey's activities.
	ErrJourneyActive = awserr.New(
		"BadRequestException: journey is ACTIVE and cannot be modified",
		awserr.ErrInvalidParameter,
	)
)
View Source
var ErrNilAppContext = errors.New("pinpoint: nil AppContext")

ErrNilAppContext is returned when Init receives a nil AppContext.

Functions

func ARNIndexSize

func ARNIndexSize(b *InMemoryBackend) int

ARNIndexSize returns the number of entries in the ARN index.

func AppCount

func AppCount(b *InMemoryBackend) int

AppCount returns the number of applications in the backend.

func CampaignCount

func CampaignCount(b *InMemoryBackend) int

CampaignCount returns the number of campaigns in the backend.

func EmailTemplateCount

func EmailTemplateCount(b *InMemoryBackend) int

EmailTemplateCount returns the number of email templates in the backend.

func ExportJobCount

func ExportJobCount(b *InMemoryBackend) int

ExportJobCount returns the number of export jobs in the backend.

func HandlerOpsLen

func HandlerOpsLen(h *Handler) int

HandlerOpsLen returns the number of supported operations for the given handler.

func ImportJobCount

func ImportJobCount(b *InMemoryBackend) int

ImportJobCount returns the number of import jobs in the backend.

func InAppTemplateCount

func InAppTemplateCount(b *InMemoryBackend) int

InAppTemplateCount returns the number of in-app templates in the backend.

func JourneyCount

func JourneyCount(b *InMemoryBackend) int

JourneyCount returns the number of journeys in the backend.

func PushTemplateCount

func PushTemplateCount(b *InMemoryBackend) int

PushTemplateCount returns the number of push templates in the backend.

func RecommenderCount

func RecommenderCount(b *InMemoryBackend) int

RecommenderCount returns the number of recommender configurations in the backend.

func SegmentCount

func SegmentCount(b *InMemoryBackend) int

SegmentCount returns the number of segments in the backend.

func SmsTemplateCount

func SmsTemplateCount(b *InMemoryBackend) int

SmsTemplateCount returns the number of SMS templates in the backend.

Types

type App

type App struct {
	Tags         map[string]string `json:"tags,omitempty"`
	ARN          string            `json:"Arn"`
	ID           string            `json:"Id"`
	Name         string            `json:"Name"`
	CreationDate string            `json:"CreationDate,omitempty"`
}

App represents an Amazon Pinpoint application.

type Campaign

type Campaign struct {
	Tags                        map[string]string `json:"tags,omitempty"`
	MessageConfiguration        map[string]any    `json:"MessageConfiguration,omitempty"`
	Schedule                    map[string]any    `json:"Schedule,omitempty"`
	Hook                        map[string]any    `json:"Hook,omitempty"`
	Limits                      map[string]any    `json:"Limits,omitempty"`
	TemplateConfiguration       map[string]any    `json:"TemplateConfiguration,omitempty"`
	CustomDeliveryConfiguration map[string]any    `json:"CustomDeliveryConfiguration,omitempty"`
	ApplicationID               string            `json:"ApplicationId"`
	ARN                         string            `json:"Arn,omitempty"`
	ID                          string            `json:"Id"`
	Name                        string            `json:"Name"`
	SegmentID                   string            `json:"SegmentId,omitempty"`
	TreatmentDescription        string            `json:"TreatmentDescription,omitempty"`
	TreatmentName               string            `json:"TreatmentName,omitempty"`
	CreationDate                string            `json:"CreationDate,omitempty"`
	LastModifiedDate            string            `json:"LastModifiedDate,omitempty"`
	Status                      string            `json:"Status,omitempty"`
	AdditionalTreatments        []map[string]any  `json:"AdditionalTreatments,omitempty"`
	SegmentVersion              int               `json:"SegmentVersion,omitempty"`
	Version                     int               `json:"Version,omitempty"`
	Priority                    int               `json:"Priority,omitempty"`
	IsPaused                    bool              `json:"IsPaused,omitempty"`
}

Campaign represents a Pinpoint campaign.

type Channel

type Channel struct {
	ExtraData         map[string]any `json:"ExtraData,omitempty"`
	ApplicationID     string         `json:"ApplicationId"`
	ChannelType       string         `json:"ChannelType"`
	Platform          string         `json:"Platform,omitempty"`
	CreationDate      string         `json:"CreationDate,omitempty"`
	LastModifiedDate  string         `json:"LastModifiedDate,omitempty"`
	Version           int            `json:"Version,omitempty"`
	MessagesPerSecond int            `json:"MessagesPerSecond,omitempty"`
	Enabled           bool           `json:"Enabled"`
	IsArchived        bool           `json:"IsArchived"`
	HasCredential     bool           `json:"HasCredential,omitempty"`
	HasTokenKey       bool           `json:"HasTokenKey,omitempty"`
}

Channel represents a generic Pinpoint channel response.

type EmailTemplate

type EmailTemplate struct {
	ARN                  string            `json:"Arn,omitempty"`
	CreationDate         string            `json:"CreationDate,omitempty"`
	DefaultSubstitutions map[string]any    `json:"DefaultSubstitutions,omitempty"`
	HTMLPart             string            `json:"HtmlPart,omitempty"`
	LastModifiedDate     string            `json:"LastModifiedDate,omitempty"`
	RecommenderID        string            `json:"RecommenderId,omitempty"`
	Subject              string            `json:"Subject,omitempty"`
	Tags                 map[string]string `json:"tags,omitempty"`
	TemplateDescription  string            `json:"TemplateDescription,omitempty"`
	TemplateName         string            `json:"TemplateName"`
	TextPart             string            `json:"TextPart,omitempty"`
	Version              string            `json:"Version,omitempty"`
}

EmailTemplate represents a Pinpoint email template.

type Endpoint

type Endpoint struct {
	Attributes     map[string][]string `json:"Attributes,omitempty"`
	UserAttributes map[string][]string `json:"UserAttributes,omitempty"`
	Metrics        map[string]float64  `json:"Metrics,omitempty"`
	Demographic    map[string]any      `json:"Demographic,omitempty"`
	Location       map[string]any      `json:"Location,omitempty"`
	ApplicationID  string              `json:"ApplicationId"`
	ID             string              `json:"Id"`
	ChannelType    string              `json:"ChannelType,omitempty"`
	Address        string              `json:"Address,omitempty"`
	UserID         string              `json:"UserId,omitempty"`
	EffectiveDate  string              `json:"EffectiveDate,omitempty"`
	CreationDate   string              `json:"CreationDate,omitempty"`
	EndpointStatus string              `json:"EndpointStatus,omitempty"`
	OptOut         string              `json:"OptOut,omitempty"`
	RequestID      string              `json:"RequestId,omitempty"`
}

Endpoint represents a Pinpoint endpoint.

type EventStream

type EventStream struct {
	ApplicationID        string `json:"ApplicationId"`
	DestinationStreamArn string `json:"DestinationStreamArn"`
	RoleArn              string `json:"RoleArn"`
	LastModifiedDate     string `json:"LastModifiedDate,omitempty"`
}

EventStream represents a Pinpoint event stream.

type ExportJob

type ExportJob struct {
	ARN           string `json:"Arn,omitempty"`
	ApplicationID string `json:"ApplicationId"`
	ID            string `json:"Id"`
	RoleArn       string `json:"RoleArn,omitempty"`
	S3UrlPrefix   string `json:"S3UrlPrefix,omitempty"`
	JobStatus     string `json:"JobStatus"`
	CreationDate  string `json:"CreationDate,omitempty"`
}

ExportJob represents a Pinpoint export job.

type ExportedApp

type ExportedApp = App

ExportedApp is a compatibility alias used by the dashboard package.

type ExportedCreateAppRequest

type ExportedCreateAppRequest = createAppRequest

ExportedCreateAppRequest aliases createAppRequest for testing.

type ExportedCreateCampaignRequest

type ExportedCreateCampaignRequest = createCampaignRequest

ExportedCreateCampaignRequest aliases createCampaignRequest for testing/seeding.

type ExportedCreateEmailTemplateRequest

type ExportedCreateEmailTemplateRequest = createEmailTemplateRequest

ExportedCreateEmailTemplateRequest aliases createEmailTemplateRequest for testing/seeding.

type ExportedCreateExportJobRequest

type ExportedCreateExportJobRequest = createExportJobRequest

ExportedCreateExportJobRequest aliases createExportJobRequest for testing/seeding.

type ExportedCreateImportJobRequest

type ExportedCreateImportJobRequest = createImportJobRequest

ExportedCreateImportJobRequest aliases createImportJobRequest for testing/seeding.

type ExportedCreateInAppTemplateRequest

type ExportedCreateInAppTemplateRequest = createInAppTemplateRequest

ExportedCreateInAppTemplateRequest aliases createInAppTemplateRequest for testing/seeding.

type ExportedCreateJourneyRequest

type ExportedCreateJourneyRequest = createJourneyRequest

ExportedCreateJourneyRequest aliases createJourneyRequest for testing/seeding.

type ExportedCreatePushTemplateRequest

type ExportedCreatePushTemplateRequest = createPushTemplateRequest

ExportedCreatePushTemplateRequest aliases createPushTemplateRequest for testing/seeding.

type ExportedCreateRecommenderConfigRequest

type ExportedCreateRecommenderConfigRequest = createRecommenderConfigRequest

ExportedCreateRecommenderConfigRequest aliases createRecommenderConfigRequest for testing/seeding.

type ExportedCreateSegmentRequest

type ExportedCreateSegmentRequest = createSegmentRequest

ExportedCreateSegmentRequest aliases createSegmentRequest for testing/seeding.

type ExportedCreateSmsTemplateRequest

type ExportedCreateSmsTemplateRequest = createSmsTemplateRequest

ExportedCreateSmsTemplateRequest aliases createSmsTemplateRequest for testing/seeding.

type Handler

type Handler struct {
	Backend       StorageBackend
	AccountID     string
	DefaultRegion string
}

Handler is the HTTP handler for the Amazon Pinpoint REST API.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Pinpoint handler.

func (*Handler) ChaosOperations

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

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

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

ChaosRegions returns all regions this handler handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

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

ExtractOperation extracts the operation name from the request path and method.

func (*Handler) ExtractResource

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

ExtractResource extracts the app ID or decoded ARN from the request path.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported Pinpoint operations.

func (*Handler) Handler

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

Handler returns the echo.HandlerFunc for this service.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears the handler's backend state (used for test isolation).

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 returns a function that matches Pinpoint API requests.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(c *echo.Context) error

ServeHTTP dispatches Pinpoint API requests.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

h.Backend is the StorageBackend interface, which already declares Snapshot(ctx context.Context) []byte (see interfaces.go) with a shape matching persistence.Persistable exactly, so this can call it directly -- no local type assertion needed. But interface membership alone does not help: h.Backend is a named field, not an embedded one, so InMemoryBackend's methods are never promoted onto *Handler. Without this delegation, cli.go's setupPersistence type-asserts the registered service.Registerable (this *Handler) against persistence.Persistable, fails silently, and never registers pinpoint for snapshot/restore despite the backend being fully capable. Mirrors services/securityhub's Handler-level delegation.

type ImportJob

type ImportJob struct {
	ARN           string `json:"Arn,omitempty"`
	ApplicationID string `json:"ApplicationId"`
	ID            string `json:"Id"`
	RoleArn       string `json:"RoleArn,omitempty"`
	S3Url         string `json:"S3Url,omitempty"`
	Format        string `json:"Format,omitempty"`
	JobStatus     string `json:"JobStatus"`
	SegmentID     string `json:"SegmentId,omitempty"`
	CreationDate  string `json:"CreationDate,omitempty"`
}

ImportJob represents a Pinpoint import job.

type InAppTemplate

type InAppTemplate struct {
	Tags                map[string]string `json:"tags,omitempty"`
	ARN                 string            `json:"Arn,omitempty"`
	CreationDate        string            `json:"CreationDate,omitempty"`
	LastModifiedDate    string            `json:"LastModifiedDate,omitempty"`
	Layout              string            `json:"Layout,omitempty"`
	TemplateDescription string            `json:"TemplateDescription,omitempty"`
	TemplateName        string            `json:"TemplateName"`
	Version             string            `json:"Version,omitempty"`
	Content             []map[string]any  `json:"Content,omitempty"`
}

InAppTemplate represents a Pinpoint in-app template.

type InMemoryBackend

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

InMemoryBackend is the in-memory implementation of StorageBackend.

func NewInMemoryBackend

func NewInMemoryBackend(region, accountID string) *InMemoryBackend

NewInMemoryBackend creates a new Pinpoint in-memory backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the configured AWS account ID.

func (*InMemoryBackend) AddAppInternal

func (b *InMemoryBackend) AddAppInternal(app *App)

AddAppInternal seeds an application directly without going through the HTTP layer.

func (*InMemoryBackend) AddCampaignInternal

func (b *InMemoryBackend) AddCampaignInternal(c *Campaign)

AddCampaignInternal seeds a campaign directly without going through the HTTP layer.

func (*InMemoryBackend) AddJourneyInternal

func (b *InMemoryBackend) AddJourneyInternal(j *Journey)

AddJourneyInternal seeds a journey directly without going through the HTTP layer.

func (*InMemoryBackend) AddSegmentInternal

func (b *InMemoryBackend) AddSegmentInternal(s *Segment)

AddSegmentInternal seeds a segment directly without going through the HTTP layer.

func (*InMemoryBackend) CreateApp

func (b *InMemoryBackend) CreateApp(region, accountID, name string, tags map[string]string) (*App, error)

CreateApp creates a new Pinpoint application.

func (*InMemoryBackend) CreateCampaign

func (b *InMemoryBackend) CreateCampaign(
	region, accountID, appID string,
	req createCampaignRequest,
) (*Campaign, error)

CreateCampaign creates a new Pinpoint campaign for an application.

func (*InMemoryBackend) CreateEmailTemplate

func (b *InMemoryBackend) CreateEmailTemplate(
	region, accountID, templateName string,
	req createEmailTemplateRequest,
) (*EmailTemplate, error)

CreateEmailTemplate creates a new Pinpoint email template.

func (*InMemoryBackend) CreateExportJob

func (b *InMemoryBackend) CreateExportJob(
	region, accountID, appID string,
	req createExportJobRequest,
) (*ExportJob, error)

CreateExportJob creates a new Pinpoint export job for an application.

func (*InMemoryBackend) CreateImportJob

func (b *InMemoryBackend) CreateImportJob(
	region, accountID, appID string,
	req createImportJobRequest,
) (*ImportJob, error)

CreateImportJob creates a new Pinpoint import job for an application. It also materialises an associated IMPORT-type Segment so that callers can reference the segment by ID after the job completes (AWS behaviour).

func (*InMemoryBackend) CreateInAppTemplate

func (b *InMemoryBackend) CreateInAppTemplate(
	region, accountID, templateName string,
	req createInAppTemplateRequest,
) (*InAppTemplate, error)

CreateInAppTemplate creates a new Pinpoint in-app template.

func (*InMemoryBackend) CreateJourney

func (b *InMemoryBackend) CreateJourney(region, accountID, appID string, req createJourneyRequest) (*Journey, error)

CreateJourney creates a new Pinpoint journey for an application.

func (*InMemoryBackend) CreatePushTemplate

func (b *InMemoryBackend) CreatePushTemplate(
	region, accountID, templateName string,
	req createPushTemplateRequest,
) (*PushTemplate, error)

CreatePushTemplate creates a new Pinpoint push notification template.

func (*InMemoryBackend) CreateRecommenderConfiguration

func (b *InMemoryBackend) CreateRecommenderConfiguration(
	req createRecommenderConfigRequest,
) (*RecommenderConfiguration, error)

CreateRecommenderConfiguration creates a new Pinpoint recommender configuration.

func (*InMemoryBackend) CreateSegment

func (b *InMemoryBackend) CreateSegment(region, accountID, appID string, req createSegmentRequest) (*Segment, error)

CreateSegment creates a new Pinpoint segment for an application.

func (*InMemoryBackend) CreateSmsTemplate

func (b *InMemoryBackend) CreateSmsTemplate(
	region, accountID, templateName string,
	req createSmsTemplateRequest,
) (*SmsTemplate, error)

CreateSmsTemplate creates a new Pinpoint SMS template.

func (*InMemoryBackend) CreateVoiceTemplate

func (b *InMemoryBackend) CreateVoiceTemplate(
	region, accountID, templateName string,
	req createVoiceTemplateRequest,
) (*VoiceTemplate, error)

CreateVoiceTemplate creates a new Pinpoint voice template.

func (*InMemoryBackend) DeleteApp

func (b *InMemoryBackend) DeleteApp(appID string) (*App, error)

DeleteApp deletes a Pinpoint application by ID.

func (*InMemoryBackend) DeleteCampaign

func (b *InMemoryBackend) DeleteCampaign(appID, campaignID string) (*Campaign, error)

DeleteCampaign deletes a Pinpoint campaign.

func (*InMemoryBackend) DeleteChannel

func (b *InMemoryBackend) DeleteChannel(appID, channelType string) *Channel

DeleteChannel removes a channel for an app.

func (*InMemoryBackend) DeleteEmailTemplate

func (b *InMemoryBackend) DeleteEmailTemplate(templateName string) (*EmailTemplate, error)

DeleteEmailTemplate deletes an email template by name.

func (*InMemoryBackend) DeleteEndpoint

func (b *InMemoryBackend) DeleteEndpoint(appID, endpointID string) (*Endpoint, error)

DeleteEndpoint deletes a Pinpoint endpoint.

func (*InMemoryBackend) DeleteEventStream

func (b *InMemoryBackend) DeleteEventStream(appID string) (*EventStream, error)

DeleteEventStream deletes the event stream for an application.

func (*InMemoryBackend) DeleteInAppTemplate

func (b *InMemoryBackend) DeleteInAppTemplate(templateName string) (*InAppTemplate, error)

DeleteInAppTemplate deletes an in-app template by name.

func (*InMemoryBackend) DeleteJourney

func (b *InMemoryBackend) DeleteJourney(appID, journeyID string) (*Journey, error)

DeleteJourney deletes a Pinpoint journey.

func (*InMemoryBackend) DeletePushTemplate

func (b *InMemoryBackend) DeletePushTemplate(templateName string) (*PushTemplate, error)

DeletePushTemplate deletes a push notification template by name.

func (*InMemoryBackend) DeleteRecommenderConfiguration

func (b *InMemoryBackend) DeleteRecommenderConfiguration(
	recommenderID string,
) (*RecommenderConfiguration, error)

DeleteRecommenderConfiguration deletes a recommender by ID.

func (*InMemoryBackend) DeleteSegment

func (b *InMemoryBackend) DeleteSegment(appID, segmentID string) (*Segment, error)

DeleteSegment deletes a Pinpoint segment.

func (*InMemoryBackend) DeleteSmsTemplate

func (b *InMemoryBackend) DeleteSmsTemplate(templateName string) (*SmsTemplate, error)

DeleteSmsTemplate deletes an SMS template by name.

func (*InMemoryBackend) DeleteUserEndpoints

func (b *InMemoryBackend) DeleteUserEndpoints(appID, userID string) error

DeleteUserEndpoints deletes all endpoints for a user in an application.

func (*InMemoryBackend) DeleteVoiceTemplate

func (b *InMemoryBackend) DeleteVoiceTemplate(templateName string) (*VoiceTemplate, error)

DeleteVoiceTemplate deletes a Pinpoint voice template by name.

func (*InMemoryBackend) GetAllChannels

func (b *InMemoryBackend) GetAllChannels(appID string) map[string]*Channel

GetAllChannels returns all channels for an app.

func (*InMemoryBackend) GetApp

func (b *InMemoryBackend) GetApp(appID string) (*App, error)

GetApp retrieves a Pinpoint application by ID.

func (*InMemoryBackend) GetApplicationDateRangeKpi

func (b *InMemoryBackend) GetApplicationDateRangeKpi(appID, kpiName string) (*kpiResult, error)

GetApplicationDateRangeKpi returns stub KPI data for an application.

func (*InMemoryBackend) GetApplicationSettings

func (b *InMemoryBackend) GetApplicationSettings(appID string) (*storedAppSettings, error)

GetApplicationSettings retrieves the settings for a Pinpoint application.

func (*InMemoryBackend) GetApps

func (b *InMemoryBackend) GetApps() ([]*App, error)

GetApps returns all Pinpoint applications sorted by name.

func (*InMemoryBackend) GetCampaign

func (b *InMemoryBackend) GetCampaign(appID, campaignID string) (*Campaign, error)

GetCampaign retrieves a Pinpoint campaign by appID and campaignID.

func (*InMemoryBackend) GetCampaignActivities

func (b *InMemoryBackend) GetCampaignActivities(
	appID, campaignID string,
) (*campaignActivitiesResponse, error)

GetCampaignActivities returns campaign activities.

func (*InMemoryBackend) GetCampaignDateRangeKpi

func (b *InMemoryBackend) GetCampaignDateRangeKpi(
	appID, campaignID, kpiName string,
) (*kpiResult, error)

GetCampaignDateRangeKpi returns stub KPI data for a campaign.

func (*InMemoryBackend) GetCampaignVersion

func (b *InMemoryBackend) GetCampaignVersion(
	appID, campaignID string,
	version int,
) (*Campaign, error)

GetCampaignVersion returns a specific campaign version.

func (*InMemoryBackend) GetCampaignVersions

func (b *InMemoryBackend) GetCampaignVersions(appID, campaignID string) ([]*Campaign, error)

GetCampaignVersions returns all stored versions of a campaign.

func (*InMemoryBackend) GetCampaigns

func (b *InMemoryBackend) GetCampaigns(appID string) ([]*Campaign, error)

GetCampaigns returns all campaigns for an application.

func (*InMemoryBackend) GetChannel

func (b *InMemoryBackend) GetChannel(appID, channelType string) *Channel

GetChannel retrieves or synthesises a channel response for an app.

func (*InMemoryBackend) GetEmailTemplate

func (b *InMemoryBackend) GetEmailTemplate(templateName string) (*EmailTemplate, error)

GetEmailTemplate retrieves an email template by name.

func (*InMemoryBackend) GetEndpoint

func (b *InMemoryBackend) GetEndpoint(appID, endpointID string) (*Endpoint, error)

GetEndpoint retrieves a Pinpoint endpoint by appID and endpointID.

func (*InMemoryBackend) GetEventStream

func (b *InMemoryBackend) GetEventStream(appID string) (*EventStream, error)

GetEventStream retrieves the event stream for an application.

func (*InMemoryBackend) GetExportJob

func (b *InMemoryBackend) GetExportJob(appID, jobID string) (*ExportJob, error)

GetExportJob retrieves an export job by ID.

func (*InMemoryBackend) GetExportJobs

func (b *InMemoryBackend) GetExportJobs(appID string) ([]*ExportJob, error)

GetExportJobs returns all export jobs for an app.

func (*InMemoryBackend) GetImportJob

func (b *InMemoryBackend) GetImportJob(appID, jobID string) (*ImportJob, error)

GetImportJob retrieves an import job by ID.

func (*InMemoryBackend) GetImportJobs

func (b *InMemoryBackend) GetImportJobs(appID string) ([]*ImportJob, error)

GetImportJobs returns all import jobs for an app.

func (*InMemoryBackend) GetInAppMessages

func (b *InMemoryBackend) GetInAppMessages(appID, _ string) (*inAppMessagesResponse, error)

GetInAppMessages returns in-app messages for an endpoint.

func (*InMemoryBackend) GetInAppTemplate

func (b *InMemoryBackend) GetInAppTemplate(templateName string) (*InAppTemplate, error)

GetInAppTemplate retrieves an in-app template by name.

func (*InMemoryBackend) GetJourney

func (b *InMemoryBackend) GetJourney(appID, journeyID string) (*Journey, error)

GetJourney retrieves a Pinpoint journey by appID and journeyID.

func (*InMemoryBackend) GetJourneyDateRangeKpi

func (b *InMemoryBackend) GetJourneyDateRangeKpi(
	appID, journeyID, kpiName string,
) (*kpiResult, error)

GetJourneyDateRangeKpi returns stub KPI data for a journey.

func (*InMemoryBackend) GetJourneyExecutionActivityMetrics

func (b *InMemoryBackend) GetJourneyExecutionActivityMetrics(
	appID, journeyID, activityID string,
) (*journeyExecutionActivityMetricsResponse, error)

GetJourneyExecutionActivityMetrics returns journey activity metrics.

func (*InMemoryBackend) GetJourneyExecutionMetrics

func (b *InMemoryBackend) GetJourneyExecutionMetrics(
	appID, journeyID string,
) (*journeyExecutionMetricsResponse, error)

GetJourneyExecutionMetrics returns journey execution metrics.

func (*InMemoryBackend) GetJourneyRunExecutionActivityMetrics

func (b *InMemoryBackend) GetJourneyRunExecutionActivityMetrics(
	appID, journeyID, runID, activityID string,
) (*journeyRunExecutionActivityMetricsResponse, error)

GetJourneyRunExecutionActivityMetrics returns metrics for a specific journey run activity.

func (*InMemoryBackend) GetJourneyRunExecutionMetrics

func (b *InMemoryBackend) GetJourneyRunExecutionMetrics(
	appID, journeyID, runID string,
) (*journeyRunExecutionMetricsResponse, error)

GetJourneyRunExecutionMetrics returns metrics for a specific journey run.

func (*InMemoryBackend) GetJourneyRuns

func (b *InMemoryBackend) GetJourneyRuns(appID, journeyID string) (*journeyRunsResponse, error)

GetJourneyRuns returns journey runs.

func (*InMemoryBackend) GetJourneys

func (b *InMemoryBackend) GetJourneys(appID string) ([]*Journey, error)

GetJourneys returns all journeys for an application.

func (*InMemoryBackend) GetPushTemplate

func (b *InMemoryBackend) GetPushTemplate(templateName string) (*PushTemplate, error)

GetPushTemplate retrieves a push notification template by name.

func (*InMemoryBackend) GetRecommenderConfiguration

func (b *InMemoryBackend) GetRecommenderConfiguration(
	recommenderID string,
) (*RecommenderConfiguration, error)

GetRecommenderConfiguration retrieves a recommender by ID.

func (*InMemoryBackend) GetRecommenderConfigurations

func (b *InMemoryBackend) GetRecommenderConfigurations() ([]*RecommenderConfiguration, error)

GetRecommenderConfigurations returns all recommender configurations.

func (*InMemoryBackend) GetSegment

func (b *InMemoryBackend) GetSegment(appID, segmentID string) (*Segment, error)

GetSegment retrieves a Pinpoint segment by appID and segmentID.

func (*InMemoryBackend) GetSegmentExportJobs

func (b *InMemoryBackend) GetSegmentExportJobs(appID, _ string) ([]*ExportJob, error)

GetSegmentExportJobs returns all export jobs for a segment.

func (*InMemoryBackend) GetSegmentImportJobs

func (b *InMemoryBackend) GetSegmentImportJobs(appID, segmentID string) ([]*ImportJob, error)

GetSegmentImportJobs returns import jobs associated with a specific segment.

func (*InMemoryBackend) GetSegmentVersion

func (b *InMemoryBackend) GetSegmentVersion(
	appID, segmentID string,
	version int,
) (*Segment, error)

GetSegmentVersion returns a specific segment version.

func (*InMemoryBackend) GetSegmentVersions

func (b *InMemoryBackend) GetSegmentVersions(appID, segmentID string) ([]*Segment, error)

GetSegmentVersions returns all stored versions of a segment.

func (*InMemoryBackend) GetSegments

func (b *InMemoryBackend) GetSegments(appID string) ([]*Segment, error)

GetSegments returns all segments for an application.

func (*InMemoryBackend) GetSmsTemplate

func (b *InMemoryBackend) GetSmsTemplate(templateName string) (*SmsTemplate, error)

GetSmsTemplate retrieves an SMS template by name.

func (*InMemoryBackend) GetUserEndpoints

func (b *InMemoryBackend) GetUserEndpoints(appID, userID string) ([]*Endpoint, error)

GetUserEndpoints retrieves all endpoints for a user in an application.

func (*InMemoryBackend) GetVoiceTemplate

func (b *InMemoryBackend) GetVoiceTemplate(templateName string) (*VoiceTemplate, error)

GetVoiceTemplate retrieves a Pinpoint voice template by name.

func (*InMemoryBackend) ListTagsForResource

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

ListTagsForResource returns all tags for a resource identified by ARN.

func (*InMemoryBackend) ListTemplateVersions

func (b *InMemoryBackend) ListTemplateVersions(
	templateName, templateType string,
) ([]*templateVersionItem, error)

ListTemplateVersions returns stored version history for a template.

func (*InMemoryBackend) ListTemplates

func (b *InMemoryBackend) ListTemplates() ([]*templateListItem, error)

ListTemplates returns all templates sorted by name.

func (*InMemoryBackend) PhoneNumberValidate

func (b *InMemoryBackend) PhoneNumberValidate(
	phoneNumber string,
) (*phoneNumberValidateResponse, error)

PhoneNumberValidate validates a phone number and returns a cleaned E164 response.

func (*InMemoryBackend) PutEventStream

func (b *InMemoryBackend) PutEventStream(
	appID string,
	req putEventStreamRequest,
) (*EventStream, error)

PutEventStream creates or updates the event stream for an application.

func (*InMemoryBackend) PutEvents

func (b *InMemoryBackend) PutEvents(appID string, req putEventsRequest) (*eventsResponse, error)

PutEvents records events for an application and returns per-endpoint per-event results.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the configured AWS region.

func (*InMemoryBackend) RemoveAttributes

func (b *InMemoryBackend) RemoveAttributes(
	appID, attributeType string, blacklist []string,
) (*attributesResource, error)

RemoveAttributes removes the attributes named in blacklist, of the given attributeType category, from every endpoint in the application. It returns the updated attributesResource echoing back what was removed.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored state and returns the backend to a pristine state.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a JSON snapshot.

func (*InMemoryBackend) SendMessages

func (b *InMemoryBackend) SendMessages(
	appID string,
	req sendMessagesRequest,
) (*messageResponse, error)

SendMessages sends messages and tracks send count.

func (*InMemoryBackend) SendOTPMessage

func (b *InMemoryBackend) SendOTPMessage(appID string) (*sendOTPMessageResponse, error)

SendOTPMessage sends an OTP message and stores the generated code.

func (*InMemoryBackend) SendUsersMessages

func (b *InMemoryBackend) SendUsersMessages(
	appID string,
	req sendUsersMessagesRequest,
) (*usersMessageResponse, error)

SendUsersMessages sends messages to users, returning per-endpoint results keyed by userID.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error

TagResource adds or updates tags on a resource identified by ARN.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error

UntagResource removes tags from a resource identified by ARN.

func (*InMemoryBackend) UpdateApplicationSettings

func (b *InMemoryBackend) UpdateApplicationSettings(
	appID string,
	settings *storedAppSettings,
) (*storedAppSettings, error)

UpdateApplicationSettings updates the settings for a Pinpoint application.

func (*InMemoryBackend) UpdateCampaign

func (b *InMemoryBackend) UpdateCampaign(
	appID, campaignID string,
	req updateCampaignRequest,
) (*Campaign, error)

UpdateCampaign updates an existing Pinpoint campaign.

func (*InMemoryBackend) UpdateEmailTemplate

func (b *InMemoryBackend) UpdateEmailTemplate(
	templateName string,
	req createEmailTemplateRequest,
) (*EmailTemplate, error)

UpdateEmailTemplate updates an existing email template.

func (*InMemoryBackend) UpdateEndpoint

func (b *InMemoryBackend) UpdateEndpoint(
	appID, endpointID string,
	req updateEndpointRequest,
) (*Endpoint, error)

UpdateEndpoint creates or updates a Pinpoint endpoint.

func (*InMemoryBackend) UpdateEndpointsBatch

func (b *InMemoryBackend) UpdateEndpointsBatch(
	appID string,
	endpoints map[string]updateEndpointRequest,
) error

UpdateEndpointsBatch updates multiple endpoints in a single call.

func (*InMemoryBackend) UpdateInAppTemplate

func (b *InMemoryBackend) UpdateInAppTemplate(
	templateName string,
	req createInAppTemplateRequest,
) (*InAppTemplate, error)

UpdateInAppTemplate updates an existing in-app template.

func (*InMemoryBackend) UpdateJourney

func (b *InMemoryBackend) UpdateJourney(
	appID, journeyID string,
	req updateJourneyRequest,
) (*Journey, error)

UpdateJourney updates an existing Pinpoint journey.

func (*InMemoryBackend) UpdateJourneyState

func (b *InMemoryBackend) UpdateJourneyState(appID, journeyID, state string) (*Journey, error)

UpdateJourneyState updates the state of a Pinpoint journey.

func (*InMemoryBackend) UpdatePushTemplate

func (b *InMemoryBackend) UpdatePushTemplate(
	templateName string,
	req createPushTemplateRequest,
) (*PushTemplate, error)

UpdatePushTemplate updates an existing push notification template.

func (*InMemoryBackend) UpdateRecommenderConfiguration

func (b *InMemoryBackend) UpdateRecommenderConfiguration(
	recommenderID string,
	req createRecommenderConfigRequest,
) (*RecommenderConfiguration, error)

UpdateRecommenderConfiguration updates an existing recommender.

func (*InMemoryBackend) UpdateSegment

func (b *InMemoryBackend) UpdateSegment(
	appID, segmentID string,
	req updateSegmentRequest,
) (*Segment, error)

UpdateSegment updates an existing Pinpoint segment.

func (*InMemoryBackend) UpdateSmsTemplate

func (b *InMemoryBackend) UpdateSmsTemplate(
	templateName string,
	req createSmsTemplateRequest,
) (*SmsTemplate, error)

UpdateSmsTemplate updates an existing SMS template.

func (*InMemoryBackend) UpdateTemplateActiveVersion

func (b *InMemoryBackend) UpdateTemplateActiveVersion(templateName, templateType string) error

UpdateTemplateActiveVersion updates the active version to the latest for the given template.

func (*InMemoryBackend) UpdateVoiceTemplate

func (b *InMemoryBackend) UpdateVoiceTemplate(
	templateName string,
	req createVoiceTemplateRequest,
) (*VoiceTemplate, error)

UpdateVoiceTemplate updates an existing Pinpoint voice template.

func (*InMemoryBackend) UpsertChannel

func (b *InMemoryBackend) UpsertChannel(
	appID, channelType string,
	enabled bool,
	extra map[string]any,
) *Channel

UpsertChannel creates or updates a channel for an app with type-specific data.

func (*InMemoryBackend) VerifyOTPMessage

func (b *InMemoryBackend) VerifyOTPMessage(appID, code string) (*verifyOTPMessageResponse, error)

VerifyOTPMessage verifies an OTP code for the given app. If code is non-empty it must match the stored code exactly. If code is empty it falls back to checking whether any OTP was ever sent.

type Journey

type Journey struct {
	Tags                   map[string]string         `json:"tags,omitempty"`
	Activities             map[string]map[string]any `json:"Activities,omitempty"`
	StartCondition         map[string]any            `json:"StartCondition,omitempty"`
	Schedule               map[string]any            `json:"Schedule,omitempty"`
	Limits                 map[string]any            `json:"Limits,omitempty"`
	QuietTime              map[string]any            `json:"QuietTime,omitempty"`
	OpenHours              map[string]any            `json:"OpenHours,omitempty"`
	ClosedDays             map[string]any            `json:"ClosedDays,omitempty"`
	ApplicationID          string                    `json:"ApplicationId"`
	ARN                    string                    `json:"Arn,omitempty"`
	ID                     string                    `json:"Id"`
	Name                   string                    `json:"Name"`
	StartActivity          string                    `json:"StartActivity,omitempty"`
	RefreshFrequency       string                    `json:"RefreshFrequency,omitempty"`
	CreationDate           string                    `json:"CreationDate,omitempty"`
	LastModifiedDate       string                    `json:"LastModifiedDate,omitempty"`
	State                  string                    `json:"State"`
	LocalTime              bool                      `json:"LocalTime,omitempty"`
	WaitForQuietTime       bool                      `json:"WaitForQuietTime,omitempty"`
	RefreshOnSegmentUpdate bool                      `json:"RefreshOnSegmentUpdate,omitempty"`
}

Journey represents a Pinpoint journey.

type Provider

type Provider struct{}

Provider implements service.Provider for the Pinpoint service.

func (*Provider) Init

Init initializes the Pinpoint service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type PushTemplate

type PushTemplate struct {
	APNS                map[string]any    `json:"APNS,omitempty"`
	Default             map[string]any    `json:"Default,omitempty"`
	GCM                 map[string]any    `json:"GCM,omitempty"`
	Tags                map[string]string `json:"tags,omitempty"`
	ARN                 string            `json:"Arn,omitempty"`
	Body                string            `json:"Body,omitempty"`
	CreationDate        string            `json:"CreationDate,omitempty"`
	LastModifiedDate    string            `json:"LastModifiedDate,omitempty"`
	TemplateDescription string            `json:"TemplateDescription,omitempty"`
	TemplateName        string            `json:"TemplateName"`
	Title               string            `json:"Title,omitempty"`
	Version             string            `json:"Version,omitempty"`
}

PushTemplate represents a Pinpoint push notification template.

type RecommenderConfiguration

type RecommenderConfiguration struct {
	Attributes                    map[string]string `json:"Attributes,omitempty"`
	ID                            string            `json:"Id"`
	Name                          string            `json:"Name"`
	Description                   string            `json:"Description,omitempty"`
	RecommendationProviderIDType  string            `json:"RecommendationProviderIdType,omitempty"`
	RecommendationProviderRoleARN string            `json:"RecommendationProviderRoleArn,omitempty"`
	RecommendationProviderURI     string            `json:"RecommendationProviderUri,omitempty"`
	CreationDate                  string            `json:"CreationDate,omitempty"`
	LastModifiedDate              string            `json:"LastModifiedDate,omitempty"`
	RecommendationsPerMessage     int               `json:"RecommendationsPerMessage,omitempty"`
}

RecommenderConfiguration represents a Pinpoint recommender configuration.

type Segment

type Segment struct {
	Tags             map[string]string `json:"tags,omitempty"`
	Dimensions       map[string]any    `json:"Dimensions,omitempty"`
	SegmentGroups    map[string]any    `json:"SegmentGroups,omitempty"`
	ImportDefinition map[string]any    `json:"ImportDefinition,omitempty"`
	ApplicationID    string            `json:"ApplicationId"`
	ARN              string            `json:"Arn,omitempty"`
	ID               string            `json:"Id"`
	Name             string            `json:"Name"`
	CreationDate     string            `json:"CreationDate,omitempty"`
	LastModifiedDate string            `json:"LastModifiedDate,omitempty"`
	SegmentType      string            `json:"SegmentType"`
	Version          int               `json:"Version,omitempty"`
}

Segment represents a Pinpoint segment.

type SmsTemplate

type SmsTemplate struct {
	ARN                 string            `json:"Arn,omitempty"`
	Body                string            `json:"Body,omitempty"`
	CreationDate        string            `json:"CreationDate,omitempty"`
	LastModifiedDate    string            `json:"LastModifiedDate,omitempty"`
	SenderID            string            `json:"SenderId,omitempty"`
	Tags                map[string]string `json:"tags,omitempty"`
	TemplateDescription string            `json:"TemplateDescription,omitempty"`
	TemplateName        string            `json:"TemplateName"`
	Version             string            `json:"Version,omitempty"`
}

SmsTemplate represents a Pinpoint SMS template.

type StorageBackend

type StorageBackend interface {
	// App operations
	CreateApp(region, accountID, name string, tags map[string]string) (*App, error)
	GetApp(appID string) (*App, error)
	DeleteApp(appID string) (*App, error)
	GetApps() ([]*App, error)
	GetApplicationSettings(appID string) (*storedAppSettings, error)
	UpdateApplicationSettings(appID string, settings *storedAppSettings) (*storedAppSettings, error)

	// Tag operations
	TagResource(resourceARN string, tags map[string]string) error
	UntagResource(resourceARN string, tagKeys []string) error
	ListTagsForResource(resourceARN string) (map[string]string, error)

	// Campaign operations
	CreateCampaign(region, accountID, appID string, req createCampaignRequest) (*Campaign, error)
	GetCampaign(appID, campaignID string) (*Campaign, error)
	GetCampaigns(appID string) ([]*Campaign, error)
	UpdateCampaign(appID, campaignID string, req updateCampaignRequest) (*Campaign, error)
	DeleteCampaign(appID, campaignID string) (*Campaign, error)
	GetCampaignActivities(appID, campaignID string) (*campaignActivitiesResponse, error)
	GetCampaignDateRangeKpi(appID, campaignID, kpiName string) (*kpiResult, error)
	GetCampaignVersion(appID, campaignID string, version int) (*Campaign, error)
	GetCampaignVersions(appID, campaignID string) ([]*Campaign, error)

	// Template operations
	CreateEmailTemplate(region, accountID, templateName string, req createEmailTemplateRequest) (*EmailTemplate, error)
	GetEmailTemplate(templateName string) (*EmailTemplate, error)
	UpdateEmailTemplate(templateName string, req createEmailTemplateRequest) (*EmailTemplate, error)
	DeleteEmailTemplate(templateName string) (*EmailTemplate, error)
	CreateInAppTemplate(region, accountID, templateName string, req createInAppTemplateRequest) (*InAppTemplate, error)
	GetInAppTemplate(templateName string) (*InAppTemplate, error)
	UpdateInAppTemplate(templateName string, req createInAppTemplateRequest) (*InAppTemplate, error)
	DeleteInAppTemplate(templateName string) (*InAppTemplate, error)
	CreatePushTemplate(region, accountID, templateName string, req createPushTemplateRequest) (*PushTemplate, error)
	GetPushTemplate(templateName string) (*PushTemplate, error)
	UpdatePushTemplate(templateName string, req createPushTemplateRequest) (*PushTemplate, error)
	DeletePushTemplate(templateName string) (*PushTemplate, error)
	CreateSmsTemplate(region, accountID, templateName string, req createSmsTemplateRequest) (*SmsTemplate, error)
	GetSmsTemplate(templateName string) (*SmsTemplate, error)
	UpdateSmsTemplate(templateName string, req createSmsTemplateRequest) (*SmsTemplate, error)
	DeleteSmsTemplate(templateName string) (*SmsTemplate, error)
	CreateVoiceTemplate(region, accountID, templateName string, req createVoiceTemplateRequest) (*VoiceTemplate, error)
	GetVoiceTemplate(templateName string) (*VoiceTemplate, error)
	UpdateVoiceTemplate(templateName string, req createVoiceTemplateRequest) (*VoiceTemplate, error)
	DeleteVoiceTemplate(templateName string) (*VoiceTemplate, error)
	ListTemplates() ([]*templateListItem, error)
	ListTemplateVersions(templateName, templateType string) ([]*templateVersionItem, error)
	UpdateTemplateActiveVersion(templateName, templateType string) error

	// Job operations
	CreateExportJob(region, accountID, appID string, req createExportJobRequest) (*ExportJob, error)
	GetExportJob(appID, jobID string) (*ExportJob, error)
	GetExportJobs(appID string) ([]*ExportJob, error)
	GetSegmentExportJobs(appID, segmentID string) ([]*ExportJob, error)
	CreateImportJob(region, accountID, appID string, req createImportJobRequest) (*ImportJob, error)
	GetImportJob(appID, jobID string) (*ImportJob, error)
	GetImportJobs(appID string) ([]*ImportJob, error)
	GetSegmentImportJobs(appID, segmentID string) ([]*ImportJob, error)

	// Journey operations
	CreateJourney(region, accountID, appID string, req createJourneyRequest) (*Journey, error)
	GetJourney(appID, journeyID string) (*Journey, error)
	GetJourneys(appID string) ([]*Journey, error)
	UpdateJourney(appID, journeyID string, req updateJourneyRequest) (*Journey, error)
	UpdateJourneyState(appID, journeyID, state string) (*Journey, error)
	DeleteJourney(appID, journeyID string) (*Journey, error)
	GetJourneyDateRangeKpi(appID, journeyID, kpiName string) (*kpiResult, error)
	GetJourneyExecutionMetrics(appID, journeyID string) (*journeyExecutionMetricsResponse, error)
	GetJourneyExecutionActivityMetrics(
		appID, journeyID, activityID string,
	) (*journeyExecutionActivityMetricsResponse, error)
	GetJourneyRuns(appID, journeyID string) (*journeyRunsResponse, error)
	GetJourneyRunExecutionMetrics(appID, journeyID, runID string) (*journeyRunExecutionMetricsResponse, error)
	GetJourneyRunExecutionActivityMetrics(
		appID, journeyID, runID, activityID string,
	) (*journeyRunExecutionActivityMetricsResponse, error)

	// Recommender operations
	CreateRecommenderConfiguration(req createRecommenderConfigRequest) (*RecommenderConfiguration, error)
	GetRecommenderConfiguration(recommenderID string) (*RecommenderConfiguration, error)
	GetRecommenderConfigurations() ([]*RecommenderConfiguration, error)
	UpdateRecommenderConfiguration(
		recommenderID string,
		req createRecommenderConfigRequest,
	) (*RecommenderConfiguration, error)
	DeleteRecommenderConfiguration(recommenderID string) (*RecommenderConfiguration, error)

	// Segment operations
	CreateSegment(region, accountID, appID string, req createSegmentRequest) (*Segment, error)
	GetSegment(appID, segmentID string) (*Segment, error)
	GetSegments(appID string) ([]*Segment, error)
	UpdateSegment(appID, segmentID string, req updateSegmentRequest) (*Segment, error)
	DeleteSegment(appID, segmentID string) (*Segment, error)
	GetSegmentVersion(appID, segmentID string, version int) (*Segment, error)
	GetSegmentVersions(appID, segmentID string) ([]*Segment, error)

	// Endpoint operations
	GetEndpoint(appID, endpointID string) (*Endpoint, error)
	UpdateEndpoint(appID, endpointID string, req updateEndpointRequest) (*Endpoint, error)
	DeleteEndpoint(appID, endpointID string) (*Endpoint, error)
	GetUserEndpoints(appID, userID string) ([]*Endpoint, error)
	DeleteUserEndpoints(appID, userID string) error
	UpdateEndpointsBatch(appID string, endpoints map[string]updateEndpointRequest) error

	// EventStream operations
	GetEventStream(appID string) (*EventStream, error)
	PutEventStream(appID string, req putEventStreamRequest) (*EventStream, error)
	DeleteEventStream(appID string) (*EventStream, error)

	// Channel operations
	GetChannel(appID, channelType string) *Channel
	UpsertChannel(appID, channelType string, enabled bool, extra map[string]any) *Channel
	DeleteChannel(appID, channelType string) *Channel
	GetAllChannels(appID string) map[string]*Channel

	// Analytics
	GetApplicationDateRangeKpi(appID, kpiName string) (*kpiResult, error)

	// Messaging
	SendMessages(appID string, req sendMessagesRequest) (*messageResponse, error)
	SendUsersMessages(appID string, req sendUsersMessagesRequest) (*usersMessageResponse, error)
	SendOTPMessage(appID string) (*sendOTPMessageResponse, error)
	VerifyOTPMessage(appID, code string) (*verifyOTPMessageResponse, error)
	PutEvents(appID string, req putEventsRequest) (*eventsResponse, error)
	PhoneNumberValidate(phoneNumber string) (*phoneNumberValidateResponse, error)
	RemoveAttributes(appID, attributeType string, blacklist []string) (*attributesResource, error)
	GetInAppMessages(appID, endpointID string) (*inAppMessagesResponse, error)

	// Lifecycle
	Reset()
	Region() string
	AccountID() string
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend defines the interface for Pinpoint backend implementations. All mutating methods must be safe for concurrent use.

type VoiceTemplate

type VoiceTemplate struct {
	Tags         map[string]string `json:"tags,omitempty"`
	ARN          string            `json:"Arn,omitempty"`
	TemplateName string            `json:"TemplateName"`
	Body         string            `json:"Body,omitempty"`
	CreationDate string            `json:"CreationDate,omitempty"`
}

VoiceTemplate represents a Pinpoint voice template.

Jump to

Keyboard shortcuts

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