# `OpenPayments.Types.Access`
[🔗](https://github.com/interledger/open-payments-elixir/blob/v1.0.0/lib/open_payments/types/access.ex#L1)

A grant access array containing typed incoming-payment, outgoing-payment or
quote entries.

`from_list/1` decodes JSON objects to their corresponding structs. The pinned
schema permits an empty array and at most three unique objects. Distinct objects
of the same resource type are allowed. Entry and action order are preserved;
uniqueness compares complete JSON values, independent of object-key order.

The result is an ordinary Elixir list of typed structs.
Jason encodes the list directly; `to_list/1` explicitly converts entries to wire
maps. Those exports can include sensitive card data. Entry inspection omits it.
Errors include safe indexed paths such as `access[1].card_authorization.pwk.key`.

`validate/1` revalidates modified typed lists. These functions do not obtain a
grant, process a card, track spending or make network requests.

# `item`

```elixir
@type item() ::
  OpenPayments.Types.AccessIncoming.t()
  | OpenPayments.Types.AccessOutgoing.t()
  | OpenPayments.Types.AccessQuote.t()
```

# `t`

```elixir
@type t() :: [item()]
```

# `from_list`

```elixir
@spec from_list(list()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
```

Decodes up to three unique access JSON objects into an ordered typed list.

# `to_list`

```elixir
@spec to_list(t()) :: [map()]
```

Converts typed entries to wire maps without validating, including card payloads.

# `validate`

```elixir
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
```

Validates a list of typed access entries and its cardinality/uniqueness.

---

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