def list_all(limit: nil, offset: nil, search: nil, order: nil, timeout: nil)def list_all: (
?limit: Integer?,
?offset: Integer?,
?search: (String | Symbol)?,
?order: ("name" | "asc" | "desc")?,
?timeout: seconds?
) -> Array[product_resource]Walks every page and returns a single flat array. Each request asks for the maximum page size of 100 and the walk stops as soon as the API reports no more rows.
The pagination envelope is discarded, so call list once when you need totalCount. A limit you pass here is the per-request page size, not a cap on how many products come back, and an offset is the starting point of the whole walk. There is no bound on the number of requests or on the size of the array, so on a large workspace prefer iterate.
Example
require "envless/sdk"
products = Envless.products.list_all
puts products.count { |product| product[:isPrivate] }Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit: | Integer | No | Page size for each underlying request, capped at 100. |
offset: | Integer | No | Row to start the walk from. |
search: | String | Symbol | No | Case-insensitive substring match against product name and slug. |
order: | "name" | "asc" | "desc" | No | Defaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
An Array[product_resource] with every product the key can see.
Reads the products collection. list returns one page as an Envless::Page with items and pagination, list_all collects every page into an array, and iterate yields one item at a time to a block, fetching the next page only when it gets there. Without a block, iterate returns an Enumerator.
Worth knowing
- A failure on any page fails the whole call, so a partial result is never returned.
Required scopes
products:read
Underlying endpoint
GET /products
Request and response schema, every error code, and a live playground.
In TypeScript
envless.products.listAll()
The same method in @goenvless/sdk, with the same request, retries and errors.