8000 fix: codersdk: add documentation for UpdateWorkspaceAutostartRequest … · coder/coder@1469e4b · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 1469e4b

Browse files
committed
fix: codersdk: add documentation for UpdateWorkspaceAutostartRequest / UpdateWorkspaceAutostart
1 parent 854e2d9 commit 1469e4b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

codersdk/workspaces.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ func (c *Client) WorkspaceBuildByName(ctx context.Context, workspace uuid.UUID,
9090
return workspaceBuild, json.NewDecoder(res.Body).Decode(&workspaceBuild)
9191
}
9292

93+
// UpdateWorkspaceAutostartRequest is a request to update a workspace's autostart schedule.
9394
type UpdateWorkspaceAutostartRequest struct {
9495
Schedule string
9596
}
9697

98+
// UpdateWorkspaceAutostart sets the autostart schedule for workspace by id.
99+
// If the provided schedule is empty, autostart is disabled for the workspace.
97100
func (c *Client) UpdateWorkspaceAutostart(ctx context.Context, id uuid.UUID, req UpdateWorkspaceAutostartRequest) error {
98101
path := fmt.Sprintf("/api/v2/workspaces/%s/autostart", id.String())
99102
res, err := c.request(ctx, http.MethodPut, path, req)

0 commit comments

Comments
 (0)
0