diff --git a/client/recipient.go b/client/recipient.go index c17c86e3..0e4e04b3 100644 --- a/client/recipient.go +++ b/client/recipient.go @@ -96,20 +96,15 @@ const ( PDDefaultSeverity = PDSeverityCRITICAL ) -// TriggerRecipientTypes returns a list of recipient types compatible with Triggers +// TriggerRecipientTypes returns a list of recipient types compatible with Triggers. +// Triggers are a special case as 'Marker' recipients are supported in addition to +// usual types. func TriggerRecipientTypes() []RecipientType { - return []RecipientType{ - RecipientTypeEmail, - RecipientTypePagerDuty, - RecipientTypeSlack, - RecipientTypeWebhook, - RecipientTypeMarker, - RecipientTypeMSTeams, - } + return append(RecipientTypes(), RecipientTypeMarker) } -// BurnAlertRecipientTypes returns a list of recipient types compatible with Burn Alerts -func BurnAlertRecipientTypes() []RecipientType { +// RecipientTypes returns all supported Recipient types +func RecipientTypes() []RecipientType { return []RecipientType{ RecipientTypeEmail, RecipientTypePagerDuty, diff --git a/honeycombio/data_source_recipient.go b/honeycombio/data_source_recipient.go index 7f4f9a3f..d6c4cfb0 100644 --- a/honeycombio/data_source_recipient.go +++ b/honeycombio/data_source_recipient.go @@ -34,8 +34,8 @@ If you want to match multiple recipients, use the 'honeycombio_recipients' data "type": { Type: schema.TypeString, Required: true, - Description: "The type of recipient, allowed types are `email`, `pagerduty`, `msteams`, `slack` and `webhook`.", - ValidateFunc: validation.StringInSlice(helper.AsStringSlice(honeycombio.BurnAlertRecipientTypes()), false), + Description: "The type of recipient.", + ValidateFunc: validation.StringInSlice(helper.AsStringSlice(honeycombio.RecipientTypes()), false), }, "target": { Type: schema.TypeString, diff --git a/honeycombio/data_source_recipients.go b/honeycombio/data_source_recipients.go index dc0ed545..4d2f4f48 100644 --- a/honeycombio/data_source_recipients.go +++ b/honeycombio/data_source_recipients.go @@ -26,7 +26,7 @@ func dataSourceHoneycombioRecipients() *schema.Resource { Type: schema.TypeString, Optional: true, Description: "The type of recipients.", - ValidateFunc: validation.StringInSlice(helper.AsStringSlice(honeycombio.BurnAlertRecipientTypes()), false), + ValidateFunc: validation.StringInSlice(helper.AsStringSlice(honeycombio.RecipientTypes()), false), }, "detail_filter": { Type: schema.TypeList, diff --git a/internal/provider/burn_alert_resource.go b/internal/provider/burn_alert_resource.go index d156ecbc..7d1438fb 100644 --- a/internal/provider/burn_alert_resource.go +++ b/internal/provider/burn_alert_resource.go @@ -79,7 +79,7 @@ func (*burnAlertResource) Schema(_ context.Context, _ resource.SchemaRequest, re }, }, Blocks: map[string]schema.Block{ - "recipient": notificationRecipientSchema(client.BurnAlertRecipientTypes()), + "recipient": notificationRecipientSchema(client.RecipientTypes()), }, } }