Help us shape the future of Go! Take the 2026 Go Developer Survey

pinpoint

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 26 Imported by: 0

README

Pinpoint

Parity grade: A · SDK aws-sdk-go-v2/service/pinpoint@v1.42.4 · last audited 2026-10-10 (24813b443)

Coverage

Metric Value
PARITY entries audited 51 (50 ok, 1 partial)
Feature families 20 (20 ok)
Known gaps none
Structural gaps (can't be emulated) 2
Deferred items 3
Resource leaks clean
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • Export and import jobs only track state: no S3 object is written or read, so exports produce no files, imports register no endpoints, and segment-scoped exports report no TotalProcessed. Campaigns stay SCHEDULED because nothing is delivered.
  • PayloadTooLargeException is not enforced where it cannot fire: the 74 modeled ops with no request body (GET/DELETE) and the 9 ops that do not model it (Tag ops, Create*Template); the other 39 are enforced (gopherstack-coib).
Deferred
  • 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 thin per-channel-type payload assertions (SMS/EMAIL/push body shape) — response envelope itself is fully covered, but content-shape assertions per channel type could be deepened in a future pass
  • PushTemplate/APNSPushNotificationTemplate/AndroidPushNotificationTemplate/DefaultPushNotificationTemplate sub-objects (ADM/APNS/Baidu/Default/GCM) are stored as generic map[string]any rather than field-validated structs, consistent with the project's existing convention for nested platform-override objects elsewhere in this file (Campaign.MessageConfiguration, Journey.Activities, etc.) — round-tripped but not field-validated. Not re-flagged as a gap since gopherstack does not field-validate equivalent nested objects anywhere else in this service either

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("requested resource does not exist", 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("resource already exists", awserr.ErrConflict)
	// ErrJourneyActive is returned when attempting to modify an ACTIVE journey's activities.
	ErrJourneyActive = awserr.New(
		"journey is ACTIVE and cannot be modified",
		awserr.ErrConflict,
	)
)
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"`
	HasFcmServiceCredentials bool           `json:"HasFcmServiceCredentials,omitempty"`
}

Channel represents a generic Pinpoint channel response.

type EmailTemplate

type EmailTemplate struct {
	ARN                  string            `json:"Arn,omitempty"`
	CreationDate         string            `json:"CreationDate,omitempty"`
	DefaultSubstitutions string            `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"`
	TemplateType         string            `json:"TemplateType"`
	TextPart             string            `json:"TextPart,omitempty"`
	Version              string            `json:"Version,omitempty"`
}

EmailTemplate represents a Pinpoint email template.

DefaultSubstitutions is a JSON-encoded string on the wire (confirmed against aws-sdk-go-v2/service/pinpoint's deserializers.go, which decodes it via a plain string type-assertion), NOT a nested JSON object -- the same is true for PushTemplate, SmsTemplate, and VoiceTemplate.

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 {
	JobStatus       string `json:"JobStatus"`
	ApplicationID   string `json:"ApplicationId"`
	SegmentID       string `json:"SegmentId,omitempty"`
	ID              string `json:"Id"`
	RoleArn         string `json:"RoleArn,omitempty"`
	S3UrlPrefix     string `json:"S3UrlPrefix,omitempty"`
	ARN             string `json:"Arn,omitempty"`
	CreationDate    string `json:"CreationDate,omitempty"`
	CompletionDate  string `json:"-"`
	SegmentVersion  int    `json:"SegmentVersion,omitempty"`
	TotalPieces     int    `json:"-"`
	CompletedPieces int    `json:"-"`
	TotalProcessed  int    `json:"-"`
}

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
	// contains filtered or unexported fields
}

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) BackendFor

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

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

func (*Handler) ChaosOperations

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

ChaosOperations returns all operations 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) EnableRegions

func (h *Handler) EnableRegions()

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

func (*Handler) ExtractOperation

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

ExtractOperation 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. The list is assembled from per-resource-family helper functions (below) purely to keep this function's own line count down for the funlen linter (suppressing it is banned project-wide), and there is no real branching logic to simplify here, only a long literal list of operation names. No package-level state is introduced: each helper returns a fresh local slice.

func (*Handler) Handler

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

Handler serves each request from the handler of its region.

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) RegionBackends

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

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

func (*Handler) RegionHandler

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

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

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears every region.

func (*Handler) Restore

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

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

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

RouteMatcher returns a function 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; other regions ride in an additive "regions" key.

type ImportJob

type ImportJob struct {
	JobStatus         string `json:"JobStatus"`
	SegmentID         string `json:"SegmentId,omitempty"`
	ID                string `json:"Id"`
	RoleArn           string `json:"RoleArn,omitempty"`
	S3Url             string `json:"S3Url,omitempty"`
	Format            string `json:"Format,omitempty"`
	ApplicationID     string `json:"ApplicationId"`
	CompletionDate    string `json:"-"`
	ARN               string `json:"Arn,omitempty"`
	ExternalID        string `json:"ExternalId,omitempty"`
	CreationDate      string `json:"CreationDate,omitempty"`
	TotalPieces       int    `json:"-"`
	CompletedPieces   int    `json:"-"`
	RegisterEndpoints bool   `json:"RegisterEndpoints,omitempty"`
	DefineSegment     bool   `json:"DefineSegment,omitempty"`
}

ImportJob represents a Pinpoint import job.

type InAppTemplate

type InAppTemplate struct {
	Tags                map[string]string `json:"tags,omitempty"`
	CustomConfig        map[string]string `json:"CustomConfig,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"`
	TemplateType        string            `json:"TemplateType"`
	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) DeleteTemplate

func (b *InMemoryBackend) DeleteTemplate(templateName, templateType, version string) error

DeleteTemplate deletes a template, or one version of it when version is set.

func (*InMemoryBackend) DeleteUserEndpoints

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

DeleteUserEndpoints deletes all endpoints for a user in an application, returning the deleted endpoints (AWS's DeleteUserEndpointsOutput requires a populated EndpointsResponse echoing what was removed).

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, startTime, endTime 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, startTime, endTime 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 the in-app messages targeted for an endpoint.

Real AWS selects campaigns by evaluating whether the endpoint matches each campaign's segment (dimension-based audience matching). gopherstack has no segment/dimension evaluation engine anywhere in this service, so this returns every non-paused campaign in the app that targets an in-app template, regardless of endpointID -- a structural limitation, not a fabrication: every returned campaign and its message content is real, unlike the prior version, which manufactured a fake "campaign" out of every in-app template that existed anywhere in the account.

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, startTime, endTime 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, segmentID 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) GetTemplate

func (b *InMemoryBackend) GetTemplate(templateName, templateType, version string) (any, error)

GetTemplate returns the template of the given channel at version (the active one when empty).

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 the version history of 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,
) (*numberValidateResponse, 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) (*messageResponse, 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) SetLifecycleDelay

func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)

SetLifecycleDelay sets how long an export or import job takes to reach COMPLETED; zero completes at once.

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) TaggedResources added in v1.3.1

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

TaggedResources returns every Pinpoint resource ARN that currently has at least one tag. Export/import jobs build ARNs (export_import_jobs.go) but are never entered into arnIndex -- they don't implement tagHolder -- so they never appear here, matching the real API's TagResource, which only documents app, campaign, journey, segment, and template ARNs.

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, version string) error

UpdateTemplateActiveVersion makes version (an existing id, or "latest") the one Get returns by default.

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 {
	ADM                  map[string]any    `json:"ADM,omitempty"`
	APNS                 map[string]any    `json:"APNS,omitempty"`
	Baidu                map[string]any    `json:"Baidu,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"`
	CreationDate         string            `json:"CreationDate,omitempty"`
	DefaultSubstitutions string            `json:"DefaultSubstitutions,omitempty"`
	LastModifiedDate     string            `json:"LastModifiedDate,omitempty"`
	RecommenderID        string            `json:"RecommenderId,omitempty"`
	TemplateDescription  string            `json:"TemplateDescription,omitempty"`
	TemplateName         string            `json:"TemplateName"`
	TemplateType         string            `json:"TemplateType"`
	Version              string            `json:"Version,omitempty"`
}

PushTemplate represents a Pinpoint push notification template.

ADM/APNS/Baidu/Default/GCM are stored as generic maps (matching the project's existing convention for nested platform-override objects, e.g. Campaign.MessageConfiguration) rather than fully typed AndroidPushNotificationTemplate/APNSPushNotificationTemplate/ DefaultPushNotificationTemplate structs -- gopherstack does not validate their sub-fields, it only round-trips them.

There is no top-level Body/Title on the real PushNotificationTemplateRequest/ PushNotificationTemplateResponse types (aws-sdk-go-v2/service/pinpoint/types) -- those fields live inside ADM/APNS/Baidu/Default/GCM. A prior pass had invented top-level Body/Title fields that don't exist on the wire; removed.

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"`
	DefaultSubstitutions string            `json:"DefaultSubstitutions,omitempty"`
	LastModifiedDate     string            `json:"LastModifiedDate,omitempty"`
	RecommenderID        string            `json:"RecommenderId,omitempty"`
	Tags                 map[string]string `json:"tags,omitempty"`
	TemplateDescription  string            `json:"TemplateDescription,omitempty"`
	TemplateName         string            `json:"TemplateName"`
	TemplateType         string            `json:"TemplateType"`
	Version              string            `json:"Version,omitempty"`
}

SmsTemplate represents a Pinpoint SMS template.

There is no SenderId field on the real SMSTemplateRequest/SMSTemplateResponse types (aws-sdk-go-v2/service/pinpoint/types) -- confirmed against both the serializer (awsRestjson1_serializeDocumentSMSTemplateRequest) and deserializer. SenderId is an SMS *channel* setting (SMSChannelRequest), not a template field. A prior pass had invented it on the template; removed.

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, startTime, endTime 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)
	GetTemplate(templateName, templateType, version string) (any, error)
	DeleteTemplate(templateName, templateType, version string) error
	UpdateTemplateActiveVersion(templateName, templateType, version 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, startTime, endTime 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) ([]*Endpoint, 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, startTime, endTime string) (*kpiResult, error)

	// Messaging
	SendMessages(appID string, req sendMessagesRequest) (*messageResponse, error)
	SendUsersMessages(appID string, req sendUsersMessagesRequest) (*usersMessageResponse, error)
	SendOTPMessage(appID string) (*messageResponse, error)
	VerifyOTPMessage(appID, code string) (*verifyOTPMessageResponse, error)
	PutEvents(appID string, req putEventsRequest) (*eventsResponse, error)
	PhoneNumberValidate(phoneNumber string) (*numberValidateResponse, 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 StoredAppSettings added in v1.3.1

type StoredAppSettings struct {
	CampaignHook        map[string]any `json:"CampaignHook"`
	Limits              map[string]any `json:"Limits"`
	QuietTime           map[string]any `json:"QuietTime"`
	JourneyLimits       map[string]any `json:"JourneyLimits"`
	LastModifiedDate    string         `json:"LastModifiedDate"`
	CloudWatchMetrics   bool           `json:"CloudWatchMetrics"`
	EventTaggingEnabled bool           `json:"EventTaggingEnabled"`
}

StoredAppSettings holds the persisted application-level settings.

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 VoiceTemplate

type VoiceTemplate struct {
	Tags                 map[string]string `json:"tags,omitempty"`
	ARN                  string            `json:"Arn,omitempty"`
	TemplateName         string            `json:"TemplateName"`
	TemplateType         string            `json:"TemplateType"`
	Body                 string            `json:"Body,omitempty"`
	CreationDate         string            `json:"CreationDate,omitempty"`
	DefaultSubstitutions string            `json:"DefaultSubstitutions,omitempty"`
	LanguageCode         string            `json:"LanguageCode,omitempty"`
	LastModifiedDate     string            `json:"LastModifiedDate,omitempty"`
	TemplateDescription  string            `json:"TemplateDescription,omitempty"`
	Version              string            `json:"Version,omitempty"`
	VoiceID              string            `json:"VoiceId,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