Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: codersdk: add documentation for UpdateWorkspaceAutostartRequest …
…/ UpdateWorkspaceAutostart
  • Loading branch information
johnstcn committed Apr 6, 2022
commit 3b4664cc8e8bf6a0e2e447cfa6770f2aba2c58d0
3 changes: 3 additions & 0 deletions codersdk/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ func (c *Client) WorkspaceBuildByName(ctx context.Context, workspace uuid.UUID,
return workspaceBuild, json.NewDecoder(res.Body).Decode(&workspaceBuild)
}

// UpdateWorkspaceAutostartRequest is a request to update a workspace's autostart schedule.
type UpdateWorkspaceAutostartRequest struct {
Schedule string
}

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