# `PhoenixGenApi.Structs.Response`
[🔗](https://github.com/ohhi-vn/phoenix_gen_api/blob/main/lib/phoenix_gen_api/structs/response.ex#L1)

Defines the structure of a response sent back to the client.

This module provides helper functions to create different types of responses,
such as synchronous, asynchronous, and error responses.

# `t`

```elixir
@type t() :: %PhoenixGenApi.Structs.Response{
  async: boolean(),
  can_retry: boolean(),
  error: String.t() | nil,
  has_more: boolean(),
  request_id: String.t(),
  result: any(),
  success: boolean()
}
```

# `async_response`

Creates a response for an asynchronous request, indicating that the request
has been received and is being processed.

# `encode`

# `encode!`

Create Request from params for convert data map from websocket api.

# `encode!`

Create Request from params for convert data map from websocket api.
Opts is not supported yet.

# `error_response`

Creates a response for a failed request.

# `is_error?`

Checks if the response represents an error.

# `stream_end_response`

Creates a response to indicate the end of a stream.

# `stream_response`

Creates a response for a streaming request.

# `sync_response`

Creates a response for a successful synchronous request.

---

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