Skip to content

Commit

Permalink
Add TriggerRecipientTypeWebhook
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenraad Verheyden committed Sep 9, 2020
1 parent 40002e0 commit 657f6dd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,18 @@ func TriggerThresholdOps() []TriggerThresholdOp {
// when the trigger fires.
//
// API docs: https://docs.honeycomb.io/api/triggers/#specifying-recipients
//
// Notes
//
// Recipients of type Slack should be specified by their ID. It is not possible
// to create a new recipient of type Slack using the API. Instead use the ID of
// a recipient of type Slack that was manually added to another trigger.
//
// Recipients of type webhook can be added by their name. If a webhook with
// this name does not exist yet (or if the name contains a typo), the Honeycomb
// API will not complain about this but the webhook will not be valid.
type TriggerRecipient struct {
// ID of the recipient, this is required when type is Slack.
// ID of the recipient.
ID string `json:"id,omitempty"`
// Type of the recipient.
Type TriggerRecipientType `json:"type"`
Expand All @@ -107,6 +117,7 @@ type TriggerRecipient struct {
// - marker: name of the marker
// - PagerDuty: N/A
// - Slack: name of a channel
// - Webhook: name of the webhook
Target string `json:"target,omitempty"`
}

Expand All @@ -119,6 +130,7 @@ const (
TriggerRecipientTypeMarker TriggerRecipientType = "marker"
TriggerRecipientTypePagerDuty TriggerRecipientType = "pagerduty"
TriggerRecipientTypeSlack TriggerRecipientType = "slack"
TriggerRecipientTypeWebhook TriggerRecipientType = "webhook"
)

// TriggerRecipientTypes returns an exhaustive list of trigger recipient types.
Expand All @@ -128,6 +140,7 @@ func TriggerRecipientTypes() []TriggerRecipientType {
TriggerRecipientTypeMarker,
TriggerRecipientTypePagerDuty,
TriggerRecipientTypeSlack,
TriggerRecipientTypeWebhook,
}
}

Expand Down

0 comments on commit 657f6dd

Please sign in to comment.