Cursor-based pagination for GoCardlessClient list endpoints.
Returns a lazy Stream that automatically fetches additional pages as items
are consumed. No extra memory is allocated until items are pulled.
Example
# Stream all paid-out payments lazily
GoCardlessClient.Resources.Payments.stream(client, %{status: "paid_out"})
|> Stream.each(&reconcile/1)
|> Stream.run()
# Collect all customers into a list
{:ok, customers} = GoCardlessClient.Paginator.collect(client, "/customers", %{}, "customers")
Summary
Types
@type page_item() :: map()
Functions
@spec collect(GoCardlessClient.Client.t(), String.t(), map(), String.t(), keyword()) :: {:ok, [page_item()]} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Eagerly collects all pages into a list.
Returns {:ok, [item]} or {:error, reason} if any page fetch fails.
@spec stream(GoCardlessClient.Client.t(), String.t(), map(), String.t(), keyword()) :: Enumerable.t()
Returns a lazy Stream over all pages of a GoCardlessClient list endpoint.
client— aGoCardlessClient.Clientstructpath— API path e.g."/payments"params— initial query params as a mapresource_key— JSON key holding the list e.g."payments"opts— per-request options (:idempotency_key,:request_id, etc.)