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

Method PatchWorkspaceSharingSettings

codersdk/workspacesharing.go:63–75  ·  view source on GitHub ↗

PatchWorkspaceSharingSettings modifies the workspace sharing settings for an organization.

(ctx context.Context, orgID string, req UpdateWorkspaceSharingSettingsRequest)

Source from the content-addressed store, hash-verified

61
62// PatchWorkspaceSharingSettings modifies the workspace sharing settings for an organization.
63func (c *Client) PatchWorkspaceSharingSettings(ctx context.Context, orgID string, req UpdateWorkspaceSharingSettingsRequest) (WorkspaceSharingSettings, error) {
64 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/workspace-sharing", orgID), req)
65 if err != nil {
66 return WorkspaceSharingSettings{}, err
67 }
68
69 defer res.Body.Close()
70 if res.StatusCode != http.StatusOK {
71 return WorkspaceSharingSettings{}, ReadBodyAsError(res)
72 }
73 var resp WorkspaceSharingSettings
74 return resp, json.NewDecoder(res.Body).Decode(&resp)
75}

Callers 3

organizationSettingsMethod · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 2