_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q15200
Regex.setGroupIndexes
train
public function setGroupIndexes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); $this->group_indexes = $arr; return $this; }
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', $argument, ['\Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRespon...
php
{ "resource": "" }
q15202
SysvTrait.getSysvKey
train
private function getSysvKey($idNum) { $key = getenv('GOOGLE_CLOUD_SYSV_ID') ?: self::$productionKey; $base = ftok(__FILE__, $key); if ($base == PHP_INT_MAX) { $base = 1; } return $base + $idNum; }
php
{ "resource": "" }
q15203
InspectConfig.setContentOptions
train
public function setContentOptions($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\ContentOption::class); $this->content_options = $arr; return $this; }
php
{ "resource": "" }
q15204
InspectConfig.setRuleSet
train
public function setRuleSet($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\InspectionRuleSet::class); $this->rule_set = $arr; return $this; }
php
{ "resource": "" }
q15205
ListTimeSeriesResponse.setTimeSeries
train
public function setTimeSeries($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeries::class); $this->time_series = $arr; return $this; }
php
{ "resource": "" }
q15206
ListTimeSeriesResponse.setExecutionErrors
train
public function setExecutionErrors($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); $this->execution_errors = $arr; return $this; }
php
{ "resource": "" }
q15207
ComputeThreatListDiffRequest.setThreatType
train
public function setThreatType($var) { GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1beta1\ThreatType::class); $this->threat_type = $var; return $this; }
php
{ "resource": "" }
q15208
ComputeThreatListDiffRequest.setConstraints
train
public function setConstraints($var) { GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffRequest_Constraints::class); $this->constraints = $var; return $this; }
php
{ "resource": "" }
q15209
ListAppProfilesResponse.setAppProfiles
train
public function setAppProfiles($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\AppProfile::class); $this->app_profiles = $arr; return $this; }
php
{ "resource": "" }
q15210
Operation.mutation
train
public function mutation($operation, $table, $mutation) { return [ $operation => [ 'table' => $table, 'columns' => array_keys($mutation), 'values' => $this->mapper->encodeValuesAsSimpleType(array_values($mutation)) ] ]; }
php
{ "resource": "" }
q15211
Operation.deleteMutation
train
public function deleteMutation($table, KeySet $keySet) { return [ self::OP_DELETE => [ 'table' => $table, 'keySet' => $this->flattenKeySet($keySet), ] ]; }
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, 'session' => $session->name(), 'database' => $session->info()['database'] ] + $options); }
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 q...
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...
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'] : false; return new Transaction($this, $session, $res['id...
php
{ "resource": "" }
q15217
Operation.snapshot
train
public function snapshot(Session $session, array $options = []) { $options += [ 'singleUse' => false, 'className' => Snapshot::class ]; if (!$options['singleUse']) { $res = $this->beginTransaction($session, $options); } else { $res = [...
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' => $this->pluck('partitionSizeBytes', $options, false), 'maxPartitions' => $this->pluck('maxPartitions', $options, false) ]); return $options; }
php
{ "resource": "" }
q15220
Operation.beginTransaction
train
private function beginTransaction(Session $session, array $options = []) { $options += [ 'transactionOptions' => [] ]; return $this->connection->beginTransaction($options + [ 'session' => $session->name(), 'database' => $session->info()['database'] ...
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->encodeValuesAsSim...
php
{ "resource": "" }
q15222
Activity.setTeamMembers
train
public function setTeamMembers($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->team_members = $arr; return $this; }
php
{ "resource": "" }
q15223
LogSink.setOutputVersionFormat
train
public function setOutputVersionFormat($var) { GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LogSink_VersionFormat::class); $this->output_version_format = $var; return $this; }
php
{ "resource": "" }
q15224
SearchJobsRequest.setJobQuery
train
public function setJobQuery($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\JobQuery::class); $this->job_query = $var; return $this; }
php
{ "resource": "" }
q15225
Paragraph.setProperty
train
public function setProperty($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\TextAnnotation_TextProperty::class); $this->property = $var; return $this; }
php
{ "resource": "" }
q15226
Paragraph.setWords
train
public function setWords($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\Word::class); $this->words = $arr; return $this; }
php
{ "resource": "" }
q15227
ListDeviceConfigVersionsResponse.setDeviceConfigs
train
public function setDeviceConfigs($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iot\V1\DeviceConfig::class); $this->device_configs = $arr; return $this; }
php
{ "resource": "" }
q15228
Text.setText
train
public function setText($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->text = $arr; return $this; }
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', $argument, ['\Google\Cloud\Talent\V4beta1\Job', 'decode'], $metadata, $options); }
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', $argument, ['\Google\Cloud\Talent\V4beta1\Job', 'decode'], $metadata, $options); ...
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', $argument, ['\Google\Protobuf\GPBEmpty', 'decode'], $metadata, $options); }
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', $argument, ['\Google\Cloud\Talent\V4beta1\ListJobsResponse', 'decode'], $metadata, $opt...
php
{ "resource": "" }
q15233
ListTopicSnapshotsResponse.setSnapshots
train
public function setSnapshots($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->snapshots = $arr; return $this; }
php
{ "resource": "" }
q15234
CreateJobRequest.setJob
train
public function setJob($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Job::class); $this->job = $var; return $this; }
php
{ "resource": "" }
q15235
KeyFilter.sample
train
public function sample($probability) { if ($probability < 0) { throw new \InvalidArgumentException('Probability must be positive'); } if ($probability >= 1.0) { throw new \InvalidArgumentException('Probability must be less than 1.0'); } return new Sim...
php
{ "resource": "" }
q15236
ListCompaniesResponse.setCompanies
train
public function setCompanies($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Talent\V4beta1\Company::class); $this->companies = $arr; return $this; }
php
{ "resource": "" }
q15237
LongRunningRecognizeResponse.setResults
train
public function setResults($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Speech\V1\SpeechRecognitionResult::class); $this->results = $arr; return $this; }
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. /...
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->get...
php
{ "resource": "" }
q15240
ChunkFormatter.reset
train
private function reset() { $this->prevRowKey = null; $this->rowKey = null; $this->state = self::$rowStateEnum['NEW_ROW']; $this->row = []; }
php
{ "resource": "" }
q15241
ChunkFormatter.moveToNextState
train
private function moveToNextState(CellChunk $chunk) { $this->state = $chunk->getValueSize() > 0 ? self::$rowStateEnum['CELL_IN_PROGRESS'] : self::$rowStateEnum['ROW_IN_PROGRESS']; }
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()) ...
php
{ "resource": "" }
q15243
ChunkFormatter.validateResetRow
train
private function validateResetRow(CellChunk $chunk) { $this->isError( $chunk->getResetRow() && ( $chunk->getRowKey() || $chunk->getQualifier() || $chunk->getValue() || $chunk->getTimestampMicros() > 0 ), ...
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.' ); $this->isErro...
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...
php
{ "resource": "" }
q15246
ChunkFormatter.cellInProgress
train
private function cellInProgress(CellChunk $chunk) { $this->validateCellInProgress($chunk); if ($chunk->getResetRow()) { $this->reset(); return; } $this->qualifierValue = $this->qualifierValue . $chunk->getValue(); $this->moveToNextState($chunk); }
php
{ "resource": "" }
q15247
WebDetection.setWebEntities
train
public function setWebEntities($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\WebDetection\WebEntity::class); $this->web_entities = $arr; return $this; }
php
{ "resource": "" }
q15248
WebDetection.setFullMatchingImages
train
public function setFullMatchingImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\WebDetection\WebImage::class); $this->full_matching_images = $arr; return $this; }
php
{ "resource": "" }
q15249
WebDetection.setPartialMatchingImages
train
public function setPartialMatchingImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\WebDetection\WebImage::class); $this->partial_matching_images = $arr; return $this; }
php
{ "resource": "" }
q15250
WebDetection.setPagesWithMatchingImages
train
public function setPagesWithMatchingImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\WebDetection\WebPage::class); $this->pages_with_matching_images = $arr; return $this; }
php
{ "resource": "" }
q15251
WebDetection.setVisuallySimilarImages
train
public function setVisuallySimilarImages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\WebDetection\WebImage::class); $this->visually_similar_images = $arr; return $this; }
php
{ "resource": "" }
q15252
Degree.setDegreeType
train
public function setDegreeType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\DegreeType::class); $this->degree_type = $var; return $this; }
php
{ "resource": "" }
q15253
Degree.setFieldsOfStudy
train
public function setFieldsOfStudy($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->fields_of_study = $arr; return $this; }
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) { throw new InvalidArgumentException( 'Cannot add pathElement becau...
php
{ "resource": "" }
q15255
Key.ancestor
train
public function ancestor($kind, $identifier, array $options = []) { $options += [ 'identifierType' => null ]; $pathElement = $this->normalizeElement($kind, $identifier, $options['identifierType']); array_unshift($this->path, $pathElement); return $this; }
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'); } $path = $key->path(); $this->path = array_merge($path, $this->path); return $this; }
php
{ "resource": "" }
q15257
Key.state
train
public function state() { $end = $this->pathEnd(); return (isset($end['id']) || isset($end['name'])) ? self::STATE_NAMED : self::STATE_INCOMPLETE; }
php
{ "resource": "" }
q15258
Key.setLastElementIdentifier
train
public function setLastElementIdentifier($value, $type = Key::TYPE_ID) { $end = $this->pathEnd(); $end[$type] = (string) $value; $elements = array_keys($this->path); $lastElement = end($elements); $this->path[$lastElement] = $end; }
php
{ "resource": "" }
q15259
Key.pathEndIdentifier
train
public function pathEndIdentifier() { $end = $this->pathEnd(); if (isset($end['id'])) { return $end['id']; } if (isset($end['name'])) { return $end['name']; } return null; }
php
{ "resource": "" }
q15260
Key.pathEndIdentifierType
train
public function pathEndIdentifierType() { $end = $this->pathEnd(); if (isset($end['id'])) { return self::TYPE_ID; } if (isset($end['name'])) { return self::TYPE_NAME; } return null; }
php
{ "resource": "" }
q15261
Key.normalizeElement
train
private function normalizeElement($kind, $identifier, $identifierType) { $identifierType = $this->determineIdentifierType($identifier, $identifierType); $element = []; $element['kind'] = $kind; if (!is_null($identifier)) { $element[$identifierType] = $identifier; ...
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)) { thro...
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'])) { ...
php
{ "resource": "" }
q15264
Address.setUsage
train
public function setUsage($var) { GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\ContactInfoUsage::class); $this->usage = $var; return $this; }
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()] = []; ...
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); ...
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)) { $seconds ...
php
{ "resource": "" }
q15268
SigningHelper.normalizeResource
train
private function normalizeResource($resource) { $pieces = explode('/', trim($resource, '/')); array_walk($pieces, function (&$piece) { $piece = rawurlencode($piece); }); return '/' . implode('/', $pieces); }
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, 'responseDispos...
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]; ...
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)) { $resou...
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 \InvalidArgum...
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['re...
php
{ "resource": "" }
q15274
ReadPartition.serialize
train
public function serialize() { $vars = get_object_vars($this); $vars['keySet'] = $vars['keySet']->keySetObject(); return base64_encode(json_encode($vars + [ BatchClient::PARTITION_TYPE_KEY => static::class ])); }
php
{ "resource": "" }
q15275
ReadPartition.hydrate
train
public static function hydrate(array $data) { return new self( $data['token'], $data['table'], KeySet::fromArray($data['keySet']), $data['columns'], $data['options'] ); }
php
{ "resource": "" }
q15276
CommitRequest.setMode
train
public function setMode($var) { GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CommitRequest_Mode::class); $this->mode = $var; return $this; }
php
{ "resource": "" }
q15277
ListTransferRunsRequest.setStates
train
public function setStates($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class); $this->states = $arr; return $this; }
php
{ "resource": "" }
q15278
ListTransferRunsRequest.setRunAttempt
train
public function setRunAttempt($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\ListTransferRunsRequest_RunAttempt::class); $this->run_attempt = $var; return $this; }
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'])) { ...
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->setCl...
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']...
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...
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. if (!$this->topicName) { ...
php
{ "resource": "" }
q15284
Subscription.update
train
public function update(array $subscription, array $options = []) { return $this->info = $this->connection->updateSubscription([ 'name' => $this->name ] + $options + $subscription); }
php
{ "resource": "" }
q15285
Subscription.reload
train
public function reload(array $options = []) { return $this->info = $this->connection->getSubscription($options + [ 'subscription' => $this->name ]); }
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'] ...
php
{ "resource": "" }
q15287
Subscription.acknowledgeBatch
train
public function acknowledgeBatch(array $messages, array $options = []) { $this->validateBatch($messages, Message::class); $this->connection->acknowledge($options + [ 'subscription' => $this->name, 'ackIds' => $this->getMessageAckIds($messages) ]); }
php
{ "resource": "" }
q15288
Subscription.modifyAckDeadline
train
public function modifyAckDeadline(Message $message, $seconds, array $options = []) { $this->modifyAckDeadlineBatch([$message], $seconds, $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, 'ackIds' => $this->getMessageAckIds($messages), ...
php
{ "resource": "" }
q15290
Subscription.modifyPushConfig
train
public function modifyPushConfig(array $pushConfig, array $options = []) { $this->connection->modifyPushConfig($options + [ 'subscription' => $this->name, 'pushConfig' => $pushConfig ]); }
php
{ "resource": "" }
q15291
Subscription.seekToTime
train
public function seekToTime(Timestamp $timestamp) { return $this->connection->seek([ 'subscription' => $this->name, 'time' => $timestamp->formatAsString() ]); }
php
{ "resource": "" }
q15292
Subscription.seekToSnapshot
train
public function seekToSnapshot(Snapshot $snapshot) { return $this->connection->seek([ 'subscription' => $this->name, 'snapshot' => $snapshot->name() ]); }
php
{ "resource": "" }
q15293
Subscription.iam
train
public function iam() { if (!$this->iam) { $iamConnection = new IamSubscription($this->connection); $this->iam = new Iam($iamConnection, $this->name); } return $this->iam; }
php
{ "resource": "" }
q15294
Subscription.getMessageAckIds
train
private function getMessageAckIds(array $messages) { $ackIds = []; foreach ($messages as $message) { $ackIds[] = $message->ackId(); } return $ackIds; }
php
{ "resource": "" }
q15295
SynthesizeSpeechRequest.setInput
train
public function setInput($var) { GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\SynthesisInput::class); $this->input = $var; return $this; }
php
{ "resource": "" }
q15296
SynthesizeSpeechRequest.setVoice
train
public function setVoice($var) { GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceSelectionParams::class); $this->voice = $var; return $this; }
php
{ "resource": "" }
q15297
SynthesizeSpeechRequest.setAudioConfig
train
public function setAudioConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AudioConfig::class); $this->audio_config = $var; return $this; }
php
{ "resource": "" }
q15298
Asset.setSecurityCenterProperties
train
public function setSecurityCenterProperties($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\Asset_SecurityCenterProperties::class); $this->security_center_properties = $var; return $this; }
php
{ "resource": "" }
q15299
Asset.setResourceProperties
train
public function setResourceProperties($var) { $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); $this->resource_properties = $arr; return $this; }
php
{ "resource": "" }