PubSub/src/PubSubClient.php
public function snapshots(array $options = [])
    {
        $resultLimit = $this->pluck('resultLimit', $options, false);

        return new ItemIterator(
            new PageIterator(
                function (array $snapshot) {
                    return new Snapshot(
                        $this->connection,
                        $this->projectId,
                        $this->pluckName('snapshot', $snapshot['name']),
                        $this->encode,
                        $snapshot
                    );
                },
                [$this->connection, 'listSnapshots'],
                ['project' => $this->formatName('project', $this->projectId)] + $options,
                [
                    'itemsKey' => 'snapshots',
                    'resultLimit' => $resultLimit
                ]
            )
        );
    }
public function snapshots(array $options = [])
    {
        $resultLimit = $this->pluck('resultLimit', $options, false);

        return new ItemIterator(
            new PageIterator(
                function (array $snapshot) {
                    return new Snapshot(
                        $this->connection,
                        $this->projectId,
                        $this->pluckName('snapshot', $snapshot['name']),
                        $this->encode,
                        $snapshot
                    );
                },
                [$this->connection, 'listSnapshots'],
                ['project' => $this->formatName('project', $this->projectId)] + $options,
                [
                    'itemsKey' => 'snapshots',
                    'resultLimit' => $resultLimit
                ]
            )
        );
    }
public function snapshots ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( array $ snapshot ) { return new Snapshot ( $ this -> connection , $ this -> projectId , $ this -> pluckName ( 'snapshot' , $ snapshot [ 'name' ] ) , $ this -> encode , $ snapshot ) ; } , [ $ this -> connection , 'listSnapshots' ] , [ 'project' => $ this -> formatName ( 'project' , $ this -> projectId ) ] + $ options , [ 'itemsKey' => 'snapshots' , 'resultLimit' => $ resultLimit ] ) ) ; }
Get a list of the snapshots in the project.

Please note that this method may not yet be available in your project.

Example:
```
$snapshots = $pubsub->snapshots();
foreach ($snapshots as $snapshot) {
$info = $snapshot->info();
echo $info['name'];
}
```

@param array $options [optional] {
Configuration Options

@type int $pageSize Maximum number of results to return per
request.
@type int $resultLimit Limit the number of results returned in total.
**Defaults to** `0` (return all results).
@type string $pageToken A previously-returned page token used to
resume the loading of results from a specific point.
}
@return ItemIterator<Snapshot>
Get a list of the snapshots in the project .