# `AshScim.Decoder`
[🔗](https://github.com/ash-project/ash_scim/blob/main/lib/ash_scim/decoder.ex#L5)

Decodes inbound SCIM 2.0 JSON payloads into Ash action input.

The decoded result has two parts:

  * `:attrs` — a flat `%{atom => value}` map suitable for
    `Ash.Changeset.for_create/3` or `for_update/3`.
  * `:relationships` — a `%{atom => [%{atom => value}]}` map of
    relationship-management input for relationship-backed multivalued
    attributes (full-replace semantics for top-level body inclusion).

Per RFC 7644 §3.1, unknown attributes are silently dropped. Emit-only
static-value mappings are skipped on the way in.

Multivalueds with `mirror_primary_to:` set additionally write the primary
entry's `value` to the named scalar attribute on the parent.

# `decoded`

```elixir
@type decoded() :: %{
  attrs: %{required(atom()) =&gt; term()},
  relationships: %{required(atom()) =&gt; [%{required(atom()) =&gt; term()}]}
}
```

# `decode`

```elixir
@spec decode(module(), %{required(String.t()) =&gt; term()}) :: decoded()
```

Decode a SCIM resource JSON map into structured Ash action input.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
