# `Attio.Entries`
[🔗](https://github.com/sgerrand/ex_attio/blob/v0.2.0/lib/attio/entries.ex#L1)

Functions for managing entries within Attio lists.

Entries are elements within a list. Each entry references a parent record and
can carry list-specific attribute values (e.g. pipeline stage, deal owner).

Requires the `list_entry:read` scope for read operations and
`list_entry:read-write` for mutations.

## Pagination

`list/3` returns a single page. `stream/3` lazily pages through all entries;
`stream_all/3` collects them into `{:ok, list}`. See `Attio` for an overview.

    client
    |> Attio.Entries.stream("pipeline")
    |> Stream.filter(fn e -> e["values"]["stage"] == "qualified" end)
    |> Enum.to_list()

# `create`

```elixir
@spec create(Attio.Client.t(), String.t(), map()) :: {:ok, map()} | {:error, term()}
```

Creates an entry in a list.

## Required attributes

  * `"record_id"` - ID of the record to add.

# `delete`

```elixir
@spec delete(Attio.Client.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, term()}
```

Deletes an entry from a list.

# `get`

```elixir
@spec get(Attio.Client.t(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}
```

Gets a single entry by its ID.

# `list`

```elixir
@spec list(Attio.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
```

Lists entries in a list. Returns one page.

## Options

  * `:limit` - Number of entries per page (1–1000, default 500).
  * `:cursor` - Opaque pagination cursor from a previous response.

# `stream`

```elixir
@spec stream(Attio.Client.t(), String.t(), keyword()) :: Enumerable.t()
```

Returns a lazy stream of all entries in a list across all pages.

Accepts the same options as `list/3`. Raises `{:attio_stream_error, error}`
on API failure mid-stream. Use `stream_all/3` if you prefer a standard
`{:ok, list} | {:error, term()}` return value.

# `stream_all`

```elixir
@spec stream_all(Attio.Client.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, Attio.Error.t() | Exception.t()}
```

Fetches all entries in a list across all pages and returns them as a list.

Accepts the same options as `list/3`. Returns `{:ok, [map()]}` on success
or `{:error, term()}` if any page request fails. Unlike `stream/3`, the
entire result set is loaded into memory.

## Example

    {:ok, entries} = Attio.Entries.stream_all(client, "pipeline")

# `update`

```elixir
@spec update(Attio.Client.t(), String.t(), String.t(), map()) ::
  {:ok, map()} | {:error, term()}
```

Updates an entry's attribute values.

---

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