ExAzureCore. Paging
(ex_azure_core v0.3.0)
Copy Markdown
Helpers for building lazy streams over paginated Azure responses.
Generated SDK operations that page via a nextLink set their
:stream_builder to a closure that delegates here, so the page-walking
logic lives (and is tested) in one place.
Summary
Functions
@spec continuation_stream(map(), ExAzureCore.Operation.t(), keyword()) :: Enumerable.t()
Builds a lazy Stream that walks continuation-token pagination.
Fetches initial_op, extracts the page's items and a continuation token from
each response body, decodes each item, and re-issues the same operation with
the token set on a request parameter until the token is absent.
Options
:items- response body key holding the page's item list (required):token_response- response body key holding the continuation token (required):token_query- query parameter name to carry the token on the next request:token_header- header name to carry the token (use instead of:token_query):decode- 1-arity function applied to each raw item (default: identity)
@spec nextlink_stream(map(), ExAzureCore.Operation.t(), keyword()) :: Enumerable.t()
Builds a lazy Stream that walks nextLink-style pagination.
Fetches initial_op, extracts the page's items and the next-page URL from
each response body, decodes each item, and follows the link until it is
absent. The next-page request targets the absolute nextLink URL, preserving
its query (e.g. the continuation token) while api-version is still injected
from config.
Options
:items- response body key holding the page's item list (required):next_link- response body key holding the next-page URL (required):decode- 1-arity function applied to each raw item (default: identity)