diff --git a/go.mod b/go.mod index e2877f7ab..1282a1c8b 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( cloud.google.com/go v0.71.0 // indirect github.com/google/go-querystring v1.0.0 // indirect github.com/hashicorp/terraform-plugin-sdk v1.7.0 - github.com/heimweh/go-pagerduty v0.0.0-20210401200608-e772e426d1d0 + github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd // indirect google.golang.org/api v0.35.0 // indirect google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb // indirect diff --git a/go.sum b/go.sum index ce9e41df2..14ecfddf8 100644 --- a/go.sum +++ b/go.sum @@ -240,6 +240,8 @@ github.com/heimweh/go-pagerduty v0.0.0-20210309231526-3275f6c029e3 h1:W26FTjH1Sg github.com/heimweh/go-pagerduty v0.0.0-20210309231526-3275f6c029e3/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY= github.com/heimweh/go-pagerduty v0.0.0-20210401200608-e772e426d1d0 h1:fF/STDApEmPMx5pxXOrliPnWim3K1w0f9Ma06OqrKeI= github.com/heimweh/go-pagerduty v0.0.0-20210401200608-e772e426d1d0/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY= +github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 h1:uyHgKwTluKHt2ctmyZfdVxECwSqYflYDo+RwyZZEdR0= +github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= diff --git a/pagerduty/resource_pagerduty_escalation_policy.go b/pagerduty/resource_pagerduty_escalation_policy.go index ec3c30067..57933e765 100644 --- a/pagerduty/resource_pagerduty_escalation_policy.go +++ b/pagerduty/resource_pagerduty_escalation_policy.go @@ -87,9 +87,8 @@ func buildEscalationPolicyStruct(d *schema.ResourceData) *pagerduty.EscalationPo escalationPolicy.Description = attr.(string) } - if attr, ok := d.GetOk("num_loops"); ok { - escalationPolicy.NumLoops = attr.(int) - } + loops := d.Get("num_loops").(int) + escalationPolicy.NumLoops = &loops if attr, ok := d.GetOk("teams"); ok { escalationPolicy.Teams = expandTeams(attr.([]interface{})) diff --git a/vendor/github.com/heimweh/go-pagerduty/pagerduty/escalation_policy.go b/vendor/github.com/heimweh/go-pagerduty/pagerduty/escalation_policy.go index 416705c9d..dc2570346 100644 --- a/vendor/github.com/heimweh/go-pagerduty/pagerduty/escalation_policy.go +++ b/vendor/github.com/heimweh/go-pagerduty/pagerduty/escalation_policy.go @@ -21,7 +21,7 @@ type EscalationPolicy struct { HTMLURL string `json:"html_url,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` - NumLoops int `json:"num_loops,omitempty"` + NumLoops *int `json:"num_loops,omitempty"` RepeatEnabled bool `json:"repeat_enabled,omitempty"` Self string `json:"self,omitempty"` Services []*ServiceReference `json:"services,omitempty"` diff --git a/vendor/modules.txt b/vendor/modules.txt index a6ec22f63..20df9f5bb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -188,7 +188,7 @@ github.com/hashicorp/terraform-svchost/auth github.com/hashicorp/terraform-svchost/disco # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hashicorp/yamux -# github.com/heimweh/go-pagerduty v0.0.0-20210401200608-e772e426d1d0 +# github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 ## explicit github.com/heimweh/go-pagerduty/pagerduty # github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af