# `Infusion.Gen.Operations`
[🔗](https://github.com/mandar1045/infusion/blob/v0.1.0/lib/infusion/gen/operations.ex#L1)

Generates one module per resource with one function per operation.

    defmodule OpenAI.Models do
      @retrieve_operation %{method: :get, path: "/models/{model}", ...}

      @spec retrieve(String.t(), keyword()) :: {:ok, OpenAI.Schemas.Model.t()} | {:error, Infusion.Runtime.Error.t()}
      def retrieve(model, opts \\ []), do: OpenAI.__request__(@retrieve_operation, [model], %{}, opts)

      def retrieve!(model, opts \\ []), do: ...
    end

Path parameters are positional. Query, header and body parameters are one
map or keyword list, `params`; operations that take none have no `params`
argument. Call options (`timeout:`, `max_retries:`, `raw:`, ...) come last.
The operation itself is data handed to `Infusion.Runtime.Request`.

# `render`

```elixir
@spec render(
  %Infusion.IR{
    auth: term(),
    operations: term(),
    schemas: term(),
    servers: term(),
    warnings: term()
  },
  String.t(),
  %{required(String.t()) =&gt; String.t()}
) :: [Infusion.Gen.Schemas.file()]
```

Renders the operations of `ir` under `base` (`"OpenAI"`), with `modules`
the schema-name-to-module mapping from `Infusion.Gen.Schemas.render/2`.

---

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