diff --git a/pagerduty/event_orchestration_path.go b/pagerduty/event_orchestration_path.go index f4a3b59..3d9707c 100644 --- a/pagerduty/event_orchestration_path.go +++ b/pagerduty/event_orchestration_path.go @@ -80,15 +80,17 @@ type EventOrchestrationPathIncidentCustomFieldUpdate struct { } type EventOrchestrationPathPagerdutyAutomationAction struct { - ActionId string `json:"action_id,omitempty"` + ActionId string `json:"action_id,omitempty"` + TriggerTypes []string `json:"trigger_types,omitempty"` } type EventOrchestrationPathAutomationAction struct { - Name string `json:"name,omitempty"` - Url string `json:"url,omitempty"` - AutoSend bool `json:"auto_send,omitempty"` - Headers []*EventOrchestrationPathAutomationActionObject `json:"headers"` - Parameters []*EventOrchestrationPathAutomationActionObject `json:"parameters"` + Name string `json:"name,omitempty"` + Url string `json:"url,omitempty"` + AutoSend bool `json:"auto_send,omitempty"` + Headers []*EventOrchestrationPathAutomationActionObject `json:"headers"` + Parameters []*EventOrchestrationPathAutomationActionObject `json:"parameters"` + TriggerTypes []string `json:"trigger_types,omitempty"` } type EventOrchestrationPathAutomationActionObject struct { diff --git a/pagerduty/event_orchestration_path_test.go b/pagerduty/event_orchestration_path_test.go index 514f0b7..4c6bfe2 100644 --- a/pagerduty/event_orchestration_path_test.go +++ b/pagerduty/event_orchestration_path_test.go @@ -253,6 +253,7 @@ func TestEventOrchestrationPathGetServiceActiveStatus(t *testing.T) { func TestEventOrchestrationPathGlobalUpdate(t *testing.T) { setup() defer teardown() + input := &EventOrchestrationPath{ CatchAll: &EventOrchestrationPathCatchAll{ Actions: &EventOrchestrationPathRuleActions{ @@ -279,7 +280,8 @@ func TestEventOrchestrationPathGlobalUpdate(t *testing.T) { Actions: &EventOrchestrationPathRuleActions{ AutomationActions: []*EventOrchestrationPathAutomationAction{ { - AutoSend: true, + AutoSend: true, + TriggerTypes: []string{"alert_suppressed"}, Headers: []*EventOrchestrationPathAutomationActionObject{ { Key: "x-header-1", @@ -404,7 +406,8 @@ func TestEventOrchestrationPathGlobalUpdate(t *testing.T) { "headers": [{"key": "x-header-1", "value": "h-one"}, {"key": "x-header-2","value": "h-two"}], "name": "test webhook", "parameters": [{"key": "hostname", "value": "{{variables.hostname}}"}, {"key": "info", "value": "{{event.summary}}"}], - "url": "https://test.com" + "url": "https://test.com", + "trigger_types": ["alert_suppressed"] } ], "event_action": "trigger",