Skip to content

Commit

Permalink
add mute first recovery notification
Browse files Browse the repository at this point in the history
  • Loading branch information
JoannaYe-Datadog committed Apr 19, 2022
1 parent 67df813 commit d623201
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions datadog/resource_datadog_downtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type downtimeOrDowntimeChild interface {
GetActiveChild() datadogV1.DowntimeChild
GetActiveChildOk() (*datadogV1.DowntimeChild, bool)
GetCanceledOk() (*int64, bool)
GetMuteFirstRecoveryNotification() bool
}

// downtimeChild wraps the `datadogV1.DowntimeChild` struct via embedding to implement `downtimeOrDowntimeChild`
Expand Down Expand Up @@ -100,6 +101,10 @@ func (d *downtimeChild) GetCanceledOk() (*int64, bool) {
return d.child.GetCanceledOk()
}

func (d *downtimeChild) GetMuteFirstRecoveryNotification() bool {
return d.child.GetMuteFirstRecoveryNotification()
}

func resourceDatadogDowntime() *schema.Resource {
return &schema.Resource{
Description: "Provides a Datadog downtime resource. This can be used to create and manage Datadog downtimes.",
Expand Down Expand Up @@ -262,6 +267,11 @@ func resourceDatadogDowntime() *schema.Resource {
Computed: true,
Description: "The id corresponding to the downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.",
},
"mute_first_recovery_notification": {
Type: schema.TypeBool,
Optional: true,
Description: "When true the first recovery notification during the downtime will be muted",
},
},
}
}
Expand Down Expand Up @@ -397,6 +407,10 @@ func buildDowntimeStruct(ctx context.Context, d *schema.ResourceData, client *da
dt.SetTimezone(attr.(string))
}

if attr, ok := d.GetOk("mute_first_recovery_notification"); ok {
dt.SetMuteFirstRecoveryNotification(attr.(bool))
}

return &dt, nil
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/terraform-providers/terraform-provider-datadog

require (
github.com/DataDog/datadog-api-client-go v1.12.1-0.20220415075550-47baab9a004b
github.com/DataDog/datadog-api-client-go v1.12.1-0.20220419095606-739a18532011
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/DataDog/dd-sdk-go-testing v0.0.0-20211116174033-1cd082e322ad
github.com/DataDog/sketches-go v1.2.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/datadog-api-client-go v1.12.1-0.20220415075550-47baab9a004b h1:A0ruvgI6TVHivSsCMLk6JPwki7HlGCk9eMjs/dXbKjs=
github.com/DataDog/datadog-api-client-go v1.12.1-0.20220415075550-47baab9a004b/go.mod h1:15sqwH81WH6nCgW+rWyHw6PdaBA3udYAOq0p5lntKcY=
github.com/DataDog/datadog-api-client-go v1.12.1-0.20220419095606-739a18532011 h1:gLWNlc2qkLVW3gfEoeUfp4n0BmjpkJbCTlz76k/NVAc=
github.com/DataDog/datadog-api-client-go v1.12.1-0.20220419095606-739a18532011/go.mod h1:15sqwH81WH6nCgW+rWyHw6PdaBA3udYAOq0p5lntKcY=
github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q=
github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
Expand Down

0 comments on commit d623201

Please sign in to comment.