Google\Cloud\PubSub\V1\SubscriberClient::listSubscriptions PHP Method

listSubscriptions() public method

Sample code: try { $subscriberClient = new SubscriberClient(); $formattedProject = SubscriberClient::formatProjectName("[PROJECT]"); foreach ($subscriberClient->listSubscriptions($formattedProject) as $element) { doThingsWith(element); } } finally { if (isset($subscriberClient)) { $subscriberClient->close(); } }
public listSubscriptions ( string $project, array $optionalArgs = [] ) : Google\GAX\PagedListResponse
$project string The name of the cloud project that subscriptions belong to. Format is `projects/{project}`.
$optionalArgs array { Optional. @type int $pageSize The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. @type string $pageToken A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
return Google\GAX\PagedListResponse
    public function listSubscriptions($project, $optionalArgs = [])
    {
        $request = new ListSubscriptionsRequest();
        $request->setProject($project);
        if (isset($optionalArgs['pageSize'])) {
            $request->setPageSize($optionalArgs['pageSize']);
        }
        if (isset($optionalArgs['pageToken'])) {
            $request->setPageToken($optionalArgs['pageToken']);
        }
        $mergedSettings = $this->defaultCallSettings['listSubscriptions']->merge(new CallSettings($optionalArgs));
        $callable = ApiCallable::createApiCall($this->subscriberStub, 'ListSubscriptions', $mergedSettings, $this->descriptors['listSubscriptions']);
        return $callable($request, [], ['call_credentials_callback' => $this->createCredentialsCallback()]);
    }