| 228 | } |
| 229 | |
| 230 | func (c *Client) PatchOrganizationIDPSyncConfig(ctx context.Context, req PatchOrganizationIDPSyncConfigRequest) (OrganizationSyncSettings, error) { |
| 231 | res, err := c.Request(ctx, http.MethodPatch, "/api/v2/settings/idpsync/organization/config", req) |
| 232 | if err != nil { |
| 233 | return OrganizationSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 234 | } |
| 235 | defer res.Body.Close() |
| 236 | |
| 237 | if res.StatusCode != http.StatusOK { |
| 238 | return OrganizationSyncSettings{}, ReadBodyAsError(res) |
| 239 | } |
| 240 | var resp OrganizationSyncSettings |
| 241 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 242 | } |
| 243 | |
| 244 | // If the same mapping is present in both Add and Remove, Remove will take presidence. |
| 245 | type PatchOrganizationIDPSyncMappingRequest struct { |