| 55 | } |
| 56 | |
| 57 | func (c *Client) PatchGroupIDPSyncSettings(ctx context.Context, orgID string, req GroupSyncSettings) (GroupSyncSettings, error) { |
| 58 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/groups", orgID), req) |
| 59 | if err != nil { |
| 60 | return GroupSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 61 | } |
| 62 | defer res.Body.Close() |
| 63 | |
| 64 | if res.StatusCode != http.StatusOK { |
| 65 | return GroupSyncSettings{}, ReadBodyAsError(res) |
| 66 | } |
| 67 | var resp GroupSyncSettings |
| 68 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 69 | } |
| 70 | |
| 71 | type PatchGroupIDPSyncConfigRequest struct { |
| 72 | Field string `json:"field"` |