# `AshHooks.Provider.Event`
[🔗](https://github.com/baselabs/ash_hooks/blob/v3.3.0/lib/ash_hooks/provider/event.ex#L1)

A verified webhook returned by a configured provider's default handler.

Its `type` is the fixed atom `:webhook`; the sender's event names remain in the
payload, never converted into atoms. Override `parse_event_type/1` and
`handle_event/2` in your provider to classify events and perform idempotent
business actions.

# `t`

```elixir
@type t() :: %AshHooks.Provider.Event{payload: map() | list(), type: atom()}
```

# `build`

```elixir
@spec build(atom(), map() | list()) :: {:ok, t()}
```

Wraps a verified, decoded payload and the host's classified event type in
an event. Returns `{:ok, event}` without performing verification or business
effects. The caller owns type and payload validation. A provider can delegate
`handle_event/2` here when it only needs to return the event.

# `parse`

```elixir
@spec parse(term()) :: {:ok, :webhook} | {:error, :malformed_payload}
```

Classifies a decoded map or list as `:webhook` without creating atoms from
sender-controlled names. Other values return `{:error, :malformed_payload}`.
Use this as a provider's `parse_event_type/1` callback when the host does not
need domain-specific classification.

---

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