_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | 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);
$this->target_change_type = $var;
return $this;
} | php | {
"resource": ""
} |
q14901 | TargetChange.setTargetIds | train | public function setTargetIds($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
$this->target_ids = $arr;
return $this;
} | php | {
"resource": ""
} |
q14902 | ThreatEntryAdditions.setRawHashes | train | public function setRawHashes($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebRisk\V1beta1\RawHashes::class);
$this->raw_hashes = $arr;
return $this;
} | php | {
"resource": ""
} |
q14903 | ThreatEntryAdditions.setRiceHashes | train | public function setRiceHashes($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\RiceDeltaEncoding::class);
$this->rice_hashes = $var;
return $this;
} | php | {
"resource": ""
} |
q14904 | CloudStorageOptions.setFileSet | train | public function setFileSet($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStorageOptions_FileSet::class);
$this->file_set = $var;
return $this;
} | php | {
"resource": ""
} |
q14905 | CloudStorageOptions.setFileTypes | train | public function setFileTypes($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\FileType::class);
$this->file_types = $arr;
return $this;
} | php | {
"resource": ""
} |
q14906 | Database.setState | train | public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Spanner\Admin\Database\V1\Database_State::class);
$this->state = $var;
return $this;
} | php | {
"resource": ""
} |
q14907 | FileSet.setRegexFileSet | train | public function setRegexFileSet($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStorageRegexFileSet::class);
$this->regex_file_set = $var;
return $this;
} | php | {
"resource": ""
} |
q14908 | LongRunningOperation.state | train | public function state(array $options = [])
{
if (!$this->done($options)) {
return self::STATE_IN_PROGRESS;
}
if ($this->done() && $this->result()) {
return self::STATE_SUCCESS;
}
return self::STATE_ERROR;
} | 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']) && $res['done']) {
$type = $res['metadata']['typeUrl'];
$this->result = $this->executeDoneCallback($type, $res['response']);
$this->error = (isset($res['error']))
? $res['error']
: null;
}
return $this->info = $res;
} | 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) + $maxPollingDuration;
do {
usleep($pollingIntervalMicros);
$this->reload($options);
} while (!$this->done() && (!$hasMaxPollingDuration || microtime(true) < $endTime));
return $this->result;
} | 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;
});
if (count($callables) === 0) {
return $response;
}
$callable = current($callables);
$fn = $callable['callable'];
return call_user_func($fn, $response);
} | php | {
"resource": ""
} |
q14912 | VoiceSelectionParams.setSsmlGender | train | public function setSsmlGender($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SsmlVoiceGender::class);
$this->ssml_gender = $var;
return $this;
} | php | {
"resource": ""
} |
q14913 | GetDatabaseDdlResponse.setStatements | train | public function setStatements($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->statements = $arr;
return $this;
} | php | {
"resource": ""
} |
q14914 | InspectionRule.setHotwordRule | train | public function setHotwordRule($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_DetectionRule_HotwordRule::class);
$this->writeOneof(1, $var);
return $this;
} | php | {
"resource": ""
} |
q14915 | InspectionRule.setExclusionRule | train | public function setExclusionRule($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ExclusionRule::class);
$this->writeOneof(2, $var);
return $this;
} | php | {
"resource": ""
} |
q14916 | HttpCheck.setAuthInfo | train | public function setAuthInfo($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_BasicAuthentication::class);
$this->auth_info = $var;
return $this;
} | php | {
"resource": ""
} |
q14917 | Job.setRetryConfig | train | public function setRetryConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1beta1\RetryConfig::class);
$this->retry_config = $var;
return $this;
} | php | {
"resource": ""
} |
q14918 | ReadModifyWriteRowRules.append | train | public function append($familyName, $qualifier, $value)
{
$this->rules[] = (new ReadModifyWriteRule)
->setFamilyName($familyName)
->setColumnQualifier($qualifier)
->setAppendValue($value);
return $this;
} | php | {
"resource": ""
} |
q14919 | Column.setCells | train | public function setCells($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Cell::class);
$this->cells = $arr;
return $this;
} | 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)
)->then(null, function (\Exception $ex) use ($fn, $retryAttempt, $retryOptions) {
$shouldRetry = $retryOptions['retryFunction']($ex);
if ($shouldRetry === false || $retryAttempt >= $retryOptions['retries']) {
throw $this->convertToGoogleException($ex);
}
$delay = $retryOptions['calcDelayFunction']($retryAttempt);
$retryOptions['delayFunction']($delay);
$retryAttempt++;
return $fn($retryAttempt);
});
};
return $fn($retryAttempt);
} | 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) {
$headers['Authorization'] = 'Bearer ' . $this->getToken();
}
return Psr7\modify_request($request, ['set_headers' => $headers]);
} | php | {
"resource": ""
} |
q14922 | RequestWrapper.fetchCredentials | train | private function fetchCredentials()
{
$backoff = new ExponentialBackoff($this->retries, $this->getRetryFunction());
try {
return $backoff->execute(
[$this->getCredentialsFetcher(), 'fetchAuthToken'],
[$this->authHttpHandler]
);
} catch (\Exception $ex) {
throw $this->convertToGoogleException($ex);
}
} | 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;
break;
case 412:
$exception = Exception\FailedPreconditionException::class;
break;
case 500:
$exception = Exception\ServerException::class;
break;
case 504:
$exception = Exception\DeadlineExceededException::class;
break;
default:
$exception = Exception\ServiceException::class;
break;
}
return new $exception($this->getExceptionMessage($ex), $ex->getCode(), $ex);
} | php | {
"resource": ""
} |
q14924 | RequestWrapper.getExceptionMessage | train | private function getExceptionMessage(\Exception $ex)
{
if ($ex instanceof RequestException && $ex->hasResponse()) {
return (string) $ex->getResponse()->getBody();
try {
$this->jsonDecode($res);
return $res;
} catch (\InvalidArgumentException $e) {
// no-op
}
}
return $ex->getMessage();
} | 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;
if ($timeout && !array_key_exists('timeout', $restOptions)) {
$restOptions['timeout'] = $timeout;
}
return $restOptions;
} | 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']
: $this->retryFunction,
'delayFunction' => isset($options['restDelayFunction'])
? $options['restDelayFunction']
: $this->delayFunction,
'calcDelayFunction' => isset($options['restCalcDelayFunction'])
? $options['restCalcDelayFunction']
: $this->calcDelayFunction
];
} | php | {
"resource": ""
} |
q14927 | RequestWrapper.buildDefaultAsyncHandler | train | private function buildDefaultAsyncHandler()
{
$isGuzzleHandler = $this->httpHandler instanceof Guzzle6HttpHandler
|| $this->httpHandler instanceof Guzzle5HttpHandler;
return $isGuzzleHandler
? [$this->httpHandler, 'async']
: [HttpHandlerFactory::build(), 'async'];
} | php | {
"resource": ""
} |
q14928 | StreamingDetectIntentRequest.setQueryParams | train | public function setQueryParams($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class);
$this->query_params = $var;
return $this;
} | php | {
"resource": ""
} |
q14929 | StreamingDetectIntentRequest.setOutputAudioConfig | train | public function setOutputAudioConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class);
$this->output_audio_config = $var;
return $this;
} | php | {
"resource": ""
} |
q14930 | HttpConfig.setHttpEnabledState | train | public function setHttpEnabledState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\HttpState::class);
$this->http_enabled_state = $var;
return $this;
} | 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']);
if (!empty($bindings)) {
$queryObj[$this->options['bindingType']] = $bindings;
}
return $queryObj;
} | 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' => $this->entityMapper->valueObject($binding)
];
}
if ($bindingType === self::BINDING_NAMED) {
$res[$key] = $value;
} else {
$res[] = $value;
}
}
return $res;
} | php | {
"resource": ""
} |
q14933 | GqlQuery.determineBindingType | train | private function determineBindingType(array $options)
{
if (isset($options['bindings']) && !$this->isAssoc($options['bindings'])) {
return self::BINDING_POSITIONAL;
}
return self::BINDING_NAMED;
} | php | {
"resource": ""
} |
q14934 | BeginTransactionRequest.setOptions | train | public function setOptions($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions::class);
$this->options = $var;
return $this;
} | php | {
"resource": ""
} |
q14935 | ExtendedSourceContext.setContext | train | public function setContext($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\SourceContext::class);
$this->context = $var;
return $this;
} | 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') {
$param += ['name' => $name];
}
$queryParams[] = $param;
}
$this->config['configuration']['query']['queryParameters'] = $queryParams;
return $this;
} | php | {
"resource": ""
} |
q14937 | ErrorContext.setHttpRequest | train | public function setHttpRequest($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\HttpRequestContext::class);
$this->http_request = $var;
return $this;
} | php | {
"resource": ""
} |
q14938 | ErrorContext.setReportLocation | train | public function setReportLocation($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\SourceLocation::class);
$this->report_location = $var;
return $this;
} | php | {
"resource": ""
} |
q14939 | Index.setQueryScope | train | public function setQueryScope($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_QueryScope::class);
$this->query_scope = $var;
return $this;
} | php | {
"resource": ""
} |
q14940 | Index.setState | train | public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_State::class);
$this->state = $var;
return $this;
} | php | {
"resource": ""
} |
q14941 | LDiversityEquivalenceClass.setQuasiIdsValues | train | public function setQuasiIdsValues($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\Value::class);
$this->quasi_ids_values = $arr;
return $this;
} | php | {
"resource": ""
} |
q14942 | LDiversityEquivalenceClass.setTopSensitiveValues | train | public function setTopSensitiveValues($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\ValueFrequency::class);
$this->top_sensitive_values = $arr;
return $this;
} | php | {
"resource": ""
} |
q14943 | RunQueryRequest.setStructuredQuery | train | public function setStructuredQuery($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery::class);
$this->writeOneof(2, $var);
return $this;
} | 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
)->getBody(),
true
);
} catch (NotFoundException $e) {
if ($whitelisted) {
throw $this->modifyWhitelistedError($e);
}
throw $e;
}
} | 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([
'name' => $this->pluck('name', $args, $required),
'topic' => $this->pluck('topic', $args, $required),
'pushConfig' => $pushConfig,
'ackDeadlineSeconds' => $this->pluck('ackDeadlineSeconds', $args, $required),
'retainAckedMessages' => $this->pluck('retainAckedMessages', $args, $required),
'messageRetentionDuration' => $this->pluck('messageRetentionDuration', $args, $required),
]));
} | php | {
"resource": ""
} |
q14946 | JobConfig.getJobFromId | train | public function getJobFromId($identifier)
{
return array_key_exists($identifier, $this->identifierToId)
? $this->jobs[$identifier]
: null;
} | php | {
"resource": ""
} |
q14947 | JobConfig.getJobFromIdNum | train | public function getJobFromIdNum($idNum)
{
return array_key_exists($idNum, $this->idToIdentifier)
? $this->jobs[$this->idToIdentifier[$idNum]]
: null;
} | 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;
}
$this->jobs[$identifier] = call_user_func(
$callback,
$idNum
);
$this->identifierToId[$identifier] = $idNum;
} | php | {
"resource": ""
} |
q14949 | CustomInfoType.setLikelihood | train | public function setLikelihood($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\Likelihood::class);
$this->likelihood = $var;
return $this;
} | php | {
"resource": ""
} |
q14950 | CustomInfoType.setDictionary | train | public function setDictionary($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Dictionary::class);
$this->writeOneof(2, $var);
return $this;
} | php | {
"resource": ""
} |
q14951 | CustomInfoType.setSurrogateType | train | public function setSurrogateType($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_SurrogateType::class);
$this->writeOneof(4, $var);
return $this;
} | php | {
"resource": ""
} |
q14952 | CustomInfoType.setStoredType | train | public function setStoredType($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredType::class);
$this->writeOneof(5, $var);
return $this;
} | php | {
"resource": ""
} |
q14953 | CustomInfoType.setDetectionRules | train | public function setDetectionRules($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\CustomInfoType\DetectionRule::class);
$this->detection_rules = $arr;
return $this;
} | php | {
"resource": ""
} |
q14954 | CustomInfoType.setExclusionType | train | public function setExclusionType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\CustomInfoType_ExclusionType::class);
$this->exclusion_type = $var;
return $this;
} | php | {
"resource": ""
} |
q14955 | Grpc.prepareQueryBinding | train | private function prepareQueryBinding(array $binding)
{
$value = $binding['value'];
list ($type, $val) = $this->toGrpcValue($value);
$binding['value'][$type] = $val;
return $binding;
} | 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:
//@codeCoverageIgnoreStart
throw new \InvalidArgumentException('Invalid value for Read Consistency.');
break;
//@codeCoverageIgnoreEnd
}
}
return $this->serializer->decodeMessage(
new ReadOptions,
$readOptions
);
} | 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.');
}
$filter['propertyFilter']['op'] = constant($constName);
}
if (isset($filter['compositeFilter'])) {
$filter['compositeFilter']['op'] = CompositeFilterOperator::PBAND;
foreach ($filter['compositeFilter']['filters'] as &$nested) {
$nested = $this->convertFilterProps($nested);
}
}
return $filter;
} | 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 = $this->formatTimestampForApi($val);
}
if ($type === 'geoPointValue') {
$val = $this->arrayFilterRemoveNull($val);
}
return [$type, $val];
} | php | {
"resource": ""
} |
q14959 | ExclusionRule.setRegex | train | public function setRegex($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Regex::class);
$this->writeOneof(2, $var);
return $this;
} | php | {
"resource": ""
} |
q14960 | ExclusionRule.setExcludeInfoTypes | train | public function setExcludeInfoTypes($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ExcludeInfoTypes::class);
$this->writeOneof(3, $var);
return $this;
} | php | {
"resource": ""
} |
q14961 | ExclusionRule.setMatchingType | train | public function setMatchingType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\MatchingType::class);
$this->matching_type = $var;
return $this;
} | php | {
"resource": ""
} |
q14962 | ListVoicesResponse.setVoices | train | public function setVoices($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class);
$this->voices = $arr;
return $this;
} | php | {
"resource": ""
} |
q14963 | StoredInfoType.setCurrentVersion | train | public function setCurrentVersion($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredInfoTypeVersion::class);
$this->current_version = $var;
return $this;
} | php | {
"resource": ""
} |
q14964 | StoredInfoType.setPendingVersions | train | public function setPendingVersions($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\StoredInfoTypeVersion::class);
$this->pending_versions = $arr;
return $this;
} | php | {
"resource": ""
} |
q14965 | ListSessionsResponse.setSessions | train | public function setSessions($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\V1\Session::class);
$this->sessions = $arr;
return $this;
} | php | {
"resource": ""
} |
q14966 | SecurityCenterProperties.setResourceOwners | train | public function setResourceOwners($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->resource_owners = $arr;
return $this;
} | php | {
"resource": ""
} |
q14967 | ListDatabasesResponse.setDatabases | train | public function setDatabases($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\Admin\Database\V1\Database::class);
$this->databases = $arr;
return $this;
} | 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']);
}
return $this->getPagedListResponse(
'ListUptimeCheckIps',
$optionalArgs,
ListUptimeCheckIpsResponse::class,
$request
);
} | php | {
"resource": ""
} |
q14969 | ApplicationServiceGapicClient.profileName | train | public static function profileName($project, $tenant, $profile)
{
return self::getProfileNameTemplate()->render([
'project' => $project,
'tenant' => $tenant,
'profile' => $profile,
]);
} | php | {
"resource": ""
} |
q14970 | ApplicationServiceGapicClient.applicationName | train | public static function applicationName($project, $tenant, $profile, $application)
{
return self::getApplicationNameTemplate()->render([
'project' => $project,
'tenant' => $tenant,
'profile' => $profile,
'application' => $application,
]);
} | php | {
"resource": ""
} |
q14971 | Instance.reload | train | public function reload(array $options = [])
{
$this->info = $this->connection->getInstance($options + [
'name' => $this->name,
'projectId' => $this->projectId
]);
return $this->info;
} | php | {
"resource": ""
} |
q14972 | Instance.state | train | public function state(array $options = [])
{
$info = $this->info($options);
return (isset($info['state']))
? $info['state']
: null;
} | php | {
"resource": ""
} |
q14973 | Instance.update | train | public function update(array $options = [])
{
$operation = $this->connection->updateInstance([
'name' => $this->name,
] + $options);
return $this->resumeOperation($operation['name'], $operation);
} | php | {
"resource": ""
} |
q14974 | Instance.createDatabase | train | public function createDatabase($name, array $options = [])
{
$instantiation = $this->pluckArray(['sessionPool'], $options);
$database = $this->database($name, $instantiation);
return $database->create($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,
$name,
isset($options['sessionPool']) ? $options['sessionPool'] : null,
$this->returnInt64AsObject
);
} | 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) {
return $this->database($database['name']);
},
[$this->connection, 'listDatabases'],
$options + ['instance' => $this->name],
[
'itemsKey' => 'databases',
'resultLimit' => $resultLimit
]
)
);
} | php | {
"resource": ""
} |
q14977 | Instance.iam | train | public function iam()
{
if (!$this->iam) {
$this->iam = new Iam(
new IamInstance($this->connection),
$this->name
);
}
return $this->iam;
} | php | {
"resource": ""
} |
q14978 | ComputeThreatListDiffResponse.setResponseType | train | public function setResponseType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse_ResponseType::class);
$this->response_type = $var;
return $this;
} | php | {
"resource": ""
} |
q14979 | ComputeThreatListDiffResponse.setAdditions | train | public function setAdditions($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions::class);
$this->additions = $var;
return $this;
} | php | {
"resource": ""
} |
q14980 | ComputeThreatListDiffResponse.setRemovals | train | public function setRemovals($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals::class);
$this->removals = $var;
return $this;
} | php | {
"resource": ""
} |
q14981 | ComputeThreatListDiffResponse.setChecksum | train | public function setChecksum($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse_Checksum::class);
$this->checksum = $var;
return $this;
} | php | {
"resource": ""
} |
q14982 | Filter.setFieldFilter | train | public function setFieldFilter($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter::class);
$this->writeOneof(2, $var);
return $this;
} | php | {
"resource": ""
} |
q14983 | Filter.setUnaryFilter | train | public function setUnaryFilter($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter::class);
$this->writeOneof(3, $var);
return $this;
} | php | {
"resource": ""
} |
q14984 | RegisterDebuggeeRequest.setDebuggee | train | public function setDebuggee($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Debugger\V2\Debuggee::class);
$this->debuggee = $var;
return $this;
} | 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 = $options['maxMemberDepth'];
$this->maxPayloadSize = $options['maxPayloadSize'];
$this->maxValueLength = $options['maxValueLength'];
$this->maxMembers = $options['maxMembers'];
} | php | {
"resource": ""
} |
q14986 | VariableTable.register | train | public function register($name, $value, $hash = null)
{
return $this->doRegister($name, $value, 0, $hash);
} | 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(
self::BUFFER_FULL_MESSAGE
)
)
]);
}
return new Variable('', '', [
'varTableIndex' => $this->bufferFullVariableIndex
]);
} | php | {
"resource": ""
} |
q14988 | Operation.results | train | public function results(array $options = [])
{
$info = $this->info($options);
$results = [];
if (!isset($info['response']['results'])) {
return $results;
}
foreach ($info['response']['results'] as $result) {
$results[] = new Result($result);
}
return $results;
} | php | {
"resource": ""
} |
q14989 | Operation.reload | train | public function reload(array $options = [])
{
return $this->info = $this->connection->getOperation($options + [
'name' => $this->name
]);
} | php | {
"resource": ""
} |
q14990 | QueryInput.setAudioConfig | train | public function setAudioConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class);
$this->writeOneof(1, $var);
return $this;
} | php | {
"resource": ""
} |
q14991 | QueryInput.setText | train | public function setText($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class);
$this->writeOneof(2, $var);
return $this;
} | php | {
"resource": ""
} |
q14992 | QueryInput.setEvent | train | public function setEvent($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class);
$this->writeOneof(3, $var);
return $this;
} | php | {
"resource": ""
} |
q14993 | TextAnnotation.setPages | train | public function setPages($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\Page::class);
$this->pages = $arr;
return $this;
} | php | {
"resource": ""
} |
q14994 | ListOperationsResponse.setOperations | train | public function setOperations($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\Operation::class);
$this->operations = $arr;
return $this;
} | php | {
"resource": ""
} |
q14995 | ListOperationsResponse.setMissingZones | train | public function setMissingZones($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->missing_zones = $arr;
return $this;
} | php | {
"resource": ""
} |
q14996 | WorkflowTemplatePlacement.setManagedCluster | train | public function setManagedCluster($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ManagedCluster::class);
$this->writeOneof(1, $var);
return $this;
} | php | {
"resource": ""
} |
q14997 | WorkflowTemplatePlacement.setClusterSelector | train | public function setClusterSelector($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ClusterSelector::class);
$this->writeOneof(2, $var);
return $this;
} | php | {
"resource": ""
} |
q14998 | IndexConfigDelta.setChangeType | train | public function setChangeType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_IndexConfigDelta_ChangeType::class);
$this->change_type = $var;
return $this;
} | php | {
"resource": ""
} |
q14999 | Subscription.setPushConfig | train | public function setPushConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class);
$this->push_config = $var;
return $this;
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.