repo
stringlengths 6
63
| path
stringlengths 5
140
| func_name
stringlengths 3
151
| original_string
stringlengths 84
13k
| language
stringclasses 1
value | code
stringlengths 84
13k
| code_tokens
sequence | docstring
stringlengths 3
47.2k
| docstring_tokens
sequence | sha
stringlengths 40
40
| url
stringlengths 91
247
| partition
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|---|---|
googleapis/google-cloud-php | Dlp/src/V2/InspectionRule.php | InspectionRule.setHotwordRule | public function setHotwordRule($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_DetectionRule_HotwordRule::class);
$this->writeOneof(1, $var);
return $this;
} | php | public function setHotwordRule($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_DetectionRule_HotwordRule::class);
$this->writeOneof(1, $var);
return $this;
} | [
"public",
"function",
"setHotwordRule",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"CustomInfoType_DetectionRule_HotwordRule",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"1",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Hotword-based detection rule.
Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;</code>
@param \Google\Cloud\Dlp\V2\CustomInfoType\DetectionRule\HotwordRule $var
@return $this | [
"Hotword",
"-",
"based",
"detection",
"rule",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/InspectionRule.php#L56-L62 | train |
googleapis/google-cloud-php | Dlp/src/V2/InspectionRule.php | InspectionRule.setExclusionRule | public function setExclusionRule($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ExclusionRule::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setExclusionRule($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ExclusionRule::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setExclusionRule",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"ExclusionRule",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"2",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Exclusion rule.
Generated from protobuf field <code>.google.privacy.dlp.v2.ExclusionRule exclusion_rule = 2;</code>
@param \Google\Cloud\Dlp\V2\ExclusionRule $var
@return $this | [
"Exclusion",
"rule",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/InspectionRule.php#L82-L88 | train |
googleapis/google-cloud-php | Monitoring/src/V3/UptimeCheckConfig/HttpCheck.php | HttpCheck.setAuthInfo | public function setAuthInfo($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_BasicAuthentication::class);
$this->auth_info = $var;
return $this;
} | php | public function setAuthInfo($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_BasicAuthentication::class);
$this->auth_info = $var;
return $this;
} | [
"public",
"function",
"setAuthInfo",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Monitoring",
"\\",
"V3",
"\\",
"UptimeCheckConfig_HttpCheck_BasicAuthentication",
"::",
"class",
")",
";",
"$",
"this",
"->",
"auth_info",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | The authentication information. Optional when creating an HTTP check;
defaults to empty.
Generated from protobuf field <code>.google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication auth_info = 4;</code>
@param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication $var
@return $this | [
"The",
"authentication",
"information",
".",
"Optional",
"when",
"creating",
"an",
"HTTP",
"check",
";",
"defaults",
"to",
"empty",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Monitoring/src/V3/UptimeCheckConfig/HttpCheck.php#L220-L226 | train |
googleapis/google-cloud-php | Scheduler/src/V1beta1/Job.php | Job.setRetryConfig | public function setRetryConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1beta1\RetryConfig::class);
$this->retry_config = $var;
return $this;
} | php | public function setRetryConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1beta1\RetryConfig::class);
$this->retry_config = $var;
return $this;
} | [
"public",
"function",
"setRetryConfig",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Scheduler",
"\\",
"V1beta1",
"\\",
"RetryConfig",
"::",
"class",
")",
";",
"$",
"this",
"->",
"retry_config",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Settings that determine the retry behavior.
Generated from protobuf field <code>.google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19;</code>
@param \Google\Cloud\Scheduler\V1beta1\RetryConfig $var
@return $this | [
"Settings",
"that",
"determine",
"the",
"retry",
"behavior",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Scheduler/src/V1beta1/Job.php#L648-L654 | train |
googleapis/google-cloud-php | Bigtable/src/ReadModifyWriteRowRules.php | ReadModifyWriteRowRules.append | public function append($familyName, $qualifier, $value)
{
$this->rules[] = (new ReadModifyWriteRule)
->setFamilyName($familyName)
->setColumnQualifier($qualifier)
->setAppendValue($value);
return $this;
} | php | public function append($familyName, $qualifier, $value)
{
$this->rules[] = (new ReadModifyWriteRule)
->setFamilyName($familyName)
->setColumnQualifier($qualifier)
->setAppendValue($value);
return $this;
} | [
"public",
"function",
"append",
"(",
"$",
"familyName",
",",
"$",
"qualifier",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"rules",
"[",
"]",
"=",
"(",
"new",
"ReadModifyWriteRule",
")",
"->",
"setFamilyName",
"(",
"$",
"familyName",
")",
"->",
"setColumnQualifier",
"(",
"$",
"qualifier",
")",
"->",
"setAppendValue",
"(",
"$",
"value",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Appends the value to the existing value of the cell. If targeted cell is unset,
it will be treated as containing the empty string.
@param string $familyName Family name of the row.
@param string $qualifier Column qualifier of the row.
@param string $value Value of the Column qualifier.
@return ReadModifyWriteRowRules returns current ReadModifyWriteRowRules object. | [
"Appends",
"the",
"value",
"to",
"the",
"existing",
"value",
"of",
"the",
"cell",
".",
"If",
"targeted",
"cell",
"is",
"unset",
"it",
"will",
"be",
"treated",
"as",
"containing",
"the",
"empty",
"string",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/ReadModifyWriteRowRules.php#L46-L53 | train |
googleapis/google-cloud-php | Bigtable/src/V2/Column.php | Column.setCells | 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 | public function setCells($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Cell::class);
$this->cells = $arr;
return $this;
} | [
"public",
"function",
"setCells",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Bigtable",
"\\",
"V2",
"\\",
"Cell",
"::",
"class",
")",
";",
"$",
"this",
"->",
"cells",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | Must not be empty. Sorted in order of decreasing "timestamp_micros".
Generated from protobuf field <code>repeated .google.bigtable.v2.Cell cells = 2;</code>
@param \Google\Cloud\Bigtable\V2\Cell[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Must",
"not",
"be",
"empty",
".",
"Sorted",
"in",
"order",
"of",
"decreasing",
"timestamp_micros",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Column.php#L109-L115 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.sendAsync | 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 | 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);
} | [
"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",
")",
";",
"}"
] | Deliver the request asynchronously.
@param RequestInterface $request A PSR-7 request.
@param array $options [optional] {
Request options.
@type float $requestTimeout Seconds to wait before timing out the
request. **Defaults to** `0`.
@type int $retries Number of retries for a failed request.
**Defaults to** `3`.
@type callable $restRetryFunction Sets the conditions for whether or
not a request should attempt to retry. Function signature should
match: `function (\Exception $ex) : bool`.
@type callable $restDelayFunction Executes a delay, defaults to
utilizing `usleep`. Function signature should match:
`function (int $delay) : void`.
@type callable $restCalcDelayFunction Sets the conditions for
determining how long to wait between attempts to retry. Function
signature should match: `function (int $attempt) : int`.
@type array $restOptions HTTP client specific configuration options.
}
@return PromiseInterface<ResponseInterface>
@experimental The experimental flag means that while we believe this method
or class is ready for use, it may change before release in backwards-
incompatible ways. Please use with caution, and test thoroughly when
upgrading. | [
"Deliver",
"the",
"request",
"asynchronously",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L238-L269 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.applyHeaders | 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 | 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]);
} | [
"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",
"]",
")",
";",
"}"
] | Applies headers to the request.
@param RequestInterface $request A PSR-7 request.
@return RequestInterface | [
"Applies",
"headers",
"to",
"the",
"request",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L277-L289 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.fetchCredentials | 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 | 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);
}
} | [
"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",
")",
";",
"}",
"}"
] | Fetches credentials.
@return array | [
"Fetches",
"credentials",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L310-L322 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.convertToGoogleException | 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 | 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);
} | [
"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",
")",
";",
"}"
] | Convert any exception to a Google Exception.
@param \Exception $ex
@return Exception\ServiceException | [
"Convert",
"any",
"exception",
"to",
"a",
"Google",
"Exception",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L330-L363 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.getExceptionMessage | 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 | 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();
} | [
"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",
"(",
")",
";",
"}"
] | Gets the exception message.
@access private
@param \Exception $ex
@return string | [
"Gets",
"the",
"exception",
"message",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L372-L386 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.getRequestOptions | 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 | 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;
} | [
"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",
";",
"}"
] | Gets a set of request options.
@param array $options
@return array | [
"Gets",
"a",
"set",
"of",
"request",
"options",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L394-L408 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.getRetryOptions | 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 | 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
];
} | [
"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",
"]",
";",
"}"
] | Gets a set of retry options.
@param array $options
@return array | [
"Gets",
"a",
"set",
"of",
"retry",
"options",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L416-L432 | train |
googleapis/google-cloud-php | Core/src/RequestWrapper.php | RequestWrapper.buildDefaultAsyncHandler | private function buildDefaultAsyncHandler()
{
$isGuzzleHandler = $this->httpHandler instanceof Guzzle6HttpHandler
|| $this->httpHandler instanceof Guzzle5HttpHandler;
return $isGuzzleHandler
? [$this->httpHandler, 'async']
: [HttpHandlerFactory::build(), 'async'];
} | php | private function buildDefaultAsyncHandler()
{
$isGuzzleHandler = $this->httpHandler instanceof Guzzle6HttpHandler
|| $this->httpHandler instanceof Guzzle5HttpHandler;
return $isGuzzleHandler
? [$this->httpHandler, 'async']
: [HttpHandlerFactory::build(), 'async'];
} | [
"private",
"function",
"buildDefaultAsyncHandler",
"(",
")",
"{",
"$",
"isGuzzleHandler",
"=",
"$",
"this",
"->",
"httpHandler",
"instanceof",
"Guzzle6HttpHandler",
"||",
"$",
"this",
"->",
"httpHandler",
"instanceof",
"Guzzle5HttpHandler",
";",
"return",
"$",
"isGuzzleHandler",
"?",
"[",
"$",
"this",
"->",
"httpHandler",
",",
"'async'",
"]",
":",
"[",
"HttpHandlerFactory",
"::",
"build",
"(",
")",
",",
"'async'",
"]",
";",
"}"
] | Builds the default async HTTP handler.
@return callable | [
"Builds",
"the",
"default",
"async",
"HTTP",
"handler",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RequestWrapper.php#L439-L447 | train |
googleapis/google-cloud-php | Dialogflow/src/V2/StreamingDetectIntentRequest.php | StreamingDetectIntentRequest.setQueryParams | public function setQueryParams($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class);
$this->query_params = $var;
return $this;
} | php | public function setQueryParams($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class);
$this->query_params = $var;
return $this;
} | [
"public",
"function",
"setQueryParams",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dialogflow",
"\\",
"V2",
"\\",
"QueryParameters",
"::",
"class",
")",
";",
"$",
"this",
"->",
"query_params",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Optional. The parameters of this query.
Generated from protobuf field <code>.google.cloud.dialogflow.v2.QueryParameters query_params = 2;</code>
@param \Google\Cloud\Dialogflow\V2\QueryParameters $var
@return $this | [
"Optional",
".",
"The",
"parameters",
"of",
"this",
"query",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/StreamingDetectIntentRequest.php#L181-L187 | train |
googleapis/google-cloud-php | Dialogflow/src/V2/StreamingDetectIntentRequest.php | StreamingDetectIntentRequest.setOutputAudioConfig | public function setOutputAudioConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class);
$this->output_audio_config = $var;
return $this;
} | php | public function setOutputAudioConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class);
$this->output_audio_config = $var;
return $this;
} | [
"public",
"function",
"setOutputAudioConfig",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dialogflow",
"\\",
"V2",
"\\",
"OutputAudioConfig",
"::",
"class",
")",
";",
"$",
"this",
"->",
"output_audio_config",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Optional. Instructs the speech synthesizer how to generate the output
audio. If this field is not set and agent-level speech synthesizer is not
configured, no output audio is generated.
Generated from protobuf field <code>.google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 5;</code>
@param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var
@return $this | [
"Optional",
".",
"Instructs",
"the",
"speech",
"synthesizer",
"how",
"to",
"generate",
"the",
"output",
"audio",
".",
"If",
"this",
"field",
"is",
"not",
"set",
"and",
"agent",
"-",
"level",
"speech",
"synthesizer",
"is",
"not",
"configured",
"no",
"output",
"audio",
"is",
"generated",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/StreamingDetectIntentRequest.php#L285-L291 | train |
googleapis/google-cloud-php | Iot/src/V1/HttpConfig.php | HttpConfig.setHttpEnabledState | public function setHttpEnabledState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\HttpState::class);
$this->http_enabled_state = $var;
return $this;
} | php | public function setHttpEnabledState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\HttpState::class);
$this->http_enabled_state = $var;
return $this;
} | [
"public",
"function",
"setHttpEnabledState",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Iot",
"\\",
"V1",
"\\",
"HttpState",
"::",
"class",
")",
";",
"$",
"this",
"->",
"http_enabled_state",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | If enabled, allows devices to use DeviceService via the HTTP protocol.
Otherwise, any requests to DeviceService will fail for this registry.
Generated from protobuf field <code>.google.cloud.iot.v1.HttpState http_enabled_state = 1;</code>
@param int $var
@return $this | [
"If",
"enabled",
"allows",
"devices",
"to",
"use",
"DeviceService",
"via",
"the",
"HTTP",
"protocol",
".",
"Otherwise",
"any",
"requests",
"to",
"DeviceService",
"will",
"fail",
"for",
"this",
"registry",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Iot/src/V1/HttpConfig.php#L62-L68 | train |
googleapis/google-cloud-php | Datastore/src/Query/GqlQuery.php | GqlQuery.queryObject | 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 | 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;
} | [
"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",
";",
"}"
] | Format the query for use in the API
This method is used internally to run queries and is not intended for use
outside the internal library API
@access private
@return array | [
"Format",
"the",
"query",
"for",
"use",
"in",
"the",
"API"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/Query/GqlQuery.php#L160-L174 | train |
googleapis/google-cloud-php | Datastore/src/Query/GqlQuery.php | GqlQuery.mapBindings | 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 | 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;
} | [
"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",
";",
"}"
] | Format bound values for the API
@param string $bindingType Either named or positional bindings.
@param array $bindings The bindings to map
@return array | [
"Format",
"bound",
"values",
"for",
"the",
"API"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/Query/GqlQuery.php#L229-L251 | train |
googleapis/google-cloud-php | Datastore/src/Query/GqlQuery.php | GqlQuery.determineBindingType | private function determineBindingType(array $options)
{
if (isset($options['bindings']) && !$this->isAssoc($options['bindings'])) {
return self::BINDING_POSITIONAL;
}
return self::BINDING_NAMED;
} | php | private function determineBindingType(array $options)
{
if (isset($options['bindings']) && !$this->isAssoc($options['bindings'])) {
return self::BINDING_POSITIONAL;
}
return self::BINDING_NAMED;
} | [
"private",
"function",
"determineBindingType",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'bindings'",
"]",
")",
"&&",
"!",
"$",
"this",
"->",
"isAssoc",
"(",
"$",
"options",
"[",
"'bindings'",
"]",
")",
")",
"{",
"return",
"self",
"::",
"BINDING_POSITIONAL",
";",
"}",
"return",
"self",
"::",
"BINDING_NAMED",
";",
"}"
] | Determine whether the query should use named or positional bindings.
@param array $options
@return string | [
"Determine",
"whether",
"the",
"query",
"should",
"use",
"named",
"or",
"positional",
"bindings",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/Query/GqlQuery.php#L259-L266 | train |
googleapis/google-cloud-php | Firestore/src/V1beta1/BeginTransactionRequest.php | BeginTransactionRequest.setOptions | public function setOptions($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions::class);
$this->options = $var;
return $this;
} | php | public function setOptions($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions::class);
$this->options = $var;
return $this;
} | [
"public",
"function",
"setOptions",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"V1beta1",
"\\",
"TransactionOptions",
"::",
"class",
")",
";",
"$",
"this",
"->",
"options",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | The options for the transaction.
Defaults to a read-write transaction.
Generated from protobuf field <code>.google.firestore.v1beta1.TransactionOptions options = 2;</code>
@param \Google\Cloud\Firestore\V1beta1\TransactionOptions $var
@return $this | [
"The",
"options",
"for",
"the",
"transaction",
".",
"Defaults",
"to",
"a",
"read",
"-",
"write",
"transaction",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1beta1/BeginTransactionRequest.php#L100-L106 | train |
googleapis/google-cloud-php | CommonProtos/src/DevTools/Source/V1/ExtendedSourceContext.php | ExtendedSourceContext.setContext | public function setContext($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\SourceContext::class);
$this->context = $var;
return $this;
} | php | public function setContext($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\SourceContext::class);
$this->context = $var;
return $this;
} | [
"public",
"function",
"setContext",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"DevTools",
"\\",
"Source",
"\\",
"V1",
"\\",
"SourceContext",
"::",
"class",
")",
";",
"$",
"this",
"->",
"context",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Any source context.
Generated from protobuf field <code>.google.devtools.source.v1.SourceContext context = 1;</code>
@param \Google\Cloud\DevTools\Source\V1\SourceContext $var
@return $this | [
"Any",
"source",
"context",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/CommonProtos/src/DevTools/Source/V1/ExtendedSourceContext.php#L67-L73 | train |
googleapis/google-cloud-php | BigQuery/src/QueryJobConfiguration.php | QueryJobConfiguration.parameters | 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 | 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;
} | [
"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",
";",
"}"
] | Sets parameters to be used on the query. Only available for standard SQL
queries.
For examples of usage please see
{@see Google\Cloud\BigQuery\BigQueryClient::runQuery()}.
@param array $parameters Parameters to use on the query. When providing
a non-associative array positional parameters (`?`) will be used.
When providing an associative array named parameters will be used
(`@name`).
@return QueryJobConfiguration | [
"Sets",
"parameters",
"to",
"be",
"used",
"on",
"the",
"query",
".",
"Only",
"available",
"for",
"standard",
"SQL",
"queries",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQuery/src/QueryJobConfiguration.php#L270-L290 | train |
googleapis/google-cloud-php | ErrorReporting/src/V1beta1/ErrorContext.php | ErrorContext.setHttpRequest | public function setHttpRequest($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\HttpRequestContext::class);
$this->http_request = $var;
return $this;
} | php | public function setHttpRequest($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\HttpRequestContext::class);
$this->http_request = $var;
return $this;
} | [
"public",
"function",
"setHttpRequest",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"ErrorReporting",
"\\",
"V1beta1",
"\\",
"HttpRequestContext",
"::",
"class",
")",
";",
"$",
"this",
"->",
"http_request",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | The HTTP request which was processed when the error was
triggered.
Generated from protobuf field <code>.google.devtools.clouderrorreporting.v1beta1.HttpRequestContext http_request = 1;</code>
@param \Google\Cloud\ErrorReporting\V1beta1\HttpRequestContext $var
@return $this | [
"The",
"HTTP",
"request",
"which",
"was",
"processed",
"when",
"the",
"error",
"was",
"triggered",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/ErrorReporting/src/V1beta1/ErrorContext.php#L105-L111 | train |
googleapis/google-cloud-php | ErrorReporting/src/V1beta1/ErrorContext.php | ErrorContext.setReportLocation | public function setReportLocation($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\SourceLocation::class);
$this->report_location = $var;
return $this;
} | php | public function setReportLocation($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\ErrorReporting\V1beta1\SourceLocation::class);
$this->report_location = $var;
return $this;
} | [
"public",
"function",
"setReportLocation",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"ErrorReporting",
"\\",
"V1beta1",
"\\",
"SourceLocation",
"::",
"class",
")",
";",
"$",
"this",
"->",
"report_location",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | The location in the source code where the decision was made to
report the error, usually the place where it was logged.
For a logged exception this would be the source line where the
exception is logged, usually close to the place where it was
caught. This value is in contrast to `Exception.cause_location`,
which describes the source line where the exception was thrown.
Generated from protobuf field <code>.google.devtools.clouderrorreporting.v1beta1.SourceLocation report_location = 3;</code>
@param \Google\Cloud\ErrorReporting\V1beta1\SourceLocation $var
@return $this | [
"The",
"location",
"in",
"the",
"source",
"code",
"where",
"the",
"decision",
"was",
"made",
"to",
"report",
"the",
"error",
"usually",
"the",
"place",
"where",
"it",
"was",
"logged",
".",
"For",
"a",
"logged",
"exception",
"this",
"would",
"be",
"the",
"source",
"line",
"where",
"the",
"exception",
"is",
"logged",
"usually",
"close",
"to",
"the",
"place",
"where",
"it",
"was",
"caught",
".",
"This",
"value",
"is",
"in",
"contrast",
"to",
"Exception",
".",
"cause_location",
"which",
"describes",
"the",
"source",
"line",
"where",
"the",
"exception",
"was",
"thrown",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/ErrorReporting/src/V1beta1/ErrorContext.php#L181-L187 | train |
googleapis/google-cloud-php | Firestore/src/Admin/V1/Index.php | Index.setQueryScope | public function setQueryScope($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_QueryScope::class);
$this->query_scope = $var;
return $this;
} | php | public function setQueryScope($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_QueryScope::class);
$this->query_scope = $var;
return $this;
} | [
"public",
"function",
"setQueryScope",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"Admin",
"\\",
"V1",
"\\",
"Index_QueryScope",
"::",
"class",
")",
";",
"$",
"this",
"->",
"query_scope",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Indexes with a collection query scope specified allow queries
against a collection that is the child of a specific document, specified at
query time, and that has the same collection id.
Indexes with a collection group query scope specified allow queries against
all collections descended from a specific document, specified at query
time, and that have the same collection id as this index.
Generated from protobuf field <code>.google.firestore.admin.v1.Index.QueryScope query_scope = 2;</code>
@param int $var
@return $this | [
"Indexes",
"with",
"a",
"collection",
"query",
"scope",
"specified",
"allow",
"queries",
"against",
"a",
"collection",
"that",
"is",
"the",
"child",
"of",
"a",
"specific",
"document",
"specified",
"at",
"query",
"time",
"and",
"that",
"has",
"the",
"same",
"collection",
"id",
".",
"Indexes",
"with",
"a",
"collection",
"group",
"query",
"scope",
"specified",
"allow",
"queries",
"against",
"all",
"collections",
"descended",
"from",
"a",
"specific",
"document",
"specified",
"at",
"query",
"time",
"and",
"that",
"have",
"the",
"same",
"collection",
"id",
"as",
"this",
"index",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/Admin/V1/Index.php#L163-L169 | train |
googleapis/google-cloud-php | Firestore/src/Admin/V1/Index.php | Index.setState | public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_State::class);
$this->state = $var;
return $this;
} | php | public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_State::class);
$this->state = $var;
return $this;
} | [
"public",
"function",
"setState",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"Admin",
"\\",
"V1",
"\\",
"Index_State",
"::",
"class",
")",
";",
"$",
"this",
"->",
"state",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Output only.
The serving state of the index.
Generated from protobuf field <code>.google.firestore.admin.v1.Index.State state = 4;</code>
@param int $var
@return $this | [
"Output",
"only",
".",
"The",
"serving",
"state",
"of",
"the",
"index",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/Admin/V1/Index.php#L233-L239 | train |
googleapis/google-cloud-php | Dlp/src/V2/AnalyzeDataSourceRiskDetails/LDiversityResult/LDiversityEquivalenceClass.php | LDiversityEquivalenceClass.setQuasiIdsValues | 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 | 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;
} | [
"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",
";",
"}"
] | Quasi-identifier values defining the k-anonymity equivalence
class. The order is always the same as the original request.
Generated from protobuf field <code>repeated .google.privacy.dlp.v2.Value quasi_ids_values = 1;</code>
@param \Google\Cloud\Dlp\V2\Value[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Quasi",
"-",
"identifier",
"values",
"defining",
"the",
"k",
"-",
"anonymity",
"equivalence",
"class",
".",
"The",
"order",
"is",
"always",
"the",
"same",
"as",
"the",
"original",
"request",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/AnalyzeDataSourceRiskDetails/LDiversityResult/LDiversityEquivalenceClass.php#L86-L92 | train |
googleapis/google-cloud-php | Dlp/src/V2/AnalyzeDataSourceRiskDetails/LDiversityResult/LDiversityEquivalenceClass.php | LDiversityEquivalenceClass.setTopSensitiveValues | 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 | 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;
} | [
"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",
";",
"}"
] | Estimated frequencies of top sensitive values.
Generated from protobuf field <code>repeated .google.privacy.dlp.v2.ValueFrequency top_sensitive_values = 4;</code>
@param \Google\Cloud\Dlp\V2\ValueFrequency[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Estimated",
"frequencies",
"of",
"top",
"sensitive",
"values",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/AnalyzeDataSourceRiskDetails/LDiversityResult/LDiversityEquivalenceClass.php#L164-L170 | train |
googleapis/google-cloud-php | Firestore/src/V1beta1/RunQueryRequest.php | RunQueryRequest.setStructuredQuery | public function setStructuredQuery($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setStructuredQuery($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setStructuredQuery",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"V1beta1",
"\\",
"StructuredQuery",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"2",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | A structured query.
Generated from protobuf field <code>.google.firestore.v1beta1.StructuredQuery structured_query = 2;</code>
@param \Google\Cloud\Firestore\V1beta1\StructuredQuery $var
@return $this | [
"A",
"structured",
"query",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1beta1/RunQueryRequest.php#L118-L124 | train |
googleapis/google-cloud-php | Core/src/RestTrait.php | RestTrait.send | 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 | 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;
}
} | [
"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",
";",
"}",
"}"
] | Delivers a request built from the service definition.
@param string $resource The resource type used for the request.
@param string $method The method used for the request.
@param array $options [optional] Options used to build out the request.
@param array $whitelisted [optional]
@return array | [
"Delivers",
"a",
"request",
"built",
"from",
"the",
"service",
"definition",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RestTrait.php#L83-L106 | train |
googleapis/google-cloud-php | PubSub/src/Connection/Grpc.php | Grpc.buildSubscription | 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 | 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),
]));
} | [
"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",
")",
",",
"]",
")",
")",
";",
"}"
] | Create a Subscription proto message from an array of arguments.
@param array $args
@param bool $required
@return Subscription | [
"Create",
"a",
"Subscription",
"proto",
"message",
"from",
"an",
"array",
"of",
"arguments",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/Connection/Grpc.php#L445-L460 | train |
googleapis/google-cloud-php | Core/src/Batch/JobConfig.php | JobConfig.getJobFromId | public function getJobFromId($identifier)
{
return array_key_exists($identifier, $this->identifierToId)
? $this->jobs[$identifier]
: null;
} | php | public function getJobFromId($identifier)
{
return array_key_exists($identifier, $this->identifierToId)
? $this->jobs[$identifier]
: null;
} | [
"public",
"function",
"getJobFromId",
"(",
"$",
"identifier",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"identifier",
",",
"$",
"this",
"->",
"identifierToId",
")",
"?",
"$",
"this",
"->",
"jobs",
"[",
"$",
"identifier",
"]",
":",
"null",
";",
"}"
] | Get the job with the given identifier.
@param string $identifier Unique identifier of the job.
@return JobInterface|null | [
"Get",
"the",
"job",
"with",
"the",
"given",
"identifier",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/JobConfig.php#L53-L58 | train |
googleapis/google-cloud-php | Core/src/Batch/JobConfig.php | JobConfig.getJobFromIdNum | public function getJobFromIdNum($idNum)
{
return array_key_exists($idNum, $this->idToIdentifier)
? $this->jobs[$this->idToIdentifier[$idNum]]
: null;
} | php | public function getJobFromIdNum($idNum)
{
return array_key_exists($idNum, $this->idToIdentifier)
? $this->jobs[$this->idToIdentifier[$idNum]]
: null;
} | [
"public",
"function",
"getJobFromIdNum",
"(",
"$",
"idNum",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"idNum",
",",
"$",
"this",
"->",
"idToIdentifier",
")",
"?",
"$",
"this",
"->",
"jobs",
"[",
"$",
"this",
"->",
"idToIdentifier",
"[",
"$",
"idNum",
"]",
"]",
":",
"null",
";",
"}"
] | Get the job with the given numeric id.
@param int $idNum A numeric id of the job.
@return JobInterface|null | [
"Get",
"the",
"job",
"with",
"the",
"given",
"numeric",
"id",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/JobConfig.php#L67-L72 | train |
googleapis/google-cloud-php | Core/src/Batch/JobConfig.php | JobConfig.registerJob | 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 | 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;
} | [
"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",
";",
"}"
] | Register a job for executing in batch.
@param string $identifier Unique identifier of the job.
@param callable $callback Callback that accepts the job $idNum
and returns a JobInterface instance.
@return void | [
"Register",
"a",
"job",
"for",
"executing",
"in",
"batch",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/JobConfig.php#L82-L95 | train |
googleapis/google-cloud-php | Dlp/src/V2/CustomInfoType.php | CustomInfoType.setLikelihood | public function setLikelihood($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\Likelihood::class);
$this->likelihood = $var;
return $this;
} | php | public function setLikelihood($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\Likelihood::class);
$this->likelihood = $var;
return $this;
} | [
"public",
"function",
"setLikelihood",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"Likelihood",
"::",
"class",
")",
";",
"$",
"this",
"->",
"likelihood",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Likelihood to return for this CustomInfoType. This base value can be
altered by a detection rule if the finding meets the criteria specified by
the rule. Defaults to `VERY_LIKELY` if not specified.
Generated from protobuf field <code>.google.privacy.dlp.v2.Likelihood likelihood = 6;</code>
@param int $var
@return $this | [
"Likelihood",
"to",
"return",
"for",
"this",
"CustomInfoType",
".",
"This",
"base",
"value",
"can",
"be",
"altered",
"by",
"a",
"detection",
"rule",
"if",
"the",
"finding",
"meets",
"the",
"criteria",
"specified",
"by",
"the",
"rule",
".",
"Defaults",
"to",
"VERY_LIKELY",
"if",
"not",
"specified",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/CustomInfoType.php#L154-L160 | train |
googleapis/google-cloud-php | Dlp/src/V2/CustomInfoType.php | CustomInfoType.setDictionary | public function setDictionary($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Dictionary::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setDictionary($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Dictionary::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setDictionary",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"CustomInfoType_Dictionary",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"2",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | A list of phrases to detect as a CustomInfoType.
Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.Dictionary dictionary = 2;</code>
@param \Google\Cloud\Dlp\V2\CustomInfoType\Dictionary $var
@return $this | [
"A",
"list",
"of",
"phrases",
"to",
"detect",
"as",
"a",
"CustomInfoType",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/CustomInfoType.php#L180-L186 | train |
googleapis/google-cloud-php | Dlp/src/V2/CustomInfoType.php | CustomInfoType.setSurrogateType | public function setSurrogateType($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_SurrogateType::class);
$this->writeOneof(4, $var);
return $this;
} | php | public function setSurrogateType($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_SurrogateType::class);
$this->writeOneof(4, $var);
return $this;
} | [
"public",
"function",
"setSurrogateType",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"CustomInfoType_SurrogateType",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"4",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Message for detecting output from deidentification transformations that
support reversing.
Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.SurrogateType surrogate_type = 4;</code>
@param \Google\Cloud\Dlp\V2\CustomInfoType\SurrogateType $var
@return $this | [
"Message",
"for",
"detecting",
"output",
"from",
"deidentification",
"transformations",
"that",
"support",
"reversing",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/CustomInfoType.php#L234-L240 | train |
googleapis/google-cloud-php | Dlp/src/V2/CustomInfoType.php | CustomInfoType.setStoredType | public function setStoredType($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredType::class);
$this->writeOneof(5, $var);
return $this;
} | php | public function setStoredType($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredType::class);
$this->writeOneof(5, $var);
return $this;
} | [
"public",
"function",
"setStoredType",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"StoredType",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"5",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Load an existing `StoredInfoType` resource for use in
`InspectDataSource`. Not currently supported in `InspectContent`.
Generated from protobuf field <code>.google.privacy.dlp.v2.StoredType stored_type = 5;</code>
@param \Google\Cloud\Dlp\V2\StoredType $var
@return $this | [
"Load",
"an",
"existing",
"StoredInfoType",
"resource",
"for",
"use",
"in",
"InspectDataSource",
".",
"Not",
"currently",
"supported",
"in",
"InspectContent",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/CustomInfoType.php#L262-L268 | train |
googleapis/google-cloud-php | Dlp/src/V2/CustomInfoType.php | CustomInfoType.setDetectionRules | 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 | 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;
} | [
"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",
";",
"}"
] | Set of detection rules to apply to all findings of this CustomInfoType.
Rules are applied in order that they are specified. Not supported for the
`surrogate_type` CustomInfoType.
Generated from protobuf field <code>repeated .google.privacy.dlp.v2.CustomInfoType.DetectionRule detection_rules = 7;</code>
@param \Google\Cloud\Dlp\V2\CustomInfoType\DetectionRule[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Set",
"of",
"detection",
"rules",
"to",
"apply",
"to",
"all",
"findings",
"of",
"this",
"CustomInfoType",
".",
"Rules",
"are",
"applied",
"in",
"order",
"that",
"they",
"are",
"specified",
".",
"Not",
"supported",
"for",
"the",
"surrogate_type",
"CustomInfoType",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/CustomInfoType.php#L292-L298 | train |
googleapis/google-cloud-php | Dlp/src/V2/CustomInfoType.php | CustomInfoType.setExclusionType | public function setExclusionType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\CustomInfoType_ExclusionType::class);
$this->exclusion_type = $var;
return $this;
} | php | public function setExclusionType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\CustomInfoType_ExclusionType::class);
$this->exclusion_type = $var;
return $this;
} | [
"public",
"function",
"setExclusionType",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"CustomInfoType_ExclusionType",
"::",
"class",
")",
";",
"$",
"this",
"->",
"exclusion_type",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding
to be returned. It still can be used for rules matching.
Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.ExclusionType exclusion_type = 8;</code>
@param int $var
@return $this | [
"If",
"set",
"to",
"EXCLUSION_TYPE_EXCLUDE",
"this",
"infoType",
"will",
"not",
"cause",
"a",
"finding",
"to",
"be",
"returned",
".",
"It",
"still",
"can",
"be",
"used",
"for",
"rules",
"matching",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/CustomInfoType.php#L320-L326 | train |
googleapis/google-cloud-php | Datastore/src/Connection/Grpc.php | Grpc.prepareQueryBinding | private function prepareQueryBinding(array $binding)
{
$value = $binding['value'];
list ($type, $val) = $this->toGrpcValue($value);
$binding['value'][$type] = $val;
return $binding;
} | php | private function prepareQueryBinding(array $binding)
{
$value = $binding['value'];
list ($type, $val) = $this->toGrpcValue($value);
$binding['value'][$type] = $val;
return $binding;
} | [
"private",
"function",
"prepareQueryBinding",
"(",
"array",
"$",
"binding",
")",
"{",
"$",
"value",
"=",
"$",
"binding",
"[",
"'value'",
"]",
";",
"list",
"(",
"$",
"type",
",",
"$",
"val",
")",
"=",
"$",
"this",
"->",
"toGrpcValue",
"(",
"$",
"value",
")",
";",
"$",
"binding",
"[",
"'value'",
"]",
"[",
"$",
"type",
"]",
"=",
"$",
"val",
";",
"return",
"$",
"binding",
";",
"}"
] | Convert a query binding to an API-compatible value.
@param array $binding The input binding data
@return array | [
"Convert",
"a",
"query",
"binding",
"to",
"an",
"API",
"-",
"compatible",
"value",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/Connection/Grpc.php#L313-L322 | train |
googleapis/google-cloud-php | Datastore/src/Connection/Grpc.php | Grpc.readOptions | 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 | 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
);
} | [
"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",
")",
";",
"}"
] | Convert read options into an API-compatible value.
@param array $readOptions The input readOptions data.
@return array | [
"Convert",
"read",
"options",
"into",
"an",
"API",
"-",
"compatible",
"value",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/Connection/Grpc.php#L330-L354 | train |
googleapis/google-cloud-php | Datastore/src/Connection/Grpc.php | Grpc.convertFilterProps | 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 | 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;
} | [
"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",
";",
"}"
] | Convert Query filters to an API-compatible value.
@param array $filter The input filter data
@return array | [
"Convert",
"Query",
"filters",
"to",
"an",
"API",
"-",
"compatible",
"value",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/Connection/Grpc.php#L362-L384 | train |
googleapis/google-cloud-php | Datastore/src/Connection/Grpc.php | Grpc.toGrpcValue | 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 | 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];
} | [
"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",
"]",
";",
"}"
] | Convert a property value to a gRPC value.
@param array $property The input property.
@return array | [
"Convert",
"a",
"property",
"value",
"to",
"a",
"gRPC",
"value",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/Connection/Grpc.php#L392-L409 | train |
googleapis/google-cloud-php | Dlp/src/V2/ExclusionRule.php | ExclusionRule.setRegex | public function setRegex($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Regex::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setRegex($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType_Regex::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setRegex",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"CustomInfoType_Regex",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"2",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Regular expression which defines the rule.
Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
@param \Google\Cloud\Dlp\V2\CustomInfoType\Regex $var
@return $this | [
"Regular",
"expression",
"which",
"defines",
"the",
"rule",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/ExclusionRule.php#L92-L98 | train |
googleapis/google-cloud-php | Dlp/src/V2/ExclusionRule.php | ExclusionRule.setExcludeInfoTypes | public function setExcludeInfoTypes($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ExcludeInfoTypes::class);
$this->writeOneof(3, $var);
return $this;
} | php | public function setExcludeInfoTypes($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ExcludeInfoTypes::class);
$this->writeOneof(3, $var);
return $this;
} | [
"public",
"function",
"setExcludeInfoTypes",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"ExcludeInfoTypes",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"3",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set of infoTypes for which findings would affect this rule.
Generated from protobuf field <code>.google.privacy.dlp.v2.ExcludeInfoTypes exclude_info_types = 3;</code>
@param \Google\Cloud\Dlp\V2\ExcludeInfoTypes $var
@return $this | [
"Set",
"of",
"infoTypes",
"for",
"which",
"findings",
"would",
"affect",
"this",
"rule",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/ExclusionRule.php#L118-L124 | train |
googleapis/google-cloud-php | Dlp/src/V2/ExclusionRule.php | ExclusionRule.setMatchingType | public function setMatchingType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\MatchingType::class);
$this->matching_type = $var;
return $this;
} | php | public function setMatchingType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\MatchingType::class);
$this->matching_type = $var;
return $this;
} | [
"public",
"function",
"setMatchingType",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"MatchingType",
"::",
"class",
")",
";",
"$",
"this",
"->",
"matching_type",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | How the rule is applied, see MatchingType documentation for details.
Generated from protobuf field <code>.google.privacy.dlp.v2.MatchingType matching_type = 4;</code>
@param int $var
@return $this | [
"How",
"the",
"rule",
"is",
"applied",
"see",
"MatchingType",
"documentation",
"for",
"details",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/ExclusionRule.php#L144-L150 | train |
googleapis/google-cloud-php | TextToSpeech/src/V1/ListVoicesResponse.php | ListVoicesResponse.setVoices | 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 | public function setVoices($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\Voice::class);
$this->voices = $arr;
return $this;
} | [
"public",
"function",
"setVoices",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"TextToSpeech",
"\\",
"V1",
"\\",
"Voice",
"::",
"class",
")",
";",
"$",
"this",
"->",
"voices",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | The list of voices.
Generated from protobuf field <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
@param \Google\Cloud\TextToSpeech\V1\Voice[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"The",
"list",
"of",
"voices",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/TextToSpeech/src/V1/ListVoicesResponse.php#L58-L64 | train |
googleapis/google-cloud-php | Dlp/src/V2/StoredInfoType.php | StoredInfoType.setCurrentVersion | public function setCurrentVersion($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredInfoTypeVersion::class);
$this->current_version = $var;
return $this;
} | php | public function setCurrentVersion($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredInfoTypeVersion::class);
$this->current_version = $var;
return $this;
} | [
"public",
"function",
"setCurrentVersion",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"StoredInfoTypeVersion",
"::",
"class",
")",
";",
"$",
"this",
"->",
"current_version",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Current version of the stored info type.
Generated from protobuf field <code>.google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2;</code>
@param \Google\Cloud\Dlp\V2\StoredInfoTypeVersion $var
@return $this | [
"Current",
"version",
"of",
"the",
"stored",
"info",
"type",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/StoredInfoType.php#L103-L109 | train |
googleapis/google-cloud-php | Dlp/src/V2/StoredInfoType.php | StoredInfoType.setPendingVersions | 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 | 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;
} | [
"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",
";",
"}"
] | Pending versions of the stored info type. Empty if no versions are
pending.
Generated from protobuf field <code>repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3;</code>
@param \Google\Cloud\Dlp\V2\StoredInfoTypeVersion[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Pending",
"versions",
"of",
"the",
"stored",
"info",
"type",
".",
"Empty",
"if",
"no",
"versions",
"are",
"pending",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/StoredInfoType.php#L131-L137 | train |
googleapis/google-cloud-php | Spanner/src/V1/ListSessionsResponse.php | ListSessionsResponse.setSessions | 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 | public function setSessions($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\V1\Session::class);
$this->sessions = $arr;
return $this;
} | [
"public",
"function",
"setSessions",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Spanner",
"\\",
"V1",
"\\",
"Session",
"::",
"class",
")",
";",
"$",
"this",
"->",
"sessions",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | The list of requested sessions.
Generated from protobuf field <code>repeated .google.spanner.v1.Session sessions = 1;</code>
@param \Google\Cloud\Spanner\V1\Session[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"The",
"list",
"of",
"requested",
"sessions",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/V1/ListSessionsResponse.php#L70-L76 | train |
googleapis/google-cloud-php | SecurityCenter/src/V1/Asset/SecurityCenterProperties.php | SecurityCenterProperties.setResourceOwners | public function setResourceOwners($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->resource_owners = $arr;
return $this;
} | php | public function setResourceOwners($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->resource_owners = $arr;
return $this;
} | [
"public",
"function",
"setResourceOwners",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"STRING",
")",
";",
"$",
"this",
"->",
"resource_owners",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | Owners of the Google Cloud resource.
Generated from protobuf field <code>repeated string resource_owners = 5;</code>
@param string[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Owners",
"of",
"the",
"Google",
"Cloud",
"resource",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/Asset/SecurityCenterProperties.php#L223-L229 | train |
googleapis/google-cloud-php | Spanner/src/Admin/Database/V1/ListDatabasesResponse.php | ListDatabasesResponse.setDatabases | 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 | 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;
} | [
"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",
";",
"}"
] | Databases that matched the request.
Generated from protobuf field <code>repeated .google.spanner.admin.database.v1.Database databases = 1;</code>
@param \Google\Cloud\Spanner\Admin\Database\V1\Database[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Databases",
"that",
"matched",
"the",
"request",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php#L71-L77 | train |
googleapis/google-cloud-php | Monitoring/src/V3/Gapic/UptimeCheckServiceGapicClient.php | UptimeCheckServiceGapicClient.listUptimeCheckIps | 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 | 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
);
} | [
"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",
")",
";",
"}"
] | Returns the list of IPs that checkers run from.
Sample code:
```
$uptimeCheckServiceClient = new UptimeCheckServiceClient();
try {
// Iterate over pages of elements
$pagedResponse = $uptimeCheckServiceClient->listUptimeCheckIps();
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $uptimeCheckServiceClient->listUptimeCheckIps();
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$uptimeCheckServiceClient->close();
}
```
@param array $optionalArgs {
Optional.
@type int $pageSize
The maximum number of resources contained in the underlying API
response. The API may return fewer values in a page, even if
there are additional values to be retrieved.
@type string $pageToken
A page token is used to specify a page of values to be returned.
If no page token is specified (the default), the first page
of values will be returned. Any page token used here must have
been generated by a previous call to the API.
@type RetrySettings|array $retrySettings
Retry settings to use for this call. Can be a
{@see Google\ApiCore\RetrySettings} object, or an associative array
of retry settings parameters. See the documentation on
{@see Google\ApiCore\RetrySettings} for example usage.
}
@return \Google\ApiCore\PagedListResponse
@throws ApiException if the remote call fails
@experimental | [
"Returns",
"the",
"list",
"of",
"IPs",
"that",
"checkers",
"run",
"from",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Monitoring/src/V3/Gapic/UptimeCheckServiceGapicClient.php#L676-L692 | train |
googleapis/google-cloud-php | Talent/src/V4beta1/Gapic/ApplicationServiceGapicClient.php | ApplicationServiceGapicClient.profileName | public static function profileName($project, $tenant, $profile)
{
return self::getProfileNameTemplate()->render([
'project' => $project,
'tenant' => $tenant,
'profile' => $profile,
]);
} | php | public static function profileName($project, $tenant, $profile)
{
return self::getProfileNameTemplate()->render([
'project' => $project,
'tenant' => $tenant,
'profile' => $profile,
]);
} | [
"public",
"static",
"function",
"profileName",
"(",
"$",
"project",
",",
"$",
"tenant",
",",
"$",
"profile",
")",
"{",
"return",
"self",
"::",
"getProfileNameTemplate",
"(",
")",
"->",
"render",
"(",
"[",
"'project'",
"=>",
"$",
"project",
",",
"'tenant'",
"=>",
"$",
"tenant",
",",
"'profile'",
"=>",
"$",
"profile",
",",
"]",
")",
";",
"}"
] | Formats a string containing the fully-qualified path to represent
a profile resource.
@param string $project
@param string $tenant
@param string $profile
@return string The formatted profile resource.
@experimental | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"profile",
"resource",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/Gapic/ApplicationServiceGapicClient.php#L168-L175 | train |
googleapis/google-cloud-php | Talent/src/V4beta1/Gapic/ApplicationServiceGapicClient.php | ApplicationServiceGapicClient.applicationName | public static function applicationName($project, $tenant, $profile, $application)
{
return self::getApplicationNameTemplate()->render([
'project' => $project,
'tenant' => $tenant,
'profile' => $profile,
'application' => $application,
]);
} | php | public static function applicationName($project, $tenant, $profile, $application)
{
return self::getApplicationNameTemplate()->render([
'project' => $project,
'tenant' => $tenant,
'profile' => $profile,
'application' => $application,
]);
} | [
"public",
"static",
"function",
"applicationName",
"(",
"$",
"project",
",",
"$",
"tenant",
",",
"$",
"profile",
",",
"$",
"application",
")",
"{",
"return",
"self",
"::",
"getApplicationNameTemplate",
"(",
")",
"->",
"render",
"(",
"[",
"'project'",
"=>",
"$",
"project",
",",
"'tenant'",
"=>",
"$",
"tenant",
",",
"'profile'",
"=>",
"$",
"profile",
",",
"'application'",
"=>",
"$",
"application",
",",
"]",
")",
";",
"}"
] | Formats a string containing the fully-qualified path to represent
a application resource.
@param string $project
@param string $tenant
@param string $profile
@param string $application
@return string The formatted application resource.
@experimental | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"application",
"resource",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/Gapic/ApplicationServiceGapicClient.php#L189-L197 | train |
googleapis/google-cloud-php | Spanner/src/Instance.php | Instance.reload | public function reload(array $options = [])
{
$this->info = $this->connection->getInstance($options + [
'name' => $this->name,
'projectId' => $this->projectId
]);
return $this->info;
} | php | public function reload(array $options = [])
{
$this->info = $this->connection->getInstance($options + [
'name' => $this->name,
'projectId' => $this->projectId
]);
return $this->info;
} | [
"public",
"function",
"reload",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"info",
"=",
"$",
"this",
"->",
"connection",
"->",
"getInstance",
"(",
"$",
"options",
"+",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"name",
",",
"'projectId'",
"=>",
"$",
"this",
"->",
"projectId",
"]",
")",
";",
"return",
"$",
"this",
"->",
"info",
";",
"}"
] | Fetch a fresh representation of the instance from the service.
Example:
```
$info = $instance->reload();
```
@codingStandardsIgnoreStart
@see https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.GetInstanceRequest GetInstanceRequest
@codingStandardsIgnoreEnd
@param array $options [optional] Configuration options.
@return array | [
"Fetch",
"a",
"fresh",
"representation",
"of",
"the",
"instance",
"from",
"the",
"service",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Instance.php#L235-L243 | train |
googleapis/google-cloud-php | Spanner/src/Instance.php | Instance.state | public function state(array $options = [])
{
$info = $this->info($options);
return (isset($info['state']))
? $info['state']
: null;
} | php | public function state(array $options = [])
{
$info = $this->info($options);
return (isset($info['state']))
? $info['state']
: null;
} | [
"public",
"function",
"state",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"info",
"(",
"$",
"options",
")",
";",
"return",
"(",
"isset",
"(",
"$",
"info",
"[",
"'state'",
"]",
")",
")",
"?",
"$",
"info",
"[",
"'state'",
"]",
":",
"null",
";",
"}"
] | Return the instance state.
When instances are created or updated, they may take some time before
they are ready for use. This method allows for checking whether an
instance is ready.
Example:
```
if ($instance->state() === Instance::STATE_READY) {
echo 'Instance is ready!';
}
```
@param array $options [optional] Configuration options.
@return string|null | [
"Return",
"the",
"instance",
"state",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Instance.php#L308-L315 | train |
googleapis/google-cloud-php | Spanner/src/Instance.php | Instance.update | public function update(array $options = [])
{
$operation = $this->connection->updateInstance([
'name' => $this->name,
] + $options);
return $this->resumeOperation($operation['name'], $operation);
} | php | public function update(array $options = [])
{
$operation = $this->connection->updateInstance([
'name' => $this->name,
] + $options);
return $this->resumeOperation($operation['name'], $operation);
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"operation",
"=",
"$",
"this",
"->",
"connection",
"->",
"updateInstance",
"(",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"name",
",",
"]",
"+",
"$",
"options",
")",
";",
"return",
"$",
"this",
"->",
"resumeOperation",
"(",
"$",
"operation",
"[",
"'name'",
"]",
",",
"$",
"operation",
")",
";",
"}"
] | Update the instance
Example:
```
$instance->update([
'displayName' => 'My Instance',
'nodeCount' => 4
]);
```
@codingStandardsIgnoreStart
@see https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#updateinstancerequest UpdateInstanceRequest
@codingStandardsIgnoreEnd
@param array $options [optional] {
Configuration options
@type string $displayName The descriptive name for this instance as
it appears in UIs. **Defaults to** the value of $name.
@type int $nodeCount The number of nodes allocated to this instance.
**Defaults to** `1`.
@type array $labels For more information, see
[Using labels to organize Google Cloud Platform resources](https://goo.gl/xmQnxf).
}
@return LongRunningOperation<void>
@throws \InvalidArgumentException | [
"Update",
"the",
"instance"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Instance.php#L345-L352 | train |
googleapis/google-cloud-php | Spanner/src/Instance.php | Instance.createDatabase | public function createDatabase($name, array $options = [])
{
$instantiation = $this->pluckArray(['sessionPool'], $options);
$database = $this->database($name, $instantiation);
return $database->create($options);
} | php | public function createDatabase($name, array $options = [])
{
$instantiation = $this->pluckArray(['sessionPool'], $options);
$database = $this->database($name, $instantiation);
return $database->create($options);
} | [
"public",
"function",
"createDatabase",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"instantiation",
"=",
"$",
"this",
"->",
"pluckArray",
"(",
"[",
"'sessionPool'",
"]",
",",
"$",
"options",
")",
";",
"$",
"database",
"=",
"$",
"this",
"->",
"database",
"(",
"$",
"name",
",",
"$",
"instantiation",
")",
";",
"return",
"$",
"database",
"->",
"create",
"(",
"$",
"options",
")",
";",
"}"
] | Create a Database
Example:
```
$operation = $instance->createDatabase('my-database');
```
@codingStandardsIgnoreStart
@see https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#createdatabaserequest CreateDatabaseRequest
@codingStandardsIgnoreEnd
@param string $name The database name.
@param array $options [optional] {
Configuration Options
@type array $statements Additional DDL statements.
@type SessionPoolInterface $sessionPool A pool used to manage
sessions.
}
@return LongRunningOperation<Database> | [
"Create",
"a",
"Database"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Instance.php#L398-L404 | train |
googleapis/google-cloud-php | Spanner/src/Instance.php | Instance.database | 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 | 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
);
} | [
"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",
")",
";",
"}"
] | Lazily instantiate a database object
Example:
```
$database = $instance->database('my-database');
```
@param string $name The database name
@param array $options [optional] {
Configuration options.
@type SessionPoolInterface $sessionPool A pool used to manage
sessions.
}
@return Database | [
"Lazily",
"instantiate",
"a",
"database",
"object"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Instance.php#L423-L435 | train |
googleapis/google-cloud-php | Spanner/src/Instance.php | Instance.databases | 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 | 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
]
)
);
} | [
"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",
"]",
")",
")",
";",
"}"
] | List databases in an instance
Example:
```
$databases = $instance->databases();
```
@codingStandardsIgnoreStart
@see https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#listdatabasesrequest ListDatabasesRequest
@codingStandardsIgnoreEnd
@param array $options [optional] {
Configuration options.
@type int $pageSize Maximum number of results to return per
request.
@type int $resultLimit Limit the number of results returned in total.
**Defaults to** `0` (return all results).
@type string $pageToken A previously-returned page token used to
resume the loading of results from a specific point.
}
@return ItemIterator<Database> | [
"List",
"databases",
"in",
"an",
"instance"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Instance.php#L461-L477 | train |
googleapis/google-cloud-php | Spanner/src/Instance.php | Instance.iam | public function iam()
{
if (!$this->iam) {
$this->iam = new Iam(
new IamInstance($this->connection),
$this->name
);
}
return $this->iam;
} | php | public function iam()
{
if (!$this->iam) {
$this->iam = new Iam(
new IamInstance($this->connection),
$this->name
);
}
return $this->iam;
} | [
"public",
"function",
"iam",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"iam",
")",
"{",
"$",
"this",
"->",
"iam",
"=",
"new",
"Iam",
"(",
"new",
"IamInstance",
"(",
"$",
"this",
"->",
"connection",
")",
",",
"$",
"this",
"->",
"name",
")",
";",
"}",
"return",
"$",
"this",
"->",
"iam",
";",
"}"
] | Manage the instance IAM policy
Example:
```
$iam = $instance->iam();
```
@return Iam | [
"Manage",
"the",
"instance",
"IAM",
"policy"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Instance.php#L489-L499 | train |
googleapis/google-cloud-php | WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php | ComputeThreatListDiffResponse.setResponseType | public function setResponseType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse_ResponseType::class);
$this->response_type = $var;
return $this;
} | php | public function setResponseType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse_ResponseType::class);
$this->response_type = $var;
return $this;
} | [
"public",
"function",
"setResponseType",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"WebRisk",
"\\",
"V1beta1",
"\\",
"ComputeThreatListDiffResponse_ResponseType",
"::",
"class",
")",
";",
"$",
"this",
"->",
"response_type",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | The type of response. This may indicate that an action is required by the
client when the response is received.
Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType response_type = 4;</code>
@param int $var
@return $this | [
"The",
"type",
"of",
"response",
".",
"This",
"may",
"indicate",
"that",
"an",
"action",
"is",
"required",
"by",
"the",
"client",
"when",
"the",
"response",
"is",
"received",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php#L114-L120 | train |
googleapis/google-cloud-php | WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php | ComputeThreatListDiffResponse.setAdditions | public function setAdditions($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions::class);
$this->additions = $var;
return $this;
} | php | public function setAdditions($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions::class);
$this->additions = $var;
return $this;
} | [
"public",
"function",
"setAdditions",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"WebRisk",
"\\",
"V1beta1",
"\\",
"ThreatEntryAdditions",
"::",
"class",
")",
";",
"$",
"this",
"->",
"additions",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | A set of entries to add to a local threat type's list.
Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryAdditions additions = 5;</code>
@param \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions $var
@return $this | [
"A",
"set",
"of",
"entries",
"to",
"add",
"to",
"a",
"local",
"threat",
"type",
"s",
"list",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php#L140-L146 | train |
googleapis/google-cloud-php | WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php | ComputeThreatListDiffResponse.setRemovals | public function setRemovals($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals::class);
$this->removals = $var;
return $this;
} | php | public function setRemovals($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals::class);
$this->removals = $var;
return $this;
} | [
"public",
"function",
"setRemovals",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"WebRisk",
"\\",
"V1beta1",
"\\",
"ThreatEntryRemovals",
"::",
"class",
")",
";",
"$",
"this",
"->",
"removals",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | A set of entries to remove from a local threat type's list.
This field may be empty.
Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryRemovals removals = 6;</code>
@param \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals $var
@return $this | [
"A",
"set",
"of",
"entries",
"to",
"remove",
"from",
"a",
"local",
"threat",
"type",
"s",
"list",
".",
"This",
"field",
"may",
"be",
"empty",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php#L168-L174 | train |
googleapis/google-cloud-php | WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php | ComputeThreatListDiffResponse.setChecksum | public function setChecksum($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse_Checksum::class);
$this->checksum = $var;
return $this;
} | php | public function setChecksum($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse_Checksum::class);
$this->checksum = $var;
return $this;
} | [
"public",
"function",
"setChecksum",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"WebRisk",
"\\",
"V1beta1",
"\\",
"ComputeThreatListDiffResponse_Checksum",
"::",
"class",
")",
";",
"$",
"this",
"->",
"checksum",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | The expected SHA256 hash of the client state; that is, of the sorted list
of all hashes present in the database after applying the provided diff.
If the client state doesn't match the expected state, the client must
disregard this diff and retry later.
Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum checksum = 8;</code>
@param \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse\Checksum $var
@return $this | [
"The",
"expected",
"SHA256",
"hash",
"of",
"the",
"client",
"state",
";",
"that",
"is",
"of",
"the",
"sorted",
"list",
"of",
"all",
"hashes",
"present",
"in",
"the",
"database",
"after",
"applying",
"the",
"provided",
"diff",
".",
"If",
"the",
"client",
"state",
"doesn",
"t",
"match",
"the",
"expected",
"state",
"the",
"client",
"must",
"disregard",
"this",
"diff",
"and",
"retry",
"later",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/WebRisk/src/V1beta1/ComputeThreatListDiffResponse.php#L226-L232 | train |
googleapis/google-cloud-php | Firestore/src/V1/StructuredQuery/Filter.php | Filter.setFieldFilter | public function setFieldFilter($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setFieldFilter($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setFieldFilter",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"V1",
"\\",
"StructuredQuery_FieldFilter",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"2",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | A filter on a document field.
Generated from protobuf field <code>.google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2;</code>
@param \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter $var
@return $this | [
"A",
"filter",
"on",
"a",
"document",
"field",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1/StructuredQuery/Filter.php#L83-L89 | train |
googleapis/google-cloud-php | Firestore/src/V1/StructuredQuery/Filter.php | Filter.setUnaryFilter | public function setUnaryFilter($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter::class);
$this->writeOneof(3, $var);
return $this;
} | php | public function setUnaryFilter($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter::class);
$this->writeOneof(3, $var);
return $this;
} | [
"public",
"function",
"setUnaryFilter",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"V1",
"\\",
"StructuredQuery_UnaryFilter",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"3",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | A filter that takes exactly one argument.
Generated from protobuf field <code>.google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3;</code>
@param \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter $var
@return $this | [
"A",
"filter",
"that",
"takes",
"exactly",
"one",
"argument",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1/StructuredQuery/Filter.php#L109-L115 | train |
googleapis/google-cloud-php | Debugger/src/V2/RegisterDebuggeeRequest.php | RegisterDebuggeeRequest.setDebuggee | public function setDebuggee($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Debugger\V2\Debuggee::class);
$this->debuggee = $var;
return $this;
} | php | public function setDebuggee($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Debugger\V2\Debuggee::class);
$this->debuggee = $var;
return $this;
} | [
"public",
"function",
"setDebuggee",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Debugger",
"\\",
"V2",
"\\",
"Debuggee",
"::",
"class",
")",
";",
"$",
"this",
"->",
"debuggee",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Debuggee information to register.
The fields `project`, `uniquifier`, `description` and `agent_version`
of the debuggee must be set.
Generated from protobuf field <code>.google.devtools.clouddebugger.v2.Debuggee debuggee = 1;</code>
@param \Google\Cloud\Debugger\V2\Debuggee $var
@return $this | [
"Debuggee",
"information",
"to",
"register",
".",
"The",
"fields",
"project",
"uniquifier",
"description",
"and",
"agent_version",
"of",
"the",
"debuggee",
"must",
"be",
"set",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Debugger/src/V2/RegisterDebuggeeRequest.php#L66-L72 | train |
googleapis/google-cloud-php | Debugger/src/VariableTable.php | VariableTable.setOptions | 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 | 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'];
} | [
"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'",
"]",
";",
"}"
] | Update evaluation options.
@param array $options [optional] {
Configuration options.
@type int $maxMemberDepth Maximum depth of member variables to capture.
**Defaults to** 5.
@type int $maxPayloadSize Maximum amount of space of captured data.
**Defaults to** 32768.
@type int $maxMembers Maximum number of member variables captured per
variable. **Defaults to** 1000.
@type int $maxValueLength Maximum length of the string representing
the captured variable. **Defaults to** 500.
} | [
"Update",
"evaluation",
"options",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Debugger/src/VariableTable.php#L112-L124 | train |
googleapis/google-cloud-php | Debugger/src/VariableTable.php | VariableTable.register | public function register($name, $value, $hash = null)
{
return $this->doRegister($name, $value, 0, $hash);
} | php | public function register($name, $value, $hash = null)
{
return $this->doRegister($name, $value, 0, $hash);
} | [
"public",
"function",
"register",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"hash",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"doRegister",
"(",
"$",
"name",
",",
"$",
"value",
",",
"0",
",",
"$",
"hash",
")",
";",
"}"
] | Register a variable in the VariableTable and return a Variable reference.
The reference should be stored in the correct Breakpoint location.
Example:
```
$variableReference = $variableTable->register('varName', 'some value');
```
@param string $name The name of the variable
@param mixed $value The value of the variable
@param string|null $hash [optional] The object hash to use for deduping
@return Variable | [
"Register",
"a",
"variable",
"in",
"the",
"VariableTable",
"and",
"return",
"a",
"Variable",
"reference",
".",
"The",
"reference",
"should",
"be",
"stored",
"in",
"the",
"correct",
"Breakpoint",
"location",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Debugger/src/VariableTable.php#L140-L143 | train |
googleapis/google-cloud-php | Debugger/src/VariableTable.php | VariableTable.bufferFullVariable | 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 | 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
]);
} | [
"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",
"]",
")",
";",
"}"
] | Returns the reference for the buffer full variable.
@return Variable | [
"Returns",
"the",
"reference",
"for",
"the",
"buffer",
"full",
"variable",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Debugger/src/VariableTable.php#L150-L167 | train |
googleapis/google-cloud-php | Speech/src/Operation.php | Operation.results | 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 | 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;
} | [
"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",
";",
"}"
] | Retrieves the results of the operation. A network request will be
triggered if no cached data exists.
Example:
```
if ($operation->isComplete()) {
$results = $operation->results();
}
```
@codingStandardsIgnoreStart
@see https://cloud.google.com/speech/reference/rest/v1/speech/recognize#SpeechRecognitionResult SpeechRecognitionResult
@codingStandardsIgnoreEnd
@param array $options [optional] Configuration Options.
@return Result[] | [
"Retrieves",
"the",
"results",
"of",
"the",
"operation",
".",
"A",
"network",
"request",
"will",
"be",
"triggered",
"if",
"no",
"cached",
"data",
"exists",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Speech/src/Operation.php#L115-L129 | train |
googleapis/google-cloud-php | Speech/src/Operation.php | Operation.reload | public function reload(array $options = [])
{
return $this->info = $this->connection->getOperation($options + [
'name' => $this->name
]);
} | php | public function reload(array $options = [])
{
return $this->info = $this->connection->getOperation($options + [
'name' => $this->name
]);
} | [
"public",
"function",
"reload",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"info",
"=",
"$",
"this",
"->",
"connection",
"->",
"getOperation",
"(",
"$",
"options",
"+",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"name",
"]",
")",
";",
"}"
] | Triggers a network request to reload the operation's details.
Example:
```
$operation->reload();
$info = $operation->info();
print_r($info['response']);
```
@codingStandardsIgnoreStart
@see https://cloud.google.com/speech/reference/rest/v1/operations/get Operations get API documentation.
@see https://cloud.google.com/speech/reference/rest/v1/operations#Operation Operation resource documentation.
@codingStandardsIgnoreEnd
@param array $options [optional] Configuration Options.
@return array | [
"Triggers",
"a",
"network",
"request",
"to",
"reload",
"the",
"operation",
"s",
"details",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Speech/src/Operation.php#L200-L205 | train |
googleapis/google-cloud-php | Dialogflow/src/V2/QueryInput.php | QueryInput.setAudioConfig | public function setAudioConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class);
$this->writeOneof(1, $var);
return $this;
} | php | public function setAudioConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class);
$this->writeOneof(1, $var);
return $this;
} | [
"public",
"function",
"setAudioConfig",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dialogflow",
"\\",
"V2",
"\\",
"InputAudioConfig",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"1",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Instructs the speech recognizer how to process the speech audio.
Generated from protobuf field <code>.google.cloud.dialogflow.v2.InputAudioConfig audio_config = 1;</code>
@param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var
@return $this | [
"Instructs",
"the",
"speech",
"recognizer",
"how",
"to",
"process",
"the",
"speech",
"audio",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/QueryInput.php#L61-L67 | train |
googleapis/google-cloud-php | Dialogflow/src/V2/QueryInput.php | QueryInput.setText | public function setText($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setText($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setText",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dialogflow",
"\\",
"V2",
"\\",
"TextInput",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"2",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | The natural language text to be processed.
Generated from protobuf field <code>.google.cloud.dialogflow.v2.TextInput text = 2;</code>
@param \Google\Cloud\Dialogflow\V2\TextInput $var
@return $this | [
"The",
"natural",
"language",
"text",
"to",
"be",
"processed",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/QueryInput.php#L87-L93 | train |
googleapis/google-cloud-php | Dialogflow/src/V2/QueryInput.php | QueryInput.setEvent | public function setEvent($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class);
$this->writeOneof(3, $var);
return $this;
} | php | public function setEvent($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class);
$this->writeOneof(3, $var);
return $this;
} | [
"public",
"function",
"setEvent",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dialogflow",
"\\",
"V2",
"\\",
"EventInput",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"3",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | The event to be processed.
Generated from protobuf field <code>.google.cloud.dialogflow.v2.EventInput event = 3;</code>
@param \Google\Cloud\Dialogflow\V2\EventInput $var
@return $this | [
"The",
"event",
"to",
"be",
"processed",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/QueryInput.php#L113-L119 | train |
googleapis/google-cloud-php | Vision/src/V1/TextAnnotation.php | TextAnnotation.setPages | 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 | public function setPages($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\Page::class);
$this->pages = $arr;
return $this;
} | [
"public",
"function",
"setPages",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Vision",
"\\",
"V1",
"\\",
"Page",
"::",
"class",
")",
";",
"$",
"this",
"->",
"pages",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | List of pages detected by OCR.
Generated from protobuf field <code>repeated .google.cloud.vision.v1.Page pages = 1;</code>
@param \Google\Cloud\Vision\V1\Page[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"List",
"of",
"pages",
"detected",
"by",
"OCR",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/TextAnnotation.php#L73-L79 | train |
googleapis/google-cloud-php | Container/src/V1/ListOperationsResponse.php | ListOperationsResponse.setOperations | 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 | public function setOperations($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\Operation::class);
$this->operations = $arr;
return $this;
} | [
"public",
"function",
"setOperations",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Container",
"\\",
"V1",
"\\",
"Operation",
"::",
"class",
")",
";",
"$",
"this",
"->",
"operations",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | A list of operations in the project in the specified zone.
Generated from protobuf field <code>repeated .google.container.v1.Operation operations = 1;</code>
@param \Google\Cloud\Container\V1\Operation[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"A",
"list",
"of",
"operations",
"in",
"the",
"project",
"in",
"the",
"specified",
"zone",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/ListOperationsResponse.php#L68-L74 | train |
googleapis/google-cloud-php | Container/src/V1/ListOperationsResponse.php | ListOperationsResponse.setMissingZones | public function setMissingZones($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->missing_zones = $arr;
return $this;
} | php | public function setMissingZones($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->missing_zones = $arr;
return $this;
} | [
"public",
"function",
"setMissingZones",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"STRING",
")",
";",
"$",
"this",
"->",
"missing_zones",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | If any zones are listed here, the list of operations returned
may be missing the operations from those zones.
Generated from protobuf field <code>repeated string missing_zones = 2;</code>
@param string[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"If",
"any",
"zones",
"are",
"listed",
"here",
"the",
"list",
"of",
"operations",
"returned",
"may",
"be",
"missing",
"the",
"operations",
"from",
"those",
"zones",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/ListOperationsResponse.php#L96-L102 | train |
googleapis/google-cloud-php | Dataproc/src/V1/WorkflowTemplatePlacement.php | WorkflowTemplatePlacement.setManagedCluster | public function setManagedCluster($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ManagedCluster::class);
$this->writeOneof(1, $var);
return $this;
} | php | public function setManagedCluster($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ManagedCluster::class);
$this->writeOneof(1, $var);
return $this;
} | [
"public",
"function",
"setManagedCluster",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dataproc",
"\\",
"V1",
"\\",
"ManagedCluster",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"1",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Optional. A cluster that is managed by the workflow.
Generated from protobuf field <code>.google.cloud.dataproc.v1.ManagedCluster managed_cluster = 1;</code>
@param \Google\Cloud\Dataproc\V1\ManagedCluster $var
@return $this | [
"Optional",
".",
"A",
"cluster",
"that",
"is",
"managed",
"by",
"the",
"workflow",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1/WorkflowTemplatePlacement.php#L58-L64 | train |
googleapis/google-cloud-php | Dataproc/src/V1/WorkflowTemplatePlacement.php | WorkflowTemplatePlacement.setClusterSelector | public function setClusterSelector($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ClusterSelector::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setClusterSelector($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ClusterSelector::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setClusterSelector",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dataproc",
"\\",
"V1",
"\\",
"ClusterSelector",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"2",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Optional. A selector that chooses target cluster for jobs based
on metadata.
The selector is evaluated at the time each job is submitted.
Generated from protobuf field <code>.google.cloud.dataproc.v1.ClusterSelector cluster_selector = 2;</code>
@param \Google\Cloud\Dataproc\V1\ClusterSelector $var
@return $this | [
"Optional",
".",
"A",
"selector",
"that",
"chooses",
"target",
"cluster",
"for",
"jobs",
"based",
"on",
"metadata",
".",
"The",
"selector",
"is",
"evaluated",
"at",
"the",
"time",
"each",
"job",
"is",
"submitted",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1/WorkflowTemplatePlacement.php#L88-L94 | train |
googleapis/google-cloud-php | Firestore/src/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php | IndexConfigDelta.setChangeType | public function setChangeType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_IndexConfigDelta_ChangeType::class);
$this->change_type = $var;
return $this;
} | php | public function setChangeType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_IndexConfigDelta_ChangeType::class);
$this->change_type = $var;
return $this;
} | [
"public",
"function",
"setChangeType",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"Admin",
"\\",
"V1",
"\\",
"FieldOperationMetadata_IndexConfigDelta_ChangeType",
"::",
"class",
")",
";",
"$",
"this",
"->",
"change_type",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Specifies how the index is changing.
Generated from protobuf field <code>.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1;</code>
@param int $var
@return $this | [
"Specifies",
"how",
"the",
"index",
"is",
"changing",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php#L66-L72 | train |
googleapis/google-cloud-php | PubSub/src/V1/Subscription.php | Subscription.setPushConfig | public function setPushConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class);
$this->push_config = $var;
return $this;
} | php | public function setPushConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PushConfig::class);
$this->push_config = $var;
return $this;
} | [
"public",
"function",
"setPushConfig",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"PubSub",
"\\",
"V1",
"\\",
"PushConfig",
"::",
"class",
")",
";",
"$",
"this",
"->",
"push_config",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | If push delivery is used with this subscription, this field is
used to configure it. An empty `pushConfig` signifies that the subscriber
will pull and ack messages using API methods.
Generated from protobuf field <code>.google.pubsub.v1.PushConfig push_config = 4;</code>
@param \Google\Cloud\PubSub\V1\PushConfig $var
@return $this | [
"If",
"push",
"delivery",
"is",
"used",
"with",
"this",
"subscription",
"this",
"field",
"is",
"used",
"to",
"configure",
"it",
".",
"An",
"empty",
"pushConfig",
"signifies",
"that",
"the",
"subscriber",
"will",
"pull",
"and",
"ack",
"messages",
"using",
"API",
"methods",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/V1/Subscription.php#L292-L298 | train |
googleapis/google-cloud-php | Container/src/V1/ListNodePoolsResponse.php | ListNodePoolsResponse.setNodePools | public function setNodePools($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\NodePool::class);
$this->node_pools = $arr;
return $this;
} | php | public function setNodePools($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\NodePool::class);
$this->node_pools = $arr;
return $this;
} | [
"public",
"function",
"setNodePools",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Container",
"\\",
"V1",
"\\",
"NodePool",
"::",
"class",
")",
";",
"$",
"this",
"->",
"node_pools",
"=",
"$",
"arr",
";",
"return",
"$",
"this",
";",
"}"
] | A list of node pools for a cluster.
Generated from protobuf field <code>repeated .google.container.v1.NodePool node_pools = 1;</code>
@param \Google\Cloud\Container\V1\NodePool[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"A",
"list",
"of",
"node",
"pools",
"for",
"a",
"cluster",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/ListNodePoolsResponse.php#L58-L64 | train |
googleapis/google-cloud-php | Core/src/Compute/Metadata.php | Metadata.getProjectId | public function getProjectId()
{
if (!isset($this->projectId)) {
$this->projectId = $this->get('project/project-id');
}
return $this->projectId;
} | php | public function getProjectId()
{
if (!isset($this->projectId)) {
$this->projectId = $this->get('project/project-id');
}
return $this->projectId;
} | [
"public",
"function",
"getProjectId",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"projectId",
")",
")",
"{",
"$",
"this",
"->",
"projectId",
"=",
"$",
"this",
"->",
"get",
"(",
"'project/project-id'",
")",
";",
"}",
"return",
"$",
"this",
"->",
"projectId",
";",
"}"
] | Detect and return the project ID
Example:
```
$projectId = $metadata->getProjectId();
```
@return string | [
"Detect",
"and",
"return",
"the",
"project",
"ID"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Compute/Metadata.php#L105-L112 | train |
googleapis/google-cloud-php | Core/src/Compute/Metadata.php | Metadata.getNumericProjectId | public function getNumericProjectId()
{
if (!isset($this->numericProjectId)) {
$this->numericProjectId = $this->get('project/numeric-project-id');
}
return $this->numericProjectId;
} | php | public function getNumericProjectId()
{
if (!isset($this->numericProjectId)) {
$this->numericProjectId = $this->get('project/numeric-project-id');
}
return $this->numericProjectId;
} | [
"public",
"function",
"getNumericProjectId",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"numericProjectId",
")",
")",
"{",
"$",
"this",
"->",
"numericProjectId",
"=",
"$",
"this",
"->",
"get",
"(",
"'project/numeric-project-id'",
")",
";",
"}",
"return",
"$",
"this",
"->",
"numericProjectId",
";",
"}"
] | Detect and return the numeric project ID
Example:
```
$projectId = $metadata->getNumericProjectId();
```
@return string | [
"Detect",
"and",
"return",
"the",
"numeric",
"project",
"ID"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Compute/Metadata.php#L124-L131 | train |
googleapis/google-cloud-php | Firestore/src/Admin/V1/Index/IndexField.php | IndexField.setArrayConfig | public function setArrayConfig($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_ArrayConfig::class);
$this->writeOneof(3, $var);
return $this;
} | php | public function setArrayConfig($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_ArrayConfig::class);
$this->writeOneof(3, $var);
return $this;
} | [
"public",
"function",
"setArrayConfig",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Firestore",
"\\",
"Admin",
"\\",
"V1",
"\\",
"Index_IndexField_ArrayConfig",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneof",
"(",
"3",
",",
"$",
"var",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Indicates that this field supports operations on `array_value`s.
Generated from protobuf field <code>.google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3;</code>
@param int $var
@return $this | [
"Indicates",
"that",
"this",
"field",
"supports",
"operations",
"on",
"array_value",
"s",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/Admin/V1/Index/IndexField.php#L128-L134 | train |
googleapis/google-cloud-php | BigQueryDataTransfer/src/V1/TransferRun.php | TransferRun.setState | public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class);
$this->state = $var;
return $this;
} | php | public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class);
$this->state = $var;
return $this;
} | [
"public",
"function",
"setState",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"BigQuery",
"\\",
"DataTransfer",
"\\",
"V1",
"\\",
"TransferState",
"::",
"class",
")",
";",
"$",
"this",
"->",
"state",
"=",
"$",
"var",
";",
"return",
"$",
"this",
";",
"}"
] | Data transfer run state. Ignored for input requests.
Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.TransferState state = 8;</code>
@param int $var
@return $this | [
"Data",
"transfer",
"run",
"state",
".",
"Ignored",
"for",
"input",
"requests",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/TransferRun.php#L454-L460 | train |
googleapis/google-cloud-php | dev/src/ComponentVersionTrait.php | ComponentVersionTrait.addToComponentManifest | private function addToComponentManifest($version, array $component)
{
$manifest = $this->getManifest($this->manifest());
$index = $this->getManifestComponentModuleIndex($manifest, $component['id']);
array_unshift($manifest['modules'][$index]['versions'], 'v'. $version);
$content = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ."\n";
$result = file_put_contents($this->manifest(), $content);
$this->setManifest($manifest);
if (!$result) {
throw new \RuntimeException('File write failed');
}
} | php | private function addToComponentManifest($version, array $component)
{
$manifest = $this->getManifest($this->manifest());
$index = $this->getManifestComponentModuleIndex($manifest, $component['id']);
array_unshift($manifest['modules'][$index]['versions'], 'v'. $version);
$content = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ."\n";
$result = file_put_contents($this->manifest(), $content);
$this->setManifest($manifest);
if (!$result) {
throw new \RuntimeException('File write failed');
}
} | [
"private",
"function",
"addToComponentManifest",
"(",
"$",
"version",
",",
"array",
"$",
"component",
")",
"{",
"$",
"manifest",
"=",
"$",
"this",
"->",
"getManifest",
"(",
"$",
"this",
"->",
"manifest",
"(",
")",
")",
";",
"$",
"index",
"=",
"$",
"this",
"->",
"getManifestComponentModuleIndex",
"(",
"$",
"manifest",
",",
"$",
"component",
"[",
"'id'",
"]",
")",
";",
"array_unshift",
"(",
"$",
"manifest",
"[",
"'modules'",
"]",
"[",
"$",
"index",
"]",
"[",
"'versions'",
"]",
",",
"'v'",
".",
"$",
"version",
")",
";",
"$",
"content",
"=",
"json_encode",
"(",
"$",
"manifest",
",",
"JSON_PRETTY_PRINT",
"|",
"JSON_UNESCAPED_SLASHES",
")",
".",
"\"\\n\"",
";",
"$",
"result",
"=",
"file_put_contents",
"(",
"$",
"this",
"->",
"manifest",
"(",
")",
",",
"$",
"content",
")",
";",
"$",
"this",
"->",
"setManifest",
"(",
"$",
"manifest",
")",
";",
"if",
"(",
"!",
"$",
"result",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'File write failed'",
")",
";",
"}",
"}"
] | Add a new component version to the manifest.
@param string $version The new version. (do not prefix with `v`).
@param array $component The component data, as an array.
@return void | [
"Add",
"a",
"new",
"component",
"version",
"to",
"the",
"manifest",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/dev/src/ComponentVersionTrait.php#L21-L35 | train |
googleapis/google-cloud-php | dev/src/ComponentVersionTrait.php | ComponentVersionTrait.updateComponentVersionConstant | private function updateComponentVersionConstant($version, $componentPath, $componentEntry)
{
if (is_null($componentEntry)) {
return false;
}
$path = $this->rootPath() .'/'. $componentPath .'/'. $componentEntry;
if (!file_exists($path)) {
throw new \RuntimeException(sprintf(
'Component entry file %s does not exist',
$path
));
}
$entry = file_get_contents($path);
$replacement = sprintf("const VERSION = '%s';", $version);
$entry = preg_replace("/const VERSION = [\'\\\"]([0-9.]{0,}|master)[\'\\\"]\;/", $replacement, $entry);
$result = file_put_contents($path, $entry);
if (!$result) {
throw new \RuntimeException('File write failed');
}
return true;
} | php | private function updateComponentVersionConstant($version, $componentPath, $componentEntry)
{
if (is_null($componentEntry)) {
return false;
}
$path = $this->rootPath() .'/'. $componentPath .'/'. $componentEntry;
if (!file_exists($path)) {
throw new \RuntimeException(sprintf(
'Component entry file %s does not exist',
$path
));
}
$entry = file_get_contents($path);
$replacement = sprintf("const VERSION = '%s';", $version);
$entry = preg_replace("/const VERSION = [\'\\\"]([0-9.]{0,}|master)[\'\\\"]\;/", $replacement, $entry);
$result = file_put_contents($path, $entry);
if (!$result) {
throw new \RuntimeException('File write failed');
}
return true;
} | [
"private",
"function",
"updateComponentVersionConstant",
"(",
"$",
"version",
",",
"$",
"componentPath",
",",
"$",
"componentEntry",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"componentEntry",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"path",
"=",
"$",
"this",
"->",
"rootPath",
"(",
")",
".",
"'/'",
".",
"$",
"componentPath",
".",
"'/'",
".",
"$",
"componentEntry",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Component entry file %s does not exist'",
",",
"$",
"path",
")",
")",
";",
"}",
"$",
"entry",
"=",
"file_get_contents",
"(",
"$",
"path",
")",
";",
"$",
"replacement",
"=",
"sprintf",
"(",
"\"const VERSION = '%s';\"",
",",
"$",
"version",
")",
";",
"$",
"entry",
"=",
"preg_replace",
"(",
"\"/const VERSION = [\\'\\\\\\\"]([0-9.]{0,}|master)[\\'\\\\\\\"]\\;/\"",
",",
"$",
"replacement",
",",
"$",
"entry",
")",
";",
"$",
"result",
"=",
"file_put_contents",
"(",
"$",
"path",
",",
"$",
"entry",
")",
";",
"if",
"(",
"!",
"$",
"result",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'File write failed'",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Update the VERSION constant in a veneer entry file.
@param string $version The new version. (do not prefix with `v`).
@param string $componentPath The path to the component, relative to the root of the project.
@param string $componentEntry The name of the entry file to modify (i.e. FooClient.php).
@return bool | [
"Update",
"the",
"VERSION",
"constant",
"in",
"a",
"veneer",
"entry",
"file",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/dev/src/ComponentVersionTrait.php#L45-L72 | train |
googleapis/google-cloud-php | dev/src/ComponentVersionTrait.php | ComponentVersionTrait.updateComponentVersionFile | private function updateComponentVersionFile($version, array $component)
{
$path = $this->rootPath() .'/'. $component['path'] .'/VERSION';
$result = file_put_contents($path, $version);
if (!$result) {
throw new \RuntimeException('File write failed');
}
return true;
} | php | private function updateComponentVersionFile($version, array $component)
{
$path = $this->rootPath() .'/'. $component['path'] .'/VERSION';
$result = file_put_contents($path, $version);
if (!$result) {
throw new \RuntimeException('File write failed');
}
return true;
} | [
"private",
"function",
"updateComponentVersionFile",
"(",
"$",
"version",
",",
"array",
"$",
"component",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"rootPath",
"(",
")",
".",
"'/'",
".",
"$",
"component",
"[",
"'path'",
"]",
".",
"'/VERSION'",
";",
"$",
"result",
"=",
"file_put_contents",
"(",
"$",
"path",
",",
"$",
"version",
")",
";",
"if",
"(",
"!",
"$",
"result",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'File write failed'",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Update the VERSION file in a component directory.
@param string $version The new version. (do not prefix with `v`).
@param array $component The component data as an array.
@return bool | [
"Update",
"the",
"VERSION",
"file",
"in",
"a",
"component",
"directory",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/dev/src/ComponentVersionTrait.php#L81-L91 | train |
googleapis/google-cloud-php | dev/src/ComponentVersionTrait.php | ComponentVersionTrait.updateComposerReplacesVersion | private function updateComposerReplacesVersion($version, array $component)
{
$composer = $this->rootPath() .'/composer.json';
if (!file_exists($composer)) {
throw new \Exception('Invalid composer.json path');
}
$data = json_decode(file_get_contents($composer), true);
$data['replace'][$component['name']] = $version;
file_put_contents($composer, json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
} | php | private function updateComposerReplacesVersion($version, array $component)
{
$composer = $this->rootPath() .'/composer.json';
if (!file_exists($composer)) {
throw new \Exception('Invalid composer.json path');
}
$data = json_decode(file_get_contents($composer), true);
$data['replace'][$component['name']] = $version;
file_put_contents($composer, json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
} | [
"private",
"function",
"updateComposerReplacesVersion",
"(",
"$",
"version",
",",
"array",
"$",
"component",
")",
"{",
"$",
"composer",
"=",
"$",
"this",
"->",
"rootPath",
"(",
")",
".",
"'/composer.json'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"composer",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Invalid composer.json path'",
")",
";",
"}",
"$",
"data",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"composer",
")",
",",
"true",
")",
";",
"$",
"data",
"[",
"'replace'",
"]",
"[",
"$",
"component",
"[",
"'name'",
"]",
"]",
"=",
"$",
"version",
";",
"file_put_contents",
"(",
"$",
"composer",
",",
"json_encode",
"(",
"$",
"data",
",",
"JSON_PRETTY_PRINT",
"|",
"JSON_UNESCAPED_SLASHES",
")",
")",
";",
"}"
] | Update the `replaces` version in the main composer.json file.
@param string $version The new version. (do not prefix with `v`).
@param array $component The component data as an array.
@return void | [
"Update",
"the",
"replaces",
"version",
"in",
"the",
"main",
"composer",
".",
"json",
"file",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/dev/src/ComponentVersionTrait.php#L100-L112 | train |
googleapis/google-cloud-php | Spanner/src/KeyRange.php | KeyRange.setStart | public function setStart($type, array $start)
{
$rangeKey = $this->fromDefinition($type, 'start');
$this->startType = $rangeKey;
$this->start = $start;
} | php | public function setStart($type, array $start)
{
$rangeKey = $this->fromDefinition($type, 'start');
$this->startType = $rangeKey;
$this->start = $start;
} | [
"public",
"function",
"setStart",
"(",
"$",
"type",
",",
"array",
"$",
"start",
")",
"{",
"$",
"rangeKey",
"=",
"$",
"this",
"->",
"fromDefinition",
"(",
"$",
"type",
",",
"'start'",
")",
";",
"$",
"this",
"->",
"startType",
"=",
"$",
"rangeKey",
";",
"$",
"this",
"->",
"start",
"=",
"$",
"start",
";",
"}"
] | Set the range start.
Example:
```
$range->setStart(KeyRange::TYPE_OPEN, ['Bob']);
```
@param string $type Either "open" or "closed". Use constants
`KeyRange::TYPE_OPEN` and `KeyRange::TYPE_CLOSED` for guaranteed
correctness.
@param array $start The start of the key range.
@return void | [
"Set",
"the",
"range",
"start",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/KeyRange.php#L172-L178 | train |
googleapis/google-cloud-php | Spanner/src/KeyRange.php | KeyRange.setEnd | public function setEnd($type, array $end)
{
if (!in_array($type, array_keys($this->definition))) {
throw new \InvalidArgumentException(sprintf(
'Invalid KeyRange type. Allowed values are %s',
implode(', ', array_keys($this->definition))
));
}
$rangeKey = $this->fromDefinition($type, 'end');
$this->endType = $rangeKey;
$this->end = $end;
} | php | public function setEnd($type, array $end)
{
if (!in_array($type, array_keys($this->definition))) {
throw new \InvalidArgumentException(sprintf(
'Invalid KeyRange type. Allowed values are %s',
implode(', ', array_keys($this->definition))
));
}
$rangeKey = $this->fromDefinition($type, 'end');
$this->endType = $rangeKey;
$this->end = $end;
} | [
"public",
"function",
"setEnd",
"(",
"$",
"type",
",",
"array",
"$",
"end",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"type",
",",
"array_keys",
"(",
"$",
"this",
"->",
"definition",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Invalid KeyRange type. Allowed values are %s'",
",",
"implode",
"(",
"', '",
",",
"array_keys",
"(",
"$",
"this",
"->",
"definition",
")",
")",
")",
")",
";",
"}",
"$",
"rangeKey",
"=",
"$",
"this",
"->",
"fromDefinition",
"(",
"$",
"type",
",",
"'end'",
")",
";",
"$",
"this",
"->",
"endType",
"=",
"$",
"rangeKey",
";",
"$",
"this",
"->",
"end",
"=",
"$",
"end",
";",
"}"
] | Set the range end.
Example:
```
$range->setEnd(KeyRange::TYPE_CLOSED, ['Jill']);
```
@param string $type Either "open" or "closed". Use constants
`KeyRange::TYPE_OPEN` and `KeyRange::TYPE_CLOSED` for guaranteed
correctness.
@param array $end The end of the key range.
@return void | [
"Set",
"the",
"range",
"end",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/KeyRange.php#L209-L222 | train |
googleapis/google-cloud-php | Spanner/src/KeyRange.php | KeyRange.keyRangeObject | public function keyRangeObject()
{
if (!$this->start || !$this->end) {
throw new \BadMethodCallException('Key Range must supply a start and an end');
}
return [
$this->startType => $this->start,
$this->endType => $this->end
];
} | php | public function keyRangeObject()
{
if (!$this->start || !$this->end) {
throw new \BadMethodCallException('Key Range must supply a start and an end');
}
return [
$this->startType => $this->start,
$this->endType => $this->end
];
} | [
"public",
"function",
"keyRangeObject",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"start",
"||",
"!",
"$",
"this",
"->",
"end",
")",
"{",
"throw",
"new",
"\\",
"BadMethodCallException",
"(",
"'Key Range must supply a start and an end'",
")",
";",
"}",
"return",
"[",
"$",
"this",
"->",
"startType",
"=>",
"$",
"this",
"->",
"start",
",",
"$",
"this",
"->",
"endType",
"=>",
"$",
"this",
"->",
"end",
"]",
";",
"}"
] | Returns an API-compliant representation of a KeyRange.
@return array
@access private | [
"Returns",
"an",
"API",
"-",
"compliant",
"representation",
"of",
"a",
"KeyRange",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/KeyRange.php#L248-L258 | train |
googleapis/google-cloud-php | Spanner/src/KeyRange.php | KeyRange.fromDefinition | private function fromDefinition($type, $startOrEnd)
{
if (!array_key_exists($type, $this->definition)) {
throw new \InvalidArgumentException(sprintf(
'Invalid KeyRange %s type. Allowed values are %s.',
$startOrEnd,
implode(', ', array_keys($this->definition))
));
}
return $this->definition[$type][$startOrEnd];
} | php | private function fromDefinition($type, $startOrEnd)
{
if (!array_key_exists($type, $this->definition)) {
throw new \InvalidArgumentException(sprintf(
'Invalid KeyRange %s type. Allowed values are %s.',
$startOrEnd,
implode(', ', array_keys($this->definition))
));
}
return $this->definition[$type][$startOrEnd];
} | [
"private",
"function",
"fromDefinition",
"(",
"$",
"type",
",",
"$",
"startOrEnd",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"type",
",",
"$",
"this",
"->",
"definition",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Invalid KeyRange %s type. Allowed values are %s.'",
",",
"$",
"startOrEnd",
",",
"implode",
"(",
"', '",
",",
"array_keys",
"(",
"$",
"this",
"->",
"definition",
")",
")",
")",
")",
";",
"}",
"return",
"$",
"this",
"->",
"definition",
"[",
"$",
"type",
"]",
"[",
"$",
"startOrEnd",
"]",
";",
"}"
] | Normalizes key range values.
@param string $type The range type.
@param mixed $startOrEnd
@return array | [
"Normalizes",
"key",
"range",
"values",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/KeyRange.php#L304-L315 | train |
googleapis/google-cloud-php | Language/src/LanguageClient.php | LanguageClient.analyzeSentiment | public function analyzeSentiment($content, array $options = [])
{
return new Annotation(
$this->connection->analyzeSentiment(
$this->formatRequest($content, $options)
)
);
} | php | public function analyzeSentiment($content, array $options = [])
{
return new Annotation(
$this->connection->analyzeSentiment(
$this->formatRequest($content, $options)
)
);
} | [
"public",
"function",
"analyzeSentiment",
"(",
"$",
"content",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"Annotation",
"(",
"$",
"this",
"->",
"connection",
"->",
"analyzeSentiment",
"(",
"$",
"this",
"->",
"formatRequest",
"(",
"$",
"content",
",",
"$",
"options",
")",
")",
")",
";",
"}"
] | Analyzes the sentiment of the provided document.
Example:
```
$annotation = $language->analyzeSentiment('Google Cloud Platform is a powerful tool.');
$sentiment = $annotation->sentiment();
if ($sentiment['score'] > 0) {
echo 'This is a positive message.';
}
```
@codingStandardsIgnoreStart
@see https://cloud.google.com/natural-language/docs/reference/rest/v1/documents/analyzeSentiment Analyze Sentiment API documentation
@codingStandardsIgnoreEnd
@param string|StorageObject $content The content to analyze. May be
either a string of UTF-8 encoded content, a URI pointing to a
Google Cloud Storage object in the format of
`gs://{bucket-name}/{object-name}` or a
{@see Google\Cloud\Storage\StorageObject}.
@param array $options [optional] {
Configuration options.
@type bool $detectGcsUri When providing $content as a string, this
flag determines whether or not to attempt to detect if the
string represents a Google Cloud Storage URI in the format of
`gs://{bucket-name}/{object-name}`. **Defaults to** `true`.
@type string $type The document type. Acceptable values are
`PLAIN_TEXT` or `HTML`. **Defaults to** `"PLAIN_TEXT"`.
@type string $language The language of the document. Both ISO
(e.g., en, es) and BCP-47 (e.g., en-US, es-ES) language codes
are accepted. If no value is provided, the language will be
detected by the service.
@type string $encodingType The text encoding type used by the API to
calculate offsets. Acceptable values are `"NONE"`, `"UTF8"`,
`"UTF16"` and `"UTF32"`. **Defaults to** `"UTF8"`. Please note
the following behaviors for the encoding type setting: `"NONE"`
will return a value of "-1" for offsets. `"UTF8"` will
return byte offsets. `"UTF16"` will return
[code unit](http://unicode.org/glossary/#code_unit) offsets.
`"UTF32"` will return
[unicode character](http://unicode.org/glossary/#character)
offsets.
}
@return Annotation | [
"Analyzes",
"the",
"sentiment",
"of",
"the",
"provided",
"document",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/LanguageClient.php#L218-L225 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.