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)
| 899 | // This is used to populate the owner dropdown when creating workspaces for |
| 900 | // other users. |
| 901 | func (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 | } |