1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
Sean Smith 97790d6168 Initial pagerduty widget
List people on call, along with the escalation policy
Addresses #159
2019-02-07 02:13:53 -05:00

23 lines
617 B
Go

package pagerduty
// ListAbilityResponse is the response when calling the ListAbility API endpoint.
type ListAbilityResponse struct {
Abilities []string `json:"abilities"`
}
// ListAbilities lists all abilities on your account.
func (c *Client) ListAbilities() (*ListAbilityResponse, error) {
resp, err := c.get("/abilities")
if err != nil {
return nil, err
}
var result ListAbilityResponse
return &result, c.decodeJSON(resp, &result)
}
// TestAbility Check if your account has the given ability.
func (c *Client) TestAbility(ability string) error {
_, err := c.get("/abilities/" + ability)
return err
}