Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions pagerduty/event_orchestration_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions pagerduty/event_orchestration_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ func TestEventOrchestrationPathGetServiceActiveStatus(t *testing.T) {
func TestEventOrchestrationPathGlobalUpdate(t *testing.T) {
setup()
defer teardown()

input := &EventOrchestrationPath{
CatchAll: &EventOrchestrationPathCatchAll{
Actions: &EventOrchestrationPathRuleActions{
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down