# `Wardrik.Notice`

Tells someone what an agent did while nobody watched.

`conversation` is `nil` for the agent's main one. `kind` is one of:

  * `:parked` - a turn waits on a person. `calls` lists each `Wardrik.Interrupt` and its
    `arguments`.
  * `:failed` - a turn failed. `reason` says why.
  * `:finished` - a turn answered. `text` is the answer.

# `call`

```elixir
@type call() :: %{interrupt: Wardrik.Interrupt.t(), arguments: term()}
```

A call a parked turn waits on, with its arguments.

# `kind`

```elixir
@type kind() :: :parked | :failed | :finished
```

# `t`

```elixir
@type t() :: %Wardrik.Notice{
  agent: String.t(),
  at: DateTime.t(),
  calls: [call()],
  conversation: String.t() | nil,
  kind: kind(),
  reason: String.t() | nil,
  text: String.t() | nil
}
```

# `event`

```elixir
@spec event(t()) :: String.t()
```

Returns the notice's event name: `turn_parked`, `turn_failed` or `turn_finished`.

# `json`

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

Returns the notice as the JSON a webhook receives.

    Wardrik.Notice.json(notice)
    #=> %{"event" => "turn_failed", "agent" => "agt_1", "reason" => "It timed out.", ...}

# `kinds`

```elixir
@spec kinds() :: [kind()]
```

Returns every kind of notice.

---

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