# `Wardrik.Operations.Types`

Converts each operation's input and output between Elixir and the protocol's JSON.

Input is keyword lists and structs. Output is structs, lists and `:ok`.

# `decode`

```elixir
@spec decode(String.t(), map() | nil) :: term()
```

Converts the operation's JSON output to what an Elixir caller gets.

# `encode`

```elixir
@spec encode(String.t(), term()) :: map()
```

Converts an Elixir caller's `input` to the operation's JSON input.

# `event`

```elixir
@spec event({map(), String.t()}) :: {Wardrik.Event.t(), String.t()}
```

Converts a streamed event and its cursor to `{%Wardrik.Event{}, cursor}`.

# `path`

```elixir
@spec path(String.t() | struct()) :: String.t()
```

Returns the path segment for `value`: a string as given, or a struct's ID or name.

---

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