DeleteProvisionerKey deletes a provisioner key.
(ctx context.Context, organizationID uuid.UUID, name string)
| 496 | |
| 497 | // DeleteProvisionerKey deletes a provisioner key. |
| 498 | func (c *Client) DeleteProvisionerKey(ctx context.Context, organizationID uuid.UUID, name string) error { |
| 499 | res, err := c.Request(ctx, http.MethodDelete, |
| 500 | fmt.Sprintf("/api/v2/organizations/%s/provisionerkeys/%s", organizationID.String(), name), |
| 501 | nil, |
| 502 | ) |
| 503 | if err != nil { |
| 504 | return xerrors.Errorf("make request: %w", err) |
| 505 | } |
| 506 | defer res.Body.Close() |
| 507 | |
| 508 | if res.StatusCode != http.StatusNoContent { |
| 509 | return ReadBodyAsError(res) |
| 510 | } |
| 511 | return nil |
| 512 | } |
| 513 | |
| 514 | func ConvertWorkspaceStatus(jobStatus ProvisionerJobStatus, transition WorkspaceTransition) WorkspaceStatus { |
| 515 | switch jobStatus { |
nothing calls this directly
no test coverage detected