| 400 | } |
| 401 | |
| 402 | func (c *Client) TemplateACL(ctx context.Context, templateID uuid.UUID) (TemplateACL, error) { |
| 403 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templates/%s/acl", templateID), nil) |
| 404 | if err != nil { |
| 405 | return TemplateACL{}, err |
| 406 | } |
| 407 | defer res.Body.Close() |
| 408 | if res.StatusCode != http.StatusOK { |
| 409 | return TemplateACL{}, ReadBodyAsError(res) |
| 410 | } |
| 411 | var acl TemplateACL |
| 412 | return acl, json.NewDecoder(res.Body).Decode(&acl) |
| 413 | } |
| 414 | |
| 415 | // UpdateActiveTemplateVersion updates the active template version to the ID provided. |
| 416 | // The template version must be attached to the template. |