# `Chronicle.Events.AppendedEvent`
[🔗](https://github.com/Cratis/Chronicle.Elixir/blob/main/lib/chronicle/events/appended_event.ex#L4)

An event read back from an event sequence, decoded into the event struct it was appended as.

Returned by `Chronicle.EventSequences.EventLog.get_for_event_source/2` and
`get_from_sequence_number/2` when called with `decode: true`.

  * `:event` — the event struct for a registered event type, or `nil` when the event type is
    not registered with this client (or the event was redacted); the decoded payload is then
    still available in `:raw`.
  * `:raw` — the event content as a map with the wire (camelCase) keys.
  * `:context` — the `Chronicle.Events.EventContext`.
  * `:type` — `%{id: String.t(), generation: non_neg_integer()}`.
  * `:redacted?` / `:redaction` — set for events that were redacted for compliance; the
    redaction carries the `:reason` and the `:original_event_type` id.

# `t`

```elixir
@type t() :: %Chronicle.Events.AppendedEvent{
  context: Chronicle.Events.EventContext.t(),
  event: struct() | nil,
  raw: map(),
  redacted?: boolean(),
  redaction: %{reason: String.t(), original_event_type: String.t()} | nil,
  type: %{id: String.t(), generation: non_neg_integer()} | nil
}
```

# `from_wire`

```elixir
@spec from_wire(map(), [module()]) :: t()
```

Decodes a wire `AppendedEvent`, resolving the event struct from `event_types`
(a list of event type modules).

---

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