Search documentation of stripe_elixir

# StripeElixir.ListObject (stripe_elixir v0.1.0)

Copy Markdown View Source

Represents a V1 paginated list response (`object: "list"`).

## Auto-paging

    client = StripeElixir.client("sk_test_...")
    {:ok, page} = StripeElixir.Client.request(client, :get, "/v1/charges")

    page
    |> StripeElixir.ListObject.auto_paging_stream(client)
    |> Enum.take(50)

## Summary

### Types

t()

### Functions

auto_paging_stream(page, client, opts \\ [])

Returns a lazy `Stream` that yields every item across all pages.

## Types

# t()

    @type t() :: %StripeElixir.ListObject{
      data: [struct() | map()] | nil,
      has_more: boolean() | nil,
      object: String.t() | nil,
      url: String.t() | nil
    }

## Functions

# auto_paging_stream(page, client, opts \\ [])

    @spec auto_paging_stream(t(), StripeElixir.Client.t(), keyword()) :: Enumerable.t()

Returns a lazy `Stream` that yields every item across all pages.

Uses `starting_after` cursor pagination. The stream fetches the next page only when consumed (via `Enum` or `Stream` functions).