# `Wardrik.Token`

An API token, without its secret.

  * `:id` and `:name` - which token.
  * `:principal` - the ID of the principal it acts for.
  * `:statements` - what it allows, as `Wardrik.Statement`s.
  * `:policy` - the policy every agent it defines is held to.
  * `:expires` - when it expires.
  * `:created_at` - when it was made.

# `t`

```elixir
@type t() :: %Wardrik.Token{
  created_at: term(),
  expires: term(),
  id: term(),
  name: term(),
  policy: term(),
  principal: term(),
  statements: term()
}
```

# `from_json`

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

Builds one from the protocol's JSON.

# `to_json`

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

Returns it as the protocol's JSON, without fields that are `nil`.

---

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