Google\Cloud\Logging\V2\ConfigServiceV2Client::listSinks PHP Method

listSinks() public method

Sample code: try { $configServiceV2Client = new ConfigServiceV2Client(); $formattedParent = ConfigServiceV2Client::formatProjectName("[PROJECT]"); foreach ($configServiceV2Client->listSinks($formattedParent) as $element) { doThingsWith(element); } } finally { if (isset($configServiceV2Client)) { $configServiceV2Client->close(); } }
public listSinks ( string $parent, array $optionalArgs = [] ) : Google\GAX\PagedListResponse
$parent string Required. The resource name where this sink was created: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
$optionalArgs array { Optional. @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 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 \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 listSinks($parent, $optionalArgs = [])
    {
        $request = new ListSinksRequest();
        $request->setParent($parent);
        if (isset($optionalArgs['pageToken'])) {
            $request->setPageToken($optionalArgs['pageToken']);
        }
        if (isset($optionalArgs['pageSize'])) {
            $request->setPageSize($optionalArgs['pageSize']);
        }
        $mergedSettings = $this->defaultCallSettings['listSinks']->merge(new CallSettings($optionalArgs));
        $callable = ApiCallable::createApiCall($this->configServiceV2Stub, 'ListSinks', $mergedSettings, $this->descriptors['listSinks']);
        return $callable($request, [], ['call_credentials_callback' => $this->createCredentialsCallback()]);
    }