def iterate(limit: nil, offset: nil, search: nil, timeout: nil, &block)def iterate: (
?limit: Integer?,
?offset: Integer?,
?search: (String | Symbol)?,
?timeout: seconds?
) -> Enumerator[invite_resource, nil]
| (
?limit: Integer?,
?offset: Integer?,
?search: (String | Symbol)?,
?timeout: seconds?
) { (invite_resource) -> void } -> nilReturns an Enumerator that yields invitations individually and fetches the next page only once the current one is drained. Breaking out of the loop stops the requests, which makes this the cheapest way to find the invite for one email address.
The Enumerator defaults to the maximum page size of 100 and clamps anything larger, so limit only ever makes pages smaller. Revoking or resending while you iterate mutates the underlying set that offsets are counted against, so collect the ids first and act on them after the loop.
Example
require "envless/sdk"
Envless.invites.iterate do |invite|
if invite[:email] == "dana@example.com"
puts "#{invite[:id]} #{invite[:status]}"
puts invite[:resendCount]
break
end
endParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit: | Integer | No | Page size per request, capped at 100 and defaulting to 100. |
offset: | Integer | No | Row the walk starts at, advancing by the number of items each page returns. |
search: | String | Symbol | No | Case insensitive substring match on the invited email address. |
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
Enumerator[invite_resource, nil] yielding one invitation per step.
Reads the invites 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
- The
Enumeratoris lazy, so no request is sent until you start consuming it.
Required scopes
members:read
Underlying endpoint
GET /invites
Request and response schema, every error code, and a live playground.
In TypeScript
envless.invites.iterate()
The same method in @goenvless/sdk, with the same request, retries and errors.