| 149 | } |
| 150 | |
| 151 | func (c *Client) PatchRoleIDPSyncConfig(ctx context.Context, orgID string, req PatchRoleIDPSyncConfigRequest) (RoleSyncSettings, error) { |
| 152 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/roles/config", orgID), req) |
| 153 | if err != nil { |
| 154 | return RoleSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 155 | } |
| 156 | defer res.Body.Close() |
| 157 | |
| 158 | if res.StatusCode != http.StatusOK { |
| 159 | return RoleSyncSettings{}, ReadBodyAsError(res) |
| 160 | } |
| 161 | var resp RoleSyncSettings |
| 162 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 163 | } |
| 164 | |
| 165 | // If the same mapping is present in both Add and Remove, Remove will take presidence. |
| 166 | type PatchRoleIDPSyncMappingRequest struct { |