# `ExWapp.Message.Content`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/message/content.ex#L1)

Canonical content contract for inbound WhatsApp messages.

The struct is intentionally independent from transport and Signal details.
Legacy message-map fields remain available at the publishing boundary while
wrappers can consume this single typed value.

# `kind`

```elixir
@type kind() ::
  :text | :media | :location | :contact | :event | :protocol | :unsupported
```

# `t`

```elixir
@type t() :: %ExWapp.Message.Content{
  contact: map() | nil,
  diagnostics: map(),
  event: map() | nil,
  kind: kind(),
  location: map() | nil,
  media: ExWapp.Media.Ref.t() | nil,
  media_type: atom() | nil,
  protocol_payload: binary() | nil,
  text: binary() | nil
}
```

# `from_legacy`

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

Adapts an already-normalized legacy message map to the canonical contract.

# `new`

```elixir
@spec new(kind(), keyword()) :: t()
```

Builds a canonical content value from one supported kind and its fields.

# `to_legacy`

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

Converts canonical content to the existing message-map fields.

---

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