ExScim.Users.Mapper (ex_scim v0.2.2)

Copy Markdown View Source

Converts between domain user structs and SCIM JSON representations.

Delegates to the configured mapper adapter. Falls back to ExScim.Users.Mapper.DefaultMapper when no adapter is configured.

Configuration

config :ex_scim, user_resource_mapper: MyApp.UserMapper

Summary

Functions

Returns the configured user mapper adapter module.

Converts a SCIM JSON map into a domain user struct.

Converts a domain user struct into a SCIM JSON map.

Functions

adapter()

Returns the configured user mapper adapter module.

from_scim(scim_data, caller)

@spec from_scim(map(), ExScim.Scope.t()) ::
  {:ok, struct() | map()} | {:error, atom() | term()}

Converts a SCIM JSON map into a domain user struct.

The scope provides tenant/caller context for the conversion.

to_scim(user_struct, caller, opts \\ [])

@spec to_scim(struct() | map(), ExScim.Scope.t(), keyword()) ::
  {:ok, map()} | {:error, atom() | term()}

Converts a domain user struct into a SCIM JSON map.

The scope provides tenant/caller context. opts are passed through to the adapter (e.g. for controlling which fields to include).