You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`pagination`|`Paginator<T>`(with a `maxPages` safety cap) over cursor / page-number / link-header `PaginationStrategy` implementations, plus `Page<T>`/ `SimplePage<T>`. Token-style APIs use `CursorPaginationStrategy` with the query-param name set (e.g. `"page_token"`). |
274
+
|`pagination`|Unified paging surface: `Page<T>` (exposes the raw per-page `Response`; `Closeable`) / `PageInfo<T>`; `Paginator<T>`/ `AsyncPaginator<T>` (strategy-driven, sync + async, each carrying a `maxPages` safety cap) exposing item-level (`iterateAll` / `streamAll`, which eager-close each page) and page-level views — sync `byPage` returns the auto-closing `CloseablePages` view (wrap in `use {}` / try-with-resources), async `forEachPageAsync` delivers a live page valid only during the consumer callback — over cursor / page-number / link-header `PaginationStrategy` implementations; `PagedIterable<T>`(functional, transport-agnostic first/next-page fetchers); and the internal `PageWalker` driver shared by the sync paths. Token-style APIs use `CursorPaginationStrategy` with the query-param name set (e.g. `"page_token"`). |
276
275
|`operation`|`OperationParams` — SPI projecting an operation's typed inputs (path / query / header / body) into a `Request` and the context chain, via `toRequest(baseUrl)` / `toRequestContext(baseUrl, dispatch)`. |
277
276
|`pipeline`| Recovery-aware primitives: `RequestPipeline`, `ResponsePipeline`, `ExecutionPipeline` over a sealed `ResponseOutcome`, with steps (`pipeline.step`, `pipeline.step.retry`) like `RetryStep`, `ResponseRecoveryStep`, `IdempotencyKeyStep`, `ClientIdentityStep`. |
|`Paginator<T>`| Lazily iterates pages by re-issuing requests through an `HttpClient`; carries a `maxPages` safety cap |
354
-
|`PaginationStrategy<T>`| Computes the next-page request (or stops) from the current page |
353
+
|`Page<T>` / `PageInfo<T>`|`Page<T>` exposes the raw per-page `Response` and is `Closeable`: its `items` are materialized and its `statusCode` / `headers` / `request` survive `close()`, while the raw response body/connection is live only while the page is current. `PageInfo<T>` is the strategy's parse result (items + next request) |
354
+
|`CloseablePages<T>`| Auto-closing, single-use page-level view returned by `byPage()`: closes each page as you advance past it and closes the page still held on view-`close()`; exposes `iterator()` / `stream()`. Wrap in `use {}` (Kotlin) / try-with-resources (Java) so an early break still releases the held page |
355
+
|`Paginator<T>`| Strategy-driven sync paginator over an `HttpClient`; exposes item-level (`iterateAll` / `streamAll`, which eager-close each page so item consumers carry no close burden) and page-level (`byPage`, returning a `CloseablePages`) views; carries a `maxPages` safety cap |
356
+
|`AsyncPaginator<T>`| Non-blocking counterpart over an `AsyncHttpClient` (`forEachAsync` / `collectAllAsync` / `forEachPageAsync`); `forEachPageAsync` delivers a live page valid only during the consumer callback (the driver closes it as soon as the callback returns) |
357
+
|`PaginationStrategy<T>`| Parses a response into a `PageInfo` — items plus the next-page request (or `null` to stop) |
355
358
|`CursorPaginationStrategy` / `PageNumberPaginationStrategy` / `LinkHeaderPaginationStrategy`| The shipped strategies |
356
-
|`PagedIterable<T>`| First/next-page fetcher abstraction over `PagedResponse`, with its own `maxPages` cap |
359
+
|`PagedIterable<T>`| Functional, transport-agnostic first/next-page fetcher abstraction, with its own `maxPages` cap |
360
+
|`PageWalker<T>` (internal) | Shared driver behind the sync paths, exposing a live-page iterator, an eager-closing item iterator, and an item stream |
357
361
358
362
Token-style APIs (`next_page_token`, `pageToken`, …) are handled by `CursorPaginationStrategy`
359
363
constructed with the query-param name set (e.g. `"page_token"`), so no separate token strategy is needed.
@@ -730,14 +734,13 @@ they should construct a fresh one.
> Superseded by #30 (pagination unification): `Page` now exposes the raw per-page `Response` and is `Closeable` (materialized `items` and derived `statusCode` / `headers` / `request` survive `close()`), strategies return `PageInfo` (`nextRequest == null` = end of stream), and `SimplePage` was removed.
376
+
375
377
**Status: shipped.**`Page`, `Paginator`, `PaginationStrategy`, and the three strategies
376
378
(`Cursor` / `PageNumber` / `LinkHeader`) are in `sdk-core/.../pagination`, alongside
377
379
helper types `SimplePage` and `RequestRebuilder`. `Paginator` gained a `maxPages` safety cap
0 commit comments