Skip to content

Commit

Permalink
add DeleteWorkspace method to api client
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasHiltl committed Sep 3, 2024
1 parent 1b7279b commit 4ae007b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,20 @@ func (c *Client) CreateWorkspace(ctx context.Context, args apitypes.CreateWorksp
err = resp.DecodeJSON(&w)
return w, err
}

func (c *Client) DeleteWorkspace(ctx context.Context, id string) error {
req, err := c.NewRequest(
ctx, http.MethodDelete,
fmt.Sprintf("/workspaces/%s", id),
nil,
)
if err != nil {
return err
}

_, err = c.rawRequestWithContext(req)
if err != nil {
return fmt.Errorf("error while creating workspace: %w", err)
}
return nil
}

0 comments on commit 4ae007b

Please sign in to comment.