PostWorkspaceUsage marks the workspace as having been used recently and records an app stat.
(ctx context.Context, id uuid.UUID, req PostWorkspaceUsageRequest)
| 371 | |
| 372 | // PostWorkspaceUsage marks the workspace as having been used recently and records an app stat. |
| 373 | func (c *Client) PostWorkspaceUsageWithBody(ctx context.Context, id uuid.UUID, req PostWorkspaceUsageRequest) error { |
| 374 | path := fmt.Sprintf("/api/v2/workspaces/%s/usage", id.String()) |
| 375 | res, err := c.Request(ctx, http.MethodPost, path, req) |
| 376 | if err != nil { |
| 377 | return xerrors.Errorf("post workspace usage: %w", err) |
| 378 | } |
| 379 | defer res.Body.Close() |
| 380 | if res.StatusCode != http.StatusNoContent { |
| 381 | return ReadBodyAsError(res) |
| 382 | } |
| 383 | return nil |
| 384 | } |
| 385 | |
| 386 | // PostWorkspaceUsage marks the workspace as having been used recently. |
| 387 | // Deprecated: use PostWorkspaceUsageWithBody instead |