# `Infusion.IR`
[🔗](https://github.com/mandar1045/infusion/blob/v0.1.0/lib/infusion/ir.ex#L1)

The intermediate representation: what the code generator reads, instead of
the spec. Built from a document that went through `Infusion.Ref` and
`Infusion.Normalize`.

    {:ok, ir} = Infusion.IR.build(document)
    ir.operations  #=> [%Infusion.IR.Operation{module: ["Repos"], function: "get", ...}]
    ir.schemas     #=> %{"Repository" => %Infusion.IR.Schema{kind: :object, ...}}
    ir.warnings    #=> what could not be represented

# `build`

```elixir
@spec build(map()) ::
  {:ok,
   %Infusion.IR{
     auth: term(),
     operations: term(),
     schemas: term(),
     servers: term(),
     warnings: term()
   }}
```

Builds the IR. Never fails on unusual schemas: they become `:any`, with a warning.

---

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