# `Spectre.GAM.Kernel.Meter.Amounts`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/kernel/meter/amounts.ex#L1)

Canonical shape for quantities bound to Meter references.

Constructors may accept a map or a list of reservation descriptors for host
ergonomics. This module normalizes either form once to
`%{meter_ref => positive_integer}`. Durable records and governed semantics
use only that map thereafter, avoiding representation-dependent digests and
repeated atom/string guessing inside the core.

# `t`

```elixir
@type t() :: %{optional(String.t()) =&gt; pos_integer()}
```

# `exact_partition`

```elixir
@spec exact_partition(t(), t(), t()) :: :ok | {:error, :invalid_meter_partition}
```

Checks that partial quantities sum exactly to the total for each Meter.

# `non_empty`

```elixir
@spec non_empty(map() | list()) :: {:ok, t()} | {:error, term()}
```

Normalizes quantities and rejects an empty result.

# `normalize`

```elixir
@spec normalize(map() | list()) :: {:ok, t()} | {:error, term()}
```

Normalizes Meter quantities; the empty map is valid.

---

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