WorkspaceSharingSettings retrieves the workspace sharing settings for an organization.
(ctx context.Context, orgID string)
| 46 | |
| 47 | // WorkspaceSharingSettings retrieves the workspace sharing settings for an organization. |
| 48 | func (c *Client) WorkspaceSharingSettings(ctx context.Context, orgID string) (WorkspaceSharingSettings, error) { |
| 49 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/settings/workspace-sharing", orgID), nil) |
| 50 | if err != nil { |
| 51 | return WorkspaceSharingSettings{}, err |
| 52 | } |
| 53 | defer res.Body.Close() |
| 54 | |
| 55 | if res.StatusCode != http.StatusOK { |
| 56 | return WorkspaceSharingSettings{}, ReadBodyAsError(res) |
| 57 | } |
| 58 | var resp WorkspaceSharingSettings |
| 59 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 60 | } |
| 61 | |
| 62 | // PatchWorkspaceSharingSettings modifies the workspace sharing settings for an organization. |
| 63 | func (c *Client) PatchWorkspaceSharingSettings(ctx context.Context, orgID string, req UpdateWorkspaceSharingSettingsRequest) (WorkspaceSharingSettings, error) { |