trait PaginatesList

Properties

protected string|null $cursor
protected int|null $limit

Methods

string
listType()

Get the plural primitive name used as the list key and method prefix (e.g. 'tools', 'prompts').

nextPage(string|null $cursor)

Build the request for the next page at the given cursor.

hydrate(array $payloads)

Hydrate the listed primitives.

string
method()

Get the list method name.

array
params()

Get the current page parameters.

handle(Protocol $protocol)

Fetch and hydrate the requested primitives.

array
fetch(Protocol $protocol)

Fetch pages up to the requested limit.

Details

at line 22
abstract protected string listType()

Get the plural primitive name used as the list key and method prefix (e.g. 'tools', 'prompts').

Return Value

string

at line 27
abstract protected PaginatesList nextPage(string|null $cursor)

Build the request for the next page at the given cursor.

Parameters

string|null $cursor

Return Value

PaginatesList

at line 35
abstract protected Collection hydrate(array $payloads)

Hydrate the listed primitives.

Parameters

array $payloads

Return Value

Collection

at line 40
string method()

Get the list method name.

Return Value

string

at line 50
array params()

Get the current page parameters.

Return Value

array

at line 60
Collection handle(Protocol $protocol)

Fetch and hydrate the requested primitives.

Parameters

Protocol $protocol

Return Value

Collection

at line 70
protected array fetch(Protocol $protocol)

Fetch pages up to the requested limit.

Parameters

Protocol $protocol

Return Value

array