Resource.ReadOptions
luastra/resourceResource.ReadOptions is the checked configuration record accepted by the related SDK operation. Required fields establish the minimum contract, while optional fields preserve documented defaults when omitted.
Before you use it
Add luastra/resource to this module's dependencies in luastra.json, then import it with require("luastra/resource"). Create each controller once outside app.render. Record the exact ticket returned by begin, correlate it with the host RequestId, and settle only that ticket from app.resolve or another admitted completion boundary.
How it fits
Resource types describe read and mutation states, immutable snapshots, generation tickets, optimistic callbacks, and application-owned errors.
When to use it
Use Resource.ReadOptions when a reusable variable or helper passes configuration to the related SDK operation. The exported type keeps optional and required fields aligned with the checked public contract.
Fields or definition
| Parameter | Type / values | Description |
|---|---|---|
| isEmpty | (T) -> boolean | Callable isEmpty member exposed by Resource.ReadOptions; invoke it through the owning contract rather than replacing internal state. |
What happens next
A checked resource-state annotation for one explicit asynchronous workflow.
Failures and fixes
Invalid options and programmer contract violations fail immediately. A stale ticket returns false without overwriting current state. Translate provider failures to bounded Resource.Error codes and keep raw messages, payloads, tokens, and credentials outside the controller.
Availability
Public-source alpha state API in 0.5.0-alpha; host-independent and designed to compose with any asynchronous capability.
Exact declaration
export type ReadOptions<T> = {
isEmpty: (T) -> boolean,
}