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

Method WorkspaceAvailableUsers

codersdk/workspaces.go:901–912  ·  view source on GitHub ↗

WorkspaceAvailableUsers returns users available for workspace creation. This is used to populate the owner dropdown when creating workspaces for other users.

(ctx context.Context, organizationID uuid.UUID, userID string)

Source from the content-addressed store, hash-verified

899// This is used to populate the owner dropdown when creating workspaces for
900// other users.
901func (c *Client) WorkspaceAvailableUsers(ctx context.Context, organizationID uuid.UUID, userID string) ([]MinimalUser, error) {
902 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/members/%s/workspaces/available-users", organizationID, userID), nil)
903 if err != nil {
904 return nil, err
905 }
906 defer res.Body.Close()
907 if res.StatusCode != http.StatusOK {
908 return nil, ReadBodyAsError(res)
909 }
910 var users []MinimalUser
911 return users, json.NewDecoder(res.Body).Decode(&users)
912}

Callers 1

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1