PagerDuty / go-pagerduty

go client library for PagerDuty v2 API
https://v2.developer.pagerduty.com/docs/rest-api
Apache License 2.0
285 stars 241 forks source link

Cannot Update EscalationPolicy for Account without teams subscription #511

Open erwan690 opened 7 months ago

erwan690 commented 7 months ago

Teams Object of array on EscalationPolicy i thinks i can be omitempty

type EscalationPolicy struct {
    APIObject
    Name                       string           `json:"name,omitempty"`
    EscalationRules            []EscalationRule `json:"escalation_rules,omitempty"`
    Services                   []APIObject      `json:"services,omitempty"`
    NumLoops                   uint             `json:"num_loops,omitempty"`
    Teams                      []APIReference   `json:"teams,omitempty"`
    Description                string           `json:"description,omitempty"`
    OnCallHandoffNotifications string           `json:"on_call_handoff_notifications,omitempty"`
}

because it fail if i use UpdateEscalationPolicyWithContext

get Response : HTTP response failed with status code 402, message: Required abilities are unavailable (code: 2014): The teams account ability is required to assign to a team

if it sent object teams with empty array on api update