# `Hyper.Firecracker.Api.Transport`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/hyper/firecracker/api/transport.ex#L1)

`oapi_generator` client backend for the Firecracker API. Each generated
operation calls `request/1` with a plain map describing the call; this issues
it over the target daemon's HTTP-over-Unix-socket API via `Req` and decodes the
typed response.

The per-VM socket path arrives as `opts[:socket_path]` (injected by
`Hyper.Node.FireVMM.Client`). Request bodies are generated structs encoded by
`Hyper.Firecracker.Api.Codec` (nil-stripped) or, for free-form bodies like
MMDS, plain maps sent verbatim. Typed responses are decoded by the schema's
own generated `decode/1` (also from `Hyper.Firecracker.Api.Codec`).

Returns: `:ok` (204 / empty), `{:ok, decoded}` (2xx with a typed body),
`{:error, {:api, status, fault_message}}` (non-2xx), or
`{:error, {:transport, reason}}` (socket/connection failure).

# `result`

```elixir
@type result() ::
  :ok
  | {:ok, term()}
  | {:error, {:api, pos_integer(), String.t() | nil} | {:transport, term()}}
```

# `request`

```elixir
@spec request(map()) :: result()
```

---

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