Skip to content

Commit 6bd0ab3

Browse files
handle only_invocable_on_unresolved_incidents as pointer since is a required field
1 parent d8d4757 commit 6bd0ab3

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

pagerduty/automation_actions_action.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type AutomationActionsAction struct {
2121
RunnerType *string `json:"runner_type,omitempty"`
2222
CreationTime *string `json:"creation_time,omitempty"`
2323
ModifyTime *string `json:"modify_time,omitempty"`
24-
OnlyInvocableOnUnresolvedIncidents bool `json:"only_invocable_on_unresolved_incidents"`
24+
OnlyInvocableOnUnresolvedIncidents *bool `json:"only_invocable_on_unresolved_incidents,omitempty"`
2525
}
2626

2727
type AutomationActionsActionDataReference struct {
@@ -164,3 +164,4 @@ func (s *AutomationActionsActionService) GetAssociationToService(actionID, servi
164164

165165
return v, resp, nil
166166
}
167+

pagerduty/automation_actions_action_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func TestAutomationActionsActionTypeProcessAutomationCreate(t *testing.T) {
105105
ActionType: "process_automation",
106106
RunnerID: &runner_id,
107107
ActionDataReference: adf,
108-
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
108+
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
109109
}
110110

111111
mux.HandleFunc("/automation_actions/actions", func(w http.ResponseWriter, r *http.Request) {
@@ -153,8 +153,8 @@ func TestAutomationActionsActionTypeProcessAutomationCreate(t *testing.T) {
153153
Privileges: &AutomationActionsPrivileges{
154154
Permissions: []*string{&permissions_read},
155155
},
156-
ModifyTime: &modify_time,
157-
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
156+
ModifyTime: &modify_time,
157+
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
158158
}
159159

160160
if !reflect.DeepEqual(resp, want) {
@@ -183,7 +183,7 @@ func TestAutomationActionsActionUpdate(t *testing.T) {
183183
ActionType: "process_automation",
184184
RunnerID: &runner_id,
185185
ActionDataReference: adf,
186-
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
186+
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
187187
}
188188

189189
var id = "01DF4OBNYKW84FS9CCYVYS1MOS"
@@ -234,8 +234,8 @@ func TestAutomationActionsActionUpdate(t *testing.T) {
234234
Privileges: &AutomationActionsPrivileges{
235235
Permissions: []*string{&permissions_read},
236236
},
237-
ModifyTime: &modify_time,
238-
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
237+
ModifyTime: &modify_time,
238+
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
239239
}
240240

241241
if !reflect.DeepEqual(resp, want) {
@@ -276,7 +276,7 @@ func TestAutomationActionsActionTypeScriptCreate(t *testing.T) {
276276
ActionType: "script",
277277
RunnerID: &runner_id,
278278
ActionDataReference: adf,
279-
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
279+
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
280280
}
281281

282282
mux.HandleFunc("/automation_actions/actions", func(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)