| 169 | } |
| 170 | |
| 171 | func (c *Client) PatchRoleIDPSyncMapping(ctx context.Context, orgID string, req PatchRoleIDPSyncMappingRequest) (RoleSyncSettings, error) { |
| 172 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/roles/mapping", orgID), req) |
| 173 | if err != nil { |
| 174 | return RoleSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 175 | } |
| 176 | defer res.Body.Close() |
| 177 | |
| 178 | if res.StatusCode != http.StatusOK { |
| 179 | return RoleSyncSettings{}, ReadBodyAsError(res) |
| 180 | } |
| 181 | var resp RoleSyncSettings |
| 182 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 183 | } |
| 184 | |
| 185 | type OrganizationSyncSettings struct { |
| 186 | // Field selects the claim field to be used as the created user's |