| 41 | } |
| 42 | |
| 43 | func (c *Client) GroupIDPSyncSettings(ctx context.Context, orgID string) (GroupSyncSettings, error) { |
| 44 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/groups", orgID), nil) |
| 45 | if err != nil { |
| 46 | return GroupSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 47 | } |
| 48 | defer res.Body.Close() |
| 49 | |
| 50 | if res.StatusCode != http.StatusOK { |
| 51 | return GroupSyncSettings{}, ReadBodyAsError(res) |
| 52 | } |
| 53 | var resp GroupSyncSettings |
| 54 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 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) |