Skip to content

Commit

Permalink
Add UninstallTool
Browse files Browse the repository at this point in the history
  • Loading branch information
nlathia committed Dec 16, 2024
1 parent a2cbe96 commit 171b40b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tool_uninstall.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package client

import (
"context"
"fmt"
"net/http"
)

// UninstallTool deletes a tool by uninstalling it. Note: this does not
// (yet) check whether those tools are used in procedures. Use with caution!
//
// Note: requires a `Management` API key.
func (c *Client) UninstallTool(ctx context.Context, toolID string) error {
rsp, err := c.makeRequest(ctx, http.MethodDelete, fmt.Sprintf("tools/%s", toolID), nil)
if err != nil {
return err
}
defer rsp.Body.Close()

if err := responseError(rsp); err != nil {
return err
}
return nil
}

0 comments on commit 171b40b

Please sign in to comment.