# Google API Core Client - Class Page (1.43.0)

1.43.0 (latest) 1.42.5 1.40.0 1.38.2 1.36.1 1.35.1 Reference documentation and code samples for the Google API Core Client class Page.

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

## Namespace

Google \\ ApiCore

## Methods

### __construct

Page constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `call` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/Call` |
| `options` | `array` |
| `callable` | `callable` |
| `pageStreamingDescriptor` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/PageStreamingDescriptor` |
| `response` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/Message` |

### hasNextPage

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### getNextPageToken

Returns the next page token from the response.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### getNextPage

Retrieves the next Page object using the next page token.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `pageSize` | `int|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/Page` |   |

### getPageElementCount

Return the number of elements in the response.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### getIterator

Return an iterator over the elements in the response.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Generator` |   |

### 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Generator|array<https://docs.cloud.google.com/php/docs/reference/gax/latest/Page>` |   |

### getRequestObject

Gets the request object used to generate the Page.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `mixed|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/Message` |   |

### getResponseObject

Gets the API response object.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `mixed|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/Message` |   |

### expandToFixedSizeCollection

Returns a collection of elements with a fixed size set by
the collectionSize parameter. The collection will only contain
fewer than collectionSize elements if there are no more
pages to be retrieved from the server.

NOTE: it is an error to call this method if an optional parameter
to set the page size is not supported or has not been set in the
API call that was used to create this page. It is also an error
if the collectionSize parameter is less than the page size that
has been set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `collectionSize` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/FixedSizeCollection` |   |

## Constants

### FINAL_PAGE_TOKEN

    Value: ''