# `Flezha.SDK.Response`
[🔗](https://github.com/flezha/flezha_elixir_sdk/blob/v0.1.0/lib/flezha/sdk/response.ex#L1)

One outcome of a `Flezha.SDK.ChannelBuilder.call/3`, as its Response channel
delivers it: the `request` the call end wrote (its bytes), the `result`
(`{:ok, answer}` with the answer read by the call's `decode:`, or
`{:error, %Flezha.SDK.Error{}}`, a missed deadline being `call.timeout`),
the callee's instance id as `target`, and `created`, true when this call
started the callee.

# `t`

```elixir
@type t() :: %Flezha.SDK.Response{
  created: boolean(),
  request: binary(),
  result: {:ok, term()} | {:error, Flezha.SDK.Error.t()},
  target: String.t()
}
```

# `decode`

```elixir
@spec decode(binary(), (binary() -&gt; {:ok, term()} | {:error, term()})) ::
  {:ok, t()} | {:error, term()}
```

The Response a controller's envelope carries, read by the core's decoder.
`decode` reads the answer's bytes as an `input_with/3` parser does. A
payload that is no envelope is `{:error, %Flezha.SDK.Error{}}` with the code
`call.malformed_response`.

---

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