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

Method GroupIDPSyncSettings

codersdk/idpsync.go:43–55  ·  view source on GitHub ↗
(ctx context.Context, orgID string)

Source from the content-addressed store, hash-verified

41}
42
43func (c *Client) GroupIDPSyncSettings(ctx context.Context, orgID string) (GroupSyncSettings, error) {
44 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/groups", orgID), nil)
45 if err != nil {
46 return GroupSyncSettings{}, xerrors.Errorf("make request: %w", err)
47 }
48 defer res.Body.Close()
49
50 if res.StatusCode != http.StatusOK {
51 return GroupSyncSettings{}, ReadBodyAsError(res)
52 }
53 var resp GroupSyncSettings
54 return resp, json.NewDecoder(res.Body).Decode(&resp)
55}
56
57func (c *Client) PatchGroupIDPSyncSettings(ctx context.Context, orgID string, req GroupSyncSettings) (GroupSyncSettings, error) {
58 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/groups", orgID), req)

Callers 5

organizationSettingsMethod · 0.80
TestGetGroupSyncSettingsFunction · 0.80
TestPatchGroupSyncConfigFunction · 0.80

Calls 4

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
ErrorfMethod · 0.45

Tested by 4

TestGetGroupSyncSettingsFunction · 0.64
TestPatchGroupSyncConfigFunction · 0.64