Simplify setting up EscalationPolicy

This commit is contained in:
Alexander Hellbom 2016-10-17 20:37:55 +02:00
parent 69fb733ad0
commit 35312f0066
1 changed files with 7 additions and 3 deletions

View File

@ -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