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
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
partition
stringclasses
1 value
googleapis/google-cloud-php
Talent/src/V4beta1/Profile.php
Profile.setApplications
public function setApplications($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->applications = $arr; return $this; }
php
public function setApplications($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->applications = $arr; return $this; }
[ "public", "function", "setApplications", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ")", ";", "$", "this", "->", "applications", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Output only. The resource names of the candidate's applications. Generated from protobuf field <code>repeated string applications = 47;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Output", "only", ".", "The", "resource", "names", "of", "the", "candidate", "s", "applications", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/Profile.php#L1278-L1284
train
googleapis/google-cloud-php
Talent/src/V4beta1/Profile.php
Profile.setAssignments
public function setAssignments($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->assignments = $arr; return $this; }
php
public function setAssignments($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->assignments = $arr; return $this; }
[ "public", "function", "setAssignments", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ")", ";", "$", "this", "->", "assignments", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Output only. The resource names of the candidate's assignments. Generated from protobuf field <code>repeated string assignments = 48;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Output", "only", ".", "The", "resource", "names", "of", "the", "candidate", "s", "assignments", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/Profile.php#L1304-L1310
train
googleapis/google-cloud-php
Core/src/ServiceBuilder.php
ServiceBuilder.createClient
private function createClient($class, $packageName, array $config = []) { if (class_exists($class)) { return new $class($this->resolveConfig($config + $this->config)); } throw new \Exception(sprintf( 'The google/cloud-%s package is missing and must be installed.', $packageName )); }
php
private function createClient($class, $packageName, array $config = []) { if (class_exists($class)) { return new $class($this->resolveConfig($config + $this->config)); } throw new \Exception(sprintf( 'The google/cloud-%s package is missing and must be installed.', $packageName )); }
[ "private", "function", "createClient", "(", "$", "class", ",", "$", "packageName", ",", "array", "$", "config", "=", "[", "]", ")", "{", "if", "(", "class_exists", "(", "$", "class", ")", ")", "{", "return", "new", "$", "class", "(", "$", "this", "->", "resolveConfig", "(", "$", "config", "+", "$", "this", "->", "config", ")", ")", ";", "}", "throw", "new", "\\", "Exception", "(", "sprintf", "(", "'The google/cloud-%s package is missing and must be installed.'", ",", "$", "packageName", ")", ")", ";", "}" ]
Create the client library, or error if not installed. @param string $class The class to create. @param string $packageName The name of the package @param array $config Configuration options.
[ "Create", "the", "client", "library", "or", "error", "if", "not", "installed", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/ServiceBuilder.php#L412-L421
train
googleapis/google-cloud-php
Core/src/ServiceBuilder.php
ServiceBuilder.resolveConfig
private function resolveConfig(array $config) { if (!isset($config['httpHandler'])) { $config['httpHandler'] = HttpHandlerFactory::build(); } if (!isset($config['asyncHttpHandler'])) { $isGuzzleHandler = $config['httpHandler'] instanceof Guzzle6HttpHandler || $config['httpHandler'] instanceof Guzzle5HttpHandler; $config['asyncHttpHandler'] = $isGuzzleHandler ? [$config['httpHandler'], 'async'] : [HttpHandlerFactory::build(), 'async']; } return array_merge($this->config, $config); }
php
private function resolveConfig(array $config) { if (!isset($config['httpHandler'])) { $config['httpHandler'] = HttpHandlerFactory::build(); } if (!isset($config['asyncHttpHandler'])) { $isGuzzleHandler = $config['httpHandler'] instanceof Guzzle6HttpHandler || $config['httpHandler'] instanceof Guzzle5HttpHandler; $config['asyncHttpHandler'] = $isGuzzleHandler ? [$config['httpHandler'], 'async'] : [HttpHandlerFactory::build(), 'async']; } return array_merge($this->config, $config); }
[ "private", "function", "resolveConfig", "(", "array", "$", "config", ")", "{", "if", "(", "!", "isset", "(", "$", "config", "[", "'httpHandler'", "]", ")", ")", "{", "$", "config", "[", "'httpHandler'", "]", "=", "HttpHandlerFactory", "::", "build", "(", ")", ";", "}", "if", "(", "!", "isset", "(", "$", "config", "[", "'asyncHttpHandler'", "]", ")", ")", "{", "$", "isGuzzleHandler", "=", "$", "config", "[", "'httpHandler'", "]", "instanceof", "Guzzle6HttpHandler", "||", "$", "config", "[", "'httpHandler'", "]", "instanceof", "Guzzle5HttpHandler", ";", "$", "config", "[", "'asyncHttpHandler'", "]", "=", "$", "isGuzzleHandler", "?", "[", "$", "config", "[", "'httpHandler'", "]", ",", "'async'", "]", ":", "[", "HttpHandlerFactory", "::", "build", "(", ")", ",", "'async'", "]", ";", "}", "return", "array_merge", "(", "$", "this", "->", "config", ",", "$", "config", ")", ";", "}" ]
Resolves configuration options. @param array $config @return array
[ "Resolves", "configuration", "options", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/ServiceBuilder.php#L429-L444
train
googleapis/google-cloud-php
Dlp/src/V2/TransformationSummary.php
TransformationSummary.setField
public function setField($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\FieldId::class); $this->field = $var; return $this; }
php
public function setField($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\FieldId::class); $this->field = $var; return $this; }
[ "public", "function", "setField", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "FieldId", "::", "class", ")", ";", "$", "this", "->", "field", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Set if the transformation was limited to a specific FieldId. Generated from protobuf field <code>.google.privacy.dlp.v2.FieldId field = 2;</code> @param \Google\Cloud\Dlp\V2\FieldId $var @return $this
[ "Set", "if", "the", "transformation", "was", "limited", "to", "a", "specific", "FieldId", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/TransformationSummary.php#L135-L141
train
googleapis/google-cloud-php
Dlp/src/V2/TransformationSummary.php
TransformationSummary.setTransformation
public function setTransformation($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\PrimitiveTransformation::class); $this->transformation = $var; return $this; }
php
public function setTransformation($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\PrimitiveTransformation::class); $this->transformation = $var; return $this; }
[ "public", "function", "setTransformation", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "PrimitiveTransformation", "::", "class", ")", ";", "$", "this", "->", "transformation", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The specific transformation these stats apply to. Generated from protobuf field <code>.google.privacy.dlp.v2.PrimitiveTransformation transformation = 3;</code> @param \Google\Cloud\Dlp\V2\PrimitiveTransformation $var @return $this
[ "The", "specific", "transformation", "these", "stats", "apply", "to", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/TransformationSummary.php#L161-L167
train
googleapis/google-cloud-php
Dlp/src/V2/TransformationSummary.php
TransformationSummary.setFieldTransformations
public function setFieldTransformations($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\FieldTransformation::class); $this->field_transformations = $arr; return $this; }
php
public function setFieldTransformations($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\FieldTransformation::class); $this->field_transformations = $arr; return $this; }
[ "public", "function", "setFieldTransformations", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "FieldTransformation", "::", "class", ")", ";", "$", "this", "->", "field_transformations", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The field transformation that was applied. If multiple field transformations are requested for a single field, this list will contain all of them; otherwise, only one is supplied. Generated from protobuf field <code>repeated .google.privacy.dlp.v2.FieldTransformation field_transformations = 5;</code> @param \Google\Cloud\Dlp\V2\FieldTransformation[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "field", "transformation", "that", "was", "applied", ".", "If", "multiple", "field", "transformations", "are", "requested", "for", "a", "single", "field", "this", "list", "will", "contain", "all", "of", "them", ";", "otherwise", "only", "one", "is", "supplied", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/TransformationSummary.php#L191-L197
train
googleapis/google-cloud-php
Dlp/src/V2/TransformationSummary.php
TransformationSummary.setRecordSuppress
public function setRecordSuppress($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\RecordSuppression::class); $this->record_suppress = $var; return $this; }
php
public function setRecordSuppress($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\RecordSuppression::class); $this->record_suppress = $var; return $this; }
[ "public", "function", "setRecordSuppress", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "RecordSuppression", "::", "class", ")", ";", "$", "this", "->", "record_suppress", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The specific suppression option these stats apply to. Generated from protobuf field <code>.google.privacy.dlp.v2.RecordSuppression record_suppress = 6;</code> @param \Google\Cloud\Dlp\V2\RecordSuppression $var @return $this
[ "The", "specific", "suppression", "option", "these", "stats", "apply", "to", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/TransformationSummary.php#L217-L223
train
googleapis/google-cloud-php
VideoIntelligence/src/V1/TextFrame.php
TextFrame.setRotatedBoundingBox
public function setRotatedBoundingBox($var) { GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingPoly::class); $this->rotated_bounding_box = $var; return $this; }
php
public function setRotatedBoundingBox($var) { GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingPoly::class); $this->rotated_bounding_box = $var; return $this; }
[ "public", "function", "setRotatedBoundingBox", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "VideoIntelligence", "\\", "V1", "\\", "NormalizedBoundingPoly", "::", "class", ")", ";", "$", "this", "->", "rotated_bounding_box", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Bounding polygon of the detected text for this frame. Generated from protobuf field <code>.google.cloud.videointelligence.v1.NormalizedBoundingPoly rotated_bounding_box = 1;</code> @param \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingPoly $var @return $this
[ "Bounding", "polygon", "of", "the", "detected", "text", "for", "this", "frame", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/VideoIntelligence/src/V1/TextFrame.php#L68-L74
train
googleapis/google-cloud-php
Core/src/Batch/SysvConfigStorage.php
SysvConfigStorage.save
public function save(JobConfig $config) { $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm); if ($shmid === false) { throw new \RuntimeException( 'Failed to attach to the shared memory' ); } // If the variable write fails, clear the memory and re-raise the exception try { $result = shm_put_var($shmid, self::VAR_KEY, $config); } catch (\Exception $e) { $this->clear(); throw new \RuntimeException($e->getMessage()); } finally { shm_detach($shmid); } return $result; }
php
public function save(JobConfig $config) { $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm); if ($shmid === false) { throw new \RuntimeException( 'Failed to attach to the shared memory' ); } // If the variable write fails, clear the memory and re-raise the exception try { $result = shm_put_var($shmid, self::VAR_KEY, $config); } catch (\Exception $e) { $this->clear(); throw new \RuntimeException($e->getMessage()); } finally { shm_detach($shmid); } return $result; }
[ "public", "function", "save", "(", "JobConfig", "$", "config", ")", "{", "$", "shmid", "=", "shm_attach", "(", "$", "this", "->", "sysvKey", ",", "$", "this", "->", "shmSize", ",", "$", "this", "->", "perm", ")", ";", "if", "(", "$", "shmid", "===", "false", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Failed to attach to the shared memory'", ")", ";", "}", "// If the variable write fails, clear the memory and re-raise the exception", "try", "{", "$", "result", "=", "shm_put_var", "(", "$", "shmid", ",", "self", "::", "VAR_KEY", ",", "$", "config", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", "$", "this", "->", "clear", "(", ")", ";", "throw", "new", "\\", "RuntimeException", "(", "$", "e", "->", "getMessage", "(", ")", ")", ";", "}", "finally", "{", "shm_detach", "(", "$", "shmid", ")", ";", "}", "return", "$", "result", ";", "}" ]
Save the given JobConfig. @param JobConfig $config A JobConfig to save. @return bool @throws \RuntimeException when failed to attach to the shared memory or serialization fails
[ "Save", "the", "given", "JobConfig", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/SysvConfigStorage.php#L101-L120
train
googleapis/google-cloud-php
Core/src/Batch/SysvConfigStorage.php
SysvConfigStorage.load
public function load() { $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm); if ($shmid === false) { throw new \RuntimeException( 'Failed to attach to the shared memory' ); } if (! shm_has_var($shmid, self::VAR_KEY)) { $result = new JobConfig(); } else { $result = shm_get_var($shmid, self::VAR_KEY); } shm_detach($shmid); if ($result === false) { throw new \RuntimeException( 'Failed to deserialize data from shared memory' ); } return $result; }
php
public function load() { $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm); if ($shmid === false) { throw new \RuntimeException( 'Failed to attach to the shared memory' ); } if (! shm_has_var($shmid, self::VAR_KEY)) { $result = new JobConfig(); } else { $result = shm_get_var($shmid, self::VAR_KEY); } shm_detach($shmid); if ($result === false) { throw new \RuntimeException( 'Failed to deserialize data from shared memory' ); } return $result; }
[ "public", "function", "load", "(", ")", "{", "$", "shmid", "=", "shm_attach", "(", "$", "this", "->", "sysvKey", ",", "$", "this", "->", "shmSize", ",", "$", "this", "->", "perm", ")", ";", "if", "(", "$", "shmid", "===", "false", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Failed to attach to the shared memory'", ")", ";", "}", "if", "(", "!", "shm_has_var", "(", "$", "shmid", ",", "self", "::", "VAR_KEY", ")", ")", "{", "$", "result", "=", "new", "JobConfig", "(", ")", ";", "}", "else", "{", "$", "result", "=", "shm_get_var", "(", "$", "shmid", ",", "self", "::", "VAR_KEY", ")", ";", "}", "shm_detach", "(", "$", "shmid", ")", ";", "if", "(", "$", "result", "===", "false", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Failed to deserialize data from shared memory'", ")", ";", "}", "return", "$", "result", ";", "}" ]
Load a JobConfig from the storage. @return JobConfig @throws \RuntimeException when failed to attach to the shared memory or deserialization fails
[ "Load", "a", "JobConfig", "from", "the", "storage", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/SysvConfigStorage.php#L128-L149
train
googleapis/google-cloud-php
Core/src/Batch/SysvConfigStorage.php
SysvConfigStorage.clear
public function clear() { $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm); shm_remove_var($shmid, self::VAR_KEY); }
php
public function clear() { $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm); shm_remove_var($shmid, self::VAR_KEY); }
[ "public", "function", "clear", "(", ")", "{", "$", "shmid", "=", "shm_attach", "(", "$", "this", "->", "sysvKey", ",", "$", "this", "->", "shmSize", ",", "$", "this", "->", "perm", ")", ";", "shm_remove_var", "(", "$", "shmid", ",", "self", "::", "VAR_KEY", ")", ";", "}" ]
Clear the JobConfig from storage.
[ "Clear", "the", "JobConfig", "from", "storage", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/SysvConfigStorage.php#L154-L158
train
googleapis/google-cloud-php
Redis/src/V1beta1/ListInstancesResponse.php
ListInstancesResponse.setUnreachable
public function setUnreachable($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->unreachable = $arr; return $this; }
php
public function setUnreachable($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->unreachable = $arr; return $this; }
[ "public", "function", "setUnreachable", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ")", ";", "$", "this", "->", "unreachable", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Locations that could not be reached. Generated from protobuf field <code>repeated string unreachable = 3;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Locations", "that", "could", "not", "be", "reached", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Redis/src/V1beta1/ListInstancesResponse.php#L163-L169
train
googleapis/google-cloud-php
Core/src/GrpcTrait.php
GrpcTrait.send
public function send(callable $request, array $args, $whitelisted = false) { $requestOptions = $this->pluckArray([ 'grpcOptions', 'retries', 'requestTimeout' ], $args[count($args) - 1]); try { return $this->requestWrapper->send($request, $args, $requestOptions); } catch (NotFoundException $e) { if ($whitelisted) { throw $this->modifyWhitelistedError($e); } throw $e; } }
php
public function send(callable $request, array $args, $whitelisted = false) { $requestOptions = $this->pluckArray([ 'grpcOptions', 'retries', 'requestTimeout' ], $args[count($args) - 1]); try { return $this->requestWrapper->send($request, $args, $requestOptions); } catch (NotFoundException $e) { if ($whitelisted) { throw $this->modifyWhitelistedError($e); } throw $e; } }
[ "public", "function", "send", "(", "callable", "$", "request", ",", "array", "$", "args", ",", "$", "whitelisted", "=", "false", ")", "{", "$", "requestOptions", "=", "$", "this", "->", "pluckArray", "(", "[", "'grpcOptions'", ",", "'retries'", ",", "'requestTimeout'", "]", ",", "$", "args", "[", "count", "(", "$", "args", ")", "-", "1", "]", ")", ";", "try", "{", "return", "$", "this", "->", "requestWrapper", "->", "send", "(", "$", "request", ",", "$", "args", ",", "$", "requestOptions", ")", ";", "}", "catch", "(", "NotFoundException", "$", "e", ")", "{", "if", "(", "$", "whitelisted", ")", "{", "throw", "$", "this", "->", "modifyWhitelistedError", "(", "$", "e", ")", ";", "}", "throw", "$", "e", ";", "}", "}" ]
Delivers a request. @param callable $request @param array $args @param bool $whitelisted @return \Generator|array
[ "Delivers", "a", "request", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/GrpcTrait.php#L73-L90
train
googleapis/google-cloud-php
Core/src/GrpcTrait.php
GrpcTrait.getGaxConfig
private function getGaxConfig($version, callable $authHttpHandler = null) { $config = [ 'libName' => 'gccl', 'libVersion' => $version, 'transport' => 'grpc' ]; // GAX v0.32.0 introduced the CredentialsWrapper class and a different // way to configure credentials. If the class exists, use this new method // otherwise default to legacy usage. if (class_exists(CredentialsWrapper::class)) { $config['credentials'] = new CredentialsWrapper( $this->requestWrapper->getCredentialsFetcher(), $authHttpHandler ); } else { $config += [ 'credentialsLoader' => $this->requestWrapper->getCredentialsFetcher(), 'authHttpHandler' => $authHttpHandler, 'enableCaching' => false ]; } return $config; }
php
private function getGaxConfig($version, callable $authHttpHandler = null) { $config = [ 'libName' => 'gccl', 'libVersion' => $version, 'transport' => 'grpc' ]; // GAX v0.32.0 introduced the CredentialsWrapper class and a different // way to configure credentials. If the class exists, use this new method // otherwise default to legacy usage. if (class_exists(CredentialsWrapper::class)) { $config['credentials'] = new CredentialsWrapper( $this->requestWrapper->getCredentialsFetcher(), $authHttpHandler ); } else { $config += [ 'credentialsLoader' => $this->requestWrapper->getCredentialsFetcher(), 'authHttpHandler' => $authHttpHandler, 'enableCaching' => false ]; } return $config; }
[ "private", "function", "getGaxConfig", "(", "$", "version", ",", "callable", "$", "authHttpHandler", "=", "null", ")", "{", "$", "config", "=", "[", "'libName'", "=>", "'gccl'", ",", "'libVersion'", "=>", "$", "version", ",", "'transport'", "=>", "'grpc'", "]", ";", "// GAX v0.32.0 introduced the CredentialsWrapper class and a different", "// way to configure credentials. If the class exists, use this new method", "// otherwise default to legacy usage.", "if", "(", "class_exists", "(", "CredentialsWrapper", "::", "class", ")", ")", "{", "$", "config", "[", "'credentials'", "]", "=", "new", "CredentialsWrapper", "(", "$", "this", "->", "requestWrapper", "->", "getCredentialsFetcher", "(", ")", ",", "$", "authHttpHandler", ")", ";", "}", "else", "{", "$", "config", "+=", "[", "'credentialsLoader'", "=>", "$", "this", "->", "requestWrapper", "->", "getCredentialsFetcher", "(", ")", ",", "'authHttpHandler'", "=>", "$", "authHttpHandler", ",", "'enableCaching'", "=>", "false", "]", ";", "}", "return", "$", "config", ";", "}" ]
Gets the default configuration for generated clients. @param string $version @param callable|null $authHttpHandler @return array
[ "Gets", "the", "default", "configuration", "for", "generated", "clients", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/GrpcTrait.php#L99-L124
train
googleapis/google-cloud-php
Core/src/GrpcTrait.php
GrpcTrait.formatStructForApi
private function formatStructForApi(array $fields) { $fFields = []; foreach ($fields as $key => $value) { $fFields[$key] = $this->formatValueForApi($value); } return ['fields' => $fFields]; }
php
private function formatStructForApi(array $fields) { $fFields = []; foreach ($fields as $key => $value) { $fFields[$key] = $this->formatValueForApi($value); } return ['fields' => $fFields]; }
[ "private", "function", "formatStructForApi", "(", "array", "$", "fields", ")", "{", "$", "fFields", "=", "[", "]", ";", "foreach", "(", "$", "fields", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "fFields", "[", "$", "key", "]", "=", "$", "this", "->", "formatValueForApi", "(", "$", "value", ")", ";", "}", "return", "[", "'fields'", "=>", "$", "fFields", "]", ";", "}" ]
Format a struct for the API. @param array $fields @return array
[ "Format", "a", "struct", "for", "the", "API", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/GrpcTrait.php#L132-L141
train
googleapis/google-cloud-php
Core/src/GrpcTrait.php
GrpcTrait.formatListForApi
private function formatListForApi(array $list) { $values = []; foreach ($list as $value) { $values[] = $this->formatValueForApi($value); } return ['values' => $values]; }
php
private function formatListForApi(array $list) { $values = []; foreach ($list as $value) { $values[] = $this->formatValueForApi($value); } return ['values' => $values]; }
[ "private", "function", "formatListForApi", "(", "array", "$", "list", ")", "{", "$", "values", "=", "[", "]", ";", "foreach", "(", "$", "list", "as", "$", "value", ")", "{", "$", "values", "[", "]", "=", "$", "this", "->", "formatValueForApi", "(", "$", "value", ")", ";", "}", "return", "[", "'values'", "=>", "$", "values", "]", ";", "}" ]
Format a list for the API. @param array $list @return array
[ "Format", "a", "list", "for", "the", "API", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/GrpcTrait.php#L203-L212
train
googleapis/google-cloud-php
Core/src/GrpcTrait.php
GrpcTrait.formatValueForApi
private function formatValueForApi($value) { $type = gettype($value); switch ($type) { case 'string': return ['string_value' => $value]; case 'double': case 'integer': return ['number_value' => $value]; case 'boolean': return ['bool_value' => $value]; case 'NULL': return ['null_value' => NullValue::NULL_VALUE]; case 'array': if (!empty($value) && $this->isAssoc($value)) { return ['struct_value' => $this->formatStructForApi($value)]; } return ['list_value' => $this->formatListForApi($value)]; } }
php
private function formatValueForApi($value) { $type = gettype($value); switch ($type) { case 'string': return ['string_value' => $value]; case 'double': case 'integer': return ['number_value' => $value]; case 'boolean': return ['bool_value' => $value]; case 'NULL': return ['null_value' => NullValue::NULL_VALUE]; case 'array': if (!empty($value) && $this->isAssoc($value)) { return ['struct_value' => $this->formatStructForApi($value)]; } return ['list_value' => $this->formatListForApi($value)]; } }
[ "private", "function", "formatValueForApi", "(", "$", "value", ")", "{", "$", "type", "=", "gettype", "(", "$", "value", ")", ";", "switch", "(", "$", "type", ")", "{", "case", "'string'", ":", "return", "[", "'string_value'", "=>", "$", "value", "]", ";", "case", "'double'", ":", "case", "'integer'", ":", "return", "[", "'number_value'", "=>", "$", "value", "]", ";", "case", "'boolean'", ":", "return", "[", "'bool_value'", "=>", "$", "value", "]", ";", "case", "'NULL'", ":", "return", "[", "'null_value'", "=>", "NullValue", "::", "NULL_VALUE", "]", ";", "case", "'array'", ":", "if", "(", "!", "empty", "(", "$", "value", ")", "&&", "$", "this", "->", "isAssoc", "(", "$", "value", ")", ")", "{", "return", "[", "'struct_value'", "=>", "$", "this", "->", "formatStructForApi", "(", "$", "value", ")", "]", ";", "}", "return", "[", "'list_value'", "=>", "$", "this", "->", "formatListForApi", "(", "$", "value", ")", "]", ";", "}", "}" ]
Format a value for the API. @param array $value @return array
[ "Format", "a", "value", "for", "the", "API", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/GrpcTrait.php#L220-L241
train
googleapis/google-cloud-php
Core/src/GrpcTrait.php
GrpcTrait.formatTimestampFromApi
private function formatTimestampFromApi(array $timestamp) { $timestamp += [ 'seconds' => 0, 'nanos' => 0 ]; $dt = $this->createDateTimeFromSeconds($timestamp['seconds']); return $this->formatTimeAsString($dt, $timestamp['nanos']); }
php
private function formatTimestampFromApi(array $timestamp) { $timestamp += [ 'seconds' => 0, 'nanos' => 0 ]; $dt = $this->createDateTimeFromSeconds($timestamp['seconds']); return $this->formatTimeAsString($dt, $timestamp['nanos']); }
[ "private", "function", "formatTimestampFromApi", "(", "array", "$", "timestamp", ")", "{", "$", "timestamp", "+=", "[", "'seconds'", "=>", "0", ",", "'nanos'", "=>", "0", "]", ";", "$", "dt", "=", "$", "this", "->", "createDateTimeFromSeconds", "(", "$", "timestamp", "[", "'seconds'", "]", ")", ";", "return", "$", "this", "->", "formatTimeAsString", "(", "$", "dt", ",", "$", "timestamp", "[", "'nanos'", "]", ")", ";", "}" ]
Format a gRPC timestamp to match the format returned by the REST API. @param array $timestamp @return string
[ "Format", "a", "gRPC", "timestamp", "to", "match", "the", "format", "returned", "by", "the", "REST", "API", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/GrpcTrait.php#L249-L259
train
googleapis/google-cloud-php
AutoMl/src/V1beta1/CreateModelRequest.php
CreateModelRequest.setModel
public function setModel($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\Model::class); $this->model = $var; return $this; }
php
public function setModel($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\Model::class); $this->model = $var; return $this; }
[ "public", "function", "setModel", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "AutoMl", "\\", "V1beta1", "\\", "Model", "::", "class", ")", ";", "$", "this", "->", "model", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The model to create. Generated from protobuf field <code>.google.cloud.automl.v1beta1.Model model = 4;</code> @param \Google\Cloud\AutoMl\V1beta1\Model $var @return $this
[ "The", "model", "to", "create", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/AutoMl/src/V1beta1/CreateModelRequest.php#L92-L98
train
googleapis/google-cloud-php
Firestore/src/PathTrait.php
PathTrait.fullName
private function fullName($projectId, $database, $relativeName = null) { return $relativeName !== null ? FirestoreGapicClient::documentPathName($projectId, $database, $relativeName) : FirestoreGapicClient::documentRootName($projectId, $database); }
php
private function fullName($projectId, $database, $relativeName = null) { return $relativeName !== null ? FirestoreGapicClient::documentPathName($projectId, $database, $relativeName) : FirestoreGapicClient::documentRootName($projectId, $database); }
[ "private", "function", "fullName", "(", "$", "projectId", ",", "$", "database", ",", "$", "relativeName", "=", "null", ")", "{", "return", "$", "relativeName", "!==", "null", "?", "FirestoreGapicClient", "::", "documentPathName", "(", "$", "projectId", ",", "$", "database", ",", "$", "relativeName", ")", ":", "FirestoreGapicClient", "::", "documentRootName", "(", "$", "projectId", ",", "$", "database", ")", ";", "}" ]
Create a full name from a project, database and relative path. @param string $projectId @param string $database @param string $relativeName @return string
[ "Create", "a", "full", "name", "from", "a", "project", "database", "and", "relative", "path", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/PathTrait.php#L37-L42
train
googleapis/google-cloud-php
Firestore/src/PathTrait.php
PathTrait.databaseIdFromName
private function databaseIdFromName($name) { try { $parsed = FirestoreGapicClient::parseName($name); } catch (ValidationException $e) { return null; } return isset($parsed['database']) ? $parsed['database'] : null; }
php
private function databaseIdFromName($name) { try { $parsed = FirestoreGapicClient::parseName($name); } catch (ValidationException $e) { return null; } return isset($parsed['database']) ? $parsed['database'] : null; }
[ "private", "function", "databaseIdFromName", "(", "$", "name", ")", "{", "try", "{", "$", "parsed", "=", "FirestoreGapicClient", "::", "parseName", "(", "$", "name", ")", ";", "}", "catch", "(", "ValidationException", "$", "e", ")", "{", "return", "null", ";", "}", "return", "isset", "(", "$", "parsed", "[", "'database'", "]", ")", "?", "$", "parsed", "[", "'database'", "]", ":", "null", ";", "}" ]
Return the database ID from a fully-qualified path name. This method returns a bare database ID. For the fully-qualified database name, use {@see Google\Cloud\Firestore\PathTrait::databaseFromName()}. @param string $name @return string|null
[ "Return", "the", "database", "ID", "from", "a", "fully", "-", "qualified", "path", "name", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/PathTrait.php#L92-L103
train
googleapis/google-cloud-php
Firestore/src/PathTrait.php
PathTrait.isDocument
private function isDocument($name) { if (!$this->isRelative($name)) { $name = $this->relativeName($name); } $parts = $this->splitName($name); return count($parts) > 0 && count($parts) % 2 === 0; }
php
private function isDocument($name) { if (!$this->isRelative($name)) { $name = $this->relativeName($name); } $parts = $this->splitName($name); return count($parts) > 0 && count($parts) % 2 === 0; }
[ "private", "function", "isDocument", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isRelative", "(", "$", "name", ")", ")", "{", "$", "name", "=", "$", "this", "->", "relativeName", "(", "$", "name", ")", ";", "}", "$", "parts", "=", "$", "this", "->", "splitName", "(", "$", "name", ")", ";", "return", "count", "(", "$", "parts", ")", ">", "0", "&&", "count", "(", "$", "parts", ")", "%", "2", "===", "0", ";", "}" ]
Determine whether the given path is a document. @param string $name @return bool
[ "Determine", "whether", "the", "given", "path", "is", "a", "document", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/PathTrait.php#L130-L138
train
googleapis/google-cloud-php
Firestore/src/PathTrait.php
PathTrait.isCollection
private function isCollection($name) { if (!$this->isRelative($name)) { $name = $this->relativeName($name); } $parts = $this->splitName($name); return count($parts) % 2 === 1; }
php
private function isCollection($name) { if (!$this->isRelative($name)) { $name = $this->relativeName($name); } $parts = $this->splitName($name); return count($parts) % 2 === 1; }
[ "private", "function", "isCollection", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isRelative", "(", "$", "name", ")", ")", "{", "$", "name", "=", "$", "this", "->", "relativeName", "(", "$", "name", ")", ";", "}", "$", "parts", "=", "$", "this", "->", "splitName", "(", "$", "name", ")", ";", "return", "count", "(", "$", "parts", ")", "%", "2", "===", "1", ";", "}" ]
Determine whether the given path is a collection. @param string $name @return bool
[ "Determine", "whether", "the", "given", "path", "is", "a", "collection", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/PathTrait.php#L146-L154
train
googleapis/google-cloud-php
Firestore/src/PathTrait.php
PathTrait.pathId
private function pathId($name) { $parts = $this->splitName($name); if ($parts[0] === '') { return null; } return end($parts); }
php
private function pathId($name) { $parts = $this->splitName($name); if ($parts[0] === '') { return null; } return end($parts); }
[ "private", "function", "pathId", "(", "$", "name", ")", "{", "$", "parts", "=", "$", "this", "->", "splitName", "(", "$", "name", ")", ";", "if", "(", "$", "parts", "[", "0", "]", "===", "''", ")", "{", "return", "null", ";", "}", "return", "end", "(", "$", "parts", ")", ";", "}" ]
Return the identifier from a path. @param string $name @return string|null
[ "Return", "the", "identifier", "from", "a", "path", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/PathTrait.php#L185-L193
train
googleapis/google-cloud-php
Firestore/src/PathTrait.php
PathTrait.parentPath
private function parentPath($name) { $parts = $this->splitName($name); array_pop($parts); return implode('/', $parts); }
php
private function parentPath($name) { $parts = $this->splitName($name); array_pop($parts); return implode('/', $parts); }
[ "private", "function", "parentPath", "(", "$", "name", ")", "{", "$", "parts", "=", "$", "this", "->", "splitName", "(", "$", "name", ")", ";", "array_pop", "(", "$", "parts", ")", ";", "return", "implode", "(", "'/'", ",", "$", "parts", ")", ";", "}" ]
Get the current path's parent. @param string $name @return string
[ "Get", "the", "current", "path", "s", "parent", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/PathTrait.php#L212-L218
train
googleapis/google-cloud-php
Firestore/src/PathTrait.php
PathTrait.randomName
private function randomName($parent) { // UUIDs are a pre-existing library dependency, so we'll use that instead // of adding random_compat or something similar. // Generate a UUID, then strip `-` and trim to expected length. // @todo revisit once library requires php >= 7.0 and random_int() can be used without dependency. $rand = substr(str_replace('-', '', Uuid::uuid4()), 0, 20); return $this->childPath($parent, $rand); }
php
private function randomName($parent) { // UUIDs are a pre-existing library dependency, so we'll use that instead // of adding random_compat or something similar. // Generate a UUID, then strip `-` and trim to expected length. // @todo revisit once library requires php >= 7.0 and random_int() can be used without dependency. $rand = substr(str_replace('-', '', Uuid::uuid4()), 0, 20); return $this->childPath($parent, $rand); }
[ "private", "function", "randomName", "(", "$", "parent", ")", "{", "// UUIDs are a pre-existing library dependency, so we'll use that instead", "// of adding random_compat or something similar.", "// Generate a UUID, then strip `-` and trim to expected length.", "// @todo revisit once library requires php >= 7.0 and random_int() can be used without dependency.", "$", "rand", "=", "substr", "(", "str_replace", "(", "'-'", ",", "''", ",", "Uuid", "::", "uuid4", "(", ")", ")", ",", "0", ",", "20", ")", ";", "return", "$", "this", "->", "childPath", "(", "$", "parent", ",", "$", "rand", ")", ";", "}" ]
Create a random name. @param string $parent @return string
[ "Create", "a", "random", "name", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/PathTrait.php#L226-L235
train
googleapis/google-cloud-php
Bigtable/src/V2/Mutation/DeleteFromColumn.php
DeleteFromColumn.setTimeRange
public function setTimeRange($var) { GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\TimestampRange::class); $this->time_range = $var; return $this; }
php
public function setTimeRange($var) { GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\TimestampRange::class); $this->time_range = $var; return $this; }
[ "public", "function", "setTimeRange", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Bigtable", "\\", "V2", "\\", "TimestampRange", "::", "class", ")", ";", "$", "this", "->", "time_range", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The range of timestamps within which cells should be deleted. Generated from protobuf field <code>.google.bigtable.v2.TimestampRange time_range = 3;</code> @param \Google\Cloud\Bigtable\V2\TimestampRange $var @return $this
[ "The", "range", "of", "timestamps", "within", "which", "cells", "should", "be", "deleted", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Mutation/DeleteFromColumn.php#L135-L141
train
googleapis/google-cloud-php
Dlp/src/V2/ListStoredInfoTypesResponse.php
ListStoredInfoTypesResponse.setStoredInfoTypes
public function setStoredInfoTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\StoredInfoType::class); $this->stored_info_types = $arr; return $this; }
php
public function setStoredInfoTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\StoredInfoType::class); $this->stored_info_types = $arr; return $this; }
[ "public", "function", "setStoredInfoTypes", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "StoredInfoType", "::", "class", ")", ";", "$", "this", "->", "stored_info_types", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest. Generated from protobuf field <code>repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1;</code> @param \Google\Cloud\Dlp\V2\StoredInfoType[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "List", "of", "storedInfoTypes", "up", "to", "page_size", "in", "ListStoredInfoTypesRequest", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/ListStoredInfoTypesResponse.php#L68-L74
train
googleapis/google-cloud-php
Trace/src/V2/StackTrace.php
StackTrace.setStackFrames
public function setStackFrames($var) { GPBUtil::checkMessage($var, \Google\Cloud\Trace\V2\StackTrace_StackFrames::class); $this->stack_frames = $var; return $this; }
php
public function setStackFrames($var) { GPBUtil::checkMessage($var, \Google\Cloud\Trace\V2\StackTrace_StackFrames::class); $this->stack_frames = $var; return $this; }
[ "public", "function", "setStackFrames", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Trace", "\\", "V2", "\\", "StackTrace_StackFrames", "::", "class", ")", ";", "$", "this", "->", "stack_frames", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Stack frames in this stack trace. A maximum of 128 frames are allowed. Generated from protobuf field <code>.google.devtools.cloudtrace.v2.StackTrace.StackFrames stack_frames = 1;</code> @param \Google\Cloud\Trace\V2\StackTrace\StackFrames $var @return $this
[ "Stack", "frames", "in", "this", "stack", "trace", ".", "A", "maximum", "of", "128", "frames", "are", "allowed", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Trace/src/V2/StackTrace.php#L78-L84
train
googleapis/google-cloud-php
BigQueryDataTransfer/src/V1/DataSource.php
DataSource.setTransferType
public function setTransferType($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferType::class); $this->transfer_type = $var; return $this; }
php
public function setTransferType($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferType::class); $this->transfer_type = $var; return $this; }
[ "public", "function", "setTransferType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "BigQuery", "\\", "DataTransfer", "\\", "V1", "\\", "TransferType", "::", "class", ")", ";", "$", "this", "->", "transfer_type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Deprecated. This field has no effect. Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.TransferType transfer_type = 7;</code> @param int $var @return $this
[ "Deprecated", ".", "This", "field", "has", "no", "effect", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/DataSource.php#L393-L399
train
googleapis/google-cloud-php
BigQueryDataTransfer/src/V1/DataSource.php
DataSource.setParameters
public function setParameters($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter::class); $this->parameters = $arr; return $this; }
php
public function setParameters($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter::class); $this->parameters = $arr; return $this; }
[ "public", "function", "setParameters", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "BigQuery", "\\", "DataTransfer", "\\", "V1", "\\", "DataSourceParameter", "::", "class", ")", ";", "$", "this", "->", "parameters", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Data source parameters. Generated from protobuf field <code>repeated .google.cloud.bigquery.datatransfer.v1.DataSourceParameter parameters = 12;</code> @param \Google\Cloud\BigQuery\DataTransfer\V1\DataSourceParameter[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Data", "source", "parameters", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/DataSource.php#L539-L545
train
googleapis/google-cloud-php
BigQueryDataTransfer/src/V1/DataSource.php
DataSource.setAuthorizationType
public function setAuthorizationType($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource_AuthorizationType::class); $this->authorization_type = $var; return $this; }
php
public function setAuthorizationType($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource_AuthorizationType::class); $this->authorization_type = $var; return $this; }
[ "public", "function", "setAuthorizationType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "BigQuery", "\\", "DataTransfer", "\\", "V1", "\\", "DataSource_AuthorizationType", "::", "class", ")", ";", "$", "this", "->", "authorization_type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Indicates the type of authorization. Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType authorization_type = 14;</code> @param int $var @return $this
[ "Indicates", "the", "type", "of", "authorization", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/DataSource.php#L591-L597
train
googleapis/google-cloud-php
BigQueryDataTransfer/src/V1/DataSource.php
DataSource.setDataRefreshType
public function setDataRefreshType($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource_DataRefreshType::class); $this->data_refresh_type = $var; return $this; }
php
public function setDataRefreshType($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource_DataRefreshType::class); $this->data_refresh_type = $var; return $this; }
[ "public", "function", "setDataRefreshType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "BigQuery", "\\", "DataTransfer", "\\", "V1", "\\", "DataSource_DataRefreshType", "::", "class", ")", ";", "$", "this", "->", "data_refresh_type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Specifies whether the data source supports automatic data refresh for the past few days, and how it's supported. For some data sources, data might not be complete until a few days later, so it's useful to refresh data automatically. Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType data_refresh_type = 15;</code> @param int $var @return $this
[ "Specifies", "whether", "the", "data", "source", "supports", "automatic", "data", "refresh", "for", "the", "past", "few", "days", "and", "how", "it", "s", "supported", ".", "For", "some", "data", "sources", "data", "might", "not", "be", "complete", "until", "a", "few", "days", "later", "so", "it", "s", "useful", "to", "refresh", "data", "automatically", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/DataSource.php#L623-L629
train
googleapis/google-cloud-php
Firestore/src/CollectionReference.php
CollectionReference.add
public function add(array $fields = [], array $options = []) { $name = $this->randomName($this->name); $document = $this->documentFactory($name); $result = $document->create($fields, $options); return $document; }
php
public function add(array $fields = [], array $options = []) { $name = $this->randomName($this->name); $document = $this->documentFactory($name); $result = $document->create($fields, $options); return $document; }
[ "public", "function", "add", "(", "array", "$", "fields", "=", "[", "]", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "name", "=", "$", "this", "->", "randomName", "(", "$", "this", "->", "name", ")", ";", "$", "document", "=", "$", "this", "->", "documentFactory", "(", "$", "name", ")", ";", "$", "result", "=", "$", "document", "->", "create", "(", "$", "fields", ",", "$", "options", ")", ";", "return", "$", "document", ";", "}" ]
Generate a new document reference, and insert it with the given field data. This method will generate a random document name. If you wish to create a document with a specified name, create a reference with {@see Google\Cloud\Firestore\CollectionReference::document()}, then call {@see Google\Cloud\Firestore\DocumentReference::create()} to insert the document. This method immediately inserts the document. If you wish for lazy creation of a Document instance, refer to {@see Google\Cloud\Firestore\CollectionReference::document()} or {@see Google\Cloud\Firestore\CollectionReference::newDocument()}. Example: ``` $newUser = $collection->add([ 'name' => 'Kate' ]); ``` @param array $fields An array containing field names paired with their value. Accepts a nested array, or a simple array of field paths. @param array $options Configuration Options. @return DocumentReference
[ "Generate", "a", "new", "document", "reference", "and", "insert", "it", "with", "the", "given", "field", "data", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/CollectionReference.php#L214-L222
train
googleapis/google-cloud-php
Firestore/src/CollectionReference.php
CollectionReference.listDocuments
public function listDocuments(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false); $options += [ 'parent' => $this->parentPath($this->name), 'collectionId' => $this->pathId($this->name), 'mask' => [] ]; return new ItemIterator( new PageIterator( function ($document) { return $this->documentFactory($document['name']); }, [$this->connection, 'listDocuments'], $options, [ 'itemsKey' => 'documents', 'resultLimit' => $resultLimit ] ) ); }
php
public function listDocuments(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false); $options += [ 'parent' => $this->parentPath($this->name), 'collectionId' => $this->pathId($this->name), 'mask' => [] ]; return new ItemIterator( new PageIterator( function ($document) { return $this->documentFactory($document['name']); }, [$this->connection, 'listDocuments'], $options, [ 'itemsKey' => 'documents', 'resultLimit' => $resultLimit ] ) ); }
[ "public", "function", "listDocuments", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "resultLimit", "=", "$", "this", "->", "pluck", "(", "'resultLimit'", ",", "$", "options", ",", "false", ")", ";", "$", "options", "+=", "[", "'parent'", "=>", "$", "this", "->", "parentPath", "(", "$", "this", "->", "name", ")", ",", "'collectionId'", "=>", "$", "this", "->", "pathId", "(", "$", "this", "->", "name", ")", ",", "'mask'", "=>", "[", "]", "]", ";", "return", "new", "ItemIterator", "(", "new", "PageIterator", "(", "function", "(", "$", "document", ")", "{", "return", "$", "this", "->", "documentFactory", "(", "$", "document", "[", "'name'", "]", ")", ";", "}", ",", "[", "$", "this", "->", "connection", ",", "'listDocuments'", "]", ",", "$", "options", ",", "[", "'itemsKey'", "=>", "'documents'", ",", "'resultLimit'", "=>", "$", "resultLimit", "]", ")", ")", ";", "}" ]
List all documents in the collection. Missing documents will be included in the result. A missing document is one which does not exist, but has sub-documents. Example: ``` $documents = $collection->listDocuments(); foreach ($documents as $document) { echo $document->name() . PHP_EOL; } ``` @codingStandardsIgnoreStart @see https://cloud.google.com/firestore/docs/reference/rpc/google.firestore.v1beta1#google.firestore.v1beta1.ListDocumentsRequest ListDocumentsRequest @codingStandardsIgnoreEnd @param array $options { Configuration options @type int $pageSize The 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<DocumentReference>
[ "List", "all", "documents", "in", "the", "collection", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/CollectionReference.php#L254-L277
train
googleapis/google-cloud-php
Trace/src/V2/AttributeValue.php
AttributeValue.setStringValue
public function setStringValue($var) { GPBUtil::checkMessage($var, \Google\Cloud\Trace\V2\TruncatableString::class); $this->writeOneof(1, $var); return $this; }
php
public function setStringValue($var) { GPBUtil::checkMessage($var, \Google\Cloud\Trace\V2\TruncatableString::class); $this->writeOneof(1, $var); return $this; }
[ "public", "function", "setStringValue", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Trace", "\\", "V2", "\\", "TruncatableString", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "1", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
A string up to 256 bytes long. Generated from protobuf field <code>.google.devtools.cloudtrace.v2.TruncatableString string_value = 1;</code> @param \Google\Cloud\Trace\V2\TruncatableString $var @return $this
[ "A", "string", "up", "to", "256", "bytes", "long", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Trace/src/V2/AttributeValue.php#L57-L63
train
googleapis/google-cloud-php
Language/src/V1/AnnotateTextResponse.php
AnnotateTextResponse.setCategories
public function setCategories($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Language\V1\ClassificationCategory::class); $this->categories = $arr; return $this; }
php
public function setCategories($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Language\V1\ClassificationCategory::class); $this->categories = $arr; return $this; }
[ "public", "function", "setCategories", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "ClassificationCategory", "::", "class", ")", ";", "$", "this", "->", "categories", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Categories identified in the input document. Generated from protobuf field <code>repeated .google.cloud.language.v1.ClassificationCategory categories = 6;</code> @param \Google\Cloud\Language\V1\ClassificationCategory[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Categories", "identified", "in", "the", "input", "document", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/AnnotateTextResponse.php#L260-L266
train
googleapis/google-cloud-php
Core/src/Batch/BatchTrait.php
BatchTrait.flush
public function flush() { $id = $this->batchRunner ->getJobFromId($this->identifier) ->id(); return $this->batchRunner ->getProcessor() ->flush($id); }
php
public function flush() { $id = $this->batchRunner ->getJobFromId($this->identifier) ->id(); return $this->batchRunner ->getProcessor() ->flush($id); }
[ "public", "function", "flush", "(", ")", "{", "$", "id", "=", "$", "this", "->", "batchRunner", "->", "getJobFromId", "(", "$", "this", "->", "identifier", ")", "->", "id", "(", ")", ";", "return", "$", "this", "->", "batchRunner", "->", "getProcessor", "(", ")", "->", "flush", "(", "$", "id", ")", ";", "}" ]
Flushes items in the batch queue that have yet to be delivered. Please note this will have no effect when using the batch daemon. @return bool
[ "Flushes", "items", "in", "the", "batch", "queue", "that", "have", "yet", "to", "be", "delivered", ".", "Please", "note", "this", "will", "have", "no", "effect", "when", "using", "the", "batch", "daemon", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/BatchTrait.php#L70-L79
train
googleapis/google-cloud-php
Core/src/Batch/BatchTrait.php
BatchTrait.send
public function send(array $items) { $start = microtime(true); try { call_user_func_array($this->getCallback(), [$items]); } catch (\Exception $e) { if ($this->debugOutput) { fwrite( $this->debugOutputResource, $e->getMessage() . PHP_EOL . PHP_EOL . $e->getTraceAsString() . PHP_EOL ); } return false; } $end = microtime(true); if ($this->debugOutput) { fwrite( $this->debugOutputResource, sprintf( '%f seconds for %s: %d items' . PHP_EOL, $end - $start, $this->batchMethod, count($items) ) ); fwrite( $this->debugOutputResource, sprintf( 'memory used: %d' . PHP_EOL, memory_get_usage() ) ); } return true; }
php
public function send(array $items) { $start = microtime(true); try { call_user_func_array($this->getCallback(), [$items]); } catch (\Exception $e) { if ($this->debugOutput) { fwrite( $this->debugOutputResource, $e->getMessage() . PHP_EOL . PHP_EOL . $e->getTraceAsString() . PHP_EOL ); } return false; } $end = microtime(true); if ($this->debugOutput) { fwrite( $this->debugOutputResource, sprintf( '%f seconds for %s: %d items' . PHP_EOL, $end - $start, $this->batchMethod, count($items) ) ); fwrite( $this->debugOutputResource, sprintf( 'memory used: %d' . PHP_EOL, memory_get_usage() ) ); } return true; }
[ "public", "function", "send", "(", "array", "$", "items", ")", "{", "$", "start", "=", "microtime", "(", "true", ")", ";", "try", "{", "call_user_func_array", "(", "$", "this", "->", "getCallback", "(", ")", ",", "[", "$", "items", "]", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", "if", "(", "$", "this", "->", "debugOutput", ")", "{", "fwrite", "(", "$", "this", "->", "debugOutputResource", ",", "$", "e", "->", "getMessage", "(", ")", ".", "PHP_EOL", ".", "PHP_EOL", ".", "$", "e", "->", "getTraceAsString", "(", ")", ".", "PHP_EOL", ")", ";", "}", "return", "false", ";", "}", "$", "end", "=", "microtime", "(", "true", ")", ";", "if", "(", "$", "this", "->", "debugOutput", ")", "{", "fwrite", "(", "$", "this", "->", "debugOutputResource", ",", "sprintf", "(", "'%f seconds for %s: %d items'", ".", "PHP_EOL", ",", "$", "end", "-", "$", "start", ",", "$", "this", "->", "batchMethod", ",", "count", "(", "$", "items", ")", ")", ")", ";", "fwrite", "(", "$", "this", "->", "debugOutputResource", ",", "sprintf", "(", "'memory used: %d'", ".", "PHP_EOL", ",", "memory_get_usage", "(", ")", ")", ")", ";", "}", "return", "true", ";", "}" ]
Deliver a list of items in a batch call. @param array $items @return bool @access private
[ "Deliver", "a", "list", "of", "items", "in", "a", "batch", "call", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/BatchTrait.php#L88-L125
train
googleapis/google-cloud-php
Speech/src/V1/StreamingRecognizeResponse.php
StreamingRecognizeResponse.setSpeechEventType
public function setSpeechEventType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1\StreamingRecognizeResponse_SpeechEventType::class); $this->speech_event_type = $var; return $this; }
php
public function setSpeechEventType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1\StreamingRecognizeResponse_SpeechEventType::class); $this->speech_event_type = $var; return $this; }
[ "public", "function", "setSpeechEventType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Speech", "\\", "V1", "\\", "StreamingRecognizeResponse_SpeechEventType", "::", "class", ")", ";", "$", "this", "->", "speech_event_type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Output only. Indicates the type of speech event. Generated from protobuf field <code>.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4;</code> @param int $var @return $this
[ "Output", "only", ".", "Indicates", "the", "type", "of", "speech", "event", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Speech/src/V1/StreamingRecognizeResponse.php#L177-L183
train
googleapis/google-cloud-php
Asset/src/V1beta1/Gapic/AssetServiceGapicClient.php
AssetServiceGapicClient.batchGetAssetsHistory
public function batchGetAssetsHistory($parent, $contentType, $readTimeWindow, array $optionalArgs = []) { $request = new BatchGetAssetsHistoryRequest(); $request->setParent($parent); $request->setContentType($contentType); $request->setReadTimeWindow($readTimeWindow); if (isset($optionalArgs['assetNames'])) { $request->setAssetNames($optionalArgs['assetNames']); } $requestParams = new RequestParamsHeaderDescriptor([ 'parent' => $request->getParent(), ]); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall( 'BatchGetAssetsHistory', BatchGetAssetsHistoryResponse::class, $optionalArgs, $request )->wait(); }
php
public function batchGetAssetsHistory($parent, $contentType, $readTimeWindow, array $optionalArgs = []) { $request = new BatchGetAssetsHistoryRequest(); $request->setParent($parent); $request->setContentType($contentType); $request->setReadTimeWindow($readTimeWindow); if (isset($optionalArgs['assetNames'])) { $request->setAssetNames($optionalArgs['assetNames']); } $requestParams = new RequestParamsHeaderDescriptor([ 'parent' => $request->getParent(), ]); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall( 'BatchGetAssetsHistory', BatchGetAssetsHistoryResponse::class, $optionalArgs, $request )->wait(); }
[ "public", "function", "batchGetAssetsHistory", "(", "$", "parent", ",", "$", "contentType", ",", "$", "readTimeWindow", ",", "array", "$", "optionalArgs", "=", "[", "]", ")", "{", "$", "request", "=", "new", "BatchGetAssetsHistoryRequest", "(", ")", ";", "$", "request", "->", "setParent", "(", "$", "parent", ")", ";", "$", "request", "->", "setContentType", "(", "$", "contentType", ")", ";", "$", "request", "->", "setReadTimeWindow", "(", "$", "readTimeWindow", ")", ";", "if", "(", "isset", "(", "$", "optionalArgs", "[", "'assetNames'", "]", ")", ")", "{", "$", "request", "->", "setAssetNames", "(", "$", "optionalArgs", "[", "'assetNames'", "]", ")", ";", "}", "$", "requestParams", "=", "new", "RequestParamsHeaderDescriptor", "(", "[", "'parent'", "=>", "$", "request", "->", "getParent", "(", ")", ",", "]", ")", ";", "$", "optionalArgs", "[", "'headers'", "]", "=", "isset", "(", "$", "optionalArgs", "[", "'headers'", "]", ")", "?", "array_merge", "(", "$", "requestParams", "->", "getHeader", "(", ")", ",", "$", "optionalArgs", "[", "'headers'", "]", ")", ":", "$", "requestParams", "->", "getHeader", "(", ")", ";", "return", "$", "this", "->", "startCall", "(", "'BatchGetAssetsHistory'", ",", "BatchGetAssetsHistoryResponse", "::", "class", ",", "$", "optionalArgs", ",", "$", "request", ")", "->", "wait", "(", ")", ";", "}" ]
Batch gets the update history of assets that overlap a time window. For RESOURCE content, this API outputs history with asset in both non-delete or deleted status. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Sample code: ``` $assetServiceClient = new AssetServiceClient(); try { $formattedParent = $assetServiceClient->projectName('[PROJECT]'); $contentType = ContentType::CONTENT_TYPE_UNSPECIFIED; $readTimeWindow = new TimeWindow(); $response = $assetServiceClient->batchGetAssetsHistory($formattedParent, $contentType, $readTimeWindow); } finally { $assetServiceClient->close(); } ``` @param string $parent Required. The relative name of the root asset. It can only be an organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id")", or a project number (such as "projects/12345"). @param int $contentType Required. The content type. For allowed values, use constants defined on {@see \Google\Cloud\Asset\V1beta1\ContentType} @param TimeWindow $readTimeWindow Optional. The time window for the asset history. Both start_time and end_time are optional and if set, it must be after 2018-10-02 UTC. If end_time is not set, it is default to current timestamp. If start_time is not set, the snapshot of the assets at end_time will be returned. The returned results contain all temporal assets whose time window overlap with read_time_window. @param array $optionalArgs { Optional. @type string[] $assetNames A list of the full names of the assets. For example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more info. The request becomes a no-op if the asset name list is empty, and the max size of the asset name list is 100 in one request. @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\Cloud\Asset\V1beta1\BatchGetAssetsHistoryResponse @throws ApiException if the remote call fails @experimental
[ "Batch", "gets", "the", "update", "history", "of", "assets", "that", "overlap", "a", "time", "window", ".", "For", "RESOURCE", "content", "this", "API", "outputs", "history", "with", "asset", "in", "both", "non", "-", "delete", "or", "deleted", "status", ".", "For", "IAM_POLICY", "content", "this", "API", "outputs", "history", "when", "the", "asset", "and", "its", "attached", "IAM", "POLICY", "both", "exist", ".", "This", "can", "create", "gaps", "in", "the", "output", "history", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Asset/src/V1beta1/Gapic/AssetServiceGapicClient.php#L495-L518
train
googleapis/google-cloud-php
PubSub/src/ResourceNameTrait.php
ResourceNameTrait.pluckName
private function pluckName($type, $name) { if (!isset($this->regexes[$type])) { throw new InvalidArgumentException(sprintf( 'Regex `%s` is not defined', $type )); } $matches = []; $res = preg_match($this->regexes[$type], $name, $matches); return ($res === 1) ? $matches[1] : null; }
php
private function pluckName($type, $name) { if (!isset($this->regexes[$type])) { throw new InvalidArgumentException(sprintf( 'Regex `%s` is not defined', $type )); } $matches = []; $res = preg_match($this->regexes[$type], $name, $matches); return ($res === 1) ? $matches[1] : null; }
[ "private", "function", "pluckName", "(", "$", "type", ",", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "regexes", "[", "$", "type", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'Regex `%s` is not defined'", ",", "$", "type", ")", ")", ";", "}", "$", "matches", "=", "[", "]", ";", "$", "res", "=", "preg_match", "(", "$", "this", "->", "regexes", "[", "$", "type", "]", ",", "$", "name", ",", "$", "matches", ")", ";", "return", "(", "$", "res", "===", "1", ")", "?", "$", "matches", "[", "1", "]", ":", "null", ";", "}" ]
Convert a fully-qualified name into a simple name. Example: ``` $topic = $pubsub->topic('projects/my-awesome-project/topics/my-topic-name'); echo $topic->pluckName('topic', $name); // `my-topic-name` ``` @param string $name @return string @throws \InvalidArgumentException
[ "Convert", "a", "fully", "-", "qualified", "name", "into", "a", "simple", "name", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/ResourceNameTrait.php#L60-L72
train
googleapis/google-cloud-php
PubSub/src/ResourceNameTrait.php
ResourceNameTrait.formatName
private function formatName($type, $name, $projectId = null) { if (!isset($this->templates[$type])) { throw new InvalidArgumentException(sprintf( 'Template `%s` is not defined', $type )); } return vsprintf($this->templates[$type], [$name, $projectId]); }
php
private function formatName($type, $name, $projectId = null) { if (!isset($this->templates[$type])) { throw new InvalidArgumentException(sprintf( 'Template `%s` is not defined', $type )); } return vsprintf($this->templates[$type], [$name, $projectId]); }
[ "private", "function", "formatName", "(", "$", "type", ",", "$", "name", ",", "$", "projectId", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "templates", "[", "$", "type", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'Template `%s` is not defined'", ",", "$", "type", ")", ")", ";", "}", "return", "vsprintf", "(", "$", "this", "->", "templates", "[", "$", "type", "]", ",", "[", "$", "name", ",", "$", "projectId", "]", ")", ";", "}" ]
Convert a simple name into the fully-qualified name required by the API. Example: ``` $topic = $pubsub->topic('my-topic-name'); echo $topic->formatName('topic', $name); // `projects/my-awesome-project/topics/my-topic-name` ``` @param string $type @param string $name @param string $projectId [optional] @return string @throws \InvalidArgumentException
[ "Convert", "a", "simple", "name", "into", "the", "fully", "-", "qualified", "name", "required", "by", "the", "API", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/ResourceNameTrait.php#L90-L100
train
googleapis/google-cloud-php
PubSub/src/ResourceNameTrait.php
ResourceNameTrait.isFullyQualifiedName
private function isFullyQualifiedName($type, $name) { if (!isset($this->regexes[$type])) { throw new InvalidArgumentException(sprintf( 'Regex `%s` is not defined', $type )); } return (preg_match($this->regexes[$type], $name) === 1); }
php
private function isFullyQualifiedName($type, $name) { if (!isset($this->regexes[$type])) { throw new InvalidArgumentException(sprintf( 'Regex `%s` is not defined', $type )); } return (preg_match($this->regexes[$type], $name) === 1); }
[ "private", "function", "isFullyQualifiedName", "(", "$", "type", ",", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "regexes", "[", "$", "type", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'Regex `%s` is not defined'", ",", "$", "type", ")", ")", ";", "}", "return", "(", "preg_match", "(", "$", "this", "->", "regexes", "[", "$", "type", "]", ",", "$", "name", ")", "===", "1", ")", ";", "}" ]
Check if a name of a give type is a fully-qualified resource name. Example: ``` $topic = $pubsub->topic('my-topic-name'); if ($topic->isFullyQualifiedName('project', 'projects/my-awesome-project/topics/my-topic-name')) { // do stuff } ``` @param string $type @param string $name @return bool @throws \InvalidArgumentException
[ "Check", "if", "a", "name", "of", "a", "give", "type", "is", "a", "fully", "-", "qualified", "resource", "name", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/ResourceNameTrait.php#L118-L127
train
googleapis/google-cloud-php
Trace/src/V2/Span/Links.php
Links.setLink
public function setLink($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Trace\V2\Span\Link::class); $this->link = $arr; return $this; }
php
public function setLink($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Trace\V2\Span\Link::class); $this->link = $arr; return $this; }
[ "public", "function", "setLink", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Trace", "\\", "V2", "\\", "Span", "\\", "Link", "::", "class", ")", ";", "$", "this", "->", "link", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
A collection of links. Generated from protobuf field <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code> @param \Google\Cloud\Trace\V2\Span\Link[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "A", "collection", "of", "links", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Trace/src/V2/Span/Links.php#L69-L75
train
googleapis/google-cloud-php
Monitoring/src/V3/ListGroupsResponse.php
ListGroupsResponse.setGroup
public function setGroup($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Group::class); $this->group = $arr; return $this; }
php
public function setGroup($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Group::class); $this->group = $arr; return $this; }
[ "public", "function", "setGroup", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Monitoring", "\\", "V3", "\\", "Group", "::", "class", ")", ";", "$", "this", "->", "group", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The groups that match the specified filters. Generated from protobuf field <code>repeated .google.monitoring.v3.Group group = 1;</code> @param \Google\Cloud\Monitoring\V3\Group[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "groups", "that", "match", "the", "specified", "filters", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Monitoring/src/V3/ListGroupsResponse.php#L70-L76
train
googleapis/google-cloud-php
Core/src/GeoPoint.php
GeoPoint.validateValue
private function validateValue($value, $type, $allowNull = false) { if (!is_numeric($value) && (!$allowNull || ($allowNull && $value !== null))) { throw new InvalidArgumentException(sprintf( 'Given %s must be a numeric value.', $type )); } return $allowNull && $value === null ? $value : (float) $value; }
php
private function validateValue($value, $type, $allowNull = false) { if (!is_numeric($value) && (!$allowNull || ($allowNull && $value !== null))) { throw new InvalidArgumentException(sprintf( 'Given %s must be a numeric value.', $type )); } return $allowNull && $value === null ? $value : (float) $value; }
[ "private", "function", "validateValue", "(", "$", "value", ",", "$", "type", ",", "$", "allowNull", "=", "false", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "value", ")", "&&", "(", "!", "$", "allowNull", "||", "(", "$", "allowNull", "&&", "$", "value", "!==", "null", ")", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'Given %s must be a numeric value.'", ",", "$", "type", ")", ")", ";", "}", "return", "$", "allowNull", "&&", "$", "value", "===", "null", "?", "$", "value", ":", "(", "float", ")", "$", "value", ";", "}" ]
Check a given value's validity as a coordinate. Numeric values will be cast to type `float`. All other values will raise an exception with the exception of `null`, if `$allowNull` is set to true. @param mixed $value The coordinate value. @param string $type The coordinate type for error reporting. @param bool $allowNull [optional] Whether null values should be allowed. **Defaults to** `false`. @return float|null
[ "Check", "a", "given", "value", "s", "validity", "as", "a", "coordinate", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/GeoPoint.php#L194-L206
train
googleapis/google-cloud-php
BigQuery/src/ValueMapper.php
ValueMapper.fromBigQuery
public function fromBigQuery(array $value, array $schema) { $value = $value['v']; if (isset($schema['mode'])) { if ($schema['mode'] === 'REPEATED') { return $this->repeatedValueFromBigQuery($value, $schema); } if ($schema['mode'] === 'NULLABLE' && $value === null) { return $value; } } switch ($schema['type']) { case self::TYPE_BOOLEAN: return $value === 'true'; case self::TYPE_INTEGER: return $this->returnInt64AsObject ? new Int64($value) : (int) $value; case self::TYPE_FLOAT: return (float) $value; case self::TYPE_NUMERIC: return new Numeric($value); case self::TYPE_STRING: return (string) $value; case self::TYPE_BYTES: return new Bytes(base64_decode($value)); case self::TYPE_DATE: return new Date(new \DateTime($value)); case self::TYPE_DATETIME: return new \DateTime($value); case self::TYPE_TIME: return new Time(new \DateTime($value)); case self::TYPE_TIMESTAMP: return $this->timestampFromBigQuery($value); case self::TYPE_RECORD: return $this->recordFromBigQuery($value, $schema['fields']); default: throw new \InvalidArgumentException(sprintf( 'Unrecognized value type %s. Please ensure you are using the latest version of google/cloud.', $schema['type'] )); break; } }
php
public function fromBigQuery(array $value, array $schema) { $value = $value['v']; if (isset($schema['mode'])) { if ($schema['mode'] === 'REPEATED') { return $this->repeatedValueFromBigQuery($value, $schema); } if ($schema['mode'] === 'NULLABLE' && $value === null) { return $value; } } switch ($schema['type']) { case self::TYPE_BOOLEAN: return $value === 'true'; case self::TYPE_INTEGER: return $this->returnInt64AsObject ? new Int64($value) : (int) $value; case self::TYPE_FLOAT: return (float) $value; case self::TYPE_NUMERIC: return new Numeric($value); case self::TYPE_STRING: return (string) $value; case self::TYPE_BYTES: return new Bytes(base64_decode($value)); case self::TYPE_DATE: return new Date(new \DateTime($value)); case self::TYPE_DATETIME: return new \DateTime($value); case self::TYPE_TIME: return new Time(new \DateTime($value)); case self::TYPE_TIMESTAMP: return $this->timestampFromBigQuery($value); case self::TYPE_RECORD: return $this->recordFromBigQuery($value, $schema['fields']); default: throw new \InvalidArgumentException(sprintf( 'Unrecognized value type %s. Please ensure you are using the latest version of google/cloud.', $schema['type'] )); break; } }
[ "public", "function", "fromBigQuery", "(", "array", "$", "value", ",", "array", "$", "schema", ")", "{", "$", "value", "=", "$", "value", "[", "'v'", "]", ";", "if", "(", "isset", "(", "$", "schema", "[", "'mode'", "]", ")", ")", "{", "if", "(", "$", "schema", "[", "'mode'", "]", "===", "'REPEATED'", ")", "{", "return", "$", "this", "->", "repeatedValueFromBigQuery", "(", "$", "value", ",", "$", "schema", ")", ";", "}", "if", "(", "$", "schema", "[", "'mode'", "]", "===", "'NULLABLE'", "&&", "$", "value", "===", "null", ")", "{", "return", "$", "value", ";", "}", "}", "switch", "(", "$", "schema", "[", "'type'", "]", ")", "{", "case", "self", "::", "TYPE_BOOLEAN", ":", "return", "$", "value", "===", "'true'", ";", "case", "self", "::", "TYPE_INTEGER", ":", "return", "$", "this", "->", "returnInt64AsObject", "?", "new", "Int64", "(", "$", "value", ")", ":", "(", "int", ")", "$", "value", ";", "case", "self", "::", "TYPE_FLOAT", ":", "return", "(", "float", ")", "$", "value", ";", "case", "self", "::", "TYPE_NUMERIC", ":", "return", "new", "Numeric", "(", "$", "value", ")", ";", "case", "self", "::", "TYPE_STRING", ":", "return", "(", "string", ")", "$", "value", ";", "case", "self", "::", "TYPE_BYTES", ":", "return", "new", "Bytes", "(", "base64_decode", "(", "$", "value", ")", ")", ";", "case", "self", "::", "TYPE_DATE", ":", "return", "new", "Date", "(", "new", "\\", "DateTime", "(", "$", "value", ")", ")", ";", "case", "self", "::", "TYPE_DATETIME", ":", "return", "new", "\\", "DateTime", "(", "$", "value", ")", ";", "case", "self", "::", "TYPE_TIME", ":", "return", "new", "Time", "(", "new", "\\", "DateTime", "(", "$", "value", ")", ")", ";", "case", "self", "::", "TYPE_TIMESTAMP", ":", "return", "$", "this", "->", "timestampFromBigQuery", "(", "$", "value", ")", ";", "case", "self", "::", "TYPE_RECORD", ":", "return", "$", "this", "->", "recordFromBigQuery", "(", "$", "value", ",", "$", "schema", "[", "'fields'", "]", ")", ";", "default", ":", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Unrecognized value type %s. Please ensure you are using the latest version of google/cloud.'", ",", "$", "schema", "[", "'type'", "]", ")", ")", ";", "break", ";", "}", "}" ]
Maps a value coming from BigQuery to the expected format for use in the library. @param array $value The value to map. @param array $schema The schema describing the value. @throws \InvalidArgumentException
[ "Maps", "a", "value", "coming", "from", "BigQuery", "to", "the", "expected", "format", "for", "use", "in", "the", "library", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQuery/src/ValueMapper.php#L76-L123
train
googleapis/google-cloud-php
BigQuery/src/ValueMapper.php
ValueMapper.toBigQuery
public function toBigQuery($value) { if ($value instanceof ValueInterface || $value instanceof Int64) { return (string) $value; } if ($value instanceof \DateTime) { return $value->format(self::DATETIME_FORMAT_INSERT); } if (is_array($value)) { foreach ($value as $key => $item) { $value[$key] = $this->toBigQuery($item); } return $value; } return $value; }
php
public function toBigQuery($value) { if ($value instanceof ValueInterface || $value instanceof Int64) { return (string) $value; } if ($value instanceof \DateTime) { return $value->format(self::DATETIME_FORMAT_INSERT); } if (is_array($value)) { foreach ($value as $key => $item) { $value[$key] = $this->toBigQuery($item); } return $value; } return $value; }
[ "public", "function", "toBigQuery", "(", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "ValueInterface", "||", "$", "value", "instanceof", "Int64", ")", "{", "return", "(", "string", ")", "$", "value", ";", "}", "if", "(", "$", "value", "instanceof", "\\", "DateTime", ")", "{", "return", "$", "value", "->", "format", "(", "self", "::", "DATETIME_FORMAT_INSERT", ")", ";", "}", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "foreach", "(", "$", "value", "as", "$", "key", "=>", "$", "item", ")", "{", "$", "value", "[", "$", "key", "]", "=", "$", "this", "->", "toBigQuery", "(", "$", "item", ")", ";", "}", "return", "$", "value", ";", "}", "return", "$", "value", ";", "}" ]
Maps a user provided value to the expected BigQuery format. @param mixed $value The value to map. @return mixed
[ "Maps", "a", "user", "provided", "value", "to", "the", "expected", "BigQuery", "format", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQuery/src/ValueMapper.php#L131-L150
train
googleapis/google-cloud-php
BigQuery/src/ValueMapper.php
ValueMapper.toParameter
public function toParameter($value) { $pValue = ['value' => $value]; $type = gettype($value); switch ($type) { case 'boolean': $pType['type'] = self::TYPE_BOOL; break; case 'integer': $pType['type'] = self::TYPE_INT64; break; case 'double': $pType['type'] = self::TYPE_FLOAT64; break; case 'string': $pType['type'] = self::TYPE_STRING; break; case 'resource': $pType['type'] = self::TYPE_BYTES; $pValue['value'] = base64_encode(stream_get_contents($value)); break; case 'object': list($pType, $pValue) = $this->objectToParameter($value); break; case 'array': list($pType, $pValue) = $this->isAssoc($value) ? $this->assocArrayToParameter($value) : $this->arrayToParameter($value); break; default: throw new \InvalidArgumentException(sprintf( 'Unrecognized value type %s. Please ensure you are using the latest version of google/cloud.', $type )); break; } return [ 'parameterType' => $pType, 'parameterValue' => $pValue ]; }
php
public function toParameter($value) { $pValue = ['value' => $value]; $type = gettype($value); switch ($type) { case 'boolean': $pType['type'] = self::TYPE_BOOL; break; case 'integer': $pType['type'] = self::TYPE_INT64; break; case 'double': $pType['type'] = self::TYPE_FLOAT64; break; case 'string': $pType['type'] = self::TYPE_STRING; break; case 'resource': $pType['type'] = self::TYPE_BYTES; $pValue['value'] = base64_encode(stream_get_contents($value)); break; case 'object': list($pType, $pValue) = $this->objectToParameter($value); break; case 'array': list($pType, $pValue) = $this->isAssoc($value) ? $this->assocArrayToParameter($value) : $this->arrayToParameter($value); break; default: throw new \InvalidArgumentException(sprintf( 'Unrecognized value type %s. Please ensure you are using the latest version of google/cloud.', $type )); break; } return [ 'parameterType' => $pType, 'parameterValue' => $pValue ]; }
[ "public", "function", "toParameter", "(", "$", "value", ")", "{", "$", "pValue", "=", "[", "'value'", "=>", "$", "value", "]", ";", "$", "type", "=", "gettype", "(", "$", "value", ")", ";", "switch", "(", "$", "type", ")", "{", "case", "'boolean'", ":", "$", "pType", "[", "'type'", "]", "=", "self", "::", "TYPE_BOOL", ";", "break", ";", "case", "'integer'", ":", "$", "pType", "[", "'type'", "]", "=", "self", "::", "TYPE_INT64", ";", "break", ";", "case", "'double'", ":", "$", "pType", "[", "'type'", "]", "=", "self", "::", "TYPE_FLOAT64", ";", "break", ";", "case", "'string'", ":", "$", "pType", "[", "'type'", "]", "=", "self", "::", "TYPE_STRING", ";", "break", ";", "case", "'resource'", ":", "$", "pType", "[", "'type'", "]", "=", "self", "::", "TYPE_BYTES", ";", "$", "pValue", "[", "'value'", "]", "=", "base64_encode", "(", "stream_get_contents", "(", "$", "value", ")", ")", ";", "break", ";", "case", "'object'", ":", "list", "(", "$", "pType", ",", "$", "pValue", ")", "=", "$", "this", "->", "objectToParameter", "(", "$", "value", ")", ";", "break", ";", "case", "'array'", ":", "list", "(", "$", "pType", ",", "$", "pValue", ")", "=", "$", "this", "->", "isAssoc", "(", "$", "value", ")", "?", "$", "this", "->", "assocArrayToParameter", "(", "$", "value", ")", ":", "$", "this", "->", "arrayToParameter", "(", "$", "value", ")", ";", "break", ";", "default", ":", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Unrecognized value type %s. Please ensure you are using the latest version of google/cloud.'", ",", "$", "type", ")", ")", ";", "break", ";", "}", "return", "[", "'parameterType'", "=>", "$", "pType", ",", "'parameterValue'", "=>", "$", "pValue", "]", ";", "}" ]
Maps a value to the expected parameter format. @param mixed $value The value to map. @return array @throws \InvalidArgumentException
[ "Maps", "a", "value", "to", "the", "expected", "parameter", "format", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQuery/src/ValueMapper.php#L159-L209
train
googleapis/google-cloud-php
Language/src/V1/PartOfSpeech.php
PartOfSpeech.setAspect
public function setAspect($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Aspect::class); $this->aspect = $var; return $this; }
php
public function setAspect($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Aspect::class); $this->aspect = $var; return $this; }
[ "public", "function", "setAspect", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "PartOfSpeech_Aspect", "::", "class", ")", ";", "$", "this", "->", "aspect", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The grammatical aspect. Generated from protobuf field <code>.google.cloud.language.v1.PartOfSpeech.Aspect aspect = 2;</code> @param int $var @return $this
[ "The", "grammatical", "aspect", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/PartOfSpeech.php#L174-L180
train
googleapis/google-cloud-php
Language/src/V1/PartOfSpeech.php
PartOfSpeech.setMood
public function setMood($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Mood::class); $this->mood = $var; return $this; }
php
public function setMood($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Mood::class); $this->mood = $var; return $this; }
[ "public", "function", "setMood", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "PartOfSpeech_Mood", "::", "class", ")", ";", "$", "this", "->", "mood", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The grammatical mood. Generated from protobuf field <code>.google.cloud.language.v1.PartOfSpeech.Mood mood = 6;</code> @param int $var @return $this
[ "The", "grammatical", "mood", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/PartOfSpeech.php#L278-L284
train
googleapis/google-cloud-php
Language/src/V1/PartOfSpeech.php
PartOfSpeech.setPerson
public function setPerson($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Person::class); $this->person = $var; return $this; }
php
public function setPerson($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Person::class); $this->person = $var; return $this; }
[ "public", "function", "setPerson", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "PartOfSpeech_Person", "::", "class", ")", ";", "$", "this", "->", "person", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The grammatical person. Generated from protobuf field <code>.google.cloud.language.v1.PartOfSpeech.Person person = 8;</code> @param int $var @return $this
[ "The", "grammatical", "person", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/PartOfSpeech.php#L330-L336
train
googleapis/google-cloud-php
Language/src/V1/PartOfSpeech.php
PartOfSpeech.setReciprocity
public function setReciprocity($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Reciprocity::class); $this->reciprocity = $var; return $this; }
php
public function setReciprocity($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Reciprocity::class); $this->reciprocity = $var; return $this; }
[ "public", "function", "setReciprocity", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "PartOfSpeech_Reciprocity", "::", "class", ")", ";", "$", "this", "->", "reciprocity", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The grammatical reciprocity. Generated from protobuf field <code>.google.cloud.language.v1.PartOfSpeech.Reciprocity reciprocity = 10;</code> @param int $var @return $this
[ "The", "grammatical", "reciprocity", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/PartOfSpeech.php#L382-L388
train
googleapis/google-cloud-php
Language/src/V1/PartOfSpeech.php
PartOfSpeech.setTense
public function setTense($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Tense::class); $this->tense = $var; return $this; }
php
public function setTense($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Tense::class); $this->tense = $var; return $this; }
[ "public", "function", "setTense", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "PartOfSpeech_Tense", "::", "class", ")", ";", "$", "this", "->", "tense", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The grammatical tense. Generated from protobuf field <code>.google.cloud.language.v1.PartOfSpeech.Tense tense = 11;</code> @param int $var @return $this
[ "The", "grammatical", "tense", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/PartOfSpeech.php#L408-L414
train
googleapis/google-cloud-php
Language/src/V1/PartOfSpeech.php
PartOfSpeech.setVoice
public function setVoice($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Voice::class); $this->voice = $var; return $this; }
php
public function setVoice($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\PartOfSpeech_Voice::class); $this->voice = $var; return $this; }
[ "public", "function", "setVoice", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "PartOfSpeech_Voice", "::", "class", ")", ";", "$", "this", "->", "voice", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The grammatical voice. Generated from protobuf field <code>.google.cloud.language.v1.PartOfSpeech.Voice voice = 12;</code> @param int $var @return $this
[ "The", "grammatical", "voice", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/PartOfSpeech.php#L434-L440
train
googleapis/google-cloud-php
TextToSpeech/src/V1/Voice.php
Voice.setSsmlGender
public function setSsmlGender($var) { GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); $this->ssml_gender = $var; return $this; }
php
public function setSsmlGender($var) { GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\SsmlVoiceGender::class); $this->ssml_gender = $var; return $this; }
[ "public", "function", "setSsmlGender", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "TextToSpeech", "\\", "V1", "\\", "SsmlVoiceGender", "::", "class", ")", ";", "$", "this", "->", "ssml_gender", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The gender of this voice. Generated from protobuf field <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code> @param int $var @return $this
[ "The", "gender", "of", "this", "voice", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/TextToSpeech/src/V1/Voice.php#L142-L148
train
googleapis/google-cloud-php
Core/src/Batch/Retry.php
Retry.retryAll
public function retryAll() { foreach ($this->getFailedFiles() as $file) { // Rename the file first $tmpFile = dirname($file) . '/retrying-' . basename($file); rename($file, $tmpFile); $fp = @fopen($tmpFile, 'r'); if ($fp === false) { fwrite( STDERR, sprintf('Could not open the file: %s' . PHP_EOL, $tmpFile) ); continue; } while ($line = fgets($fp)) { $a = unserialize($line); $idNum = key($a); $job = $this->runner->getJobFromIdNum($idNum); if (! $job->callFunc($a[$idNum])) { $this->handleFailure($idNum, $a[$idNum]); } } @fclose($fp); @unlink($tmpFile); } }
php
public function retryAll() { foreach ($this->getFailedFiles() as $file) { // Rename the file first $tmpFile = dirname($file) . '/retrying-' . basename($file); rename($file, $tmpFile); $fp = @fopen($tmpFile, 'r'); if ($fp === false) { fwrite( STDERR, sprintf('Could not open the file: %s' . PHP_EOL, $tmpFile) ); continue; } while ($line = fgets($fp)) { $a = unserialize($line); $idNum = key($a); $job = $this->runner->getJobFromIdNum($idNum); if (! $job->callFunc($a[$idNum])) { $this->handleFailure($idNum, $a[$idNum]); } } @fclose($fp); @unlink($tmpFile); } }
[ "public", "function", "retryAll", "(", ")", "{", "foreach", "(", "$", "this", "->", "getFailedFiles", "(", ")", "as", "$", "file", ")", "{", "// Rename the file first", "$", "tmpFile", "=", "dirname", "(", "$", "file", ")", ".", "'/retrying-'", ".", "basename", "(", "$", "file", ")", ";", "rename", "(", "$", "file", ",", "$", "tmpFile", ")", ";", "$", "fp", "=", "@", "fopen", "(", "$", "tmpFile", ",", "'r'", ")", ";", "if", "(", "$", "fp", "===", "false", ")", "{", "fwrite", "(", "STDERR", ",", "sprintf", "(", "'Could not open the file: %s'", ".", "PHP_EOL", ",", "$", "tmpFile", ")", ")", ";", "continue", ";", "}", "while", "(", "$", "line", "=", "fgets", "(", "$", "fp", ")", ")", "{", "$", "a", "=", "unserialize", "(", "$", "line", ")", ";", "$", "idNum", "=", "key", "(", "$", "a", ")", ";", "$", "job", "=", "$", "this", "->", "runner", "->", "getJobFromIdNum", "(", "$", "idNum", ")", ";", "if", "(", "!", "$", "job", "->", "callFunc", "(", "$", "a", "[", "$", "idNum", "]", ")", ")", "{", "$", "this", "->", "handleFailure", "(", "$", "idNum", ",", "$", "a", "[", "$", "idNum", "]", ")", ";", "}", "}", "@", "fclose", "(", "$", "fp", ")", ";", "@", "unlink", "(", "$", "tmpFile", ")", ";", "}", "}" ]
Retry all the failed items.
[ "Retry", "all", "the", "failed", "items", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/Retry.php#L49-L75
train
googleapis/google-cloud-php
Firestore/src/V1beta1/TransactionOptions.php
TransactionOptions.setReadOnly
public function setReadOnly($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions_ReadOnly::class); $this->writeOneof(2, $var); return $this; }
php
public function setReadOnly($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions_ReadOnly::class); $this->writeOneof(2, $var); return $this; }
[ "public", "function", "setReadOnly", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Firestore", "\\", "V1beta1", "\\", "TransactionOptions_ReadOnly", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "2", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
The transaction can only be used for read operations. Generated from protobuf field <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code> @param \Google\Cloud\Firestore\V1beta1\TransactionOptions\ReadOnly $var @return $this
[ "The", "transaction", "can", "only", "be", "used", "for", "read", "operations", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1beta1/TransactionOptions.php#L55-L61
train
googleapis/google-cloud-php
Firestore/src/V1beta1/TransactionOptions.php
TransactionOptions.setReadWrite
public function setReadWrite($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions_ReadWrite::class); $this->writeOneof(3, $var); return $this; }
php
public function setReadWrite($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\TransactionOptions_ReadWrite::class); $this->writeOneof(3, $var); return $this; }
[ "public", "function", "setReadWrite", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Firestore", "\\", "V1beta1", "\\", "TransactionOptions_ReadWrite", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "3", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
The transaction can be used for both read and write operations. Generated from protobuf field <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code> @param \Google\Cloud\Firestore\V1beta1\TransactionOptions\ReadWrite $var @return $this
[ "The", "transaction", "can", "be", "used", "for", "both", "read", "and", "write", "operations", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1beta1/TransactionOptions.php#L81-L87
train
googleapis/google-cloud-php
Monitoring/src/V3/Gapic/AlertPolicyServiceGapicClient.php
AlertPolicyServiceGapicClient.alertPolicyConditionName
public static function alertPolicyConditionName($project, $alertPolicy, $condition) { return self::getAlertPolicyConditionNameTemplate()->render([ 'project' => $project, 'alert_policy' => $alertPolicy, 'condition' => $condition, ]); }
php
public static function alertPolicyConditionName($project, $alertPolicy, $condition) { return self::getAlertPolicyConditionNameTemplate()->render([ 'project' => $project, 'alert_policy' => $alertPolicy, 'condition' => $condition, ]); }
[ "public", "static", "function", "alertPolicyConditionName", "(", "$", "project", ",", "$", "alertPolicy", ",", "$", "condition", ")", "{", "return", "self", "::", "getAlertPolicyConditionNameTemplate", "(", ")", "->", "render", "(", "[", "'project'", "=>", "$", "project", ",", "'alert_policy'", "=>", "$", "alertPolicy", ",", "'condition'", "=>", "$", "condition", ",", "]", ")", ";", "}" ]
Formats a string containing the fully-qualified path to represent a alert_policy_condition resource. @param string $project @param string $alertPolicy @param string $condition @return string The formatted alert_policy_condition resource. @experimental
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "alert_policy_condition", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Monitoring/src/V3/Gapic/AlertPolicyServiceGapicClient.php#L220-L227
train
googleapis/google-cloud-php
WebRisk/src/V1beta1/SearchUrisRequest.php
SearchUrisRequest.setThreatTypes
public function setThreatTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\WebRisk\V1beta1\ThreatType::class); $this->threat_types = $arr; return $this; }
php
public function setThreatTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\WebRisk\V1beta1\ThreatType::class); $this->threat_types = $arr; return $this; }
[ "public", "function", "setThreatTypes", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "ENUM", ",", "\\", "Google", "\\", "Cloud", "\\", "WebRisk", "\\", "V1beta1", "\\", "ThreatType", "::", "class", ")", ";", "$", "this", "->", "threat_types", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Required. The ThreatLists to search in. Generated from protobuf field <code>repeated .google.cloud.webrisk.v1beta1.ThreatType threat_types = 2;</code> @param int[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Required", ".", "The", "ThreatLists", "to", "search", "in", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/WebRisk/src/V1beta1/SearchUrisRequest.php#L92-L98
train
googleapis/google-cloud-php
Datastore/src/V1/ReadOptions.php
ReadOptions.setReadConsistency
public function setReadConsistency($var) { GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\ReadOptions_ReadConsistency::class); $this->writeOneof(1, $var); return $this; }
php
public function setReadConsistency($var) { GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\ReadOptions_ReadConsistency::class); $this->writeOneof(1, $var); return $this; }
[ "public", "function", "setReadConsistency", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Datastore", "\\", "V1", "\\", "ReadOptions_ReadConsistency", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "1", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
The non-transactional read consistency to use. Cannot be set to `STRONG` for global queries. Generated from protobuf field <code>.google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1;</code> @param int $var @return $this
[ "The", "non", "-", "transactional", "read", "consistency", "to", "use", ".", "Cannot", "be", "set", "to", "STRONG", "for", "global", "queries", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/V1/ReadOptions.php#L60-L66
train
googleapis/google-cloud-php
Dialogflow/src/V2/Intent/Message/CarouselSelect.php
CarouselSelect.setItems
public function setItems($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item::class); $this->items = $arr; return $this; }
php
public function setItems($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item::class); $this->items = $arr; return $this; }
[ "public", "function", "setItems", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Dialogflow", "\\", "V2", "\\", "Intent", "\\", "Message", "\\", "CarouselSelect", "\\", "Item", "::", "class", ")", ";", "$", "this", "->", "items", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Required. Carousel items. Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item items = 1;</code> @param \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Required", ".", "Carousel", "items", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/Intent/Message/CarouselSelect.php#L58-L64
train
googleapis/google-cloud-php
Core/src/Batch/InMemoryConfigStorage.php
InMemoryConfigStorage.submit
public function submit($item, $idNum) { if (!$this->hasShutdownHookRegistered) { register_shutdown_function([$this, 'shutdown']); $this->hasShutdownHookRegistered = true; } if (!array_key_exists($idNum, $this->items)) { $this->items[$idNum] = []; $this->lastInvoked[$idNum] = $this->created; } $this->items[$idNum][] = $item; $job = $this->config->getJobFromIdNum($idNum); $batchSize = $job->getBatchSize(); $period = $job->getCallPeriod(); if ((count($this->items[$idNum]) >= $batchSize) || (count($this->items[$idNum]) !== 0 && microtime(true) > $this->lastInvoked[$idNum] + $period)) { $this->flush($idNum); $this->items[$idNum] = []; $this->lastInvoked[$idNum] = microtime(true); } }
php
public function submit($item, $idNum) { if (!$this->hasShutdownHookRegistered) { register_shutdown_function([$this, 'shutdown']); $this->hasShutdownHookRegistered = true; } if (!array_key_exists($idNum, $this->items)) { $this->items[$idNum] = []; $this->lastInvoked[$idNum] = $this->created; } $this->items[$idNum][] = $item; $job = $this->config->getJobFromIdNum($idNum); $batchSize = $job->getBatchSize(); $period = $job->getCallPeriod(); if ((count($this->items[$idNum]) >= $batchSize) || (count($this->items[$idNum]) !== 0 && microtime(true) > $this->lastInvoked[$idNum] + $period)) { $this->flush($idNum); $this->items[$idNum] = []; $this->lastInvoked[$idNum] = microtime(true); } }
[ "public", "function", "submit", "(", "$", "item", ",", "$", "idNum", ")", "{", "if", "(", "!", "$", "this", "->", "hasShutdownHookRegistered", ")", "{", "register_shutdown_function", "(", "[", "$", "this", ",", "'shutdown'", "]", ")", ";", "$", "this", "->", "hasShutdownHookRegistered", "=", "true", ";", "}", "if", "(", "!", "array_key_exists", "(", "$", "idNum", ",", "$", "this", "->", "items", ")", ")", "{", "$", "this", "->", "items", "[", "$", "idNum", "]", "=", "[", "]", ";", "$", "this", "->", "lastInvoked", "[", "$", "idNum", "]", "=", "$", "this", "->", "created", ";", "}", "$", "this", "->", "items", "[", "$", "idNum", "]", "[", "]", "=", "$", "item", ";", "$", "job", "=", "$", "this", "->", "config", "->", "getJobFromIdNum", "(", "$", "idNum", ")", ";", "$", "batchSize", "=", "$", "job", "->", "getBatchSize", "(", ")", ";", "$", "period", "=", "$", "job", "->", "getCallPeriod", "(", ")", ";", "if", "(", "(", "count", "(", "$", "this", "->", "items", "[", "$", "idNum", "]", ")", ">=", "$", "batchSize", ")", "||", "(", "count", "(", "$", "this", "->", "items", "[", "$", "idNum", "]", ")", "!==", "0", "&&", "microtime", "(", "true", ")", ">", "$", "this", "->", "lastInvoked", "[", "$", "idNum", "]", "+", "$", "period", ")", ")", "{", "$", "this", "->", "flush", "(", "$", "idNum", ")", ";", "$", "this", "->", "items", "[", "$", "idNum", "]", "=", "[", "]", ";", "$", "this", "->", "lastInvoked", "[", "$", "idNum", "]", "=", "microtime", "(", "true", ")", ";", "}", "}" ]
Hold the items in memory and run the job in the same process when it meets the condition. We want to delay registering the shutdown function. The error reporter also registers a shutdown function and the order matters. {@see Google\ErrorReporting\Bootstrap::init()} {@see http://php.net/manual/en/function.register-shutdown-function.php} @param mixed $item An item to submit. @param int $idNum A numeric id for the job. @return void
[ "Hold", "the", "items", "in", "memory", "and", "run", "the", "job", "in", "the", "same", "process", "when", "it", "meets", "the", "condition", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/InMemoryConfigStorage.php#L160-L181
train
googleapis/google-cloud-php
Core/src/Batch/InMemoryConfigStorage.php
InMemoryConfigStorage.flush
public function flush($idNum) { if (isset($this->items[$idNum])) { $job = $this->config->getJobFromIdNum($idNum); if (!$job->flush($this->items[$idNum])) { $this->handleFailure($idNum, $this->items[$idNum]); } $this->items[$idNum] = []; $this->lastInvoked[$idNum] = microtime(true); } return true; }
php
public function flush($idNum) { if (isset($this->items[$idNum])) { $job = $this->config->getJobFromIdNum($idNum); if (!$job->flush($this->items[$idNum])) { $this->handleFailure($idNum, $this->items[$idNum]); } $this->items[$idNum] = []; $this->lastInvoked[$idNum] = microtime(true); } return true; }
[ "public", "function", "flush", "(", "$", "idNum", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "items", "[", "$", "idNum", "]", ")", ")", "{", "$", "job", "=", "$", "this", "->", "config", "->", "getJobFromIdNum", "(", "$", "idNum", ")", ";", "if", "(", "!", "$", "job", "->", "flush", "(", "$", "this", "->", "items", "[", "$", "idNum", "]", ")", ")", "{", "$", "this", "->", "handleFailure", "(", "$", "idNum", ",", "$", "this", "->", "items", "[", "$", "idNum", "]", ")", ";", "}", "$", "this", "->", "items", "[", "$", "idNum", "]", "=", "[", "]", ";", "$", "this", "->", "lastInvoked", "[", "$", "idNum", "]", "=", "microtime", "(", "true", ")", ";", "}", "return", "true", ";", "}" ]
Run the job with the given id. @param int $idNum A numeric id for the job. @return bool
[ "Run", "the", "job", "with", "the", "given", "id", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/InMemoryConfigStorage.php#L189-L203
train
googleapis/google-cloud-php
Core/src/Batch/InMemoryConfigStorage.php
InMemoryConfigStorage.shutdown
public function shutdown() { foreach ($this->items as $idNum => $items) { if (count($items) !== 0) { $this->flush($idNum); } } }
php
public function shutdown() { foreach ($this->items as $idNum => $items) { if (count($items) !== 0) { $this->flush($idNum); } } }
[ "public", "function", "shutdown", "(", ")", "{", "foreach", "(", "$", "this", "->", "items", "as", "$", "idNum", "=>", "$", "items", ")", "{", "if", "(", "count", "(", "$", "items", ")", "!==", "0", ")", "{", "$", "this", "->", "flush", "(", "$", "idNum", ")", ";", "}", "}", "}" ]
Run the job for remainder items.
[ "Run", "the", "job", "for", "remainder", "items", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Batch/InMemoryConfigStorage.php#L208-L215
train
googleapis/google-cloud-php
Dlp/src/V2/ImageLocation.php
ImageLocation.setBoundingBoxes
public function setBoundingBoxes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\BoundingBox::class); $this->bounding_boxes = $arr; return $this; }
php
public function setBoundingBoxes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\BoundingBox::class); $this->bounding_boxes = $arr; return $this; }
[ "public", "function", "setBoundingBoxes", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "BoundingBox", "::", "class", ")", ";", "$", "this", "->", "bounding_boxes", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Bounding boxes locating the pixels within the image containing the finding. Generated from protobuf field <code>repeated .google.privacy.dlp.v2.BoundingBox bounding_boxes = 1;</code> @param \Google\Cloud\Dlp\V2\BoundingBox[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Bounding", "boxes", "locating", "the", "pixels", "within", "the", "image", "containing", "the", "finding", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/ImageLocation.php#L58-L64
train
googleapis/google-cloud-php
Container/src/V1/SetAddonsConfigRequest.php
SetAddonsConfigRequest.setAddonsConfig
public function setAddonsConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\AddonsConfig::class); $this->addons_config = $var; return $this; }
php
public function setAddonsConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\AddonsConfig::class); $this->addons_config = $var; return $this; }
[ "public", "function", "setAddonsConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "AddonsConfig", "::", "class", ")", ";", "$", "this", "->", "addons_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The desired configurations for the various addons available to run in the cluster. Generated from protobuf field <code>.google.container.v1.AddonsConfig addons_config = 4;</code> @param \Google\Cloud\Container\V1\AddonsConfig $var @return $this
[ "The", "desired", "configurations", "for", "the", "various", "addons", "available", "to", "run", "in", "the", "cluster", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/SetAddonsConfigRequest.php#L198-L204
train
googleapis/google-cloud-php
PubSub/src/IncomingMessageTrait.php
IncomingMessageTrait.messageFactory
private function messageFactory(array $message, ConnectionInterface $connection, $projectId, $encode) { if (!isset($message['message'])) { throw new GoogleException('Invalid message data.'); } if (isset($message['message']['data']) && $encode) { $message['message']['data'] = base64_decode($message['message']['data']); } $subscription = null; if (isset($message['subscription'])) { $subscription = new Subscription( $connection, $projectId, $message['subscription'], null, $encode ); } return new Message($message['message'], [ 'ackId' => (isset($message['ackId'])) ? $message['ackId'] : null, 'subscription' => $subscription ]); }
php
private function messageFactory(array $message, ConnectionInterface $connection, $projectId, $encode) { if (!isset($message['message'])) { throw new GoogleException('Invalid message data.'); } if (isset($message['message']['data']) && $encode) { $message['message']['data'] = base64_decode($message['message']['data']); } $subscription = null; if (isset($message['subscription'])) { $subscription = new Subscription( $connection, $projectId, $message['subscription'], null, $encode ); } return new Message($message['message'], [ 'ackId' => (isset($message['ackId'])) ? $message['ackId'] : null, 'subscription' => $subscription ]); }
[ "private", "function", "messageFactory", "(", "array", "$", "message", ",", "ConnectionInterface", "$", "connection", ",", "$", "projectId", ",", "$", "encode", ")", "{", "if", "(", "!", "isset", "(", "$", "message", "[", "'message'", "]", ")", ")", "{", "throw", "new", "GoogleException", "(", "'Invalid message data.'", ")", ";", "}", "if", "(", "isset", "(", "$", "message", "[", "'message'", "]", "[", "'data'", "]", ")", "&&", "$", "encode", ")", "{", "$", "message", "[", "'message'", "]", "[", "'data'", "]", "=", "base64_decode", "(", "$", "message", "[", "'message'", "]", "[", "'data'", "]", ")", ";", "}", "$", "subscription", "=", "null", ";", "if", "(", "isset", "(", "$", "message", "[", "'subscription'", "]", ")", ")", "{", "$", "subscription", "=", "new", "Subscription", "(", "$", "connection", ",", "$", "projectId", ",", "$", "message", "[", "'subscription'", "]", ",", "null", ",", "$", "encode", ")", ";", "}", "return", "new", "Message", "(", "$", "message", "[", "'message'", "]", ",", "[", "'ackId'", "=>", "(", "isset", "(", "$", "message", "[", "'ackId'", "]", ")", ")", "?", "$", "message", "[", "'ackId'", "]", ":", "null", ",", "'subscription'", "=>", "$", "subscription", "]", ")", ";", "}" ]
Create a Message instance from an incoming message. @param array $message The message data @param ConnectionInterface $connection The service connection. @param string $projectId The current project ID. @param bool $encode Whether to base64_encode. @return Message
[ "Create", "a", "Message", "instance", "from", "an", "incoming", "message", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/IncomingMessageTrait.php#L37-L62
train
googleapis/google-cloud-php
Redis/src/V1/CloudRedisGrpcClient.php
CloudRedisGrpcClient.GetInstance
public function GetInstance(\Google\Cloud\Redis\V1\GetInstanceRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.redis.v1.CloudRedis/GetInstance', $argument, ['\Google\Cloud\Redis\V1\Instance', 'decode'], $metadata, $options); }
php
public function GetInstance(\Google\Cloud\Redis\V1\GetInstanceRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.redis.v1.CloudRedis/GetInstance', $argument, ['\Google\Cloud\Redis\V1\Instance', 'decode'], $metadata, $options); }
[ "public", "function", "GetInstance", "(", "\\", "Google", "\\", "Cloud", "\\", "Redis", "\\", "V1", "\\", "GetInstanceRequest", "$", "argument", ",", "$", "metadata", "=", "[", "]", ",", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_simpleRequest", "(", "'/google.cloud.redis.v1.CloudRedis/GetInstance'", ",", "$", "argument", ",", "[", "'\\Google\\Cloud\\Redis\\V1\\Instance'", ",", "'decode'", "]", ",", "$", "metadata", ",", "$", "options", ")", ";", "}" ]
Gets the details of a specific Redis instance. @param \Google\Cloud\Redis\V1\GetInstanceRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "Gets", "the", "details", "of", "a", "specific", "Redis", "instance", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Redis/src/V1/CloudRedisGrpcClient.php#L77-L83
train
googleapis/google-cloud-php
Redis/src/V1/CloudRedisGrpcClient.php
CloudRedisGrpcClient.UpdateInstance
public function UpdateInstance(\Google\Cloud\Redis\V1\UpdateInstanceRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.redis.v1.CloudRedis/UpdateInstance', $argument, ['\Google\LongRunning\Operation', 'decode'], $metadata, $options); }
php
public function UpdateInstance(\Google\Cloud\Redis\V1\UpdateInstanceRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.redis.v1.CloudRedis/UpdateInstance', $argument, ['\Google\LongRunning\Operation', 'decode'], $metadata, $options); }
[ "public", "function", "UpdateInstance", "(", "\\", "Google", "\\", "Cloud", "\\", "Redis", "\\", "V1", "\\", "UpdateInstanceRequest", "$", "argument", ",", "$", "metadata", "=", "[", "]", ",", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_simpleRequest", "(", "'/google.cloud.redis.v1.CloudRedis/UpdateInstance'", ",", "$", "argument", ",", "[", "'\\Google\\LongRunning\\Operation'", ",", "'decode'", "]", ",", "$", "metadata", ",", "$", "options", ")", ";", "}" ]
Updates the metadata and configuration of a specific Redis instance. Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. @param \Google\Cloud\Redis\V1\UpdateInstanceRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "Updates", "the", "metadata", "and", "configuration", "of", "a", "specific", "Redis", "instance", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Redis/src/V1/CloudRedisGrpcClient.php#L120-L126
train
googleapis/google-cloud-php
PubSub/src/V1/ListSnapshotsResponse.php
ListSnapshotsResponse.setSnapshots
public function setSnapshots($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Snapshot::class); $this->snapshots = $arr; return $this; }
php
public function setSnapshots($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Snapshot::class); $this->snapshots = $arr; return $this; }
[ "public", "function", "setSnapshots", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "PubSub", "\\", "V1", "\\", "Snapshot", "::", "class", ")", ";", "$", "this", "->", "snapshots", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The resulting snapshots. Generated from protobuf field <code>repeated .google.pubsub.v1.Snapshot snapshots = 1;</code> @param \Google\Cloud\PubSub\V1\Snapshot[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "resulting", "snapshots", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/V1/ListSnapshotsResponse.php#L68-L74
train
googleapis/google-cloud-php
PubSub/src/V1/PublishResponse.php
PublishResponse.setMessageIds
public function setMessageIds($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->message_ids = $arr; return $this; }
php
public function setMessageIds($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->message_ids = $arr; return $this; }
[ "public", "function", "setMessageIds", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ")", ";", "$", "this", "->", "message_ids", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic. Generated from protobuf field <code>repeated string message_ids = 1;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "server", "-", "assigned", "ID", "of", "each", "published", "message", "in", "the", "same", "order", "as", "the", "messages", "in", "the", "request", ".", "IDs", "are", "guaranteed", "to", "be", "unique", "within", "the", "topic", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/V1/PublishResponse.php#L66-L72
train
googleapis/google-cloud-php
Vision/src/V1/ImageAnnotatorClient.php
ImageAnnotatorClient.annotateImage
public function annotateImage($image, $features, $optionalArgs = []) { $image = $this->createImageObject($image); return $this->annotateImageHelper( [$this, 'batchAnnotateImages'], AnnotateImageRequest::class, $image, $features, $optionalArgs ); }
php
public function annotateImage($image, $features, $optionalArgs = []) { $image = $this->createImageObject($image); return $this->annotateImageHelper( [$this, 'batchAnnotateImages'], AnnotateImageRequest::class, $image, $features, $optionalArgs ); }
[ "public", "function", "annotateImage", "(", "$", "image", ",", "$", "features", ",", "$", "optionalArgs", "=", "[", "]", ")", "{", "$", "image", "=", "$", "this", "->", "createImageObject", "(", "$", "image", ")", ";", "return", "$", "this", "->", "annotateImageHelper", "(", "[", "$", "this", ",", "'batchAnnotateImages'", "]", ",", "AnnotateImageRequest", "::", "class", ",", "$", "image", ",", "$", "features", ",", "$", "optionalArgs", ")", ";", "}" ]
Run image detection and annotation for an image. Example: ``` use Google\Cloud\Vision\V1\Feature; use Google\Cloud\Vision\V1\Feature\Type; $imageResource = fopen('path/to/image.jpg', 'r'); $features = [Type::FACE_DETECTION]; $response = $imageAnnotatorClient->annotateImage($imageResource, $features); ``` @param resource|string|Image $image The image to be processed. @param Feature[]|int[] $features Requested features. @param array $optionalArgs { Configuration Options. @type ImageContext $imageContext Additional context that may accompany the image. @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 AnnotateImageResponse @throws ApiException if the remote call fails @experimental
[ "Run", "image", "detection", "and", "annotation", "for", "an", "image", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/ImageAnnotatorClient.php#L116-L126
train
googleapis/google-cloud-php
Vision/src/V1/ImageAnnotatorClient.php
ImageAnnotatorClient.productSearch
public function productSearch($image, ProductSearchParams $productSearchParams, $optionalArgs = []) { if (isset($optionalArgs['imageContext']) && $optionalArgs['imageContext'] instanceof ImageContext) { $optionalArgs['imageContext']->setProductSearchParams($productSearchParams); } else { $optionalArgs['imageContext'] = (new ImageContext) ->setProductSearchParams($productSearchParams); } return $this->annotateSingleFeature( $image, Type::PRODUCT_SEARCH, $optionalArgs ); }
php
public function productSearch($image, ProductSearchParams $productSearchParams, $optionalArgs = []) { if (isset($optionalArgs['imageContext']) && $optionalArgs['imageContext'] instanceof ImageContext) { $optionalArgs['imageContext']->setProductSearchParams($productSearchParams); } else { $optionalArgs['imageContext'] = (new ImageContext) ->setProductSearchParams($productSearchParams); } return $this->annotateSingleFeature( $image, Type::PRODUCT_SEARCH, $optionalArgs ); }
[ "public", "function", "productSearch", "(", "$", "image", ",", "ProductSearchParams", "$", "productSearchParams", ",", "$", "optionalArgs", "=", "[", "]", ")", "{", "if", "(", "isset", "(", "$", "optionalArgs", "[", "'imageContext'", "]", ")", "&&", "$", "optionalArgs", "[", "'imageContext'", "]", "instanceof", "ImageContext", ")", "{", "$", "optionalArgs", "[", "'imageContext'", "]", "->", "setProductSearchParams", "(", "$", "productSearchParams", ")", ";", "}", "else", "{", "$", "optionalArgs", "[", "'imageContext'", "]", "=", "(", "new", "ImageContext", ")", "->", "setProductSearchParams", "(", "$", "productSearchParams", ")", ";", "}", "return", "$", "this", "->", "annotateSingleFeature", "(", "$", "image", ",", "Type", "::", "PRODUCT_SEARCH", ",", "$", "optionalArgs", ")", ";", "}" ]
Run product search for an image. Example: ``` use Google\Cloud\Vision\V1\ProductSearchClient; use Google\Cloud\Vision\V1\ProductSearchParams; $imageContent = file_get_contents('path/to/image.jpg'); $productSetName = ProductSearchClient::productSetName('PROJECT_ID', 'LOC_ID', 'PRODUCT_SET_ID'); $productSearchParams = (new ProductSearchParams) ->setProductSet($productSetName); $response = $imageAnnotatorClient->productSearch( $imageContent, $productSearchParams ); ``` @param resource|string|Image $image The image to be processed. @param ProductSearchParams $productSearchParams Parameters for a product search request. Please note, this value will override the {@see Google\Cloud\Vision\V1\ProductSearchParams} in the {@see Google\Cloud\Vision\V1\ImageContext} instance if provided. @param array $optionalArgs { Configuration Options. @type ImageContext $imageContext Additional context that may accompany the image. @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 AnnotateImageResponse @throws ApiException if the remote call fails @experimental
[ "Run", "product", "search", "for", "an", "image", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/ImageAnnotatorClient.php#L551-L565
train
googleapis/google-cloud-php
Scheduler/src/V1beta1/AppEngineHttpTarget.php
AppEngineHttpTarget.setAppEngineRouting
public function setAppEngineRouting($var) { GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1beta1\AppEngineRouting::class); $this->app_engine_routing = $var; return $this; }
php
public function setAppEngineRouting($var) { GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1beta1\AppEngineRouting::class); $this->app_engine_routing = $var; return $this; }
[ "public", "function", "setAppEngineRouting", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Scheduler", "\\", "V1beta1", "\\", "AppEngineRouting", "::", "class", ")", ";", "$", "this", "->", "app_engine_routing", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
App Engine Routing setting for the job. Generated from protobuf field <code>.google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2;</code> @param \Google\Cloud\Scheduler\V1beta1\AppEngineRouting $var @return $this
[ "App", "Engine", "Routing", "setting", "for", "the", "job", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Scheduler/src/V1beta1/AppEngineHttpTarget.php#L188-L194
train
googleapis/google-cloud-php
VideoIntelligence/src/V1/NormalizedBoundingPoly.php
NormalizedBoundingPoly.setVertices
public function setVertices($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\NormalizedVertex::class); $this->vertices = $arr; return $this; }
php
public function setVertices($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\NormalizedVertex::class); $this->vertices = $arr; return $this; }
[ "public", "function", "setVertices", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "VideoIntelligence", "\\", "V1", "\\", "NormalizedVertex", "::", "class", ")", ";", "$", "this", "->", "vertices", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Normalized vertices of the bounding polygon. Generated from protobuf field <code>repeated .google.cloud.videointelligence.v1.NormalizedVertex vertices = 1;</code> @param \Google\Cloud\VideoIntelligence\V1\NormalizedVertex[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Normalized", "vertices", "of", "the", "bounding", "polygon", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/VideoIntelligence/src/V1/NormalizedBoundingPoly.php#L72-L78
train
googleapis/google-cloud-php
ErrorReporting/src/V1beta1/QueryTimeRange.php
QueryTimeRange.setPeriod
public function setPeriod($var) { GPBUtil::checkEnum($var, \Google\Cloud\ErrorReporting\V1beta1\QueryTimeRange_Period::class); $this->period = $var; return $this; }
php
public function setPeriod($var) { GPBUtil::checkEnum($var, \Google\Cloud\ErrorReporting\V1beta1\QueryTimeRange_Period::class); $this->period = $var; return $this; }
[ "public", "function", "setPeriod", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "ErrorReporting", "\\", "V1beta1", "\\", "QueryTimeRange_Period", "::", "class", ")", ";", "$", "this", "->", "period", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Restricts the query to the specified time range. Generated from protobuf field <code>.google.devtools.clouderrorreporting.v1beta1.QueryTimeRange.Period period = 1;</code> @param int $var @return $this
[ "Restricts", "the", "query", "to", "the", "specified", "time", "range", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/ErrorReporting/src/V1beta1/QueryTimeRange.php#L59-L65
train
googleapis/google-cloud-php
Scheduler/src/V1/Job.php
Job.setAppEngineHttpTarget
public function setAppEngineHttpTarget($var) { GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\AppEngineHttpTarget::class); $this->writeOneof(5, $var); return $this; }
php
public function setAppEngineHttpTarget($var) { GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\AppEngineHttpTarget::class); $this->writeOneof(5, $var); return $this; }
[ "public", "function", "setAppEngineHttpTarget", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Scheduler", "\\", "V1", "\\", "AppEngineHttpTarget", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "5", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
App Engine HTTP target. Generated from protobuf field <code>.google.cloud.scheduler.v1.AppEngineHttpTarget app_engine_http_target = 5;</code> @param \Google\Cloud\Scheduler\V1\AppEngineHttpTarget $var @return $this
[ "App", "Engine", "HTTP", "target", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Scheduler/src/V1/Job.php#L336-L342
train
googleapis/google-cloud-php
Scheduler/src/V1/Job.php
Job.setHttpTarget
public function setHttpTarget($var) { GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\HttpTarget::class); $this->writeOneof(6, $var); return $this; }
php
public function setHttpTarget($var) { GPBUtil::checkMessage($var, \Google\Cloud\Scheduler\V1\HttpTarget::class); $this->writeOneof(6, $var); return $this; }
[ "public", "function", "setHttpTarget", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Scheduler", "\\", "V1", "\\", "HttpTarget", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "6", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
HTTP target. Generated from protobuf field <code>.google.cloud.scheduler.v1.HttpTarget http_target = 6;</code> @param \Google\Cloud\Scheduler\V1\HttpTarget $var @return $this
[ "HTTP", "target", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Scheduler/src/V1/Job.php#L362-L368
train
googleapis/google-cloud-php
Scheduler/src/V1/Job.php
Job.setState
public function setState($var) { GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\Job_State::class); $this->state = $var; return $this; }
php
public function setState($var) { GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1\Job_State::class); $this->state = $var; return $this; }
[ "public", "function", "setState", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Scheduler", "\\", "V1", "\\", "Job_State", "::", "class", ")", ";", "$", "this", "->", "state", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Output only. State of the job. Generated from protobuf field <code>.google.cloud.scheduler.v1.Job.State state = 10;</code> @param int $var @return $this
[ "Output", "only", ".", "State", "of", "the", "job", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Scheduler/src/V1/Job.php#L514-L520
train
googleapis/google-cloud-php
VideoIntelligence/src/V1/ObjectTrackingFrame.php
ObjectTrackingFrame.setNormalizedBoundingBox
public function setNormalizedBoundingBox($var) { GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox::class); $this->normalized_bounding_box = $var; return $this; }
php
public function setNormalizedBoundingBox($var) { GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox::class); $this->normalized_bounding_box = $var; return $this; }
[ "public", "function", "setNormalizedBoundingBox", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "VideoIntelligence", "\\", "V1", "\\", "NormalizedBoundingBox", "::", "class", ")", ";", "$", "this", "->", "normalized_bounding_box", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The normalized bounding box location of this object track for the frame. Generated from protobuf field <code>.google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_box = 1;</code> @param \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox $var @return $this
[ "The", "normalized", "bounding", "box", "location", "of", "this", "object", "track", "for", "the", "frame", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/VideoIntelligence/src/V1/ObjectTrackingFrame.php#L67-L73
train
googleapis/google-cloud-php
Vision/src/V1/FaceAnnotation/Landmark.php
Landmark.setPosition
public function setPosition($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\Position::class); $this->position = $var; return $this; }
php
public function setPosition($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\Position::class); $this->position = $var; return $this; }
[ "public", "function", "setPosition", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Vision", "\\", "V1", "\\", "Position", "::", "class", ")", ";", "$", "this", "->", "position", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Face landmark position. Generated from protobuf field <code>.google.cloud.vision.v1.Position position = 4;</code> @param \Google\Cloud\Vision\V1\Position $var @return $this
[ "Face", "landmark", "position", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/FaceAnnotation/Landmark.php#L92-L98
train
googleapis/google-cloud-php
Bigtable/src/V2/RowSet.php
RowSet.setRowKeys
public function setRowKeys($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); $this->row_keys = $arr; return $this; }
php
public function setRowKeys($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); $this->row_keys = $arr; return $this; }
[ "public", "function", "setRowKeys", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "BYTES", ")", ";", "$", "this", "->", "row_keys", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Single rows included in the set. Generated from protobuf field <code>repeated bytes row_keys = 1;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Single", "rows", "included", "in", "the", "set", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/RowSet.php#L66-L72
train
googleapis/google-cloud-php
Bigtable/src/V2/RowSet.php
RowSet.setRowRanges
public function setRowRanges($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowRange::class); $this->row_ranges = $arr; return $this; }
php
public function setRowRanges($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowRange::class); $this->row_ranges = $arr; return $this; }
[ "public", "function", "setRowRanges", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Bigtable", "\\", "V2", "\\", "RowRange", "::", "class", ")", ";", "$", "this", "->", "row_ranges", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Contiguous row ranges included in the set. Generated from protobuf field <code>repeated .google.bigtable.v2.RowRange row_ranges = 2;</code> @param \Google\Cloud\Bigtable\V2\RowRange[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Contiguous", "row", "ranges", "included", "in", "the", "set", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/RowSet.php#L92-L98
train
googleapis/google-cloud-php
Dataproc/src/V1beta2/ClusterConfig.php
ClusterConfig.setSecondaryWorkerConfig
public function setSecondaryWorkerConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\InstanceGroupConfig::class); $this->secondary_worker_config = $var; return $this; }
php
public function setSecondaryWorkerConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\InstanceGroupConfig::class); $this->secondary_worker_config = $var; return $this; }
[ "public", "function", "setSecondaryWorkerConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dataproc", "\\", "V1beta2", "\\", "InstanceGroupConfig", "::", "class", ")", ";", "$", "this", "->", "secondary_worker_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Optional. The Compute Engine config settings for additional worker instances in a cluster. Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.InstanceGroupConfig secondary_worker_config = 12;</code> @param \Google\Cloud\Dataproc\V1beta2\InstanceGroupConfig $var @return $this
[ "Optional", ".", "The", "Compute", "Engine", "config", "settings", "for", "additional", "worker", "instances", "in", "a", "cluster", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1beta2/ClusterConfig.php#L284-L290
train
googleapis/google-cloud-php
Dataproc/src/V1beta2/ClusterConfig.php
ClusterConfig.setSoftwareConfig
public function setSoftwareConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\SoftwareConfig::class); $this->software_config = $var; return $this; }
php
public function setSoftwareConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\SoftwareConfig::class); $this->software_config = $var; return $this; }
[ "public", "function", "setSoftwareConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dataproc", "\\", "V1beta2", "\\", "SoftwareConfig", "::", "class", ")", ";", "$", "this", "->", "software_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Optional. The config settings for software inside the cluster. Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.SoftwareConfig software_config = 13;</code> @param \Google\Cloud\Dataproc\V1beta2\SoftwareConfig $var @return $this
[ "Optional", ".", "The", "config", "settings", "for", "software", "inside", "the", "cluster", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1beta2/ClusterConfig.php#L310-L316
train
googleapis/google-cloud-php
Dataproc/src/V1beta2/ClusterConfig.php
ClusterConfig.setLifecycleConfig
public function setLifecycleConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\LifecycleConfig::class); $this->lifecycle_config = $var; return $this; }
php
public function setLifecycleConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\LifecycleConfig::class); $this->lifecycle_config = $var; return $this; }
[ "public", "function", "setLifecycleConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dataproc", "\\", "V1beta2", "\\", "LifecycleConfig", "::", "class", ")", ";", "$", "this", "->", "lifecycle_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Optional. The config setting for auto delete cluster schedule. Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.LifecycleConfig lifecycle_config = 14;</code> @param \Google\Cloud\Dataproc\V1beta2\LifecycleConfig $var @return $this
[ "Optional", ".", "The", "config", "setting", "for", "auto", "delete", "cluster", "schedule", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1beta2/ClusterConfig.php#L336-L342
train
googleapis/google-cloud-php
Dataproc/src/V1beta2/ClusterConfig.php
ClusterConfig.setEncryptionConfig
public function setEncryptionConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\EncryptionConfig::class); $this->encryption_config = $var; return $this; }
php
public function setEncryptionConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\EncryptionConfig::class); $this->encryption_config = $var; return $this; }
[ "public", "function", "setEncryptionConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dataproc", "\\", "V1beta2", "\\", "EncryptionConfig", "::", "class", ")", ";", "$", "this", "->", "encryption_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Optional. Encryption settings for the cluster. Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.EncryptionConfig encryption_config = 15;</code> @param \Google\Cloud\Dataproc\V1beta2\EncryptionConfig $var @return $this
[ "Optional", ".", "Encryption", "settings", "for", "the", "cluster", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1beta2/ClusterConfig.php#L410-L416
train
googleapis/google-cloud-php
Spanner/src/V1/TransactionOptions.php
TransactionOptions.setPartitionedDml
public function setPartitionedDml($var) { GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\TransactionOptions_PartitionedDml::class); $this->writeOneof(3, $var); return $this; }
php
public function setPartitionedDml($var) { GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\TransactionOptions_PartitionedDml::class); $this->writeOneof(3, $var); return $this; }
[ "public", "function", "setPartitionedDml", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Spanner", "\\", "V1", "\\", "TransactionOptions_PartitionedDml", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "3", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
Partitioned DML transaction. Authorization to begin a Partitioned DML transaction requires `spanner.databases.beginPartitionedDmlTransaction` permission on the `session` resource. Generated from protobuf field <code>.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;</code> @param \Google\Cloud\Spanner\V1\TransactionOptions\PartitionedDml $var @return $this
[ "Partitioned", "DML", "transaction", ".", "Authorization", "to", "begin", "a", "Partitioned", "DML", "transaction", "requires", "spanner", ".", "databases", ".", "beginPartitionedDmlTransaction", "permission", "on", "the", "session", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/V1/TransactionOptions.php#L323-L329
train
googleapis/google-cloud-php
Language/src/V1beta2/Document.php
Document.setType
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1beta2\Document_Type::class); $this->type = $var; return $this; }
php
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1beta2\Document_Type::class); $this->type = $var; return $this; }
[ "public", "function", "setType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1beta2", "\\", "Document_Type", "::", "class", ")", ";", "$", "this", "->", "type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error. Generated from protobuf field <code>.google.cloud.language.v1beta2.Document.Type type = 1;</code> @param int $var @return $this
[ "Required", ".", "If", "the", "type", "is", "not", "set", "or", "is", "TYPE_UNSPECIFIED", "returns", "an", "INVALID_ARGUMENT", "error", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1beta2/Document.php#L93-L99
train
googleapis/google-cloud-php
Vision/src/V1/InputConfig.php
InputConfig.setGcsSource
public function setGcsSource($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\GcsSource::class); $this->gcs_source = $var; return $this; }
php
public function setGcsSource($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\GcsSource::class); $this->gcs_source = $var; return $this; }
[ "public", "function", "setGcsSource", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Vision", "\\", "V1", "\\", "GcsSource", "::", "class", ")", ";", "$", "this", "->", "gcs_source", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The Google Cloud Storage location to read the input from. Generated from protobuf field <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> @param \Google\Cloud\Vision\V1\GcsSource $var @return $this
[ "The", "Google", "Cloud", "Storage", "location", "to", "read", "the", "input", "from", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/InputConfig.php#L84-L90
train
googleapis/google-cloud-php
Talent/src/V4beta1/UpdateCompanyRequest.php
UpdateCompanyRequest.setCompany
public function setCompany($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Company::class); $this->company = $var; return $this; }
php
public function setCompany($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Company::class); $this->company = $var; return $this; }
[ "public", "function", "setCompany", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Talent", "\\", "V4beta1", "\\", "Company", "::", "class", ")", ";", "$", "this", "->", "company", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Required. The company resource to replace the current resource in the system. Generated from protobuf field <code>.google.cloud.talent.v4beta1.Company company = 1;</code> @param \Google\Cloud\Talent\V4beta1\Company $var @return $this
[ "Required", ".", "The", "company", "resource", "to", "replace", "the", "current", "resource", "in", "the", "system", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/UpdateCompanyRequest.php#L88-L94
train
googleapis/google-cloud-php
Iot/src/V1/PublicKeyCredential.php
PublicKeyCredential.setFormat
public function setFormat($var) { GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\PublicKeyFormat::class); $this->format = $var; return $this; }
php
public function setFormat($var) { GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\PublicKeyFormat::class); $this->format = $var; return $this; }
[ "public", "function", "setFormat", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Iot", "\\", "V1", "\\", "PublicKeyFormat", "::", "class", ")", ";", "$", "this", "->", "format", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The format of the key. Generated from protobuf field <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> @param int $var @return $this
[ "The", "format", "of", "the", "key", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Iot/src/V1/PublicKeyCredential.php#L66-L72
train
googleapis/google-cloud-php
SecurityCenter/src/V1/ListAssetsResponse.php
ListAssetsResponse.setListAssetsResults
public function setListAssetsResults($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\SecurityCenter\V1\ListAssetsResponse\ListAssetsResult::class); $this->list_assets_results = $arr; return $this; }
php
public function setListAssetsResults($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\SecurityCenter\V1\ListAssetsResponse\ListAssetsResult::class); $this->list_assets_results = $arr; return $this; }
[ "public", "function", "setListAssetsResults", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "SecurityCenter", "\\", "V1", "\\", "ListAssetsResponse", "\\", "ListAssetsResult", "::", "class", ")", ";", "$", "this", "->", "list_assets_results", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Assets matching the list request. Generated from protobuf field <code>repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1;</code> @param \Google\Cloud\SecurityCenter\V1\ListAssetsResponse\ListAssetsResult[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Assets", "matching", "the", "list", "request", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/ListAssetsResponse.php#L84-L90
train
googleapis/google-cloud-php
BigQueryDataTransfer/src/V1/ListTransferLogsResponse.php
ListTransferLogsResponse.setTransferMessages
public function setTransferMessages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage::class); $this->transfer_messages = $arr; return $this; }
php
public function setTransferMessages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage::class); $this->transfer_messages = $arr; return $this; }
[ "public", "function", "setTransferMessages", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "BigQuery", "\\", "DataTransfer", "\\", "V1", "\\", "TransferMessage", "::", "class", ")", ";", "$", "this", "->", "transfer_messages", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Output only. The stored pipeline transfer messages. Generated from protobuf field <code>repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage transfer_messages = 1;</code> @param \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Output", "only", ".", "The", "stored", "pipeline", "transfer", "messages", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/ListTransferLogsResponse.php#L72-L78
train
googleapis/google-cloud-php
Firestore/src/V1beta1/StructuredQuery.php
StructuredQuery.setSelect
public function setSelect($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery_Projection::class); $this->select = $var; return $this; }
php
public function setSelect($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery_Projection::class); $this->select = $var; return $this; }
[ "public", "function", "setSelect", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Firestore", "\\", "V1beta1", "\\", "StructuredQuery_Projection", "::", "class", ")", ";", "$", "this", "->", "select", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The projection to return. Generated from protobuf field <code>.google.firestore.v1beta1.StructuredQuery.Projection select = 1;</code> @param \Google\Cloud\Firestore\V1beta1\StructuredQuery\Projection $var @return $this
[ "The", "projection", "to", "return", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1beta1/StructuredQuery.php#L148-L154
train
googleapis/google-cloud-php
Firestore/src/V1beta1/StructuredQuery.php
StructuredQuery.setEndAt
public function setEndAt($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\Cursor::class); $this->end_at = $var; return $this; }
php
public function setEndAt($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\Cursor::class); $this->end_at = $var; return $this; }
[ "public", "function", "setEndAt", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Firestore", "\\", "V1beta1", "\\", "Cursor", "::", "class", ")", ";", "$", "this", "->", "end_at", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
A end point for the query results. Generated from protobuf field <code>.google.firestore.v1beta1.Cursor end_at = 8;</code> @param \Google\Cloud\Firestore\V1beta1\Cursor $var @return $this
[ "A", "end", "point", "for", "the", "query", "results", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1beta1/StructuredQuery.php#L304-L310
train