From 35312f0066210bec9250c65db4a8931b22e99809 Mon Sep 17 00:00:00 2001 From: Alexander Hellbom Date: Mon, 17 Oct 2016 20:37:55 +0200 Subject: [PATCH] Simplify setting up EscalationPolicy --- .../providers/pagerduty/resource_pagerduty_service.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/builtin/providers/pagerduty/resource_pagerduty_service.go b/builtin/providers/pagerduty/resource_pagerduty_service.go index d45710306..aa20cf408 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_service.go +++ b/builtin/providers/pagerduty/resource_pagerduty_service.go @@ -61,9 +61,13 @@ func buildServiceStruct(d *schema.ResourceData) *pagerduty.Service { service.AcknowledgementTimeout = &acknowledgementTimeout } - policy := &pagerduty.EscalationPolicy{} - policy.ID = d.Get("escalation_policy").(string) - policy.Type = "escalation_policy" + policy := &pagerduty.EscalationPolicy{ + APIObject: pagerduty.APIObject{ + ID: d.Get("escalation_policy").(string), + Type: "escalation_policy", + }, + } + service.EscalationPolicy = *policy return &service