class Page implements IteratorAggregate

A Page object wraps an API list method response and provides methods to retrieve additional pages using the page token.

Constants

FINAL_PAGE_TOKEN

Methods

__construct(array $params, callable $callable, PageStreamingDescriptor $pageStreamingDescriptor)

Page constructor.

hasNextPage()

Returns true if there are more pages that can be retrieved from the API.

getNextPageToken()

Returns the next page token from the response.

getNextPage($pageSize = null)

Retrieves the next Page object using the next page token.

getPageElementCount()

Return the number of elements in the response.

getIterator()

Return an iterator over the elements in the response.

Page[]
iteratePages()

Return an iterator over Page objects, beginning with this object.

Message
getRequestObject()

Gets the request object used to generate the Page.

getResponseObject()

Gets the API response object.

Details

at line 58
__construct(array $params, callable $callable, PageStreamingDescriptor $pageStreamingDescriptor)

Page constructor.

Parameters

array $params
callable $callable
PageStreamingDescriptor $pageStreamingDescriptor

at line 78
hasNextPage()

Returns true if there are more pages that can be retrieved from the API.

at line 86
getNextPageToken()

Returns the next page token from the response.

at line 95
getNextPage($pageSize = null)

Retrieves the next Page object using the next page token.

Parameters

$pageSize

at line 128
getPageElementCount()

Return the number of elements in the response.

at line 137
getIterator()

Return an iterator over the elements in the response.

at line 151
Page[] iteratePages()

Return an iterator over Page objects, beginning with this object.

Additional Page objects are retrieved lazily via API calls until all elements have been retrieved.

Return Value

Page[]

at line 165
Message getRequestObject()

Gets the request object used to generate the Page.

Return Value

Message

at line 173
getResponseObject()

Gets the API response object.