# `AshHooks.OutboundBinding`
[🔗](https://github.com/baselabs/ash_hooks/blob/v3.3.0/lib/ash_hooks/outbound_binding.ex#L1)

Builds the versioned, opaque identifiers stored in outbound delivery rows.

Migration code may use `source/3`, `direct_source/2`, and `route/2` to
backfill the same identifiers that dispatch and worker execution validate.
Store returned identifiers as-is. They are versioned data descriptors, not
serialized executable terms. Treat their byte format as opaque.

# `direct_source`

```elixir
@spec direct_source(module(), module()) :: String.t()
```

Returns the source identifier for a direct delivery driver configuration.

# `named_route`

```elixir
@spec named_route(module(), atom()) :: String.t()
```

Returns the route identifier for a named two-argument enqueue callback.

Use this directly when a migration already stores the callback module and
function separately. It returns the same identifier as `route/2` receives
from `{module, function}` or an external function capture.

# `route`

```elixir
@spec route(nil | {module(), atom()} | (term(), term() -&gt; term()), keyword()) ::
  {:ok, String.t()} | {:error, :invalid_enqueue_key | :invalid_enqueuer}
```

Returns the route identifier for an enqueue callback.

Named `{module, function}` callbacks and external captures normalize to the
same identifier. Anonymous callbacks require a stable, nonempty binary (up
to 512 bytes) or atom `:enqueue_key` for automatic recovery; without it they
receive an explicit unresolved marker. A nil callback receives the distinct
unbound marker that reconciliation may bind once to a later named or keyed
route. Invalid callback and key shapes return an error.

# `source`

```elixir
@spec source(module(), atom(), module()) :: String.t()
```

Returns the source identifier for an outbound declaration and endpoint resource.

---

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