ExScim.Groups.Mapper (ex_scim v0.2.2)

Copy Markdown View Source

Converts between domain group structs and SCIM JSON representations.

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

Configuration

config :ex_scim, group_resource_mapper: MyApp.GroupMapper

Summary

Functions

Returns the configured group mapper adapter module.

Converts a SCIM JSON map into a domain group struct.

Converts a domain group struct into a SCIM JSON map.

Functions

adapter()

Returns the configured group 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 group struct.

The scope provides tenant/caller context for the conversion.

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

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

Converts a domain group 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).