public function expandToFixedSizeCollection($collectionSize)
    {
        if (!$this->pageStreamingDescriptor->requestHasPageSizeField()) {
            throw new ValidationException(
                "FixedSizeCollection is not supported for this method, because " .
                "the method does not support an optional argument to set the " .
                "page size."
            );
        }
        $request = $this->getRequestObject();
        $pageSizeGetMethod = $this->pageStreamingDescriptor->getRequestPageSizeGetMethod();
        $pageSize = $request->$pageSizeGetMethod();
        if (is_null($pageSize)) {
            throw new ValidationException(
                "Error while expanding Page to FixedSizeCollection: No page size " .
                "parameter found. The page size parameter must be set in the API " .
                "optional arguments array, and must be less than the collectionSize " .
                "parameter, in order to create a FixedSizeCollection object."
            );
        }
        if ($pageSize > $collectionSize) {
            throw new ValidationException(
                "Error while expanding Page to FixedSizeCollection: collectionSize " .
                "parameter is less than the page size optional argument specified in " .
                "the API call. collectionSize: $collectionSize, page size: $pageSize"
            );
        }
        return new FixedSizeCollection($this, $collectionSize);
    }
public function expandToFixedSizeCollection($collectionSize)
    {
        if (!$this->pageStreamingDescriptor->requestHasPageSizeField()) {
            throw new ValidationException(
                "FixedSizeCollection is not supported for this method, because " .
                "the method does not support an optional argument to set the " .
                "page size."
            );
        }
        $request = $this->getRequestObject();
        $pageSizeGetMethod = $this->pageStreamingDescriptor->getRequestPageSizeGetMethod();
        $pageSize = $request->$pageSizeGetMethod();
        if (is_null($pageSize)) {
            throw new ValidationException(
                "Error while expanding Page to FixedSizeCollection: No page size " .
                "parameter found. The page size parameter must be set in the API " .
                "optional arguments array, and must be less than the collectionSize " .
                "parameter, in order to create a FixedSizeCollection object."
            );
        }
        if ($pageSize > $collectionSize) {
            throw new ValidationException(
                "Error while expanding Page to FixedSizeCollection: collectionSize " .
                "parameter is less than the page size optional argument specified in " .
                "the API call. collectionSize: $collectionSize, page size: $pageSize"
            );
        }
        return new FixedSizeCollection($this, $collectionSize);
    }
public function expandToFixedSizeCollection ( $ collectionSize ) { if ( ! $ this -> pageStreamingDescriptor -> requestHasPageSizeField ( ) ) { throw new ValidationException ( "FixedSizeCollection is not supported for this method, because " . "the method does not support an optional argument to set the " . "page size." ) ; } $ request = $ this -> getRequestObject ( ) ; $ pageSizeGetMethod = $ this -> pageStreamingDescriptor -> getRequestPageSizeGetMethod ( ) ; $ pageSize = $ request -> $ pageSizeGetMethod ( ) ; if ( is_null ( $ pageSize ) ) { throw new ValidationException ( "Error while expanding Page to FixedSizeCollection: No page size " . "parameter found. The page size parameter must be set in the API " . "optional arguments array, and must be less than the collectionSize " . "parameter, in order to create a FixedSizeCollection object." ) ; } if ( $ pageSize > $ collectionSize ) { throw new ValidationException ( "Error while expanding Page to FixedSizeCollection: collectionSize " . "parameter is less than the page size optional argument specified in " . "the API call. collectionSize: $collectionSize, page size: $pageSize" ) ; } return new FixedSizeCollection ( $ this , $ collectionSize ) ; }
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.

@param $collectionSize int
@throws ValidationException if a FixedSizeCollection of the specified size cannot be constructed
@return FixedSizeCollection
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 .