Skip to content

Commit

Permalink
handle only_invocable_on_unresolved_incidents as pointer since is a…
Browse files Browse the repository at this point in the history
… required field
  • Loading branch information
imjaroiswebdev committed Jan 13, 2025
1 parent d8d4757 commit efb96f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pagerduty/automation_actions_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type AutomationActionsAction struct {
RunnerType *string `json:"runner_type,omitempty"`
CreationTime *string `json:"creation_time,omitempty"`
ModifyTime *string `json:"modify_time,omitempty"`
OnlyInvocableOnUnresolvedIncidents bool `json:"only_invocable_on_unresolved_incidents"`
OnlyInvocableOnUnresolvedIncidents *bool `json:"only_invocable_on_unresolved_incidents,omitempty"`
}

type AutomationActionsActionDataReference struct {
Expand Down
14 changes: 7 additions & 7 deletions pagerduty/automation_actions_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestAutomationActionsActionTypeProcessAutomationCreate(t *testing.T) {
ActionType: "process_automation",
RunnerID: &runner_id,
ActionDataReference: adf,
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
}

mux.HandleFunc("/automation_actions/actions", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -153,8 +153,8 @@ func TestAutomationActionsActionTypeProcessAutomationCreate(t *testing.T) {
Privileges: &AutomationActionsPrivileges{
Permissions: []*string{&permissions_read},
},
ModifyTime: &modify_time,
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
ModifyTime: &modify_time,
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
}

if !reflect.DeepEqual(resp, want) {
Expand Down Expand Up @@ -183,7 +183,7 @@ func TestAutomationActionsActionUpdate(t *testing.T) {
ActionType: "process_automation",
RunnerID: &runner_id,
ActionDataReference: adf,
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
}

var id = "01DF4OBNYKW84FS9CCYVYS1MOS"
Expand Down Expand Up @@ -234,8 +234,8 @@ func TestAutomationActionsActionUpdate(t *testing.T) {
Privileges: &AutomationActionsPrivileges{
Permissions: []*string{&permissions_read},
},
ModifyTime: &modify_time,
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
ModifyTime: &modify_time,
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
}

if !reflect.DeepEqual(resp, want) {
Expand Down Expand Up @@ -276,7 +276,7 @@ func TestAutomationActionsActionTypeScriptCreate(t *testing.T) {
ActionType: "script",
RunnerID: &runner_id,
ActionDataReference: adf,
OnlyInvocableOnUnresolvedIncidents: only_invocable_on_unresolved_incidents,
OnlyInvocableOnUnresolvedIncidents: &only_invocable_on_unresolved_incidents,
}

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

0 comments on commit efb96f8

Please sign in to comment.