nolint:revive
(ctx context.Context, templateVersion uuid.UUID, archive bool)
| 320 | |
| 321 | //nolint:revive |
| 322 | func (c *Client) SetArchiveTemplateVersion(ctx context.Context, templateVersion uuid.UUID, archive bool) error { |
| 323 | u := fmt.Sprintf("/api/v2/templateversions/%s", templateVersion.String()) |
| 324 | if archive { |
| 325 | u += "/archive" |
| 326 | } else { |
| 327 | u += "/unarchive" |
| 328 | } |
| 329 | res, err := c.Request(ctx, http.MethodPost, u, nil) |
| 330 | if err != nil { |
| 331 | return err |
| 332 | } |
| 333 | defer res.Body.Close() |
| 334 | if res.StatusCode != http.StatusOK { |
| 335 | return ReadBodyAsError(res) |
| 336 | } |
| 337 | |
| 338 | return nil |
| 339 | } |
| 340 | |
| 341 | func (c *Client) DeleteTemplate(ctx context.Context, template uuid.UUID) error { |
| 342 | res, err := c.Request(ctx, http.MethodDelete, fmt.Sprintf("/api/v2/templates/%s", template), nil) |