Skip to content

Commit

Permalink
Merge pull request #161 from cjgajard/cjavier/omit-empty-alert-grouping
Browse files Browse the repository at this point in the history
Allow null and omitted service.alert_grouping by double indirection
  • Loading branch information
imjaroiswebdev authored Feb 14, 2025
2 parents 12b6de6 + b64bb09 commit c474ec4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pagerduty/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ type Service struct {
AcknowledgementTimeout *int `json:"acknowledgement_timeout"`
Addons []*AddonReference `json:"addons,omitempty"`
AlertCreation string `json:"alert_creation,omitempty"`
AlertGrouping *string `json:"alert_grouping"`
AlertGrouping **string `json:"alert_grouping,omitempty"`
AlertGroupingTimeout *int `json:"alert_grouping_timeout,omitempty"`
AlertGroupingParameters *AlertGroupingParameters `json:"alert_grouping_parameters,omitempty"`
AutoPauseNotificationsParameters *AutoPauseNotificationsParameters `json:"auto_pause_notifications_parameters,omitempty"`
Expand Down
8 changes: 5 additions & 3 deletions pagerduty/service_fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,16 @@ var (
defaultAutoResolveTimeout = 14400
defaultPosition = 0

ag = "intelligent"
ag = "intelligent"
agPtr = &ag

validListServicesResponse = &ListServicesResponse{
Services: []*Service{
&Service{
{
AcknowledgementTimeout: &defaultTestServiceAcknowledgementTimeout,
Addons: nil,
AlertCreation: "create_alerts_and_incidents",
AlertGrouping: &ag,
AlertGrouping: &agPtr,
AlertGroupingTimeout: nil,
AutoResolveTimeout: &defaultAutoResolveTimeout,
CreatedAt: "2015-11-06T11:12:51-05:00",
Expand Down

0 comments on commit c474ec4

Please sign in to comment.