| 248 | } |
| 249 | |
| 250 | func (c *Client) PatchOrganizationIDPSyncMapping(ctx context.Context, req PatchOrganizationIDPSyncMappingRequest) (OrganizationSyncSettings, error) { |
| 251 | res, err := c.Request(ctx, http.MethodPatch, "/api/v2/settings/idpsync/organization/mapping", req) |
| 252 | if err != nil { |
| 253 | return OrganizationSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 254 | } |
| 255 | defer res.Body.Close() |
| 256 | |
| 257 | if res.StatusCode != http.StatusOK { |
| 258 | return OrganizationSyncSettings{}, ReadBodyAsError(res) |
| 259 | } |
| 260 | var resp OrganizationSyncSettings |
| 261 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 262 | } |
| 263 | |
| 264 | func (c *Client) GetAvailableIDPSyncFields(ctx context.Context) ([]string, error) { |
| 265 | res, err := c.Request(ctx, http.MethodGet, "/api/v2/settings/idpsync/available-fields", nil) |