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

Method PatchRoleIDPSyncSettings

codersdk/idpsync.go:133–145  ·  view source on GitHub ↗
(ctx context.Context, orgID string, req RoleSyncSettings)

Source from the content-addressed store, hash-verified

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)
135 if err != nil {
136 return RoleSyncSettings{}, xerrors.Errorf("make request: %w", err)
137 }
138 defer res.Body.Close()
139
140 if res.StatusCode != http.StatusOK {
141 return RoleSyncSettings{}, ReadBodyAsError(res)
142 }
143 var resp RoleSyncSettings
144 return resp, json.NewDecoder(res.Body).Decode(&resp)
145}
146
147type PatchRoleIDPSyncConfigRequest struct {
148 Field string `json:"field"`

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