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

Method RoleIDPSyncSettings

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

Source from the content-addressed store, hash-verified

117}
118
119func (c *Client) RoleIDPSyncSettings(ctx context.Context, orgID string) (RoleSyncSettings, error) {
120 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/roles", orgID), nil)
121 if err != nil {
122 return RoleSyncSettings{}, xerrors.Errorf("make request: %w", err)
123 }
124 defer res.Body.Close()
125
126 if res.StatusCode != http.StatusOK {
127 return RoleSyncSettings{}, ReadBodyAsError(res)
128 }
129 var resp RoleSyncSettings
130 return resp, json.NewDecoder(res.Body).Decode(&resp)
131}
132
133func (c *Client) PatchRoleIDPSyncSettings(ctx context.Context, orgID string, req RoleSyncSettings) (RoleSyncSettings, error) {
134 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/roles", orgID), req)

Callers 6

organizationSettingsMethod · 0.80
TestGetRoleSyncSettingsFunction · 0.80
TestPatchRoleSyncConfigFunction · 0.80
TestPatchRoleSyncMappingFunction · 0.80

Calls 4

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

Tested by 5

TestGetRoleSyncSettingsFunction · 0.64
TestPatchRoleSyncConfigFunction · 0.64
TestPatchRoleSyncMappingFunction · 0.64