Encodes Ash records into SCIM 2.0 JSON-shaped maps using the mappings
declared in the resource's scim section.
The result is a plain map suitable for Jason.encode!/1. List-response
envelopes are the responsibility of the router; this module concerns itself
only with single-resource encoding.
Summary
Functions
Encode a single Ash record as a SCIM resource.
Wrap a list of encoded resources in a SCIM ListResponse envelope.
Types
@type opts() :: [{:base_url, String.t()}]
Functions
@spec encode(Ash.Resource.Record.t(), opts()) :: %{required(String.t()) => term()}
Encode a single Ash record as a SCIM resource.
Options:
:base_url— used to buildmeta.location. If omitted,meta.locationis not emitted.
@spec list_response([%{required(String.t()) => term()}], keyword()) :: %{ required(String.t()) => term() }
Wrap a list of encoded resources in a SCIM ListResponse envelope.
total_results should reflect the unfiltered/unpaginated count when
pagination is in play; for the simple case, pass length(resources).