_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q15200
Regex.setGroupIndexes
train
public function setGroupIndexes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
php
{ "resource": "" }
q15201
UptimeCheckServiceGrpcClient.ListUptimeCheckIps
train
public function ListUptimeCheckIps(\Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps',
php
{ "resource": "" }
q15202
SysvTrait.getSysvKey
train
private function getSysvKey($idNum) { $key = getenv('GOOGLE_CLOUD_SYSV_ID') ?: self::$productionKey; $base = ftok(__FILE__, $key);
php
{ "resource": "" }
q15203
InspectConfig.setContentOptions
train
public function setContentOptions($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM,
php
{ "resource": "" }
q15204
InspectConfig.setRuleSet
train
public function setRuleSet($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15205
ListTimeSeriesResponse.setTimeSeries
train
public function setTimeSeries($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15206
ListTimeSeriesResponse.setExecutionErrors
train
public function setExecutionErrors($var) { $arr = GPBUtil::checkRepeatedField($var,
php
{ "resource": "" }
q15207
ComputeThreatListDiffRequest.setThreatType
train
public function setThreatType($var) { GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1beta1\ThreatType::class);
php
{ "resource": "" }
q15208
ComputeThreatListDiffRequest.setConstraints
train
public function setConstraints($var) { GPBUtil::checkMessage($var, \Google\Cloud
php
{ "resource": "" }
q15209
ListAppProfilesResponse.setAppProfiles
train
public function setAppProfiles($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15210
Operation.mutation
train
public function mutation($operation, $table, $mutation) { return [ $operation => [ 'table' => $table, 'columns' => array_keys($mutation),
php
{ "resource": "" }
q15211
Operation.deleteMutation
train
public function deleteMutation($table, KeySet $keySet) { return [ self::OP_DELETE => [ 'table' => $table,
php
{ "resource": "" }
q15212
Operation.commit
train
public function commit(Session $session, array $mutations, array $options = []) { $options += [ 'transactionId' => null ]; $res = $this->connection->commit($this->arrayFilterRemoveNull([ 'mutations' => $mutations, 'session' => $session->name(),
php
{ "resource": "" }
q15213
Operation.rollback
train
public function rollback(Session $session, $transactionId, array $options = []) { return $this->connection->rollback([ 'transactionId' => $transactionId,
php
{ "resource": "" }
q15214
Operation.executeUpdate
train
public function executeUpdate( Session $session, Transaction $transaction, $sql, array $options = [] ) { $res = $this->execute($session, $sql, [ 'transactionId' => $transaction->id() ] + $options); // Iterate through the result to ensure we have query statistics available.
php
{ "resource": "" }
q15215
Operation.read
train
public function read(Session $session, $table, KeySet $keySet, array $columns, array $options = []) { $options += [ 'index' => null, 'limit' => null, 'offset' => null, 'transactionContext' => null ]; $context = $this->pluck('transactionContext', $options); $call = function ($resumeToken = null) use ($table, $session, $columns, $keySet, $options) { if ($resumeToken) { $options['resumeToken'] = $resumeToken; } return $this->connection->streamingRead([
php
{ "resource": "" }
q15216
Operation.createTransaction
train
public function createTransaction(Session $session, array $res = [], array $options = []) { $res += [ 'id' => null ]; $options['isRetry'] = isset($options['isRetry']) ? $options['isRetry']
php
{ "resource": "" }
q15217
Operation.snapshot
train
public function snapshot(Session $session, array $options = []) { $options += [ 'singleUse' => false, 'className' => Snapshot::class ]; if (!$options['singleUse']) {
php
{ "resource": "" }
q15218
Operation.createSnapshot
train
public function createSnapshot(Session $session, array $res = [], $className = Snapshot::class) { $res += [ 'id' => null, 'readTimestamp' => null ]; if ($res['readTimestamp']) { if (!($res['readTimestamp'] instanceof Timestamp)) { $time =
php
{ "resource": "" }
q15219
Operation.partitionOptions
train
private function partitionOptions(array $options) { $options['partitionOptions'] = array_filter([ 'partitionSizeBytes' =>
php
{ "resource": "" }
q15220
Operation.beginTransaction
train
private function beginTransaction(Session $session, array $options = []) { $options += [ 'transactionOptions' => [] ]; return $this->connection->beginTransaction($options + [
php
{ "resource": "" }
q15221
Operation.flattenKeySet
train
private function flattenKeySet(KeySet $keySet) { $keys = $keySet->keySetObject(); if (!empty($keys['ranges'])) { foreach ($keys['ranges'] as $index => $range) { foreach ($range as $type => $rangeKeys) { $range[$type] = $this->mapper->encodeValuesAsSimpleType($rangeKeys); } $keys['ranges'][$index] = $range; }
php
{ "resource": "" }
q15222
Activity.setTeamMembers
train
public function setTeamMembers($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
php
{ "resource": "" }
q15223
LogSink.setOutputVersionFormat
train
public function setOutputVersionFormat($var) { GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LogSink_VersionFormat::class);
php
{ "resource": "" }
q15224
SearchJobsRequest.setJobQuery
train
public function setJobQuery($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15225
Paragraph.setProperty
train
public function setProperty($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\TextAnnotation_TextProperty::class);
php
{ "resource": "" }
q15226
Paragraph.setWords
train
public function setWords($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15227
ListDeviceConfigVersionsResponse.setDeviceConfigs
train
public function setDeviceConfigs($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15228
Text.setText
train
public function setText($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
php
{ "resource": "" }
q15229
JobServiceGrpcClient.GetJob
train
public function GetJob(\Google\Cloud\Talent\V4beta1\GetJobRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.talent.v4beta1.JobService/GetJob',
php
{ "resource": "" }
q15230
JobServiceGrpcClient.UpdateJob
train
public function UpdateJob(\Google\Cloud\Talent\V4beta1\UpdateJobRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.talent.v4beta1.JobService/UpdateJob',
php
{ "resource": "" }
q15231
JobServiceGrpcClient.DeleteJob
train
public function DeleteJob(\Google\Cloud\Talent\V4beta1\DeleteJobRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.talent.v4beta1.JobService/DeleteJob',
php
{ "resource": "" }
q15232
JobServiceGrpcClient.ListJobs
train
public function ListJobs(\Google\Cloud\Talent\V4beta1\ListJobsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.talent.v4beta1.JobService/ListJobs',
php
{ "resource": "" }
q15233
ListTopicSnapshotsResponse.setSnapshots
train
public function setSnapshots($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
php
{ "resource": "" }
q15234
CreateJobRequest.setJob
train
public function setJob($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Job::class);
php
{ "resource": "" }
q15235
KeyFilter.sample
train
public function sample($probability) { if ($probability < 0) { throw new \InvalidArgumentException('Probability must be positive'); }
php
{ "resource": "" }
q15236
ListCompaniesResponse.setCompanies
train
public function setCompanies($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15237
LongRunningRecognizeResponse.setResults
train
public function setResults($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15238
ChunkFormatter.readAll
train
public function readAll() { // Chunks contain 3 properties: // - rowContents: The row contents, this essentially is all data // pertaining to a single family. // - commitRow: This is a boolean telling us the all previous chunks for // this row are ok to consume. // - resetRow: This is a boolean telling us that all the previous chunks // are to be discarded. foreach ($this->stream as $readRowsResponse) { foreach ($readRowsResponse->getChunks() as $chunk) { switch ($this->state) { case self::$rowStateEnum['NEW_ROW']: $this->newRow($chunk); break; case self::$rowStateEnum['ROW_IN_PROGRESS']: $this->rowInProgress($chunk);
php
{ "resource": "" }
q15239
ChunkFormatter.validateNewRow
train
private function validateNewRow(CellChunk $chunk) { $this->isError( $this->row, 'A new row cannot have existing state.' ); $this->isError( !$chunk->getRowKey(), 'A row key must be set.' ); $this->isError( $chunk->getResetRow(), 'A new row cannot be reset.' ); $this->isError( $this->prevRowKey && $this->prevRowKey === $chunk->getRowKey(),
php
{ "resource": "" }
q15240
ChunkFormatter.reset
train
private function reset() { $this->prevRowKey = null; $this->rowKey = null;
php
{ "resource": "" }
q15241
ChunkFormatter.moveToNextState
train
private function moveToNextState(CellChunk $chunk) { $this->state = $chunk->getValueSize() >
php
{ "resource": "" }
q15242
ChunkFormatter.newRow
train
private function newRow(CellChunk $chunk) { $this->validateNewRow($chunk); $this->rowKey = $chunk->getRowKey(); $familyName = $chunk->getFamilyName()->getValue(); $qualifierName = $chunk->getQualifier()->getValue(); $labels = ($chunk->getLabels()->getIterator()->valid()) ? implode(iterator_to_array($chunk->getLabels()->getIterator())) : ''; $this->row[$familyName] = []; $this->family = &$this->row[$familyName]; $this->family[$qualifierName] = []; $this->qualifiers = &$this->family[$qualifierName]; $qualifier = [
php
{ "resource": "" }
q15243
ChunkFormatter.validateResetRow
train
private function validateResetRow(CellChunk $chunk) { $this->isError( $chunk->getResetRow() && ( $chunk->getRowKey() || $chunk->getQualifier() || $chunk->getValue()
php
{ "resource": "" }
q15244
ChunkFormatter.validateRowInProgress
train
private function validateRowInProgress(CellChunk $chunk) { $this->validateResetRow($chunk); $newRowKey = $chunk->getRowKey(); $this->isError( $chunk->getRowKey() && $newRowKey !== $this->rowKey, 'A commit is required between row keys.' );
php
{ "resource": "" }
q15245
ChunkFormatter.rowInProgress
train
private function rowInProgress(CellChunk $chunk) { $this->validateRowInProgress($chunk); if ($chunk->getResetRow()) { $this->reset(); return; } if ($chunk->getFamilyName()) { $familyName = $chunk->getFamilyName()->getValue(); if (!isset($this->row[$familyName])) { $this->row[$familyName] = []; } $this->family = &$this->row[$familyName]; } if ($chunk->getQualifier()) { $qualifierName = $chunk->getQualifier()->getValue(); if (!isset($this->family[$qualifierName])) { $this->family[$qualifierName] = []; }
php
{ "resource": "" }
q15246
ChunkFormatter.cellInProgress
train
private function cellInProgress(CellChunk $chunk) { $this->validateCellInProgress($chunk); if ($chunk->getResetRow()) { $this->reset(); return; }
php
{ "resource": "" }
q15247
WebDetection.setWebEntities
train
public function setWebEntities($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15248
WebDetection.setFullMatchingImages
train
public function setFullMatchingImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15249
WebDetection.setPartialMatchingImages
train
public function setPartialMatchingImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15250
WebDetection.setPagesWithMatchingImages
train
public function setPagesWithMatchingImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15251
WebDetection.setVisuallySimilarImages
train
public function setVisuallySimilarImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15252
Degree.setDegreeType
train
public function setDegreeType($var) { GPBUtil::checkEnum($var,
php
{ "resource": "" }
q15253
Degree.setFieldsOfStudy
train
public function setFieldsOfStudy($var) { $arr = GPBUtil::checkRepeatedField($var,
php
{ "resource": "" }
q15254
Key.pathElement
train
public function pathElement($kind, $identifier = null, array $options = []) { $options += [ 'identifierType' => null ]; if (!empty($this->path) && $this->state() !== Key::STATE_NAMED) {
php
{ "resource": "" }
q15255
Key.ancestor
train
public function ancestor($kind, $identifier, array $options = []) { $options += [ 'identifierType' => null ];
php
{ "resource": "" }
q15256
Key.ancestorKey
train
public function ancestorKey(Key $key) { if ($key->state() !== self::STATE_NAMED) { throw new InvalidArgumentException('Cannot use an incomplete key as an ancestor'); }
php
{ "resource": "" }
q15257
Key.state
train
public function state() { $end = $this->pathEnd(); return (isset($end['id']) ||
php
{ "resource": "" }
q15258
Key.setLastElementIdentifier
train
public function setLastElementIdentifier($value, $type = Key::TYPE_ID) { $end = $this->pathEnd(); $end[$type] = (string) $value;
php
{ "resource": "" }
q15259
Key.pathEndIdentifier
train
public function pathEndIdentifier() { $end = $this->pathEnd(); if (isset($end['id'])) {
php
{ "resource": "" }
q15260
Key.pathEndIdentifierType
train
public function pathEndIdentifierType() { $end = $this->pathEnd(); if (isset($end['id'])) {
php
{ "resource": "" }
q15261
Key.normalizeElement
train
private function normalizeElement($kind, $identifier, $identifierType) { $identifierType = $this->determineIdentifierType($identifier, $identifierType);
php
{ "resource": "" }
q15262
Key.determineIdentifierType
train
private function determineIdentifierType($identifier, $identifierType) { $allowedTypes = [self::TYPE_ID, self::TYPE_NAME]; if (!is_null($identifierType) && in_array($identifierType, $allowedTypes)) { return $identifierType; } elseif (!is_null($identifierType)) { throw new InvalidArgumentException(sprintf(
php
{ "resource": "" }
q15263
Key.normalizePath
train
private function normalizePath(array $path) { // If the path is associative (i.e. not nested), wrap it up. if ($this->isAssoc($path)) { $path = [$path]; } $res = []; foreach ($path as $index => $pathElement) { if (!isset($pathElement['kind'])) { throw new InvalidArgumentException('Each path element must contain a kind.'); } $incomplete = (!isset($pathElement['id']) && !isset($pathElement['name'])); if ($index < count($path) -1 && $incomplete) { throw new
php
{ "resource": "" }
q15264
Address.setUsage
train
public function setUsage($var) { GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\ContactInfoUsage::class);
php
{ "resource": "" }
q15265
BatchDaemon.run
train
public function run() { $this->setupSignalHandlers(); $procs = []; while (true) { $jobs = $this->runner->getJobs(); foreach ($jobs as $job) { if (! array_key_exists($job->identifier(), $procs)) { $procs[$job->identifier()] = []; } while (count($procs[$job->identifier()]) > $job->numWorkers()) { // Stopping an excessive child. echo 'Stopping an excessive child.' . PHP_EOL; $proc = array_pop($procs[$job->identifier()]); $status = proc_get_status($proc); // Keep sending SIGTERM until the child exits. while ($status['running'] === true) { @proc_terminate($proc); usleep(50000); $status = proc_get_status($proc); } @proc_close($proc); } for ($i = 0; $i < $job->numWorkers(); $i++) { $needStart = false; if (array_key_exists($i, $procs[$job->identifier()])) { $status = proc_get_status($procs[$job->identifier()][$i]); if ($status['running'] !== true) { $needStart = true; } } else { $needStart = true; } if ($needStart) { echo 'Starting a child.' . PHP_EOL; $procs[$job->identifier()][$i] = proc_open(
php
{ "resource": "" }
q15266
SigningHelper.v2Sign
train
public function v2Sign(ConnectionInterface $connection, $expires, $resource, $generation, array $options) { list($credentials, $options) = $this->getSigningCredentials($connection, $options); $expires = $this->normalizeExpiration($expires); $resource = $this->normalizeResource($resource); $options = $this->normalizeOptions($options); $headers = $this->normalizeHeaders($options['headers']); // Make sure disallowed headers are not included. $illegalHeaders = [ 'x-goog-encryption-key', 'x-goog-encryption-key-sha256' ]; if ($illegal = array_intersect_key(array_flip($illegalHeaders), $headers)) { throw new \InvalidArgumentException(sprintf( '%s %s not allowed in Signed URL headers.', implode(' and ', array_keys($illegal)), count($illegal) === 1 ? 'is' : 'are'
php
{ "resource": "" }
q15267
SigningHelper.normalizeExpiration
train
private function normalizeExpiration($expires) { if ($expires instanceof Timestamp) { $seconds = $expires->get()->format('U'); } elseif ($expires instanceof \DateTimeInterface) { $seconds = $expires->format('U'); } elseif (is_numeric($expires)) {
php
{ "resource": "" }
q15268
SigningHelper.normalizeResource
train
private function normalizeResource($resource) { $pieces = explode('/', trim($resource, '/')); array_walk($pieces, function (&$piece) {
php
{ "resource": "" }
q15269
SigningHelper.normalizeOptions
train
private function normalizeOptions(array $options) { $options += [ 'method' => 'GET', 'cname' => self::DEFAULT_DOWNLOAD_HOST, 'contentMd5' => null, 'contentType' => null, 'headers' => [], 'saveAsName' => null, 'responseDisposition' => null, 'responseType' => null, 'keyFile' => null, 'keyFilePath' => null, 'allowPost' => false, 'forceOpenssl' => false, 'queryParams' => [], 'timestamp' => null ]; $allowedMethods = ['GET', 'PUT', 'POST', 'DELETE']; $options['method'] = strtoupper($options['method']); if (!in_array($options['method'], $allowedMethods)) { throw new \InvalidArgumentException('$options.method must be one of `GET`, `PUT` or `DELETE`.'); } if ($options['method'] === 'POST' && !$options['allowPost']) { throw new \InvalidArgumentException( 'Invalid method. To create an upload URI, use StorageObject::signedUploadUrl().' ); } unset($options['allowPost']); // For backwards compatibility, strip protocol from cname. $cnameParts = explode('//', $options['cname']); if (count($cnameParts) > 1) { $options['cname'] = $cnameParts[1]; } $options['cname'] = trim($options['cname'], '/'); // If a timestamp is provided, use it in place of `now` for v4 URLs only.. // This option exists for testing purposes, and should not
php
{ "resource": "" }
q15270
SigningHelper.normalizeHeaders
train
private function normalizeHeaders(array $headers) { $out = []; foreach ($headers as $name => $value) { $name = strtolower(trim($name)); // collapse arrays of values into a comma-separated list. if (!is_array($value)) { $value = [$value]; } foreach ($value as &$headerValue) { // strip trailing and leading spaces. $headerValue = trim($headerValue); // replace newlines with empty strings.
php
{ "resource": "" }
q15271
SigningHelper.normalizeUriPath
train
private function normalizeUriPath($cname, $resource) { if ($cname !== self::DEFAULT_DOWNLOAD_HOST) { $resourceParts = explode('/', trim($resource, '/')); array_shift($resourceParts); // Resource is a Bucket. if (empty($resourceParts)) {
php
{ "resource": "" }
q15272
SigningHelper.getSigningCredentials
train
private function getSigningCredentials(ConnectionInterface $connection, array $options) { $keyFilePath = isset($options['keyFilePath']) ? $options['keyFilePath'] : null; if ($keyFilePath) { if (!file_exists($keyFilePath)) { throw new \InvalidArgumentException(sprintf( 'Keyfile path %s does not exist.', $keyFilePath )); } $options['keyFile'] = self::jsonDecode(file_get_contents($keyFilePath), true); } $rw = $connection->requestWrapper(); $keyFile = isset($options['keyFile']) ? $options['keyFile'] : null; if ($keyFile) { $scopes = isset($options['scopes']) ? $options['scopes'] : $rw->scopes(); $credentials = CredentialsLoader::makeCredentials($scopes, $keyFile); } else { $credentials = $rw->getCredentialsFetcher();
php
{ "resource": "" }
q15273
SigningHelper.addCommonParams
train
private function addCommonParams($generation, array $params, array $options) { if ($options['responseType']) { $params['response-content-type'] = $options['responseType']; } if ($options['responseDisposition']) { $params['response-content-disposition'] = $options['responseDisposition']; } elseif ($options['saveAsName']) { $params['response-content-disposition']
php
{ "resource": "" }
q15274
ReadPartition.serialize
train
public function serialize() { $vars = get_object_vars($this); $vars['keySet'] = $vars['keySet']->keySetObject();
php
{ "resource": "" }
q15275
ReadPartition.hydrate
train
public static function hydrate(array $data) { return new self( $data['token'], $data['table'],
php
{ "resource": "" }
q15276
CommitRequest.setMode
train
public function setMode($var) { GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CommitRequest_Mode::class);
php
{ "resource": "" }
q15277
ListTransferRunsRequest.setStates
train
public function setStates($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM,
php
{ "resource": "" }
q15278
ListTransferRunsRequest.setRunAttempt
train
public function setRunAttempt($var) { GPBUtil::checkEnum($var, \Google\Cloud\Big
php
{ "resource": "" }
q15279
ClusterControllerGapicClient.createCluster
train
public function createCluster($projectId, $region, $cluster, array $optionalArgs = []) { $request = new CreateClusterRequest(); $request->setProjectId($projectId); $request->setRegion($region); $request->setCluster($cluster); if (isset($optionalArgs['requestId'])) { $request->setRequestId($optionalArgs['requestId']); }
php
{ "resource": "" }
q15280
ClusterControllerGapicClient.updateCluster
train
public function updateCluster($projectId, $region, $clusterName, $cluster, $updateMask, array $optionalArgs = []) { $request = new UpdateClusterRequest(); $request->setProjectId($projectId); $request->setRegion($region); $request->setClusterName($clusterName); $request->setCluster($cluster); $request->setUpdateMask($updateMask); if (isset($optionalArgs['gracefulDecommissionTimeout'])) { $request->setGracefulDecommissionTimeout($optionalArgs['gracefulDecommissionTimeout']); }
php
{ "resource": "" }
q15281
ClusterControllerGapicClient.deleteCluster
train
public function deleteCluster($projectId, $region, $clusterName, array $optionalArgs = []) { $request = new DeleteClusterRequest(); $request->setProjectId($projectId); $request->setRegion($region); $request->setClusterName($clusterName); if (isset($optionalArgs['clusterUuid'])) { $request->setClusterUuid($optionalArgs['clusterUuid']); } if (isset($optionalArgs['requestId'])) {
php
{ "resource": "" }
q15282
CodeParser.buildNestedParams
train
private function buildNestedParams($nestedParams, $origParam, $isProto = false) { $paramsArray = []; foreach ($nestedParams as $param) { $nestedParam = explode(' ', trim($param), 3); // START proto nested arg missing description workaround if (count($nestedParam) < 3 && !$isProto) { throw new \Exception('nested param is in an invalid format: '. $param); } // END proto nested arg missing description workaround list($type, $name, $description) = $nestedParam; $name = substr($name, 1); $description = preg_replace('/\s+/', ' ', $description); $types = new Collection( array($type), $origParam->getDocBlock() ? $origParam->getDocBlock()->getContext() : null ); $paramsArray[] = [
php
{ "resource": "" }
q15283
Subscription.create
train
public function create(array $options = []) { // If a subscription is created via PubSubClient::subscription(), // it may or may not have a topic name. This is fine for most API // interactions, but a topic name is required to create a subscription.
php
{ "resource": "" }
q15284
Subscription.update
train
public function update(array $subscription, array $options = []) { return $this->info = $this->connection->updateSubscription([
php
{ "resource": "" }
q15285
Subscription.reload
train
public function reload(array $options = []) { return $this->info
php
{ "resource": "" }
q15286
Subscription.pull
train
public function pull(array $options = []) { $messages = []; $options['returnImmediately'] = isset($options['returnImmediately']) ? $options['returnImmediately'] : false; $options['maxMessages'] = isset($options['maxMessages']) ? $options['maxMessages'] : self::MAX_MESSAGES; $response = $this->connection->pull($options + [ 'subscription' => $this->name ]); if (isset($response['receivedMessages'])) {
php
{ "resource": "" }
q15287
Subscription.acknowledgeBatch
train
public function acknowledgeBatch(array $messages, array $options = []) { $this->validateBatch($messages, Message::class); $this->connection->acknowledge($options + [
php
{ "resource": "" }
q15288
Subscription.modifyAckDeadline
train
public function modifyAckDeadline(Message $message, $seconds, array $options
php
{ "resource": "" }
q15289
Subscription.modifyAckDeadlineBatch
train
public function modifyAckDeadlineBatch(array $messages, $seconds, array $options = []) { $this->validateBatch($messages, Message::class); $this->connection->modifyAckDeadline($options + [ 'subscription' => $this->name,
php
{ "resource": "" }
q15290
Subscription.modifyPushConfig
train
public function modifyPushConfig(array $pushConfig, array $options = []) { $this->connection->modifyPushConfig($options +
php
{ "resource": "" }
q15291
Subscription.seekToTime
train
public function seekToTime(Timestamp $timestamp) { return $this->connection->seek([ 'subscription' => $this->name,
php
{ "resource": "" }
q15292
Subscription.seekToSnapshot
train
public function seekToSnapshot(Snapshot $snapshot) { return $this->connection->seek([
php
{ "resource": "" }
q15293
Subscription.iam
train
public function iam() { if (!$this->iam) { $iamConnection = new IamSubscription($this->connection);
php
{ "resource": "" }
q15294
Subscription.getMessageAckIds
train
private function getMessageAckIds(array $messages) { $ackIds = []; foreach ($messages as $message) {
php
{ "resource": "" }
q15295
SynthesizeSpeechRequest.setInput
train
public function setInput($var) { GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class);
php
{ "resource": "" }
q15296
SynthesizeSpeechRequest.setVoice
train
public function setVoice($var) { GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class);
php
{ "resource": "" }
q15297
SynthesizeSpeechRequest.setAudioConfig
train
public function setAudioConfig($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15298
Asset.setSecurityCenterProperties
train
public function setSecurityCenterProperties($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\Asset_SecurityCenterProperties::class);
php
{ "resource": "" }
q15299
Asset.setResourceProperties
train
public function setResourceProperties($var) { $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING,
php
{ "resource": "" }