| 75 | } |
| 76 | |
| 77 | func (c *Client) PatchGroupIDPSyncConfig(ctx context.Context, orgID string, req PatchGroupIDPSyncConfigRequest) (GroupSyncSettings, error) { |
| 78 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/groups/config", orgID), req) |
| 79 | if err != nil { |
| 80 | return GroupSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 81 | } |
| 82 | defer res.Body.Close() |
| 83 | |
| 84 | if res.StatusCode != http.StatusOK { |
| 85 | return GroupSyncSettings{}, ReadBodyAsError(res) |
| 86 | } |
| 87 | var resp GroupSyncSettings |
| 88 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 89 | } |
| 90 | |
| 91 | // If the same mapping is present in both Add and Remove, Remove will take presidence. |
| 92 | type PatchGroupIDPSyncMappingRequest struct { |