| 95 | } |
| 96 | |
| 97 | func (c *Client) PatchGroupIDPSyncMapping(ctx context.Context, orgID string, req PatchGroupIDPSyncMappingRequest) (GroupSyncSettings, error) { |
| 98 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/groups/mapping", orgID), req) |
| 99 | if err != nil { |
| 100 | return GroupSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 101 | } |
| 102 | defer res.Body.Close() |
| 103 | |
| 104 | if res.StatusCode != http.StatusOK { |
| 105 | return GroupSyncSettings{}, ReadBodyAsError(res) |
| 106 | } |
| 107 | var resp GroupSyncSettings |
| 108 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 109 | } |
| 110 | |
| 111 | type RoleSyncSettings struct { |
| 112 | // Field is the name of the claim field that specifies what organization roles |