Msg.Pagination (msg v0.3.8)
Shared pagination utilities for Microsoft Graph API list operations.
Summary
Functions
Recursively fetches all pages following @odata.nextLink.
Fetches a single page from the Graph API.
Functions
@spec fetch_all_pages(Req.Request.t(), String.t() | nil, [map()]) :: {:ok, [map()]} | {:error, term()}
Recursively fetches all pages following @odata.nextLink.
Parameters
client- Authenticated Req.Request clientnext_link- Next page URL (or nil to stop)acc- Accumulated items from previous pages
Returns
{:ok, [item]}- All items from all pages{:error, term}- Error
@spec fetch_page(Req.Request.t(), String.t(), keyword()) :: {:ok, %{items: [map()], next_link: String.t() | nil}} | {:error, term()}
Fetches a single page from the Graph API.
Parameters
client- Authenticated Req.Request clientpath- API path to fetchquery_params- List of query parameter tuples
Returns
{:ok, %{items: [item], next_link: url | nil}}- Page data with optional next link{:error, term}- Error