# `Insider.Event`
[🔗](https://github.com/hiivemarkets/insider/blob/v0.1.0/lib/insider/event.ex#L1)

Versioned, bounded, portable evidence shared by collectors and detectors.

Extensible vocabulary remains binary on both sides of the trust boundary.
Only closed library-owned enums, such as severity, use atoms internally.
Version 1 monotonic timestamps are signed microseconds. Wall time is display
and provenance metadata and never establishes causality.

# `causality`

```elixir
@type causality() :: %{
  trace_id: String.t() | nil,
  span_id: String.t() | nil,
  parent_event_id: String.t() | nil,
  logical_operation_id: String.t() | nil,
  process_generation: String.t() | nil
}
```

# `severity`

```elixir
@type severity() :: :debug | :info | :warning | :error | :critical
```

# `t`

```elixir
@type t() :: %Insider.Event{
  attributes: map(),
  authority: String.t(),
  boot_id: String.t(),
  causality: causality(),
  clock_id: String.t(),
  extensions: map(),
  id: String.t(),
  kind: String.t(),
  monotonic_time: integer(),
  node: String.t(),
  payload: term(),
  redactions: [map()],
  schema: String.t(),
  severity: severity(),
  source: String.t(),
  source_instance_id: String.t(),
  source_sequence: pos_integer(),
  subject: map() | nil,
  wall_time: DateTime.t() | nil
}
```

# `canonical_binary`

```elixir
@spec canonical_binary(term()) ::
  {:ok, binary()} | {:error, Insider.Protocol.Error.t()}
```

# `decode_map`

```elixir
@spec decode_map(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

# `new!`

```elixir
@spec new!(keyword()) :: t()
```

# `to_wire_map`

```elixir
@spec to_wire_map(t()) :: map()
```

# `validate`

```elixir
@spec validate(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

---

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