| 196 | } |
| 197 | |
| 198 | func (c *Client) PatchGroup(ctx context.Context, group uuid.UUID, req PatchGroupRequest) (Group, error) { |
| 199 | res, err := c.Request(ctx, http.MethodPatch, |
| 200 | fmt.Sprintf("/api/v2/groups/%s", group.String()), |
| 201 | req, |
| 202 | ) |
| 203 | if err != nil { |
| 204 | return Group{}, xerrors.Errorf("make request: %w", err) |
| 205 | } |
| 206 | defer res.Body.Close() |
| 207 | |
| 208 | if res.StatusCode != http.StatusOK { |
| 209 | return Group{}, ReadBodyAsError(res) |
| 210 | } |
| 211 | var resp Group |
| 212 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 213 | } |
| 214 | |
| 215 | func (c *Client) DeleteGroup(ctx context.Context, group uuid.UUID) error { |
| 216 | res, err := c.Request(ctx, http.MethodDelete, |