# `WardrikRest.Call`

Makes one call to an operation for an agent.

  * The credentials of the operation's first scheme alternative the API has sources for go in
    as its description says, with the API's `:headers` and the header arguments given.
  * A `401` tells the agent's `WardrikCore.Credentials` the token was refused, then the call is
    made once more with a fresh one.
  * A `429`, a `5xx` or no answer raises `WardrikRest.Unavailable`, so the tool runner retries.
  * Any other status is an error naming it, with the API's message.
  * An answer longer than the API's `:max_result_bytes` is cut, as JSON text.

# `t`

```elixir
@type t() :: %WardrikRest.Call{
  api: WardrikRest.API.t(),
  args: %{required(String.t()) =&gt; term()},
  context: WardrikCore.Context.t(),
  operation: WardrikRest.Operation.t()
}
```

One call: the operation of an API, its arguments, and the turn it's made in.

# `run`

```elixir
@spec run(
  WardrikRest.API.t(),
  WardrikRest.Operation.t(),
  map(),
  WardrikCore.Context.t()
) ::
  {:ok, term()} | {:error, String.t()} | {:park, WardrikCore.Authorization.t()}
```

Calls `operation` of `api` with the tool's `args`, as whoever `context` acts for.

---

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