_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q14900
TargetChange.setTargetChangeType
train
public function setTargetChangeType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\TargetChange_TargetChangeType::class);
php
{ "resource": "" }
q14901
TargetChange.setTargetIds
train
public function setTargetIds($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
php
{ "resource": "" }
q14902
ThreatEntryAdditions.setRawHashes
train
public function setRawHashes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14903
ThreatEntryAdditions.setRiceHashes
train
public function setRiceHashes($var) { GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\RiceDeltaEncoding::class);
php
{ "resource": "" }
q14904
CloudStorageOptions.setFileSet
train
public function setFileSet($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStorageOptions_FileSet::class);
php
{ "resource": "" }
q14905
CloudStorageOptions.setFileTypes
train
public function setFileTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM,
php
{ "resource": "" }
q14906
Database.setState
train
public function setState($var) { GPBUtil::checkEnum($var, \Google\Cloud\Spanner\Admin\Database\V1\Database_State::class);
php
{ "resource": "" }
q14907
FileSet.setRegexFileSet
train
public function setRegexFileSet($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStorageRegexFileSet::class);
php
{ "resource": "" }
q14908
LongRunningOperation.state
train
public function state(array $options = []) { if (!$this->done($options)) { return self::STATE_IN_PROGRESS; }
php
{ "resource": "" }
q14909
LongRunningOperation.reload
train
public function reload(array $options = []) { $res = $this->connection->get([ 'name' => $this->name, ] + $options); $this->result = null; $this->error = null; if (isset($res['done']) &&
php
{ "resource": "" }
q14910
LongRunningOperation.pollUntilComplete
train
public function pollUntilComplete(array $options = []) { $options += [ 'pollingIntervalSeconds' => $this::WAIT_INTERVAL, 'maxPollingDurationSeconds' => 0.0, ]; $pollingIntervalMicros = $options['pollingIntervalSeconds'] * 1000000; $maxPollingDuration = $options['maxPollingDurationSeconds']; $hasMaxPollingDuration = $maxPollingDuration > 0.0; $endTime = microtime(true) +
php
{ "resource": "" }
q14911
LongRunningOperation.executeDoneCallback
train
private function executeDoneCallback($type, $response) { if (is_null($response)) { return null; } $callables = array_filter($this->callablesMap, function ($callable) use ($type) { return $callable['typeUrl'] === $type; });
php
{ "resource": "" }
q14912
VoiceSelectionParams.setSsmlGender
train
public function setSsmlGender($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SsmlVoiceGender::class);
php
{ "resource": "" }
q14913
GetDatabaseDdlResponse.setStatements
train
public function setStatements($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
php
{ "resource": "" }
q14914
InspectionRule.setHotwordRule
train
public function setHotwordRule($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_DetectionRule_HotwordRule::class);
php
{ "resource": "" }
q14915
InspectionRule.setExclusionRule
train
public function setExclusionRule($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ExclusionRule::class);
php
{ "resource": "" }
q14916
HttpCheck.setAuthInfo
train
public function setAuthInfo($var) { GPBUtil::checkMessage($var, \Google\Cloud\Mo
php
{ "resource": "" }
q14917
Job.setRetryConfig
train
public function setRetryConfig($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q14918
ReadModifyWriteRowRules.append
train
public function append($familyName, $qualifier, $value) { $this->rules[] = (new ReadModifyWriteRule) ->setFamilyName($familyName)
php
{ "resource": "" }
q14919
Column.setCells
train
public function setCells($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14920
RequestWrapper.sendAsync
train
public function sendAsync(RequestInterface $request, array $options = []) { // Unfortunately, the current ExponentialBackoff implementation doesn't // play nicely with promises. $retryAttempt = 0; $fn = function ($retryAttempt) use (&$fn, $request, $options) { $asyncHttpHandler = $this->asyncHttpHandler; $retryOptions = $this->getRetryOptions($options); if (!$retryOptions['calcDelayFunction']) { $retryOptions['calcDelayFunction'] = [ExponentialBackoff::class, 'calculateDelay']; } return $asyncHttpHandler( $this->applyHeaders($request), $this->getRequestOptions($options)
php
{ "resource": "" }
q14921
RequestWrapper.applyHeaders
train
private function applyHeaders(RequestInterface $request) { $headers = [ 'User-Agent' => 'gcloud-php/' . $this->componentVersion, 'x-goog-api-client' => 'gl-php/' . PHP_VERSION . ' gccl/' . $this->componentVersion, ]; if ($this->shouldSignRequest) {
php
{ "resource": "" }
q14922
RequestWrapper.fetchCredentials
train
private function fetchCredentials() { $backoff = new ExponentialBackoff($this->retries, $this->getRetryFunction()); try { return $backoff->execute(
php
{ "resource": "" }
q14923
RequestWrapper.convertToGoogleException
train
private function convertToGoogleException(\Exception $ex) { switch ($ex->getCode()) { case 400: $exception = Exception\BadRequestException::class; break; case 404: $exception = Exception\NotFoundException::class; break; case 409: $exception = Exception\ConflictException::class;
php
{ "resource": "" }
q14924
RequestWrapper.getExceptionMessage
train
private function getExceptionMessage(\Exception $ex) { if ($ex instanceof RequestException && $ex->hasResponse()) { return (string) $ex->getResponse()->getBody();
php
{ "resource": "" }
q14925
RequestWrapper.getRequestOptions
train
private function getRequestOptions(array $options) { $restOptions = isset($options['restOptions']) ? $options['restOptions'] : $this->restOptions; $timeout = isset($options['requestTimeout']) ? $options['requestTimeout'] : $this->requestTimeout;
php
{ "resource": "" }
q14926
RequestWrapper.getRetryOptions
train
private function getRetryOptions(array $options) { return [ 'retries' => isset($options['retries']) ? $options['retries'] : $this->retries, 'retryFunction' => isset($options['restRetryFunction']) ? $options['restRetryFunction']
php
{ "resource": "" }
q14927
RequestWrapper.buildDefaultAsyncHandler
train
private function buildDefaultAsyncHandler() { $isGuzzleHandler = $this->httpHandler instanceof Guzzle6HttpHandler || $this->httpHandler instanceof Guzzle5HttpHandler;
php
{ "resource": "" }
q14928
StreamingDetectIntentRequest.setQueryParams
train
public function setQueryParams($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q14929
StreamingDetectIntentRequest.setOutputAudioConfig
train
public function setOutputAudioConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class);
php
{ "resource": "" }
q14930
HttpConfig.setHttpEnabledState
train
public function setHttpEnabledState($var) { GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\HttpState::class);
php
{ "resource": "" }
q14931
GqlQuery.queryObject
train
public function queryObject() { $bindingType = $this->options['bindingType']; $queryObj = []; $queryObj['queryString'] = $this->query; $queryObj['allowLiterals'] = (bool) $this->options['allowLiterals']; $bindings = $this->mapBindings($bindingType, $this->options['bindings']);
php
{ "resource": "" }
q14932
GqlQuery.mapBindings
train
private function mapBindings($bindingType, array $bindings) { $res = []; foreach ($bindings as $key => $binding) { if ($binding instanceof Cursor) { $value = [ 'cursor' => $binding->cursor() ]; } else { $value = [ 'value' =>
php
{ "resource": "" }
q14933
GqlQuery.determineBindingType
train
private function determineBindingType(array $options) { if (isset($options['bindings']) &&
php
{ "resource": "" }
q14934
BeginTransactionRequest.setOptions
train
public function setOptions($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions::class);
php
{ "resource": "" }
q14935
ExtendedSourceContext.setContext
train
public function setContext($var) { GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\SourceContext::class);
php
{ "resource": "" }
q14936
QueryJobConfiguration.parameters
train
public function parameters(array $parameters) { $queryParams = []; $this->config['configuration']['query']['parameterMode'] = $this->isAssoc($parameters) ? 'named' : 'positional'; foreach ($parameters as $name => $value) { $param = $this->mapper->toParameter($value); if ($this->config['configuration']['query']['parameterMode'] === 'named')
php
{ "resource": "" }
q14937
ErrorContext.setHttpRequest
train
public function setHttpRequest($var) { GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\HttpRequestContext::class);
php
{ "resource": "" }
q14938
ErrorContext.setReportLocation
train
public function setReportLocation($var) { GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\SourceLocation::class);
php
{ "resource": "" }
q14939
Index.setQueryScope
train
public function setQueryScope($var) { GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_QueryScope::class);
php
{ "resource": "" }
q14940
Index.setState
train
public function setState($var) { GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_State::class);
php
{ "resource": "" }
q14941
LDiversityEquivalenceClass.setQuasiIdsValues
train
public function setQuasiIdsValues($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14942
LDiversityEquivalenceClass.setTopSensitiveValues
train
public function setTopSensitiveValues($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14943
RunQueryRequest.setStructuredQuery
train
public function setStructuredQuery($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery::class);
php
{ "resource": "" }
q14944
RestTrait.send
train
public function send($resource, $method, array $options = [], $whitelisted = false) { $requestOptions = $this->pluckArray([ 'restOptions', 'retries', 'requestTimeout' ], $options); try { return json_decode( $this->requestWrapper->send( $this->requestBuilder->build($resource, $method, $options), $requestOptions
php
{ "resource": "" }
q14945
Grpc.buildSubscription
train
private function buildSubscription(array &$args, $required = false) { $pushConfig = $this->pluck('pushConfig', $args, $required); $pushConfig = $pushConfig ? $this->buildPushConfig($pushConfig) : null; return $this->serializer->decodeMessage(new Subscription(), array_filter([
php
{ "resource": "" }
q14946
JobConfig.getJobFromId
train
public function getJobFromId($identifier) { return array_key_exists($identifier, $this->identifierToId)
php
{ "resource": "" }
q14947
JobConfig.getJobFromIdNum
train
public function getJobFromIdNum($idNum) { return array_key_exists($idNum, $this->idToIdentifier)
php
{ "resource": "" }
q14948
JobConfig.registerJob
train
public function registerJob($identifier, $callback) { if (array_key_exists($identifier, $this->identifierToId)) { $idNum = $this->identifierToId[$identifier]; } else { $idNum = count($this->identifierToId) + 1; $this->idToIdentifier[$idNum] = $identifier;
php
{ "resource": "" }
q14949
CustomInfoType.setLikelihood
train
public function setLikelihood($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\Likelihood::class);
php
{ "resource": "" }
q14950
CustomInfoType.setDictionary
train
public function setDictionary($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Dictionary::class);
php
{ "resource": "" }
q14951
CustomInfoType.setSurrogateType
train
public function setSurrogateType($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_SurrogateType::class);
php
{ "resource": "" }
q14952
CustomInfoType.setStoredType
train
public function setStoredType($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredType::class);
php
{ "resource": "" }
q14953
CustomInfoType.setDetectionRules
train
public function setDetectionRules($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14954
CustomInfoType.setExclusionType
train
public function setExclusionType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\CustomInfoType_ExclusionType::class);
php
{ "resource": "" }
q14955
Grpc.prepareQueryBinding
train
private function prepareQueryBinding(array $binding) { $value = $binding['value']; list ($type, $val) = $this->toGrpcValue($value);
php
{ "resource": "" }
q14956
Grpc.readOptions
train
private function readOptions(array $readOptions) { if (isset($readOptions['readConsistency'])) { switch ($readOptions['readConsistency']) { case 'STRONG': $readOptions['readConsistency'] = ReadConsistency::STRONG; break; case 'EVENTUAL': $readOptions['readConsistency'] = ReadConsistency::EVENTUAL; break; default:
php
{ "resource": "" }
q14957
Grpc.convertFilterProps
train
private function convertFilterProps(array $filter) { if (isset($filter['propertyFilter'])) { $operator = $filter['propertyFilter']['op']; $constName = PropertyFilterOperator::class . '::' . $operator; if (!defined($constName)) { throw new \InvalidArgumentException('Invalid operator.');
php
{ "resource": "" }
q14958
Grpc.toGrpcValue
train
private function toGrpcValue(array $property) { $type = array_keys($property)[0]; $val = $property[$type]; if ($val === null) { $val = NullValue::NULL_VALUE; } if ($type === 'timestampValue') { $val
php
{ "resource": "" }
q14959
ExclusionRule.setRegex
train
public function setRegex($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Regex::class);
php
{ "resource": "" }
q14960
ExclusionRule.setExcludeInfoTypes
train
public function setExcludeInfoTypes($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q14961
ExclusionRule.setMatchingType
train
public function setMatchingType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\MatchingType::class);
php
{ "resource": "" }
q14962
ListVoicesResponse.setVoices
train
public function setVoices($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14963
StoredInfoType.setCurrentVersion
train
public function setCurrentVersion($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q14964
StoredInfoType.setPendingVersions
train
public function setPendingVersions($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14965
ListSessionsResponse.setSessions
train
public function setSessions($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14966
SecurityCenterProperties.setResourceOwners
train
public function setResourceOwners($var) { $arr = GPBUtil::checkRepeatedField($var,
php
{ "resource": "" }
q14967
ListDatabasesResponse.setDatabases
train
public function setDatabases($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14968
UptimeCheckServiceGapicClient.listUptimeCheckIps
train
public function listUptimeCheckIps(array $optionalArgs = []) { $request = new ListUptimeCheckIpsRequest(); if (isset($optionalArgs['pageSize'])) { $request->setPageSize($optionalArgs['pageSize']); } if (isset($optionalArgs['pageToken'])) { $request->setPageToken($optionalArgs['pageToken']);
php
{ "resource": "" }
q14969
ApplicationServiceGapicClient.profileName
train
public static function profileName($project, $tenant, $profile) { return self::getProfileNameTemplate()->render([ 'project' => $project,
php
{ "resource": "" }
q14970
ApplicationServiceGapicClient.applicationName
train
public static function applicationName($project, $tenant, $profile, $application) { return self::getApplicationNameTemplate()->render([
php
{ "resource": "" }
q14971
Instance.reload
train
public function reload(array $options = []) { $this->info = $this->connection->getInstance($options + [ 'name' => $this->name,
php
{ "resource": "" }
q14972
Instance.state
train
public function state(array $options = []) { $info = $this->info($options);
php
{ "resource": "" }
q14973
Instance.update
train
public function update(array $options = []) { $operation = $this->connection->updateInstance([
php
{ "resource": "" }
q14974
Instance.createDatabase
train
public function createDatabase($name, array $options = []) { $instantiation = $this->pluckArray(['sessionPool'], $options);
php
{ "resource": "" }
q14975
Instance.database
train
public function database($name, array $options = []) { return new Database( $this->connection, $this, $this->lroConnection, $this->lroCallables, $this->projectId,
php
{ "resource": "" }
q14976
Instance.databases
train
public function databases(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false); return new ItemIterator( new PageIterator( function (array $database) {
php
{ "resource": "" }
q14977
Instance.iam
train
public function iam() { if (!$this->iam) { $this->iam = new Iam(
php
{ "resource": "" }
q14978
ComputeThreatListDiffResponse.setResponseType
train
public function setResponseType($var) { GPBUtil::checkEnum($var, \Google\Cloud\We
php
{ "resource": "" }
q14979
ComputeThreatListDiffResponse.setAdditions
train
public function setAdditions($var) { GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions::class);
php
{ "resource": "" }
q14980
ComputeThreatListDiffResponse.setRemovals
train
public function setRemovals($var) { GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals::class);
php
{ "resource": "" }
q14981
ComputeThreatListDiffResponse.setChecksum
train
public function setChecksum($var) { GPBUtil::checkMessage($var, \Google\Cloud
php
{ "resource": "" }
q14982
Filter.setFieldFilter
train
public function setFieldFilter($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter::class);
php
{ "resource": "" }
q14983
Filter.setUnaryFilter
train
public function setUnaryFilter($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter::class);
php
{ "resource": "" }
q14984
RegisterDebuggeeRequest.setDebuggee
train
public function setDebuggee($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q14985
VariableTable.setOptions
train
public function setOptions(array $options = []) { $options += [ 'maxMemberDepth' => self::DEFAULT_MAX_MEMBER_DEPTH, 'maxPayloadSize' => self::DEFAULT_MAX_PAYLOAD_SIZE, 'maxMembers' => self::DEFAULT_MAX_MEMBERS, 'maxValueLength' => self::DEFAULT_MAX_STRING_LENGTH ]; $this->maxMemberDepth =
php
{ "resource": "" }
q14986
VariableTable.register
train
public function register($name, $value, $hash = null) {
php
{ "resource": "" }
q14987
VariableTable.bufferFullVariable
train
public function bufferFullVariable() { if (!$this->bufferFullVariableIndex) { $this->bufferFullVariableIndex = $this->nextIndex++; $this->variables[] = new Variable('', '', [ 'status' => new StatusMessage( true, StatusMessage::REFERENCE_VARIABLE_VALUE, new FormatMessage(
php
{ "resource": "" }
q14988
Operation.results
train
public function results(array $options = []) { $info = $this->info($options); $results = []; if (!isset($info['response']['results'])) {
php
{ "resource": "" }
q14989
Operation.reload
train
public function reload(array $options = []) { return $this->info
php
{ "resource": "" }
q14990
QueryInput.setAudioConfig
train
public function setAudioConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class);
php
{ "resource": "" }
q14991
QueryInput.setText
train
public function setText($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class);
php
{ "resource": "" }
q14992
QueryInput.setEvent
train
public function setEvent($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class);
php
{ "resource": "" }
q14993
TextAnnotation.setPages
train
public function setPages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14994
ListOperationsResponse.setOperations
train
public function setOperations($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q14995
ListOperationsResponse.setMissingZones
train
public function setMissingZones($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
php
{ "resource": "" }
q14996
WorkflowTemplatePlacement.setManagedCluster
train
public function setManagedCluster($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q14997
WorkflowTemplatePlacement.setClusterSelector
train
public function setClusterSelector($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ClusterSelector::class);
php
{ "resource": "" }
q14998
IndexConfigDelta.setChangeType
train
public function setChangeType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Firesto
php
{ "resource": "" }
q14999
Subscription.setPushConfig
train
public function setPushConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class);
php
{ "resource": "" }