public function getNextPage($pageSize = null)
    {
        if (!$this->hasNextPage()) {
            throw new ValidationException(
                'Could not complete getNextPage operation: ' .
                'there are no more pages to retrieve.'
            );
        }

        $newRequest = clone $this->getRequestObject();

        $requestPageTokenSetMethod = $this->pageStreamingDescriptor->getRequestPageTokenSetMethod();
        $newRequest->$requestPageTokenSetMethod($this->getNextPageToken());

        if (isset($pageSize)) {
            if (!$this->pageStreamingDescriptor->requestHasPageSizeField()) {
                throw new ValidationException(
                    'pageSize argument was defined, but the method does not ' .
                    'support a page size parameter in the optional array argument'
                );
            }
            $requestPageSizeSetMethod = $this->pageStreamingDescriptor->getRequestPageSizeSetMethod();
            $newRequest->$requestPageSizeSetMethod($pageSize);
        }
        $this->call = $this->call->withMessage($newRequest);

        $callable = $this->callable;
        $response = $callable(
            $this->call,
            $this->options
        )->wait();

        return new Page(
            $this->call,
            $this->options,
            $this->callable,
            $this->pageStreamingDescriptor,
            $response
        );
    }
public function getNextPage($pageSize = null)
    {
        if (!$this->hasNextPage()) {
            throw new ValidationException(
                'Could not complete getNextPage operation: ' .
                'there are no more pages to retrieve.'
            );
        }

        $newRequest = clone $this->getRequestObject();

        $requestPageTokenSetMethod = $this->pageStreamingDescriptor->getRequestPageTokenSetMethod();
        $newRequest->$requestPageTokenSetMethod($this->getNextPageToken());

        if (isset($pageSize)) {
            if (!$this->pageStreamingDescriptor->requestHasPageSizeField()) {
                throw new ValidationException(
                    'pageSize argument was defined, but the method does not ' .
                    'support a page size parameter in the optional array argument'
                );
            }
            $requestPageSizeSetMethod = $this->pageStreamingDescriptor->getRequestPageSizeSetMethod();
            $newRequest->$requestPageSizeSetMethod($pageSize);
        }
        $this->call = $this->call->withMessage($newRequest);

        $callable = $this->callable;
        $response = $callable(
            $this->call,
            $this->options
        )->wait();

        return new Page(
            $this->call,
            $this->options,
            $this->callable,
            $this->pageStreamingDescriptor,
            $response
        );
    }
public function getNextPage ( $ pageSize = null ) { if ( ! $ this -> hasNextPage ( ) ) { throw new ValidationException ( 'Could not complete getNextPage operation: ' . 'there are no more pages to retrieve.' ) ; } $ newRequest = clone $ this -> getRequestObject ( ) ; $ requestPageTokenSetMethod = $ this -> pageStreamingDescriptor -> getRequestPageTokenSetMethod ( ) ; $ newRequest -> $ requestPageTokenSetMethod ( $ this -> getNextPageToken ( ) ) ; if ( isset ( $ pageSize ) ) { if ( ! $ this -> pageStreamingDescriptor -> requestHasPageSizeField ( ) ) { throw new ValidationException ( 'pageSize argument was defined, but the method does not ' . 'support a page size parameter in the optional array argument' ) ; } $ requestPageSizeSetMethod = $ this -> pageStreamingDescriptor -> getRequestPageSizeSetMethod ( ) ; $ newRequest -> $ requestPageSizeSetMethod ( $ pageSize ) ; } $ this -> call = $ this -> call -> withMessage ( $ newRequest ) ; $ callable = $ this -> callable ; $ response = $ callable ( $ this -> call , $ this -> options ) -> wait ( ) ; return new Page ( $ this -> call , $ this -> options , $ this -> callable , $ this -> pageStreamingDescriptor , $ response ) ; }
Retrieves the next Page object using the next page token.

@param int|null $pageSize
@throws ValidationException if there are no pages remaining, or if pageSize is supplied but
is not supported by the API
@throws ApiException if the call to fetch the next page fails.
@return Page
Retrieves the next Page object using the next page token .