Skip to content

Commit c474ec4

Browse files
Merge pull request #161 from cjgajard/cjavier/omit-empty-alert-grouping
Allow null and omitted service.alert_grouping by double indirection
2 parents 12b6de6 + b64bb09 commit c474ec4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pagerduty/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ type Service struct {
133133
AcknowledgementTimeout *int `json:"acknowledgement_timeout"`
134134
Addons []*AddonReference `json:"addons,omitempty"`
135135
AlertCreation string `json:"alert_creation,omitempty"`
136-
AlertGrouping *string `json:"alert_grouping"`
136+
AlertGrouping **string `json:"alert_grouping,omitempty"`
137137
AlertGroupingTimeout *int `json:"alert_grouping_timeout,omitempty"`
138138
AlertGroupingParameters *AlertGroupingParameters `json:"alert_grouping_parameters,omitempty"`
139139
AutoPauseNotificationsParameters *AutoPauseNotificationsParameters `json:"auto_pause_notifications_parameters,omitempty"`

pagerduty/service_fixtures_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,16 @@ var (
146146
defaultAutoResolveTimeout = 14400
147147
defaultPosition = 0
148148

149-
ag = "intelligent"
149+
ag = "intelligent"
150+
agPtr = &ag
151+
150152
validListServicesResponse = &ListServicesResponse{
151153
Services: []*Service{
152-
&Service{
154+
{
153155
AcknowledgementTimeout: &defaultTestServiceAcknowledgementTimeout,
154156
Addons: nil,
155157
AlertCreation: "create_alerts_and_incidents",
156-
AlertGrouping: &ag,
158+
AlertGrouping: &agPtr,
157159
AlertGroupingTimeout: nil,
158160
AutoResolveTimeout: &defaultAutoResolveTimeout,
159161
CreatedAt: "2015-11-06T11:12:51-05:00",

0 commit comments

Comments
 (0)