Loading documentation…
Loading documentation…
Turn paginated inventory responses into a durable application model.
Build a snapshot only after every requested page succeeds. Keep the currently published snapshot separate from a refresh that is still in progress.
Keep private, unavailable, partial, and empty inventories as different states.
Treat each returned cursor as opaque and pass it unchanged. Stop when the response says no page remains, when your overall deadline expires, or when a defensive page limit is reached. Deduplicate assets by their stable identity while assembling the candidate snapshot.
Description records can be shared by several assets. Join them using the documented identifiers, not localized names. Preserve optional description fields as optional instead of manufacturing defaults.
| Outcome | Recommended application state |
|---|---|
| Complete read with zero assets | Successful empty snapshot |
| Private inventory | Inaccessible; retain any last successful snapshot separately |
| Validation or authentication error | Configuration failure; correct before retrying |
| Rate limit or transient upstream failure | Refresh failed; use bounded retry or a declared stale policy |
| Deadline or page limit reached | Partial candidate; do not replace the published snapshot |
Keep raw inventory data out of analytics and error reports unless a reviewed privacy policy requires it. Log the request ID, operation, status, duration, page count, and publish decision without logging credentials or complete response bodies.
Coordinate refreshes for the same inventory so workers do not duplicate a paginated read. Continue with Synchronize inventory data, Caching, and Inventory errors.