MCPcopy Index your code
hub / github.com/coder/coder / DeleteAIProvider

Method DeleteAIProvider

codersdk/aiproviders.go:470–480  ·  view source on GitHub ↗

DeleteAIProvider soft-deletes an AI provider identified by ID or name. The row is preserved for audit/FK history.

(ctx context.Context, idOrName string)

Source from the content-addressed store, hash-verified

468// DeleteAIProvider soft-deletes an AI provider identified by ID or
469// name. The row is preserved for audit/FK history.
470func (c *Client) DeleteAIProvider(ctx context.Context, idOrName string) error {
471 res, err := c.Request(ctx, http.MethodDelete, fmt.Sprintf("/api/v2/ai/providers/%s", idOrName), nil)
472 if err != nil {
473 return err
474 }
475 defer res.Body.Close()
476 if res.StatusCode != http.StatusNoContent {
477 return ReadBodyAsError(res)
478 }
479 return nil
480}

Callers 3

TestAIProvidersCRUDFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 3

TestAIProvidersCRUDFunction · 0.64