ExScim.Users.Patcher (ex_scim v0.2.2)

Copy Markdown View Source

Applies SCIM PatchOp operations to user data (maps or structs). Handles multiple ops, optional path, simple/complex values, and removals. Supports both plain maps and domain structs with automatic key conversion.

Summary

Functions

Applies SCIM PatchOp operations to a user.

Functions

patch(user_data, patch_ops)

@spec patch(map() | struct(), map()) :: {:ok, map() | struct()} | {:error, term()}

Applies SCIM PatchOp operations to a user.

The patch_ops map must contain an "Operations" key with a non-empty list of operations. Each operation must have an "op" field ("add", "replace", or "remove") and optionally "path" and "value" fields.

Returns {:ok, updated_user} or {:error, reason}.