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
Dataproc/src/V1beta2/InstanceGroupConfig.php
InstanceGroupConfig.setManagedGroupConfig
public function setManagedGroupConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\ManagedGroupConfig::class); $this->managed_group_config = $var; return $this; }
php
public function setManagedGroupConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\ManagedGroupConfig::class); $this->managed_group_config = $var; return $this; }
[ "public", "function", "setManagedGroupConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dataproc", "\\", "V1beta2", "\\", "ManagedGroupConfig", "::", "class", ")", ";", "$", "this", "->", "managed_group_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Output only. The config for Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.ManagedGroupConfig managed_group_config = 7;</code> @param \Google\Cloud\Dataproc\V1beta2\ManagedGroupConfig $var @return $this
[ "Output", "only", ".", "The", "config", "for", "Compute", "Engine", "Instance", "Group", "Manager", "that", "manages", "this", "group", ".", "This", "is", "only", "used", "for", "preemptible", "instance", "groups", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1beta2/InstanceGroupConfig.php#L353-L359
train
googleapis/google-cloud-php
SecurityCenter/src/V1/UpdateFindingRequest.php
UpdateFindingRequest.setFinding
public function setFinding($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\Finding::class); $this->finding = $var; return $this; }
php
public function setFinding($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\Finding::class); $this->finding = $var; return $this; }
[ "public", "function", "setFinding", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "SecurityCenter", "\\", "V1", "\\", "Finding", "::", "class", ")", ";", "$", "this", "->", "finding", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The finding resource to update or create if it does not already exist. parent, security_marks, and update_time will be ignored. In the case of creation, the finding id portion of the name must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length. Generated from protobuf field <code>.google.cloud.securitycenter.v1.Finding finding = 1;</code> @param \Google\Cloud\SecurityCenter\V1\Finding $var @return $this
[ "The", "finding", "resource", "to", "update", "or", "create", "if", "it", "does", "not", "already", "exist", ".", "parent", "security_marks", "and", "update_time", "will", "be", "ignored", ".", "In", "the", "case", "of", "creation", "the", "finding", "id", "portion", "of", "the", "name", "must", "be", "alphanumeric", "and", "less", "than", "or", "equal", "to", "32", "characters", "and", "greater", "than", "0", "characters", "in", "length", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/UpdateFindingRequest.php#L92-L98
train
googleapis/google-cloud-php
Bigtable/src/Admin/V2/ListSnapshotsResponse.php
ListSnapshotsResponse.setSnapshots
public function setSnapshots($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Snapshot::class); $this->snapshots = $arr; return $this; }
php
public function setSnapshots($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Snapshot::class); $this->snapshots = $arr; return $this; }
[ "public", "function", "setSnapshots", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Bigtable", "\\", "Admin", "\\", "V2", "\\", "Snapshot", "::", "class", ")", ";", "$", "this", "->", "snapshots", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The snapshots present in the requested cluster. Generated from protobuf field <code>repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;</code> @param \Google\Cloud\Bigtable\Admin\V2\Snapshot[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "snapshots", "present", "in", "the", "requested", "cluster", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/Admin/V2/ListSnapshotsResponse.php#L75-L81
train
googleapis/google-cloud-php
OsLogin/src/V1beta/LoginProfile.php
LoginProfile.setPosixAccounts
public function setPosixAccounts($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsLogin\Common\PosixAccount::class); $this->posix_accounts = $arr; return $this; }
php
public function setPosixAccounts($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsLogin\Common\PosixAccount::class); $this->posix_accounts = $arr; return $this; }
[ "public", "function", "setPosixAccounts", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "OsLogin", "\\", "Common", "\\", "PosixAccount", "::", "class", ")", ";", "$", "this", "->", "posix_accounts", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The list of POSIX accounts associated with the user. Generated from protobuf field <code>repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2;</code> @param \Google\Cloud\OsLogin\Common\PosixAccount[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "list", "of", "POSIX", "accounts", "associated", "with", "the", "user", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/OsLogin/src/V1beta/LoginProfile.php#L111-L117
train
googleapis/google-cloud-php
OsLogin/src/V1beta/LoginProfile.php
LoginProfile.setSshPublicKeys
public function setSshPublicKeys($var) { $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsLogin\Common\SshPublicKey::class); $this->ssh_public_keys = $arr; return $this; }
php
public function setSshPublicKeys($var) { $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsLogin\Common\SshPublicKey::class); $this->ssh_public_keys = $arr; return $this; }
[ "public", "function", "setSshPublicKeys", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkMapField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "OsLogin", "\\", "Common", "\\", "SshPublicKey", "::", "class", ")", ";", "$", "this", "->", "ssh_public_keys", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
A map from SSH public key fingerprint to the associated key object. Generated from protobuf field <code>map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3;</code> @param array|\Google\Protobuf\Internal\MapField $var @return $this
[ "A", "map", "from", "SSH", "public", "key", "fingerprint", "to", "the", "associated", "key", "object", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/OsLogin/src/V1beta/LoginProfile.php#L137-L143
train
googleapis/google-cloud-php
Tasks/src/V2/ListQueuesResponse.php
ListQueuesResponse.setQueues
public function setQueues($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Queue::class); $this->queues = $arr; return $this; }
php
public function setQueues($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Queue::class); $this->queues = $arr; return $this; }
[ "public", "function", "setQueues", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Tasks", "\\", "V2", "\\", "Queue", "::", "class", ")", ";", "$", "this", "->", "queues", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The list of queues. Generated from protobuf field <code>repeated .google.cloud.tasks.v2.Queue queues = 1;</code> @param \Google\Cloud\Tasks\V2\Queue[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "list", "of", "queues", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Tasks/src/V2/ListQueuesResponse.php#L76-L82
train
googleapis/google-cloud-php
Core/src/Iterator/PageIteratorTrait.php
PageIteratorTrait.next
public function next() { $this->position++; $this->page = $this->nextResultToken() ? $this->executeCall() : null; }
php
public function next() { $this->position++; $this->page = $this->nextResultToken() ? $this->executeCall() : null; }
[ "public", "function", "next", "(", ")", "{", "$", "this", "->", "position", "++", ";", "$", "this", "->", "page", "=", "$", "this", "->", "nextResultToken", "(", ")", "?", "$", "this", "->", "executeCall", "(", ")", ":", "null", ";", "}" ]
Advances to the next page. @return null
[ "Advances", "to", "the", "next", "page", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Iterator/PageIteratorTrait.php#L202-L208
train
googleapis/google-cloud-php
Core/src/Iterator/PageIteratorTrait.php
PageIteratorTrait.executeCall
private function executeCall() { $call = $this->call; list($results, $shouldContinue) = $this->mapResults( $call($this->callOptions) ); $this->set( $this->resultTokenPath, $this->callOptions, $this->determineNextResultToken($results, $shouldContinue) ); return $results; }
php
private function executeCall() { $call = $this->call; list($results, $shouldContinue) = $this->mapResults( $call($this->callOptions) ); $this->set( $this->resultTokenPath, $this->callOptions, $this->determineNextResultToken($results, $shouldContinue) ); return $results; }
[ "private", "function", "executeCall", "(", ")", "{", "$", "call", "=", "$", "this", "->", "call", ";", "list", "(", "$", "results", ",", "$", "shouldContinue", ")", "=", "$", "this", "->", "mapResults", "(", "$", "call", "(", "$", "this", "->", "callOptions", ")", ")", ";", "$", "this", "->", "set", "(", "$", "this", "->", "resultTokenPath", ",", "$", "this", "->", "callOptions", ",", "$", "this", "->", "determineNextResultToken", "(", "$", "results", ",", "$", "shouldContinue", ")", ")", ";", "return", "$", "results", ";", "}" ]
Executes the provided call to get a set of results. @return array
[ "Executes", "the", "provided", "call", "to", "get", "a", "set", "of", "results", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/Iterator/PageIteratorTrait.php#L229-L243
train
googleapis/google-cloud-php
Logging/src/V2/ListLogMetricsResponse.php
ListLogMetricsResponse.setMetrics
public function setMetrics($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogMetric::class); $this->metrics = $arr; return $this; }
php
public function setMetrics($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogMetric::class); $this->metrics = $arr; return $this; }
[ "public", "function", "setMetrics", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Logging", "\\", "V2", "\\", "LogMetric", "::", "class", ")", ";", "$", "this", "->", "metrics", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
A list of logs-based metrics. Generated from protobuf field <code>repeated .google.logging.v2.LogMetric metrics = 1;</code> @param \Google\Cloud\Logging\V2\LogMetric[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "A", "list", "of", "logs", "-", "based", "metrics", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Logging/src/V2/ListLogMetricsResponse.php#L70-L76
train
googleapis/google-cloud-php
Language/src/V1/DependencyEdge.php
DependencyEdge.setLabel
public function setLabel($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\DependencyEdge_Label::class); $this->label = $var; return $this; }
php
public function setLabel($var) { GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\DependencyEdge_Label::class); $this->label = $var; return $this; }
[ "public", "function", "setLabel", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "DependencyEdge_Label", "::", "class", ")", ";", "$", "this", "->", "label", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The parse label for the token. Generated from protobuf field <code>.google.cloud.language.v1.DependencyEdge.Label label = 2;</code> @param int $var @return $this
[ "The", "parse", "label", "for", "the", "token", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/DependencyEdge.php#L110-L116
train
googleapis/google-cloud-php
Trace/src/V2/Span/Link.php
Link.setType
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Trace\V2\Span_Link_Type::class); $this->type = $var; return $this; }
php
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Trace\V2\Span_Link_Type::class); $this->type = $var; return $this; }
[ "public", "function", "setType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Trace", "\\", "V2", "\\", "Span_Link_Type", "::", "class", ")", ";", "$", "this", "->", "type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The relationship of the current span relative to the linked span. Generated from protobuf field <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code> @param int $var @return $this
[ "The", "relationship", "of", "the", "current", "span", "relative", "to", "the", "linked", "span", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Trace/src/V2/Span/Link.php#L139-L145
train
googleapis/google-cloud-php
WebRisk/src/V1beta1/SearchHashesResponse.php
SearchHashesResponse.setThreats
public function setThreats($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebRisk\V1beta1\SearchHashesResponse\ThreatHash::class); $this->threats = $arr; return $this; }
php
public function setThreats($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebRisk\V1beta1\SearchHashesResponse\ThreatHash::class); $this->threats = $arr; return $this; }
[ "public", "function", "setThreats", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "WebRisk", "\\", "V1beta1", "\\", "SearchHashesResponse", "\\", "ThreatHash", "::", "class", ")", ";", "$", "this", "->", "threats", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The full hashes that matched the requested prefixes. The hash will be populated in the key. Generated from protobuf field <code>repeated .google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash threats = 1;</code> @param \Google\Cloud\WebRisk\V1beta1\SearchHashesResponse\ThreatHash[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "full", "hashes", "that", "matched", "the", "requested", "prefixes", ".", "The", "hash", "will", "be", "populated", "in", "the", "key", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/WebRisk/src/V1beta1/SearchHashesResponse.php#L70-L76
train
googleapis/google-cloud-php
Dlp/src/V2/InfoTypeDescription.php
InfoTypeDescription.setSupportedBy
public function setSupportedBy($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\InfoTypeSupportedBy::class); $this->supported_by = $arr; return $this; }
php
public function setSupportedBy($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\InfoTypeSupportedBy::class); $this->supported_by = $arr; return $this; }
[ "public", "function", "setSupportedBy", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "ENUM", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "InfoTypeSupportedBy", "::", "class", ")", ";", "$", "this", "->", "supported_by", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Which parts of the API supports this InfoType. Generated from protobuf field <code>repeated .google.privacy.dlp.v2.InfoTypeSupportedBy supported_by = 3;</code> @param int[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Which", "parts", "of", "the", "API", "supports", "this", "InfoType", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/InfoTypeDescription.php#L136-L142
train
googleapis/google-cloud-php
VideoIntelligence/src/V1/LabelDetectionConfig.php
LabelDetectionConfig.setLabelDetectionMode
public function setLabelDetectionMode($var) { GPBUtil::checkEnum($var, \Google\Cloud\VideoIntelligence\V1\LabelDetectionMode::class); $this->label_detection_mode = $var; return $this; }
php
public function setLabelDetectionMode($var) { GPBUtil::checkEnum($var, \Google\Cloud\VideoIntelligence\V1\LabelDetectionMode::class); $this->label_detection_mode = $var; return $this; }
[ "public", "function", "setLabelDetectionMode", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "VideoIntelligence", "\\", "V1", "\\", "LabelDetectionMode", "::", "class", ")", ";", "$", "this", "->", "label_detection_mode", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
What labels should be detected with LABEL_DETECTION, in addition to video-level labels or segment-level labels. If unspecified, defaults to `SHOT_MODE`. Generated from protobuf field <code>.google.cloud.videointelligence.v1.LabelDetectionMode label_detection_mode = 1;</code> @param int $var @return $this
[ "What", "labels", "should", "be", "detected", "with", "LABEL_DETECTION", "in", "addition", "to", "video", "-", "level", "labels", "or", "segment", "-", "level", "labels", ".", "If", "unspecified", "defaults", "to", "SHOT_MODE", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/VideoIntelligence/src/V1/LabelDetectionConfig.php#L90-L96
train
googleapis/google-cloud-php
Translate/src/TranslateClient.php
TranslateClient.translate
public function translate($string, array $options = []) { $res = $this->translateBatch([$string], $options); if (count($res) > 0) { return $res[0]; } }
php
public function translate($string, array $options = []) { $res = $this->translateBatch([$string], $options); if (count($res) > 0) { return $res[0]; } }
[ "public", "function", "translate", "(", "$", "string", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "res", "=", "$", "this", "->", "translateBatch", "(", "[", "$", "string", "]", ",", "$", "options", ")", ";", "if", "(", "count", "(", "$", "res", ")", ">", "0", ")", "{", "return", "$", "res", "[", "0", "]", ";", "}", "}" ]
Translate a string from one language to another. Example: ``` $result = $translate->translate('Hello world!'); echo $result['text']; ``` @see https://cloud.google.com/translation/v2/translating-text-with-rest Translating Text @param string $string The string to translate. @param array $options [optional] { Configuration Options. @type string $source The source language to translate from. Must be a valid ISO 639-1 language code. If not provided the value will be automatically detected by the server. @type string $target The target language to translate to. Must be a valid ISO 639-1 language code. **Defaults to** the value assigned to the client (`"en"` by default). @type string $format Indicates whether the string to be translated is either plain-text or HTML. Acceptable values are `html` or `text`. **Defaults to** `"html"`. @type string $model The model to use for the translation request. May be `nmt` (for the NMT model) or `base` (for the PBMT model). **Defaults to** using the NMT model. If the NMT model is not supported for the requested language translation pair, the PBMT model will be defaulted instead. For a list of supported languages for the model types, please see the [Language Support](https://cloud.google.com/translate/docs/languages) documentation. } @return array|null A translation result including a `source` key containing the detected or provided language of the provided input, an `input` key containing the original string, and a `text` key containing the translated result.
[ "Translate", "a", "string", "from", "one", "language", "to", "another", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Translate/src/TranslateClient.php#L179-L185
train
googleapis/google-cloud-php
Translate/src/TranslateClient.php
TranslateClient.translateBatch
public function translateBatch(array $strings, array $options = []) { $options += [ 'model' => null, ]; $options = array_filter($options + [ 'q' => $strings, 'key' => $this->key, 'target' => $this->targetLanguage, 'model' => $options['model'] ], function ($opt) { return !is_null($opt); }); $response = $this->connection->listTranslations($options); $translations = []; $strings = array_values($strings); if (isset($response['data']['translations'])) { foreach ($response['data']['translations'] as $key => $translation) { $source = isset($translation['detectedSourceLanguage']) ? $translation['detectedSourceLanguage'] : $options['source']; $model = (isset($translation['model'])) ? $translation['model'] : null; $translations[] = [ 'source' => $source, 'input' => $strings[$key], 'text' => $translation['translatedText'], 'model' => $model ]; } } return $translations; }
php
public function translateBatch(array $strings, array $options = []) { $options += [ 'model' => null, ]; $options = array_filter($options + [ 'q' => $strings, 'key' => $this->key, 'target' => $this->targetLanguage, 'model' => $options['model'] ], function ($opt) { return !is_null($opt); }); $response = $this->connection->listTranslations($options); $translations = []; $strings = array_values($strings); if (isset($response['data']['translations'])) { foreach ($response['data']['translations'] as $key => $translation) { $source = isset($translation['detectedSourceLanguage']) ? $translation['detectedSourceLanguage'] : $options['source']; $model = (isset($translation['model'])) ? $translation['model'] : null; $translations[] = [ 'source' => $source, 'input' => $strings[$key], 'text' => $translation['translatedText'], 'model' => $model ]; } } return $translations; }
[ "public", "function", "translateBatch", "(", "array", "$", "strings", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "+=", "[", "'model'", "=>", "null", ",", "]", ";", "$", "options", "=", "array_filter", "(", "$", "options", "+", "[", "'q'", "=>", "$", "strings", ",", "'key'", "=>", "$", "this", "->", "key", ",", "'target'", "=>", "$", "this", "->", "targetLanguage", ",", "'model'", "=>", "$", "options", "[", "'model'", "]", "]", ",", "function", "(", "$", "opt", ")", "{", "return", "!", "is_null", "(", "$", "opt", ")", ";", "}", ")", ";", "$", "response", "=", "$", "this", "->", "connection", "->", "listTranslations", "(", "$", "options", ")", ";", "$", "translations", "=", "[", "]", ";", "$", "strings", "=", "array_values", "(", "$", "strings", ")", ";", "if", "(", "isset", "(", "$", "response", "[", "'data'", "]", "[", "'translations'", "]", ")", ")", "{", "foreach", "(", "$", "response", "[", "'data'", "]", "[", "'translations'", "]", "as", "$", "key", "=>", "$", "translation", ")", "{", "$", "source", "=", "isset", "(", "$", "translation", "[", "'detectedSourceLanguage'", "]", ")", "?", "$", "translation", "[", "'detectedSourceLanguage'", "]", ":", "$", "options", "[", "'source'", "]", ";", "$", "model", "=", "(", "isset", "(", "$", "translation", "[", "'model'", "]", ")", ")", "?", "$", "translation", "[", "'model'", "]", ":", "null", ";", "$", "translations", "[", "]", "=", "[", "'source'", "=>", "$", "source", ",", "'input'", "=>", "$", "strings", "[", "$", "key", "]", ",", "'text'", "=>", "$", "translation", "[", "'translatedText'", "]", ",", "'model'", "=>", "$", "model", "]", ";", "}", "}", "return", "$", "translations", ";", "}" ]
Translate multiple strings from one language to another. Example: ``` $results = $translate->translateBatch([ 'Hello world!', 'My name is David.' ]); foreach ($results as $result) { echo $result['text']; } ``` @see https://cloud.google.com/translation/v2/translating-text-with-rest Translating Text @param array $strings An array of strings to translate. @param array $options [optional] { Configuration Options. @type string $source The source language to translate from. Must be a valid ISO 639-1 language code. If not provided the value will be automatically detected by the server. @type string $target The target language to translate to. Must be a valid ISO 639-1 language code. **Defaults to** the value assigned to the client (`"en"` by default). @type string $format Indicates whether the string to be translated is either plain-text or HTML. Acceptable values are `html` or `text`. **Defaults to** `"html"`. @type string $model The model to use for the translation request. May be `nmt` (for the NMT model) or `base` (for the PBMT model). **Defaults to** using the NMT model. If the NMT model is not supported for the requested language translation pair, the PBMT model will be defaulted instead. For a list of supported languages for the model types, please see the [Language Support](https://cloud.google.com/translate/docs/languages) documentation. } @return array A set of translation results. Each result includes a `source` key containing the detected or provided language of the provided input, an `input` key containing the original string, and a `text` key containing the translated result.
[ "Translate", "multiple", "strings", "from", "one", "language", "to", "another", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Translate/src/TranslateClient.php#L231-L271
train
googleapis/google-cloud-php
Translate/src/TranslateClient.php
TranslateClient.detectLanguageBatch
public function detectLanguageBatch(array $strings, array $options = []) { $response = $this->connection->listDetections($options + [ 'q' => $strings, 'key' => $this->key ]); $detections = []; foreach ($response['data']['detections'] as $key => $detection) { $detection = $detection[0]; $detections[] = array_filter([ 'languageCode' => $detection['language'], 'input' => $strings[$key], 'confidence' => isset($detection['confidence']) ? $detection['confidence'] : null ]); } return $detections; }
php
public function detectLanguageBatch(array $strings, array $options = []) { $response = $this->connection->listDetections($options + [ 'q' => $strings, 'key' => $this->key ]); $detections = []; foreach ($response['data']['detections'] as $key => $detection) { $detection = $detection[0]; $detections[] = array_filter([ 'languageCode' => $detection['language'], 'input' => $strings[$key], 'confidence' => isset($detection['confidence']) ? $detection['confidence'] : null ]); } return $detections; }
[ "public", "function", "detectLanguageBatch", "(", "array", "$", "strings", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "connection", "->", "listDetections", "(", "$", "options", "+", "[", "'q'", "=>", "$", "strings", ",", "'key'", "=>", "$", "this", "->", "key", "]", ")", ";", "$", "detections", "=", "[", "]", ";", "foreach", "(", "$", "response", "[", "'data'", "]", "[", "'detections'", "]", "as", "$", "key", "=>", "$", "detection", ")", "{", "$", "detection", "=", "$", "detection", "[", "0", "]", ";", "$", "detections", "[", "]", "=", "array_filter", "(", "[", "'languageCode'", "=>", "$", "detection", "[", "'language'", "]", ",", "'input'", "=>", "$", "strings", "[", "$", "key", "]", ",", "'confidence'", "=>", "isset", "(", "$", "detection", "[", "'confidence'", "]", ")", "?", "$", "detection", "[", "'confidence'", "]", ":", "null", "]", ")", ";", "}", "return", "$", "detections", ";", "}" ]
Detect the language of multiple strings. Example: ``` $results = $translate->detectLanguageBatch([ 'Hello World!', 'My name is David.' ]); foreach ($results as $result) { echo $result['languageCode']; } ``` @see https://cloud.google.com/translation/v2/detecting-language-with-rest Detecting Langauge @param string $string The string to detect the language of. @param array $options [optional] Configuration Options. @return array A set of results. Each result includes a `languageCode` key containing the detected ISO 639-1 language code, an `input` key containing the original string, and in most cases a `confidence` key containing a value between 0 - 1 signifying the confidence of the result.
[ "Detect", "the", "language", "of", "multiple", "strings", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Translate/src/TranslateClient.php#L323-L343
train
googleapis/google-cloud-php
Translate/src/TranslateClient.php
TranslateClient.languages
public function languages(array $options = []) { $response = $this->localizedLanguages($options + ['target' => null]); return array_map(function ($language) { return $language['code']; }, $response); }
php
public function languages(array $options = []) { $response = $this->localizedLanguages($options + ['target' => null]); return array_map(function ($language) { return $language['code']; }, $response); }
[ "public", "function", "languages", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "localizedLanguages", "(", "$", "options", "+", "[", "'target'", "=>", "null", "]", ")", ";", "return", "array_map", "(", "function", "(", "$", "language", ")", "{", "return", "$", "language", "[", "'code'", "]", ";", "}", ",", "$", "response", ")", ";", "}" ]
Get all supported languages. Example: ``` $languages = $translate->languages(); foreach ($languages as $language) { echo $language; } ``` @codingStandardsIgnoreStart @see https://cloud.google.com/translation/v2/discovering-supported-languages-with-rest Discovering Supported Languages @codingStandardsIgnoreEnd @param array $options [optional] Configuration Options. @return array A list of supported ISO 639-1 language codes.
[ "Get", "all", "supported", "languages", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Translate/src/TranslateClient.php#L364-L371
train
googleapis/google-cloud-php
Translate/src/TranslateClient.php
TranslateClient.localizedLanguages
public function localizedLanguages(array $options = []) { $response = $this->connection->listLanguages($options + [ 'key' => $this->key, 'target' => $this->targetLanguage ]); return array_map(function ($language) { return array_filter([ 'code' => $language['language'], 'name' => isset($language['name']) ? $language['name'] : null ]); }, $response['data']['languages']); }
php
public function localizedLanguages(array $options = []) { $response = $this->connection->listLanguages($options + [ 'key' => $this->key, 'target' => $this->targetLanguage ]); return array_map(function ($language) { return array_filter([ 'code' => $language['language'], 'name' => isset($language['name']) ? $language['name'] : null ]); }, $response['data']['languages']); }
[ "public", "function", "localizedLanguages", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "connection", "->", "listLanguages", "(", "$", "options", "+", "[", "'key'", "=>", "$", "this", "->", "key", ",", "'target'", "=>", "$", "this", "->", "targetLanguage", "]", ")", ";", "return", "array_map", "(", "function", "(", "$", "language", ")", "{", "return", "array_filter", "(", "[", "'code'", "=>", "$", "language", "[", "'language'", "]", ",", "'name'", "=>", "isset", "(", "$", "language", "[", "'name'", "]", ")", "?", "$", "language", "[", "'name'", "]", ":", "null", "]", ")", ";", "}", ",", "$", "response", "[", "'data'", "]", "[", "'languages'", "]", ")", ";", "}" ]
Get the supported languages for translation in the targeted language. Unlike {@see Google\Cloud\Translate\TranslateClient::languages()} this will return the localized language names in addition to the ISO 639-1 language codes. Example: ``` $languages = $translate->localizedLanguages(); foreach ($languages as $language) { echo $language['code']; } ``` @codingStandardsIgnoreStart @see https://cloud.google.com/translation/v2/discovering-supported-languages-with-rest Discovering Supported Languages @codingStandardsIgnoreEnd @param array $options [optional] { Configuration Options. @type string $target The language to discover supported languages for. Must be a valid ISO 639-1 language code. **Defaults to** the value assigned to the client (`"en"` by default). } @return array A set of language results. Each result includes a `code` key containing the ISO 639-1 code for the supported language and a `name` key containing the name of the language written in the target language.
[ "Get", "the", "supported", "languages", "for", "translation", "in", "the", "targeted", "language", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Translate/src/TranslateClient.php#L405-L418
train
googleapis/google-cloud-php
Datastore/src/V1/CompositeFilter.php
CompositeFilter.setOp
public function setOp($var) { GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CompositeFilter_Operator::class); $this->op = $var; return $this; }
php
public function setOp($var) { GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CompositeFilter_Operator::class); $this->op = $var; return $this; }
[ "public", "function", "setOp", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Datastore", "\\", "V1", "\\", "CompositeFilter_Operator", "::", "class", ")", ";", "$", "this", "->", "op", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The operator for combining multiple filters. Generated from protobuf field <code>.google.datastore.v1.CompositeFilter.Operator op = 1;</code> @param int $var @return $this
[ "The", "operator", "for", "combining", "multiple", "filters", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/V1/CompositeFilter.php#L68-L74
train
googleapis/google-cloud-php
Iot/src/V1/ListDeviceStatesResponse.php
ListDeviceStatesResponse.setDeviceStates
public function setDeviceStates($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iot\V1\DeviceState::class); $this->device_states = $arr; return $this; }
php
public function setDeviceStates($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iot\V1\DeviceState::class); $this->device_states = $arr; return $this; }
[ "public", "function", "setDeviceStates", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Iot", "\\", "V1", "\\", "DeviceState", "::", "class", ")", ";", "$", "this", "->", "device_states", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
The last few device states. States are listed in descending order of server update time, starting from the most recent one. Generated from protobuf field <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> @param \Google\Cloud\Iot\V1\DeviceState[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "The", "last", "few", "device", "states", ".", "States", "are", "listed", "in", "descending", "order", "of", "server", "update", "time", "starting", "from", "the", "most", "recent", "one", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Iot/src/V1/ListDeviceStatesResponse.php#L62-L68
train
googleapis/google-cloud-php
Dialogflow/src/V2/BatchUpdateEntityTypesRequest.php
BatchUpdateEntityTypesRequest.setEntityTypeBatchInline
public function setEntityTypeBatchInline($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityTypeBatch::class); $this->writeOneof(3, $var); return $this; }
php
public function setEntityTypeBatchInline($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityTypeBatch::class); $this->writeOneof(3, $var); return $this; }
[ "public", "function", "setEntityTypeBatchInline", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dialogflow", "\\", "V2", "\\", "EntityTypeBatch", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "3", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
The collection of entity types to update or create. Generated from protobuf field <code>.google.cloud.dialogflow.v2.EntityTypeBatch entity_type_batch_inline = 3;</code> @param \Google\Cloud\Dialogflow\V2\EntityTypeBatch $var @return $this
[ "The", "collection", "of", "entity", "types", "to", "update", "or", "create", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/BatchUpdateEntityTypesRequest.php#L154-L160
train
googleapis/google-cloud-php
Storage/src/Notification.php
Notification.reload
public function reload(array $options = []) { return $this->info = $this->connection->getNotification( $options + $this->identity ); }
php
public function reload(array $options = []) { return $this->info = $this->connection->getNotification( $options + $this->identity ); }
[ "public", "function", "reload", "(", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "info", "=", "$", "this", "->", "connection", "->", "getNotification", "(", "$", "options", "+", "$", "this", "->", "identity", ")", ";", "}" ]
Triggers a network request to reload the notification's details. Example: ``` $notification->reload(); $info = $notification->info(); echo $info['topic']; ``` @see https://cloud.google.com/storage/docs/json_api/v1/notifications/get Notifications get API documentation. @param array $options [optional] @return array
[ "Triggers", "a", "network", "request", "to", "reload", "the", "notification", "s", "details", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Storage/src/Notification.php#L164-L169
train
googleapis/google-cloud-php
Dlp/src/V2/LargeCustomDictionaryConfig.php
LargeCustomDictionaryConfig.setOutputPath
public function setOutputPath($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStoragePath::class); $this->output_path = $var; return $this; }
php
public function setOutputPath($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStoragePath::class); $this->output_path = $var; return $this; }
[ "public", "function", "setOutputPath", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "CloudStoragePath", "::", "class", ")", ";", "$", "this", "->", "output_path", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Location to store dictionary artifacts in Google Cloud Storage. These files will only be accessible by project owners and the DLP API. If any of these artifacts are modified, the dictionary is considered invalid and can no longer be used. Generated from protobuf field <code>.google.privacy.dlp.v2.CloudStoragePath output_path = 1;</code> @param \Google\Cloud\Dlp\V2\CloudStoragePath $var @return $this
[ "Location", "to", "store", "dictionary", "artifacts", "in", "Google", "Cloud", "Storage", ".", "These", "files", "will", "only", "be", "accessible", "by", "project", "owners", "and", "the", "DLP", "API", ".", "If", "any", "of", "these", "artifacts", "are", "modified", "the", "dictionary", "is", "considered", "invalid", "and", "can", "no", "longer", "be", "used", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/LargeCustomDictionaryConfig.php#L80-L86
train
googleapis/google-cloud-php
Dlp/src/V2/LargeCustomDictionaryConfig.php
LargeCustomDictionaryConfig.setCloudStorageFileSet
public function setCloudStorageFileSet($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStorageFileSet::class); $this->writeOneof(2, $var); return $this; }
php
public function setCloudStorageFileSet($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStorageFileSet::class); $this->writeOneof(2, $var); return $this; }
[ "public", "function", "setCloudStorageFileSet", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "CloudStorageFileSet", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "2", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
Set of files containing newline-delimited lists of dictionary phrases. Generated from protobuf field <code>.google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2;</code> @param \Google\Cloud\Dlp\V2\CloudStorageFileSet $var @return $this
[ "Set", "of", "files", "containing", "newline", "-", "delimited", "lists", "of", "dictionary", "phrases", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/LargeCustomDictionaryConfig.php#L106-L112
train
googleapis/google-cloud-php
Dlp/src/V2/LargeCustomDictionaryConfig.php
LargeCustomDictionaryConfig.setBigQueryField
public function setBigQueryField($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\BigQueryField::class); $this->writeOneof(3, $var); return $this; }
php
public function setBigQueryField($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\BigQueryField::class); $this->writeOneof(3, $var); return $this; }
[ "public", "function", "setBigQueryField", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "BigQueryField", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "3", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
Field in a BigQuery table where each cell represents a dictionary phrase. Generated from protobuf field <code>.google.privacy.dlp.v2.BigQueryField big_query_field = 3;</code> @param \Google\Cloud\Dlp\V2\BigQueryField $var @return $this
[ "Field", "in", "a", "BigQuery", "table", "where", "each", "cell", "represents", "a", "dictionary", "phrase", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/LargeCustomDictionaryConfig.php#L132-L138
train
googleapis/google-cloud-php
Talent/src/V4beta1/CreateClientEventRequest.php
CreateClientEventRequest.setClientEvent
public function setClientEvent($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\ClientEvent::class); $this->client_event = $var; return $this; }
php
public function setClientEvent($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\ClientEvent::class); $this->client_event = $var; return $this; }
[ "public", "function", "setClientEvent", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Talent", "\\", "V4beta1", "\\", "ClientEvent", "::", "class", ")", ";", "$", "this", "->", "client_event", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Required. Events issued when end user interacts with customer's application that uses Cloud Talent Solution. Generated from protobuf field <code>.google.cloud.talent.v4beta1.ClientEvent client_event = 2;</code> @param \Google\Cloud\Talent\V4beta1\ClientEvent $var @return $this
[ "Required", ".", "Events", "issued", "when", "end", "user", "interacts", "with", "customer", "s", "application", "that", "uses", "Cloud", "Talent", "Solution", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/CreateClientEventRequest.php#L120-L126
train
googleapis/google-cloud-php
Vision/src/V1/Gapic/ProductSearchGapicClient.php
ProductSearchGapicClient.productName
public static function productName($project, $location, $product) { return self::getProductNameTemplate()->render([ 'project' => $project, 'location' => $location, 'product' => $product, ]); }
php
public static function productName($project, $location, $product) { return self::getProductNameTemplate()->render([ 'project' => $project, 'location' => $location, 'product' => $product, ]); }
[ "public", "static", "function", "productName", "(", "$", "project", ",", "$", "location", ",", "$", "product", ")", "{", "return", "self", "::", "getProductNameTemplate", "(", ")", "->", "render", "(", "[", "'project'", "=>", "$", "project", ",", "'location'", "=>", "$", "location", ",", "'product'", "=>", "$", "product", ",", "]", ")", ";", "}" ]
Formats a string containing the fully-qualified path to represent a product resource. @param string $project @param string $location @param string $product @return string The formatted product resource. @experimental
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "product", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/Gapic/ProductSearchGapicClient.php#L248-L255
train
googleapis/google-cloud-php
Vision/src/V1/Gapic/ProductSearchGapicClient.php
ProductSearchGapicClient.productSetName
public static function productSetName($project, $location, $productSet) { return self::getProductSetNameTemplate()->render([ 'project' => $project, 'location' => $location, 'product_set' => $productSet, ]); }
php
public static function productSetName($project, $location, $productSet) { return self::getProductSetNameTemplate()->render([ 'project' => $project, 'location' => $location, 'product_set' => $productSet, ]); }
[ "public", "static", "function", "productSetName", "(", "$", "project", ",", "$", "location", ",", "$", "productSet", ")", "{", "return", "self", "::", "getProductSetNameTemplate", "(", ")", "->", "render", "(", "[", "'project'", "=>", "$", "project", ",", "'location'", "=>", "$", "location", ",", "'product_set'", "=>", "$", "productSet", ",", "]", ")", ";", "}" ]
Formats a string containing the fully-qualified path to represent a product_set resource. @param string $project @param string $location @param string $productSet @return string The formatted product_set resource. @experimental
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "product_set", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/Gapic/ProductSearchGapicClient.php#L268-L275
train
googleapis/google-cloud-php
Vision/src/V1/Gapic/ProductSearchGapicClient.php
ProductSearchGapicClient.referenceImageName
public static function referenceImageName($project, $location, $product, $referenceImage) { return self::getReferenceImageNameTemplate()->render([ 'project' => $project, 'location' => $location, 'product' => $product, 'reference_image' => $referenceImage, ]); }
php
public static function referenceImageName($project, $location, $product, $referenceImage) { return self::getReferenceImageNameTemplate()->render([ 'project' => $project, 'location' => $location, 'product' => $product, 'reference_image' => $referenceImage, ]); }
[ "public", "static", "function", "referenceImageName", "(", "$", "project", ",", "$", "location", ",", "$", "product", ",", "$", "referenceImage", ")", "{", "return", "self", "::", "getReferenceImageNameTemplate", "(", ")", "->", "render", "(", "[", "'project'", "=>", "$", "project", ",", "'location'", "=>", "$", "location", ",", "'product'", "=>", "$", "product", ",", "'reference_image'", "=>", "$", "referenceImage", ",", "]", ")", ";", "}" ]
Formats a string containing the fully-qualified path to represent a reference_image resource. @param string $project @param string $location @param string $product @param string $referenceImage @return string The formatted reference_image resource. @experimental
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "reference_image", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/Gapic/ProductSearchGapicClient.php#L289-L297
train
googleapis/google-cloud-php
PubSub/src/Message.php
Message.attribute
public function attribute($key) { return (isset($this->message['attributes'][$key])) ? $this->message['attributes'][$key] : null; }
php
public function attribute($key) { return (isset($this->message['attributes'][$key])) ? $this->message['attributes'][$key] : null; }
[ "public", "function", "attribute", "(", "$", "key", ")", "{", "return", "(", "isset", "(", "$", "this", "->", "message", "[", "'attributes'", "]", "[", "$", "key", "]", ")", ")", "?", "$", "this", "->", "message", "[", "'attributes'", "]", "[", "$", "key", "]", ":", "null", ";", "}" ]
Retrieve a single message attribute. Example: ``` echo $message->attribute('browser-name'); ``` @param string $key The attribute key @return string|null
[ "Retrieve", "a", "single", "message", "attribute", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/Message.php#L109-L114
train
googleapis/google-cloud-php
Core/src/RetryDeciderTrait.php
RetryDeciderTrait.getRetryFunction
private function getRetryFunction($shouldRetryMessages = true) { $httpRetryCodes = $this->httpRetryCodes; $httpRetryMessages = $this->httpRetryMessages; return function (\Exception $ex) use ($httpRetryCodes, $httpRetryMessages, $shouldRetryMessages) { $statusCode = $ex->getCode(); if (in_array($statusCode, $httpRetryCodes)) { return true; } if (!$shouldRetryMessages) { return false; } $message = ($ex instanceof RequestException && $ex->hasResponse()) ? (string) $ex->getResponse()->getBody() : $ex->getMessage(); try { $message = $this->jsonDecode( $message, true ); } catch (\InvalidArgumentException $ex) { return false; } if (!isset($message['error']['errors'])) { return false; } foreach ($message['error']['errors'] as $error) { if (in_array($error['reason'], $httpRetryMessages)) { return true; } } return false; }; }
php
private function getRetryFunction($shouldRetryMessages = true) { $httpRetryCodes = $this->httpRetryCodes; $httpRetryMessages = $this->httpRetryMessages; return function (\Exception $ex) use ($httpRetryCodes, $httpRetryMessages, $shouldRetryMessages) { $statusCode = $ex->getCode(); if (in_array($statusCode, $httpRetryCodes)) { return true; } if (!$shouldRetryMessages) { return false; } $message = ($ex instanceof RequestException && $ex->hasResponse()) ? (string) $ex->getResponse()->getBody() : $ex->getMessage(); try { $message = $this->jsonDecode( $message, true ); } catch (\InvalidArgumentException $ex) { return false; } if (!isset($message['error']['errors'])) { return false; } foreach ($message['error']['errors'] as $error) { if (in_array($error['reason'], $httpRetryMessages)) { return true; } } return false; }; }
[ "private", "function", "getRetryFunction", "(", "$", "shouldRetryMessages", "=", "true", ")", "{", "$", "httpRetryCodes", "=", "$", "this", "->", "httpRetryCodes", ";", "$", "httpRetryMessages", "=", "$", "this", "->", "httpRetryMessages", ";", "return", "function", "(", "\\", "Exception", "$", "ex", ")", "use", "(", "$", "httpRetryCodes", ",", "$", "httpRetryMessages", ",", "$", "shouldRetryMessages", ")", "{", "$", "statusCode", "=", "$", "ex", "->", "getCode", "(", ")", ";", "if", "(", "in_array", "(", "$", "statusCode", ",", "$", "httpRetryCodes", ")", ")", "{", "return", "true", ";", "}", "if", "(", "!", "$", "shouldRetryMessages", ")", "{", "return", "false", ";", "}", "$", "message", "=", "(", "$", "ex", "instanceof", "RequestException", "&&", "$", "ex", "->", "hasResponse", "(", ")", ")", "?", "(", "string", ")", "$", "ex", "->", "getResponse", "(", ")", "->", "getBody", "(", ")", ":", "$", "ex", "->", "getMessage", "(", ")", ";", "try", "{", "$", "message", "=", "$", "this", "->", "jsonDecode", "(", "$", "message", ",", "true", ")", ";", "}", "catch", "(", "\\", "InvalidArgumentException", "$", "ex", ")", "{", "return", "false", ";", "}", "if", "(", "!", "isset", "(", "$", "message", "[", "'error'", "]", "[", "'errors'", "]", ")", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "message", "[", "'error'", "]", "[", "'errors'", "]", "as", "$", "error", ")", "{", "if", "(", "in_array", "(", "$", "error", "[", "'reason'", "]", ",", "$", "httpRetryMessages", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", ";", "}" ]
Determines whether or not the request should be retried. @param bool $shouldRetryMessages Whether or not to attempt retrying based on the failure message. @return callable
[ "Determines", "whether", "or", "not", "the", "request", "should", "be", "retried", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/RetryDeciderTrait.php#L53-L94
train
googleapis/google-cloud-php
Vision/src/V1/TextAnnotation/DetectedBreak.php
DetectedBreak.setType
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Vision\V1\TextAnnotation_DetectedBreak_BreakType::class); $this->type = $var; return $this; }
php
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Vision\V1\TextAnnotation_DetectedBreak_BreakType::class); $this->type = $var; return $this; }
[ "public", "function", "setType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Vision", "\\", "V1", "\\", "TextAnnotation_DetectedBreak_BreakType", "::", "class", ")", ";", "$", "this", "->", "type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Detected break type. Generated from protobuf field <code>.google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType type = 1;</code> @param int $var @return $this
[ "Detected", "break", "type", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/TextAnnotation/DetectedBreak.php#L66-L72
train
googleapis/google-cloud-php
Container/src/V1/Cluster.php
Cluster.setMasterAuth
public function setMasterAuth($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuth::class); $this->master_auth = $var; return $this; }
php
public function setMasterAuth($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuth::class); $this->master_auth = $var; return $this; }
[ "public", "function", "setMasterAuth", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "MasterAuth", "::", "class", ")", ";", "$", "this", "->", "master_auth", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The authentication information for accessing the master endpoint. Generated from protobuf field <code>.google.container.v1.MasterAuth master_auth = 5;</code> @param \Google\Cloud\Container\V1\MasterAuth $var @return $this
[ "The", "authentication", "information", "for", "accessing", "the", "master", "endpoint", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/Cluster.php#L652-L658
train
googleapis/google-cloud-php
Container/src/V1/Cluster.php
Cluster.setLegacyAbac
public function setLegacyAbac($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\LegacyAbac::class); $this->legacy_abac = $var; return $this; }
php
public function setLegacyAbac($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\LegacyAbac::class); $this->legacy_abac = $var; return $this; }
[ "public", "function", "setLegacyAbac", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "LegacyAbac", "::", "class", ")", ";", "$", "this", "->", "legacy_abac", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Configuration for the legacy ABAC authorization mode. Generated from protobuf field <code>.google.container.v1.LegacyAbac legacy_abac = 18;</code> @param \Google\Cloud\Container\V1\LegacyAbac $var @return $this
[ "Configuration", "for", "the", "legacy", "ABAC", "authorization", "mode", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/Cluster.php#L1016-L1022
train
googleapis/google-cloud-php
Container/src/V1/Cluster.php
Cluster.setIpAllocationPolicy
public function setIpAllocationPolicy($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\IPAllocationPolicy::class); $this->ip_allocation_policy = $var; return $this; }
php
public function setIpAllocationPolicy($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\IPAllocationPolicy::class); $this->ip_allocation_policy = $var; return $this; }
[ "public", "function", "setIpAllocationPolicy", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "IPAllocationPolicy", "::", "class", ")", ";", "$", "this", "->", "ip_allocation_policy", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Configuration for cluster IP allocation. Generated from protobuf field <code>.google.container.v1.IPAllocationPolicy ip_allocation_policy = 20;</code> @param \Google\Cloud\Container\V1\IPAllocationPolicy $var @return $this
[ "Configuration", "for", "cluster", "IP", "allocation", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/Cluster.php#L1068-L1074
train
googleapis/google-cloud-php
Container/src/V1/Cluster.php
Cluster.setMasterAuthorizedNetworksConfig
public function setMasterAuthorizedNetworksConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig::class); $this->master_authorized_networks_config = $var; return $this; }
php
public function setMasterAuthorizedNetworksConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig::class); $this->master_authorized_networks_config = $var; return $this; }
[ "public", "function", "setMasterAuthorizedNetworksConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "MasterAuthorizedNetworksConfig", "::", "class", ")", ";", "$", "this", "->", "master_authorized_networks_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The configuration options for master authorized networks feature. Generated from protobuf field <code>.google.container.v1.MasterAuthorizedNetworksConfig master_authorized_networks_config = 22;</code> @param \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig $var @return $this
[ "The", "configuration", "options", "for", "master", "authorized", "networks", "feature", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/Cluster.php#L1094-L1100
train
googleapis/google-cloud-php
Container/src/V1/Cluster.php
Cluster.setNetworkConfig
public function setNetworkConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NetworkConfig::class); $this->network_config = $var; return $this; }
php
public function setNetworkConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NetworkConfig::class); $this->network_config = $var; return $this; }
[ "public", "function", "setNetworkConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "NetworkConfig", "::", "class", ")", ";", "$", "this", "->", "network_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Configuration for cluster networking. Generated from protobuf field <code>.google.container.v1.NetworkConfig network_config = 27;</code> @param \Google\Cloud\Container\V1\NetworkConfig $var @return $this
[ "Configuration", "for", "cluster", "networking", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/Cluster.php#L1146-L1152
train
googleapis/google-cloud-php
Container/src/V1/Cluster.php
Cluster.setPrivateClusterConfig
public function setPrivateClusterConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\PrivateClusterConfig::class); $this->private_cluster_config = $var; return $this; }
php
public function setPrivateClusterConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\PrivateClusterConfig::class); $this->private_cluster_config = $var; return $this; }
[ "public", "function", "setPrivateClusterConfig", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "PrivateClusterConfig", "::", "class", ")", ";", "$", "this", "->", "private_cluster_config", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Configuration for private cluster. Generated from protobuf field <code>.google.container.v1.PrivateClusterConfig private_cluster_config = 37;</code> @param \Google\Cloud\Container\V1\PrivateClusterConfig $var @return $this
[ "Configuration", "for", "private", "cluster", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/Cluster.php#L1172-L1178
train
googleapis/google-cloud-php
Talent/src/V4beta1/Publication.php
Publication.setAuthors
public function setAuthors($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->authors = $arr; return $this; }
php
public function setAuthors($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->authors = $arr; return $this; }
[ "public", "function", "setAuthors", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ")", ";", "$", "this", "->", "authors", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Optional. A list of author names. Number of characters allowed is 100. Generated from protobuf field <code>repeated string authors = 1;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Optional", ".", "A", "list", "of", "author", "names", ".", "Number", "of", "characters", "allowed", "is", "100", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/Publication.php#L160-L166
train
googleapis/google-cloud-php
AutoMl/src/V1beta1/ClassificationEvaluationMetrics/ConfusionMatrix.php
ConfusionMatrix.setAnnotationSpecId
public function setAnnotationSpecId($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->annotation_spec_id = $arr; return $this; }
php
public function setAnnotationSpecId($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->annotation_spec_id = $arr; return $this; }
[ "public", "function", "setAnnotationSpecId", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ")", ";", "$", "this", "->", "annotation_spec_id", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Output only. IDs of the annotation specs used in the confusion matrix. Generated from protobuf field <code>repeated string annotation_spec_id = 1;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Output", "only", ".", "IDs", "of", "the", "annotation", "specs", "used", "in", "the", "confusion", "matrix", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/AutoMl/src/V1beta1/ClassificationEvaluationMetrics/ConfusionMatrix.php#L74-L80
train
googleapis/google-cloud-php
Firestore/src/V1beta1/DocumentDelete.php
DocumentDelete.setRemovedTargetIds
public function setRemovedTargetIds($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); $this->removed_target_ids = $arr; return $this; }
php
public function setRemovedTargetIds($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); $this->removed_target_ids = $arr; return $this; }
[ "public", "function", "setRemovedTargetIds", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "INT32", ")", ";", "$", "this", "->", "removed_target_ids", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
A set of target IDs for targets that previously matched this entity. Generated from protobuf field <code>repeated int32 removed_target_ids = 6;</code> @param int[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "A", "set", "of", "target", "IDs", "for", "targets", "that", "previously", "matched", "this", "entity", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1beta1/DocumentDelete.php#L106-L112
train
googleapis/google-cloud-php
BigQueryDataTransfer/src/V1/Gapic/DataTransferServiceGapicClient.php
DataTransferServiceGapicClient.projectRunName
public static function projectRunName($project, $transferConfig, $run) { return self::getProjectRunNameTemplate()->render([ 'project' => $project, 'transfer_config' => $transferConfig, 'run' => $run, ]); }
php
public static function projectRunName($project, $transferConfig, $run) { return self::getProjectRunNameTemplate()->render([ 'project' => $project, 'transfer_config' => $transferConfig, 'run' => $run, ]); }
[ "public", "static", "function", "projectRunName", "(", "$", "project", ",", "$", "transferConfig", ",", "$", "run", ")", "{", "return", "self", "::", "getProjectRunNameTemplate", "(", ")", "->", "render", "(", "[", "'project'", "=>", "$", "project", ",", "'transfer_config'", "=>", "$", "transferConfig", ",", "'run'", "=>", "$", "run", ",", "]", ")", ";", "}" ]
Formats a string containing the fully-qualified path to represent a project_run resource. @param string $project @param string $transferConfig @param string $run @return string The formatted project_run resource. @experimental
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "project_run", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/Gapic/DataTransferServiceGapicClient.php#L240-L247
train
googleapis/google-cloud-php
Container/src/V1/CreateNodePoolRequest.php
CreateNodePoolRequest.setNodePool
public function setNodePool($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NodePool::class); $this->node_pool = $var; return $this; }
php
public function setNodePool($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NodePool::class); $this->node_pool = $var; return $this; }
[ "public", "function", "setNodePool", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "NodePool", "::", "class", ")", ";", "$", "this", "->", "node_pool", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The node pool to create. Generated from protobuf field <code>.google.container.v1.NodePool node_pool = 4;</code> @param \Google\Cloud\Container\V1\NodePool $var @return $this
[ "The", "node", "pool", "to", "create", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/CreateNodePoolRequest.php#L196-L202
train
googleapis/google-cloud-php
Asset/src/V1/OutputConfig.php
OutputConfig.setGcsDestination
public function setGcsDestination($var) { GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\GcsDestination::class); $this->writeOneof(1, $var); return $this; }
php
public function setGcsDestination($var) { GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\GcsDestination::class); $this->writeOneof(1, $var); return $this; }
[ "public", "function", "setGcsDestination", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Asset", "\\", "V1", "\\", "GcsDestination", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "1", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
Destination on Cloud Storage. Generated from protobuf field <code>.google.cloud.asset.v1.GcsDestination gcs_destination = 1;</code> @param \Google\Cloud\Asset\V1\GcsDestination $var @return $this
[ "Destination", "on", "Cloud", "Storage", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Asset/src/V1/OutputConfig.php#L53-L59
train
googleapis/google-cloud-php
SecurityCenter/src/V1/Gapic/SecurityCenterGapicClient.php
SecurityCenterGapicClient.findingSecurityMarksName
public static function findingSecurityMarksName($organization, $source, $finding) { return self::getFindingSecurityMarksNameTemplate()->render([ 'organization' => $organization, 'source' => $source, 'finding' => $finding, ]); }
php
public static function findingSecurityMarksName($organization, $source, $finding) { return self::getFindingSecurityMarksNameTemplate()->render([ 'organization' => $organization, 'source' => $source, 'finding' => $finding, ]); }
[ "public", "static", "function", "findingSecurityMarksName", "(", "$", "organization", ",", "$", "source", ",", "$", "finding", ")", "{", "return", "self", "::", "getFindingSecurityMarksNameTemplate", "(", ")", "->", "render", "(", "[", "'organization'", "=>", "$", "organization", ",", "'source'", "=>", "$", "source", ",", "'finding'", "=>", "$", "finding", ",", "]", ")", ";", "}" ]
Formats a string containing the fully-qualified path to represent a finding_security_marks resource. @param string $organization @param string $source @param string $finding @return string The formatted finding_security_marks resource. @experimental
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "finding_security_marks", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/Gapic/SecurityCenterGapicClient.php#L283-L290
train
googleapis/google-cloud-php
SecurityCenter/src/V1/Gapic/SecurityCenterGapicClient.php
SecurityCenterGapicClient.findingName
public static function findingName($organization, $source, $finding) { return self::getFindingNameTemplate()->render([ 'organization' => $organization, 'source' => $source, 'finding' => $finding, ]); }
php
public static function findingName($organization, $source, $finding) { return self::getFindingNameTemplate()->render([ 'organization' => $organization, 'source' => $source, 'finding' => $finding, ]); }
[ "public", "static", "function", "findingName", "(", "$", "organization", ",", "$", "source", ",", "$", "finding", ")", "{", "return", "self", "::", "getFindingNameTemplate", "(", ")", "->", "render", "(", "[", "'organization'", "=>", "$", "organization", ",", "'source'", "=>", "$", "source", ",", "'finding'", "=>", "$", "finding", ",", "]", ")", ";", "}" ]
Formats a string containing the fully-qualified path to represent a finding resource. @param string $organization @param string $source @param string $finding @return string The formatted finding resource. @experimental
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "finding", "resource", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/Gapic/SecurityCenterGapicClient.php#L353-L360
train
googleapis/google-cloud-php
SecurityCenter/src/V1/Gapic/SecurityCenterGapicClient.php
SecurityCenterGapicClient.getIamPolicy
public function getIamPolicy($resource, array $optionalArgs = []) { $request = new GetIamPolicyRequest(); $request->setResource($resource); return $this->startCall( 'GetIamPolicy', Policy::class, $optionalArgs, $request )->wait(); }
php
public function getIamPolicy($resource, array $optionalArgs = []) { $request = new GetIamPolicyRequest(); $request->setResource($resource); return $this->startCall( 'GetIamPolicy', Policy::class, $optionalArgs, $request )->wait(); }
[ "public", "function", "getIamPolicy", "(", "$", "resource", ",", "array", "$", "optionalArgs", "=", "[", "]", ")", "{", "$", "request", "=", "new", "GetIamPolicyRequest", "(", ")", ";", "$", "request", "->", "setResource", "(", "$", "resource", ")", ";", "return", "$", "this", "->", "startCall", "(", "'GetIamPolicy'", ",", "Policy", "::", "class", ",", "$", "optionalArgs", ",", "$", "request", ")", "->", "wait", "(", ")", ";", "}" ]
Gets the access control policy on the specified Source. Sample code: ``` $securityCenterClient = new SecurityCenterClient(); try { $formattedResource = $securityCenterClient->sourceName('[ORGANIZATION]', '[SOURCE]'); $response = $securityCenterClient->getIamPolicy($formattedResource); } finally { $securityCenterClient->close(); } ``` @param string $resource REQUIRED: The resource for which the policy is being requested. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`. @param array $optionalArgs { Optional. @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\Iam\V1\Policy @throws ApiException if the remote call fails @experimental
[ "Gets", "the", "access", "control", "policy", "on", "the", "specified", "Source", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/Gapic/SecurityCenterGapicClient.php#L637-L648
train
googleapis/google-cloud-php
AutoMl/src/V1beta1/ClassificationEvaluationMetrics.php
ClassificationEvaluationMetrics.setConfidenceMetricsEntry
public function setConfidenceMetricsEntry($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry::class); $this->confidence_metrics_entry = $arr; return $this; }
php
public function setConfidenceMetricsEntry($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry::class); $this->confidence_metrics_entry = $arr; return $this; }
[ "public", "function", "setConfidenceMetricsEntry", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "AutoMl", "\\", "V1beta1", "\\", "ClassificationEvaluationMetrics", "\\", "ConfidenceMetricsEntry", "::", "class", ")", ";", "$", "this", "->", "confidence_metrics_entry", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Output only. Metrics that have confidence thresholds. Precision-recall curve can be derived from it. Generated from protobuf field <code>repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;</code> @param \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Output", "only", ".", "Metrics", "that", "have", "confidence", "thresholds", ".", "Precision", "-", "recall", "curve", "can", "be", "derived", "from", "it", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/AutoMl/src/V1beta1/ClassificationEvaluationMetrics.php#L153-L159
train
googleapis/google-cloud-php
AutoMl/src/V1beta1/ClassificationEvaluationMetrics.php
ClassificationEvaluationMetrics.setConfusionMatrix
public function setConfusionMatrix($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics_ConfusionMatrix::class); $this->confusion_matrix = $var; return $this; }
php
public function setConfusionMatrix($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics_ConfusionMatrix::class); $this->confusion_matrix = $var; return $this; }
[ "public", "function", "setConfusionMatrix", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "AutoMl", "\\", "V1beta1", "\\", "ClassificationEvaluationMetrics_ConfusionMatrix", "::", "class", ")", ";", "$", "this", "->", "confusion_matrix", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Output only. Confusion matrix of the evaluation. Only set for MULTICLASS classification problems where number of labels is no more than 10. Only set for model level evaluation, not for evaluation per label. Generated from protobuf field <code>.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;</code> @param \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfusionMatrix $var @return $this
[ "Output", "only", ".", "Confusion", "matrix", "of", "the", "evaluation", ".", "Only", "set", "for", "MULTICLASS", "classification", "problems", "where", "number", "of", "labels", "is", "no", "more", "than", "10", ".", "Only", "set", "for", "model", "level", "evaluation", "not", "for", "evaluation", "per", "label", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/AutoMl/src/V1beta1/ClassificationEvaluationMetrics.php#L185-L191
train
googleapis/google-cloud-php
BigQueryDataTransfer/src/V1/ListTransferLogsRequest.php
ListTransferLogsRequest.setMessageTypes
public function setMessageTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage\MessageSeverity::class); $this->message_types = $arr; return $this; }
php
public function setMessageTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage\MessageSeverity::class); $this->message_types = $arr; return $this; }
[ "public", "function", "setMessageTypes", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "ENUM", ",", "\\", "Google", "\\", "Cloud", "\\", "BigQuery", "\\", "DataTransfer", "\\", "V1", "\\", "TransferMessage", "\\", "MessageSeverity", "::", "class", ")", ";", "$", "this", "->", "message_types", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Message types to return. If not populated - INFO, WARNING and ERROR messages are returned. Generated from protobuf field <code>repeated .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity message_types = 6;</code> @param int[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Message", "types", "to", "return", ".", "If", "not", "populated", "-", "INFO", "WARNING", "and", "ERROR", "messages", "are", "returned", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQueryDataTransfer/src/V1/ListTransferLogsRequest.php#L184-L190
train
googleapis/google-cloud-php
SecurityCenter/src/V1/CreateSourceRequest.php
CreateSourceRequest.setSource
public function setSource($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\Source::class); $this->source = $var; return $this; }
php
public function setSource($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\Source::class); $this->source = $var; return $this; }
[ "public", "function", "setSource", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "SecurityCenter", "\\", "V1", "\\", "Source", "::", "class", ")", ";", "$", "this", "->", "source", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The Source being created, only the display_name and description will be used. All other fields will be ignored. Generated from protobuf field <code>.google.cloud.securitycenter.v1.Source source = 2;</code> @param \Google\Cloud\SecurityCenter\V1\Source $var @return $this
[ "The", "Source", "being", "created", "only", "the", "display_name", "and", "description", "will", "be", "used", ".", "All", "other", "fields", "will", "be", "ignored", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/CreateSourceRequest.php#L100-L106
train
googleapis/google-cloud-php
SecurityCenter/src/V1/UpdateOrganizationSettingsRequest.php
UpdateOrganizationSettingsRequest.setOrganizationSettings
public function setOrganizationSettings($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\OrganizationSettings::class); $this->organization_settings = $var; return $this; }
php
public function setOrganizationSettings($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\OrganizationSettings::class); $this->organization_settings = $var; return $this; }
[ "public", "function", "setOrganizationSettings", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "SecurityCenter", "\\", "V1", "\\", "OrganizationSettings", "::", "class", ")", ";", "$", "this", "->", "organization_settings", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The organization settings resource to update. Generated from protobuf field <code>.google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1;</code> @param \Google\Cloud\SecurityCenter\V1\OrganizationSettings $var @return $this
[ "The", "organization", "settings", "resource", "to", "update", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/SecurityCenter/src/V1/UpdateOrganizationSettingsRequest.php#L68-L74
train
googleapis/google-cloud-php
PubSub/src/V1/UpdateSubscriptionRequest.php
UpdateSubscriptionRequest.setSubscription
public function setSubscription($var) { GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Subscription::class); $this->subscription = $var; return $this; }
php
public function setSubscription($var) { GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Subscription::class); $this->subscription = $var; return $this; }
[ "public", "function", "setSubscription", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "PubSub", "\\", "V1", "\\", "Subscription", "::", "class", ")", ";", "$", "this", "->", "subscription", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The updated subscription object. Generated from protobuf field <code>.google.pubsub.v1.Subscription subscription = 1;</code> @param \Google\Cloud\PubSub\V1\Subscription $var @return $this
[ "The", "updated", "subscription", "object", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/V1/UpdateSubscriptionRequest.php#L68-L74
train
googleapis/google-cloud-php
Logging/src/Metric.php
Metric.update
public function update(array $metadata, array $options = []) { $options += $metadata; $options += $this->info($options); return $this->info = $this->connection->updateMetric($options + [ 'metricName' => $this->formattedName ]); }
php
public function update(array $metadata, array $options = []) { $options += $metadata; $options += $this->info($options); return $this->info = $this->connection->updateMetric($options + [ 'metricName' => $this->formattedName ]); }
[ "public", "function", "update", "(", "array", "$", "metadata", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "+=", "$", "metadata", ";", "$", "options", "+=", "$", "this", "->", "info", "(", "$", "options", ")", ";", "return", "$", "this", "->", "info", "=", "$", "this", "->", "connection", "->", "updateMetric", "(", "$", "options", "+", "[", "'metricName'", "=>", "$", "this", "->", "formattedName", "]", ")", ";", "}" ]
Update the metric. Please note this will trigger a network request if cached data is not available to perform the update with. Example: ``` $metric->update([ 'description' => 'A description for my metric.' ]); ``` @codingStandardsIgnoreStart @see https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics/update projects.metrics update API documentation. @codingStandardsIgnoreEnd @param array $metadata { The data to update. @type string $description A description of the metric. @type string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters). } @param array $options [optional] Configuration Options. @return array
[ "Update", "the", "metric", ".", "Please", "note", "this", "will", "trigger", "a", "network", "request", "if", "cached", "data", "is", "not", "available", "to", "perform", "the", "update", "with", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Logging/src/Metric.php#L143-L151
train
googleapis/google-cloud-php
Logging/src/Metric.php
Metric.reload
public function reload(array $options = []) { return $this->info = $this->connection->getMetric($options + [ 'metricName' => $this->formattedName ]); }
php
public function reload(array $options = []) { return $this->info = $this->connection->getMetric($options + [ 'metricName' => $this->formattedName ]); }
[ "public", "function", "reload", "(", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "info", "=", "$", "this", "->", "connection", "->", "getMetric", "(", "$", "options", "+", "[", "'metricName'", "=>", "$", "this", "->", "formattedName", "]", ")", ";", "}" ]
Triggers a network request to reload the metric's details. Example: ``` $metric->reload(); $info = $metric->info(); echo $info['description']; ``` @codingStandardsIgnoreStart @see https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics/get projects.metrics get API documentation. @codingStandardsIgnoreEnd @param array $options [optional] Configuration Options. @return array
[ "Triggers", "a", "network", "request", "to", "reload", "the", "metric", "s", "details", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Logging/src/Metric.php#L196-L201
train
googleapis/google-cloud-php
Vision/src/V1/AnnotateImageRequest.php
AnnotateImageRequest.setImage
public function setImage($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\Image::class); $this->image = $var; return $this; }
php
public function setImage($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\Image::class); $this->image = $var; return $this; }
[ "public", "function", "setImage", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Vision", "\\", "V1", "\\", "Image", "::", "class", ")", ";", "$", "this", "->", "image", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The image to be processed. Generated from protobuf field <code>.google.cloud.vision.v1.Image image = 1;</code> @param \Google\Cloud\Vision\V1\Image $var @return $this
[ "The", "image", "to", "be", "processed", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Vision/src/V1/AnnotateImageRequest.php#L75-L81
train
googleapis/google-cloud-php
Debugger/src/Daemon.php
Daemon.run
public function run(DebuggerClient $client = null, $asDaemon = true) { $client = $client ?: $this->defaultClient(); $extSourceContexts = $this->extSourceContext ? [$this->extSourceContext] : []; $uniquifier = $this->uniquifier ?: $this->defaultUniquifier(); do { $debuggee = $client->debuggee(null, [ 'uniquifier' => $uniquifier, 'description' => $this->description, 'extSourceContexts' => $extSourceContexts, 'labels' => $this->labels ]); // If registration with backoff fails, then propagate the exception. $backoff = new ExponentialBackoff(); $backoff->execute(function () use ($debuggee) { $debuggee->register(); }); try { $options = []; do { try { $resp = $debuggee->breakpointsWithWaitToken($options); $this->setBreakpoints($debuggee, $resp['breakpoints']); $options['waitToken'] = $resp['nextWaitToken']; } catch (ConflictException $e) { // The hanging GET call returns a 409 (Conflict) response // when the request times out with a status of 'ABORTED'. // In this case, we'll fetch again with the same waitToken. } gc_collect_cycles(); } while ($asDaemon); } catch (ServiceException $e) { // For any other ServiceExceptions, re-register and start over. } gc_collect_cycles(); } while ($asDaemon); }
php
public function run(DebuggerClient $client = null, $asDaemon = true) { $client = $client ?: $this->defaultClient(); $extSourceContexts = $this->extSourceContext ? [$this->extSourceContext] : []; $uniquifier = $this->uniquifier ?: $this->defaultUniquifier(); do { $debuggee = $client->debuggee(null, [ 'uniquifier' => $uniquifier, 'description' => $this->description, 'extSourceContexts' => $extSourceContexts, 'labels' => $this->labels ]); // If registration with backoff fails, then propagate the exception. $backoff = new ExponentialBackoff(); $backoff->execute(function () use ($debuggee) { $debuggee->register(); }); try { $options = []; do { try { $resp = $debuggee->breakpointsWithWaitToken($options); $this->setBreakpoints($debuggee, $resp['breakpoints']); $options['waitToken'] = $resp['nextWaitToken']; } catch (ConflictException $e) { // The hanging GET call returns a 409 (Conflict) response // when the request times out with a status of 'ABORTED'. // In this case, we'll fetch again with the same waitToken. } gc_collect_cycles(); } while ($asDaemon); } catch (ServiceException $e) { // For any other ServiceExceptions, re-register and start over. } gc_collect_cycles(); } while ($asDaemon); }
[ "public", "function", "run", "(", "DebuggerClient", "$", "client", "=", "null", ",", "$", "asDaemon", "=", "true", ")", "{", "$", "client", "=", "$", "client", "?", ":", "$", "this", "->", "defaultClient", "(", ")", ";", "$", "extSourceContexts", "=", "$", "this", "->", "extSourceContext", "?", "[", "$", "this", "->", "extSourceContext", "]", ":", "[", "]", ";", "$", "uniquifier", "=", "$", "this", "->", "uniquifier", "?", ":", "$", "this", "->", "defaultUniquifier", "(", ")", ";", "do", "{", "$", "debuggee", "=", "$", "client", "->", "debuggee", "(", "null", ",", "[", "'uniquifier'", "=>", "$", "uniquifier", ",", "'description'", "=>", "$", "this", "->", "description", ",", "'extSourceContexts'", "=>", "$", "extSourceContexts", ",", "'labels'", "=>", "$", "this", "->", "labels", "]", ")", ";", "// If registration with backoff fails, then propagate the exception.", "$", "backoff", "=", "new", "ExponentialBackoff", "(", ")", ";", "$", "backoff", "->", "execute", "(", "function", "(", ")", "use", "(", "$", "debuggee", ")", "{", "$", "debuggee", "->", "register", "(", ")", ";", "}", ")", ";", "try", "{", "$", "options", "=", "[", "]", ";", "do", "{", "try", "{", "$", "resp", "=", "$", "debuggee", "->", "breakpointsWithWaitToken", "(", "$", "options", ")", ";", "$", "this", "->", "setBreakpoints", "(", "$", "debuggee", ",", "$", "resp", "[", "'breakpoints'", "]", ")", ";", "$", "options", "[", "'waitToken'", "]", "=", "$", "resp", "[", "'nextWaitToken'", "]", ";", "}", "catch", "(", "ConflictException", "$", "e", ")", "{", "// The hanging GET call returns a 409 (Conflict) response", "// when the request times out with a status of 'ABORTED'.", "// In this case, we'll fetch again with the same waitToken.", "}", "gc_collect_cycles", "(", ")", ";", "}", "while", "(", "$", "asDaemon", ")", ";", "}", "catch", "(", "ServiceException", "$", "e", ")", "{", "// For any other ServiceExceptions, re-register and start over.", "}", "gc_collect_cycles", "(", ")", ";", "}", "while", "(", "$", "asDaemon", ")", ";", "}" ]
Main loop for the daemon. Fetches breakpoints from the DebuggerClient and stores them in shared storage for the application to read. This function runs indefinitely. Example: ``` $daemon->run(); ```
[ "Main", "loop", "for", "the", "daemon", ".", "Fetches", "breakpoints", "from", "the", "DebuggerClient", "and", "stores", "them", "in", "shared", "storage", "for", "the", "application", "to", "read", ".", "This", "function", "runs", "indefinitely", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Debugger/src/Daemon.php#L176-L215
train
googleapis/google-cloud-php
Bigtable/src/V2/RowFilter/Condition.php
Condition.setTrueFilter
public function setTrueFilter($var) { GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); $this->true_filter = $var; return $this; }
php
public function setTrueFilter($var) { GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); $this->true_filter = $var; return $this; }
[ "public", "function", "setTrueFilter", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Bigtable", "\\", "V2", "\\", "RowFilter", "::", "class", ")", ";", "$", "this", "->", "true_filter", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The filter to apply to the input row if `predicate_filter` returns any results. If not provided, no results will be returned in the true case. Generated from protobuf field <code>.google.bigtable.v2.RowFilter true_filter = 2;</code> @param \Google\Cloud\Bigtable\V2\RowFilter $var @return $this
[ "The", "filter", "to", "apply", "to", "the", "input", "row", "if", "predicate_filter", "returns", "any", "results", ".", "If", "not", "provided", "no", "results", "will", "be", "returned", "in", "the", "true", "case", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/RowFilter/Condition.php#L117-L123
train
googleapis/google-cloud-php
Bigtable/src/V2/RowFilter/Condition.php
Condition.setFalseFilter
public function setFalseFilter($var) { GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); $this->false_filter = $var; return $this; }
php
public function setFalseFilter($var) { GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); $this->false_filter = $var; return $this; }
[ "public", "function", "setFalseFilter", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Bigtable", "\\", "V2", "\\", "RowFilter", "::", "class", ")", ";", "$", "this", "->", "false_filter", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The filter to apply to the input row if `predicate_filter` does not return any results. If not provided, no results will be returned in the false case. Generated from protobuf field <code>.google.bigtable.v2.RowFilter false_filter = 3;</code> @param \Google\Cloud\Bigtable\V2\RowFilter $var @return $this
[ "The", "filter", "to", "apply", "to", "the", "input", "row", "if", "predicate_filter", "does", "not", "return", "any", "results", ".", "If", "not", "provided", "no", "results", "will", "be", "returned", "in", "the", "false", "case", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/RowFilter/Condition.php#L147-L153
train
googleapis/google-cloud-php
Language/src/V1beta2/Gapic/LanguageServiceGapicClient.php
LanguageServiceGapicClient.annotateText
public function annotateText($document, $features, array $optionalArgs = []) { $request = new AnnotateTextRequest(); $request->setDocument($document); $request->setFeatures($features); if (isset($optionalArgs['encodingType'])) { $request->setEncodingType($optionalArgs['encodingType']); } return $this->startCall( 'AnnotateText', AnnotateTextResponse::class, $optionalArgs, $request )->wait(); }
php
public function annotateText($document, $features, array $optionalArgs = []) { $request = new AnnotateTextRequest(); $request->setDocument($document); $request->setFeatures($features); if (isset($optionalArgs['encodingType'])) { $request->setEncodingType($optionalArgs['encodingType']); } return $this->startCall( 'AnnotateText', AnnotateTextResponse::class, $optionalArgs, $request )->wait(); }
[ "public", "function", "annotateText", "(", "$", "document", ",", "$", "features", ",", "array", "$", "optionalArgs", "=", "[", "]", ")", "{", "$", "request", "=", "new", "AnnotateTextRequest", "(", ")", ";", "$", "request", "->", "setDocument", "(", "$", "document", ")", ";", "$", "request", "->", "setFeatures", "(", "$", "features", ")", ";", "if", "(", "isset", "(", "$", "optionalArgs", "[", "'encodingType'", "]", ")", ")", "{", "$", "request", "->", "setEncodingType", "(", "$", "optionalArgs", "[", "'encodingType'", "]", ")", ";", "}", "return", "$", "this", "->", "startCall", "(", "'AnnotateText'", ",", "AnnotateTextResponse", "::", "class", ",", "$", "optionalArgs", ",", "$", "request", ")", "->", "wait", "(", ")", ";", "}" ]
A convenience method that provides all syntax, sentiment, entity, and classification features in one call. Sample code: ``` $languageServiceClient = new LanguageServiceClient(); try { $document = new Document(); $features = new AnnotateTextRequest\Features(); $response = $languageServiceClient->annotateText($document, $features); } finally { $languageServiceClient->close(); } ``` @param Document $document Input document. @param AnnotateTextRequest\Features $features The enabled features. @param array $optionalArgs { Optional. @type int $encodingType The encoding type used by the API to calculate offsets. For allowed values, use constants defined on {@see \Google\Cloud\Language\V1beta2\EncodingType} @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\Language\V1beta2\AnnotateTextResponse @throws ApiException if the remote call fails @experimental
[ "A", "convenience", "method", "that", "provides", "all", "syntax", "sentiment", "entity", "and", "classification", "features", "in", "one", "call", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1beta2/Gapic/LanguageServiceGapicClient.php#L462-L477
train
googleapis/google-cloud-php
Speech/src/V1p1beta1/RecognitionMetadata.php
RecognitionMetadata.setInteractionType
public function setInteractionType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_InteractionType::class); $this->interaction_type = $var; return $this; }
php
public function setInteractionType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_InteractionType::class); $this->interaction_type = $var; return $this; }
[ "public", "function", "setInteractionType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Speech", "\\", "V1p1beta1", "\\", "RecognitionMetadata_InteractionType", "::", "class", ")", ";", "$", "this", "->", "interaction_type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The use case most closely describing the audio content to be recognized. Generated from protobuf field <code>.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1;</code> @param int $var @return $this
[ "The", "use", "case", "most", "closely", "describing", "the", "audio", "content", "to", "be", "recognized", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Speech/src/V1p1beta1/RecognitionMetadata.php#L142-L148
train
googleapis/google-cloud-php
Speech/src/V1p1beta1/RecognitionMetadata.php
RecognitionMetadata.setMicrophoneDistance
public function setMicrophoneDistance($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_MicrophoneDistance::class); $this->microphone_distance = $var; return $this; }
php
public function setMicrophoneDistance($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_MicrophoneDistance::class); $this->microphone_distance = $var; return $this; }
[ "public", "function", "setMicrophoneDistance", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Speech", "\\", "V1p1beta1", "\\", "RecognitionMetadata_MicrophoneDistance", "::", "class", ")", ";", "$", "this", "->", "microphone_distance", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The audio type that most closely describes the audio being recognized. Generated from protobuf field <code>.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4;</code> @param int $var @return $this
[ "The", "audio", "type", "that", "most", "closely", "describes", "the", "audio", "being", "recognized", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Speech/src/V1p1beta1/RecognitionMetadata.php#L200-L206
train
googleapis/google-cloud-php
Speech/src/V1p1beta1/RecognitionMetadata.php
RecognitionMetadata.setOriginalMediaType
public function setOriginalMediaType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_OriginalMediaType::class); $this->original_media_type = $var; return $this; }
php
public function setOriginalMediaType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_OriginalMediaType::class); $this->original_media_type = $var; return $this; }
[ "public", "function", "setOriginalMediaType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Speech", "\\", "V1p1beta1", "\\", "RecognitionMetadata_OriginalMediaType", "::", "class", ")", ";", "$", "this", "->", "original_media_type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The original media the speech was recorded on. Generated from protobuf field <code>.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5;</code> @param int $var @return $this
[ "The", "original", "media", "the", "speech", "was", "recorded", "on", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Speech/src/V1p1beta1/RecognitionMetadata.php#L226-L232
train
googleapis/google-cloud-php
Speech/src/V1p1beta1/RecognitionMetadata.php
RecognitionMetadata.setRecordingDeviceType
public function setRecordingDeviceType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_RecordingDeviceType::class); $this->recording_device_type = $var; return $this; }
php
public function setRecordingDeviceType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Speech\V1p1beta1\RecognitionMetadata_RecordingDeviceType::class); $this->recording_device_type = $var; return $this; }
[ "public", "function", "setRecordingDeviceType", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Speech", "\\", "V1p1beta1", "\\", "RecognitionMetadata_RecordingDeviceType", "::", "class", ")", ";", "$", "this", "->", "recording_device_type", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The type of device the speech was recorded with. Generated from protobuf field <code>.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6;</code> @param int $var @return $this
[ "The", "type", "of", "device", "the", "speech", "was", "recorded", "with", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Speech/src/V1p1beta1/RecognitionMetadata.php#L252-L258
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.responseToEntityProperties
public function responseToEntityProperties(array $entityData, $className = Entity::class) { if (!is_subclass_of($className, EntityInterface::class)) { throw new \InvalidArgumentException(sprintf( 'Class %s must implement EntityInterface.', $className )); } $properties = []; $excludes = []; $meanings = []; $mappings = $className::mappings(); foreach ($entityData as $key => $property) { $mapClassName = Entity::class; if (array_key_exists($key, $mappings)) { $mapClassName = $mappings[$key]; } if ($mapClassName) { if (!is_subclass_of($mapClassName, EntityInterface::class)) { throw new \InvalidArgumentException(sprintf( 'Class %s must implement EntityInterface. (Found in mappings on %s)', $mapClassName, $className )); } } $properties[$key] = $this->getPropertyValue($property, $mapClassName); if (isset($property['excludeFromIndexes']) && $property['excludeFromIndexes']) { $excludes[] = $key; } if (isset($property['meaning']) && $property['meaning']) { $meanings[$key] = $property['meaning']; } } return [ 'properties' => $properties, 'excludes' => $excludes, 'meanings' => $meanings ]; }
php
public function responseToEntityProperties(array $entityData, $className = Entity::class) { if (!is_subclass_of($className, EntityInterface::class)) { throw new \InvalidArgumentException(sprintf( 'Class %s must implement EntityInterface.', $className )); } $properties = []; $excludes = []; $meanings = []; $mappings = $className::mappings(); foreach ($entityData as $key => $property) { $mapClassName = Entity::class; if (array_key_exists($key, $mappings)) { $mapClassName = $mappings[$key]; } if ($mapClassName) { if (!is_subclass_of($mapClassName, EntityInterface::class)) { throw new \InvalidArgumentException(sprintf( 'Class %s must implement EntityInterface. (Found in mappings on %s)', $mapClassName, $className )); } } $properties[$key] = $this->getPropertyValue($property, $mapClassName); if (isset($property['excludeFromIndexes']) && $property['excludeFromIndexes']) { $excludes[] = $key; } if (isset($property['meaning']) && $property['meaning']) { $meanings[$key] = $property['meaning']; } } return [ 'properties' => $properties, 'excludes' => $excludes, 'meanings' => $meanings ]; }
[ "public", "function", "responseToEntityProperties", "(", "array", "$", "entityData", ",", "$", "className", "=", "Entity", "::", "class", ")", "{", "if", "(", "!", "is_subclass_of", "(", "$", "className", ",", "EntityInterface", "::", "class", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Class %s must implement EntityInterface.'", ",", "$", "className", ")", ")", ";", "}", "$", "properties", "=", "[", "]", ";", "$", "excludes", "=", "[", "]", ";", "$", "meanings", "=", "[", "]", ";", "$", "mappings", "=", "$", "className", "::", "mappings", "(", ")", ";", "foreach", "(", "$", "entityData", "as", "$", "key", "=>", "$", "property", ")", "{", "$", "mapClassName", "=", "Entity", "::", "class", ";", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "mappings", ")", ")", "{", "$", "mapClassName", "=", "$", "mappings", "[", "$", "key", "]", ";", "}", "if", "(", "$", "mapClassName", ")", "{", "if", "(", "!", "is_subclass_of", "(", "$", "mapClassName", ",", "EntityInterface", "::", "class", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Class %s must implement EntityInterface. (Found in mappings on %s)'", ",", "$", "mapClassName", ",", "$", "className", ")", ")", ";", "}", "}", "$", "properties", "[", "$", "key", "]", "=", "$", "this", "->", "getPropertyValue", "(", "$", "property", ",", "$", "mapClassName", ")", ";", "if", "(", "isset", "(", "$", "property", "[", "'excludeFromIndexes'", "]", ")", "&&", "$", "property", "[", "'excludeFromIndexes'", "]", ")", "{", "$", "excludes", "[", "]", "=", "$", "key", ";", "}", "if", "(", "isset", "(", "$", "property", "[", "'meaning'", "]", ")", "&&", "$", "property", "[", "'meaning'", "]", ")", "{", "$", "meanings", "[", "$", "key", "]", "=", "$", "property", "[", "'meaning'", "]", ";", "}", "}", "return", "[", "'properties'", "=>", "$", "properties", ",", "'excludes'", "=>", "$", "excludes", ",", "'meanings'", "=>", "$", "meanings", "]", ";", "}" ]
Convert an entity response to properties, excludes and meanings. @param array $entityData The incoming entity @param string $className The name of a class to use as the entity. Must implement {@see Google\Cloud\Datastore\EntityInterface}. @return array @throws \InvalidArgumentException If the value of $className does not implement {@see Google\Cloud\Datastore\EntityInterface}. @throws \InvalidArgumentException If the custom entity type containts invalid mappings for embedded entities.
[ "Convert", "an", "entity", "response", "to", "properties", "excludes", "and", "meanings", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L80-L126
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.objectToRequest
public function objectToRequest(EntityInterface $entity) { $data = $entity->get(); $properties = []; foreach ($data as $key => $value) { $exclude = in_array($key, $entity->excludedProperties()); $meaning = (isset($entity->meanings()[$key])) ? $entity->meanings()[$key] : null; $properties[$key] = $this->valueObject( $value, $exclude, $meaning ); } $key = $entity->key() ? $entity->key()->keyObject() : null; return array_filter([ 'key' => $key, 'properties' => $properties ]); }
php
public function objectToRequest(EntityInterface $entity) { $data = $entity->get(); $properties = []; foreach ($data as $key => $value) { $exclude = in_array($key, $entity->excludedProperties()); $meaning = (isset($entity->meanings()[$key])) ? $entity->meanings()[$key] : null; $properties[$key] = $this->valueObject( $value, $exclude, $meaning ); } $key = $entity->key() ? $entity->key()->keyObject() : null; return array_filter([ 'key' => $key, 'properties' => $properties ]); }
[ "public", "function", "objectToRequest", "(", "EntityInterface", "$", "entity", ")", "{", "$", "data", "=", "$", "entity", "->", "get", "(", ")", ";", "$", "properties", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "exclude", "=", "in_array", "(", "$", "key", ",", "$", "entity", "->", "excludedProperties", "(", ")", ")", ";", "$", "meaning", "=", "(", "isset", "(", "$", "entity", "->", "meanings", "(", ")", "[", "$", "key", "]", ")", ")", "?", "$", "entity", "->", "meanings", "(", ")", "[", "$", "key", "]", ":", "null", ";", "$", "properties", "[", "$", "key", "]", "=", "$", "this", "->", "valueObject", "(", "$", "value", ",", "$", "exclude", ",", "$", "meaning", ")", ";", "}", "$", "key", "=", "$", "entity", "->", "key", "(", ")", "?", "$", "entity", "->", "key", "(", ")", "->", "keyObject", "(", ")", ":", "null", ";", "return", "array_filter", "(", "[", "'key'", "=>", "$", "key", ",", "'properties'", "=>", "$", "properties", "]", ")", ";", "}" ]
Translate an Entity to a datastore representation. @param EntityInterface $entity The input entity. @return array A Datastore [Entity](https://cloud.google.com/datastore/reference/rest/v1/Entity)
[ "Translate", "an", "Entity", "to", "a", "datastore", "representation", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L134-L160
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.valueObject
public function valueObject($value, $exclude = false, $meaning = null) { switch (gettype($value)) { case 'boolean': $propertyValue = [ 'booleanValue' => $value ]; break; case 'integer': $propertyValue = [ 'integerValue' => $value ]; break; case 'double': $propertyValue = [ 'doubleValue' => $value ]; break; case 'string': $propertyValue = [ 'stringValue' => $value ]; break; case 'array': if (!empty($value) && $this->isAssoc($value)) { $propertyValue = $this->convertArrayToEntityValue($value); } else { $propertyValue = $this->convertArrayToArrayValue($value); } break; case 'object': $propertyValue = $this->objectProperty($value); break; case 'resource': $content = stream_get_contents($value); $propertyValue = [ 'blobValue' => ($this->encode) ? base64_encode($content) : $content ]; break; case 'NULL': $propertyValue = [ 'nullValue' => null ]; break; //@codeCoverageIgnoreStart case 'unknown type': throw new \InvalidArgumentException(sprintf( 'Unknown type for `%s', $content )); break; default: throw new \InvalidArgumentException(sprintf( 'Invalid type for `%s', $content )); break; //@codeCoverageIgnoreEnd } if ($exclude) { $propertyValue['excludeFromIndexes'] = true; } if ($meaning) { $propertyValue['meaning'] = $meaning; } return $propertyValue; }
php
public function valueObject($value, $exclude = false, $meaning = null) { switch (gettype($value)) { case 'boolean': $propertyValue = [ 'booleanValue' => $value ]; break; case 'integer': $propertyValue = [ 'integerValue' => $value ]; break; case 'double': $propertyValue = [ 'doubleValue' => $value ]; break; case 'string': $propertyValue = [ 'stringValue' => $value ]; break; case 'array': if (!empty($value) && $this->isAssoc($value)) { $propertyValue = $this->convertArrayToEntityValue($value); } else { $propertyValue = $this->convertArrayToArrayValue($value); } break; case 'object': $propertyValue = $this->objectProperty($value); break; case 'resource': $content = stream_get_contents($value); $propertyValue = [ 'blobValue' => ($this->encode) ? base64_encode($content) : $content ]; break; case 'NULL': $propertyValue = [ 'nullValue' => null ]; break; //@codeCoverageIgnoreStart case 'unknown type': throw new \InvalidArgumentException(sprintf( 'Unknown type for `%s', $content )); break; default: throw new \InvalidArgumentException(sprintf( 'Invalid type for `%s', $content )); break; //@codeCoverageIgnoreEnd } if ($exclude) { $propertyValue['excludeFromIndexes'] = true; } if ($meaning) { $propertyValue['meaning'] = $meaning; } return $propertyValue; }
[ "public", "function", "valueObject", "(", "$", "value", ",", "$", "exclude", "=", "false", ",", "$", "meaning", "=", "null", ")", "{", "switch", "(", "gettype", "(", "$", "value", ")", ")", "{", "case", "'boolean'", ":", "$", "propertyValue", "=", "[", "'booleanValue'", "=>", "$", "value", "]", ";", "break", ";", "case", "'integer'", ":", "$", "propertyValue", "=", "[", "'integerValue'", "=>", "$", "value", "]", ";", "break", ";", "case", "'double'", ":", "$", "propertyValue", "=", "[", "'doubleValue'", "=>", "$", "value", "]", ";", "break", ";", "case", "'string'", ":", "$", "propertyValue", "=", "[", "'stringValue'", "=>", "$", "value", "]", ";", "break", ";", "case", "'array'", ":", "if", "(", "!", "empty", "(", "$", "value", ")", "&&", "$", "this", "->", "isAssoc", "(", "$", "value", ")", ")", "{", "$", "propertyValue", "=", "$", "this", "->", "convertArrayToEntityValue", "(", "$", "value", ")", ";", "}", "else", "{", "$", "propertyValue", "=", "$", "this", "->", "convertArrayToArrayValue", "(", "$", "value", ")", ";", "}", "break", ";", "case", "'object'", ":", "$", "propertyValue", "=", "$", "this", "->", "objectProperty", "(", "$", "value", ")", ";", "break", ";", "case", "'resource'", ":", "$", "content", "=", "stream_get_contents", "(", "$", "value", ")", ";", "$", "propertyValue", "=", "[", "'blobValue'", "=>", "(", "$", "this", "->", "encode", ")", "?", "base64_encode", "(", "$", "content", ")", ":", "$", "content", "]", ";", "break", ";", "case", "'NULL'", ":", "$", "propertyValue", "=", "[", "'nullValue'", "=>", "null", "]", ";", "break", ";", "//@codeCoverageIgnoreStart", "case", "'unknown type'", ":", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Unknown type for `%s'", ",", "$", "content", ")", ")", ";", "break", ";", "default", ":", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Invalid type for `%s'", ",", "$", "content", ")", ")", ";", "break", ";", "//@codeCoverageIgnoreEnd", "}", "if", "(", "$", "exclude", ")", "{", "$", "propertyValue", "[", "'excludeFromIndexes'", "]", "=", "true", ";", "}", "if", "(", "$", "meaning", ")", "{", "$", "propertyValue", "[", "'meaning'", "]", "=", "$", "meaning", ";", "}", "return", "$", "propertyValue", ";", "}" ]
Format values for the API @param mixed $value @param bool $exclude [optional] If true, value will be excluded from datastore indexes. @param int $meaning [optional] The Meaning value. Maintained only for backwards compatibility. @return array
[ "Format", "values", "for", "the", "API" ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L315-L401
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.objectProperty
public function objectProperty($value) { switch (true) { case $value instanceof Int64: return [ 'integerValue' => $value->get() ]; break; case $value instanceof Blob: return [ 'blobValue' => ($this->encode) ? base64_encode((string) $value) : (string) $value ]; break; case $value instanceof \DateTimeInterface: return [ 'timestampValue' => $value->format(self::DATE_FORMAT) ]; break; case $value instanceof EntityInterface: return [ 'entityValue' => $this->objectToRequest($value) ]; break; case $value instanceof GeoPoint: return [ 'geoPointValue' => $value->point() ]; break; case $value instanceof Key: return [ 'keyValue' => $value->keyObject() ]; break; case $value instanceof \stdClass: return $this->convertArrayToEntityValue((array) $value); default: throw new \InvalidArgumentException( sprintf('Value of type `%s` could not be serialized', get_class($value)) ); break; } }
php
public function objectProperty($value) { switch (true) { case $value instanceof Int64: return [ 'integerValue' => $value->get() ]; break; case $value instanceof Blob: return [ 'blobValue' => ($this->encode) ? base64_encode((string) $value) : (string) $value ]; break; case $value instanceof \DateTimeInterface: return [ 'timestampValue' => $value->format(self::DATE_FORMAT) ]; break; case $value instanceof EntityInterface: return [ 'entityValue' => $this->objectToRequest($value) ]; break; case $value instanceof GeoPoint: return [ 'geoPointValue' => $value->point() ]; break; case $value instanceof Key: return [ 'keyValue' => $value->keyObject() ]; break; case $value instanceof \stdClass: return $this->convertArrayToEntityValue((array) $value); default: throw new \InvalidArgumentException( sprintf('Value of type `%s` could not be serialized', get_class($value)) ); break; } }
[ "public", "function", "objectProperty", "(", "$", "value", ")", "{", "switch", "(", "true", ")", "{", "case", "$", "value", "instanceof", "Int64", ":", "return", "[", "'integerValue'", "=>", "$", "value", "->", "get", "(", ")", "]", ";", "break", ";", "case", "$", "value", "instanceof", "Blob", ":", "return", "[", "'blobValue'", "=>", "(", "$", "this", "->", "encode", ")", "?", "base64_encode", "(", "(", "string", ")", "$", "value", ")", ":", "(", "string", ")", "$", "value", "]", ";", "break", ";", "case", "$", "value", "instanceof", "\\", "DateTimeInterface", ":", "return", "[", "'timestampValue'", "=>", "$", "value", "->", "format", "(", "self", "::", "DATE_FORMAT", ")", "]", ";", "break", ";", "case", "$", "value", "instanceof", "EntityInterface", ":", "return", "[", "'entityValue'", "=>", "$", "this", "->", "objectToRequest", "(", "$", "value", ")", "]", ";", "break", ";", "case", "$", "value", "instanceof", "GeoPoint", ":", "return", "[", "'geoPointValue'", "=>", "$", "value", "->", "point", "(", ")", "]", ";", "break", ";", "case", "$", "value", "instanceof", "Key", ":", "return", "[", "'keyValue'", "=>", "$", "value", "->", "keyObject", "(", ")", "]", ";", "break", ";", "case", "$", "value", "instanceof", "\\", "stdClass", ":", "return", "$", "this", "->", "convertArrayToEntityValue", "(", "(", "array", ")", "$", "value", ")", ";", "default", ":", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Value of type `%s` could not be serialized'", ",", "get_class", "(", "$", "value", ")", ")", ")", ";", "break", ";", "}", "}" ]
Convert different object types to API values @todo add middleware @param mixed $value The value object @return array
[ "Convert", "different", "object", "types", "to", "API", "values" ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L411-L467
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.convertArrayToArrayValue
private function convertArrayToArrayValue(array $value) { $values = []; foreach ($value as $val) { // ListValues may not contain nested ListValues. // Therefore, if an empty array is provided as part of an array, // we can encode it as an EntityValue. if (is_array($val) && empty($val)) { $val = (object) $val; } $values[] = $this->valueObject($val); } return [ 'arrayValue' => [ 'values' => $values ] ]; }
php
private function convertArrayToArrayValue(array $value) { $values = []; foreach ($value as $val) { // ListValues may not contain nested ListValues. // Therefore, if an empty array is provided as part of an array, // we can encode it as an EntityValue. if (is_array($val) && empty($val)) { $val = (object) $val; } $values[] = $this->valueObject($val); } return [ 'arrayValue' => [ 'values' => $values ] ]; }
[ "private", "function", "convertArrayToArrayValue", "(", "array", "$", "value", ")", "{", "$", "values", "=", "[", "]", ";", "foreach", "(", "$", "value", "as", "$", "val", ")", "{", "// ListValues may not contain nested ListValues.", "// Therefore, if an empty array is provided as part of an array,", "// we can encode it as an EntityValue.", "if", "(", "is_array", "(", "$", "val", ")", "&&", "empty", "(", "$", "val", ")", ")", "{", "$", "val", "=", "(", "object", ")", "$", "val", ";", "}", "$", "values", "[", "]", "=", "$", "this", "->", "valueObject", "(", "$", "val", ")", ";", "}", "return", "[", "'arrayValue'", "=>", "[", "'values'", "=>", "$", "values", "]", "]", ";", "}" ]
Convert a non-associative array to a datastore arrayValue type @param array $value The input array @return array The arrayValue property
[ "Convert", "a", "non", "-", "associative", "array", "to", "a", "datastore", "arrayValue", "type" ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L475-L494
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.convertArrayToEntityValue
private function convertArrayToEntityValue(array $value) { $excludes = $this->pluck(Entity::EXCLUDE_FROM_INDEXES, $value, false) ?: []; $properties = []; foreach ($value as $key => $val) { $properties[$key] = $this->valueObject( $val, in_array($key, $excludes) ); } if (!$properties) { $properties = (object) $properties; } return [ 'entityValue' => [ 'properties' => $properties ] ]; }
php
private function convertArrayToEntityValue(array $value) { $excludes = $this->pluck(Entity::EXCLUDE_FROM_INDEXES, $value, false) ?: []; $properties = []; foreach ($value as $key => $val) { $properties[$key] = $this->valueObject( $val, in_array($key, $excludes) ); } if (!$properties) { $properties = (object) $properties; } return [ 'entityValue' => [ 'properties' => $properties ] ]; }
[ "private", "function", "convertArrayToEntityValue", "(", "array", "$", "value", ")", "{", "$", "excludes", "=", "$", "this", "->", "pluck", "(", "Entity", "::", "EXCLUDE_FROM_INDEXES", ",", "$", "value", ",", "false", ")", "?", ":", "[", "]", ";", "$", "properties", "=", "[", "]", ";", "foreach", "(", "$", "value", "as", "$", "key", "=>", "$", "val", ")", "{", "$", "properties", "[", "$", "key", "]", "=", "$", "this", "->", "valueObject", "(", "$", "val", ",", "in_array", "(", "$", "key", ",", "$", "excludes", ")", ")", ";", "}", "if", "(", "!", "$", "properties", ")", "{", "$", "properties", "=", "(", "object", ")", "$", "properties", ";", "}", "return", "[", "'entityValue'", "=>", "[", "'properties'", "=>", "$", "properties", "]", "]", ";", "}" ]
Convert an associative array to a datastore entityValue type @param array $value The input array @return array The entityValue property
[ "Convert", "an", "associative", "array", "to", "a", "datastore", "entityValue", "type" ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L502-L523
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.getPropertyValue
private function getPropertyValue(array $property, $className = Entity::class) { $type = $this->getValueType($property); return $this->convertValue($type, $property[$type], $className); }
php
private function getPropertyValue(array $property, $className = Entity::class) { $type = $this->getValueType($property); return $this->convertValue($type, $property[$type], $className); }
[ "private", "function", "getPropertyValue", "(", "array", "$", "property", ",", "$", "className", "=", "Entity", "::", "class", ")", "{", "$", "type", "=", "$", "this", "->", "getValueType", "(", "$", "property", ")", ";", "return", "$", "this", "->", "convertValue", "(", "$", "type", ",", "$", "property", "[", "$", "type", "]", ",", "$", "className", ")", ";", "}" ]
Determine the property type and return a converted value @param array $property The API property @param string $className [optional] The type to decode into, if property is an entity. @return mixed
[ "Determine", "the", "property", "type", "and", "return", "a", "converted", "value" ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L549-L553
train
googleapis/google-cloud-php
Datastore/src/EntityMapper.php
EntityMapper.getValueType
private function getValueType(array $value) { $keys = array_keys($value); $types = array_values(array_filter($keys, function ($key) { return strpos($key, 'Value') !== false; })); if (!empty($types)) { return $types[0]; } throw new \RuntimeException('Invalid entity property value given'); }
php
private function getValueType(array $value) { $keys = array_keys($value); $types = array_values(array_filter($keys, function ($key) { return strpos($key, 'Value') !== false; })); if (!empty($types)) { return $types[0]; } throw new \RuntimeException('Invalid entity property value given'); }
[ "private", "function", "getValueType", "(", "array", "$", "value", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "value", ")", ";", "$", "types", "=", "array_values", "(", "array_filter", "(", "$", "keys", ",", "function", "(", "$", "key", ")", "{", "return", "strpos", "(", "$", "key", ",", "'Value'", ")", "!==", "false", ";", "}", ")", ")", ";", "if", "(", "!", "empty", "(", "$", "types", ")", ")", "{", "return", "$", "types", "[", "0", "]", ";", "}", "throw", "new", "\\", "RuntimeException", "(", "'Invalid entity property value given'", ")", ";", "}" ]
Get the value type from a value object. @param array $value @return string @throws RuntimeException
[ "Get", "the", "value", "type", "from", "a", "value", "object", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Datastore/src/EntityMapper.php#L562-L574
train
googleapis/google-cloud-php
Firestore/src/V1/ListenRequest.php
ListenRequest.setAddTarget
public function setAddTarget($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target::class); $this->writeOneof(2, $var); return $this; }
php
public function setAddTarget($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target::class); $this->writeOneof(2, $var); return $this; }
[ "public", "function", "setAddTarget", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Firestore", "\\", "V1", "\\", "Target", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "2", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
A target to add to this stream. Generated from protobuf field <code>.google.firestore.v1.Target add_target = 2;</code> @param \Google\Cloud\Firestore\V1\Target $var @return $this
[ "A", "target", "to", "add", "to", "this", "stream", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1/ListenRequest.php#L101-L107
train
googleapis/google-cloud-php
Container/src/V1/ClusterManagerGrpcClient.php
ClusterManagerGrpcClient.DeleteCluster
public function DeleteCluster(\Google\Cloud\Container\V1\DeleteClusterRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.container.v1.ClusterManager/DeleteCluster', $argument, ['\Google\Cloud\Container\V1\Operation', 'decode'], $metadata, $options); }
php
public function DeleteCluster(\Google\Cloud\Container\V1\DeleteClusterRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.container.v1.ClusterManager/DeleteCluster', $argument, ['\Google\Cloud\Container\V1\Operation', 'decode'], $metadata, $options); }
[ "public", "function", "DeleteCluster", "(", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "DeleteClusterRequest", "$", "argument", ",", "$", "metadata", "=", "[", "]", ",", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_simpleRequest", "(", "'/google.container.v1.ClusterManager/DeleteCluster'", ",", "$", "argument", ",", "[", "'\\Google\\Cloud\\Container\\V1\\Operation'", ",", "'decode'", "]", ",", "$", "metadata", ",", "$", "options", ")", ";", "}" ]
Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time. @param \Google\Cloud\Container\V1\DeleteClusterRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "Deletes", "the", "cluster", "including", "the", "Kubernetes", "endpoint", "and", "all", "worker", "nodes", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/ClusterManagerGrpcClient.php#L233-L239
train
googleapis/google-cloud-php
Container/src/V1/ClusterManagerGrpcClient.php
ClusterManagerGrpcClient.RollbackNodePoolUpgrade
public function RollbackNodePoolUpgrade(\Google\Cloud\Container\V1\RollbackNodePoolUpgradeRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.container.v1.ClusterManager/RollbackNodePoolUpgrade', $argument, ['\Google\Cloud\Container\V1\Operation', 'decode'], $metadata, $options); }
php
public function RollbackNodePoolUpgrade(\Google\Cloud\Container\V1\RollbackNodePoolUpgradeRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.container.v1.ClusterManager/RollbackNodePoolUpgrade', $argument, ['\Google\Cloud\Container\V1\Operation', 'decode'], $metadata, $options); }
[ "public", "function", "RollbackNodePoolUpgrade", "(", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "RollbackNodePoolUpgradeRequest", "$", "argument", ",", "$", "metadata", "=", "[", "]", ",", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_simpleRequest", "(", "'/google.container.v1.ClusterManager/RollbackNodePoolUpgrade'", ",", "$", "argument", ",", "[", "'\\Google\\Cloud\\Container\\V1\\Operation'", ",", "'decode'", "]", ",", "$", "metadata", ",", "$", "options", ")", ";", "}" ]
Roll back the previously Aborted or Failed NodePool upgrade. This will be an no-op if the last upgrade successfully completed. @param \Google\Cloud\Container\V1\RollbackNodePoolUpgradeRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "Roll", "back", "the", "previously", "Aborted", "or", "Failed", "NodePool", "upgrade", ".", "This", "will", "be", "an", "no", "-", "op", "if", "the", "last", "upgrade", "successfully", "completed", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/ClusterManagerGrpcClient.php#L360-L366
train
googleapis/google-cloud-php
Dialogflow/src/V2/SentimentAnalysisResult.php
SentimentAnalysisResult.setQueryTextSentiment
public function setQueryTextSentiment($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Sentiment::class); $this->query_text_sentiment = $var; return $this; }
php
public function setQueryTextSentiment($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Sentiment::class); $this->query_text_sentiment = $var; return $this; }
[ "public", "function", "setQueryTextSentiment", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dialogflow", "\\", "V2", "\\", "Sentiment", "::", "class", ")", ";", "$", "this", "->", "query_text_sentiment", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The sentiment analysis result for `query_text`. Generated from protobuf field <code>.google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1;</code> @param \Google\Cloud\Dialogflow\V2\Sentiment $var @return $this
[ "The", "sentiment", "analysis", "result", "for", "query_text", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/SentimentAnalysisResult.php#L59-L65
train
googleapis/google-cloud-php
Language/src/V1/LanguageServiceGrpcClient.php
LanguageServiceGrpcClient.AnnotateText
public function AnnotateText(\Google\Cloud\Language\V1\AnnotateTextRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.language.v1.LanguageService/AnnotateText', $argument, ['\Google\Cloud\Language\V1\AnnotateTextResponse', 'decode'], $metadata, $options); }
php
public function AnnotateText(\Google\Cloud\Language\V1\AnnotateTextRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.language.v1.LanguageService/AnnotateText', $argument, ['\Google\Cloud\Language\V1\AnnotateTextResponse', 'decode'], $metadata, $options); }
[ "public", "function", "AnnotateText", "(", "\\", "Google", "\\", "Cloud", "\\", "Language", "\\", "V1", "\\", "AnnotateTextRequest", "$", "argument", ",", "$", "metadata", "=", "[", "]", ",", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_simpleRequest", "(", "'/google.cloud.language.v1.LanguageService/AnnotateText'", ",", "$", "argument", ",", "[", "'\\Google\\Cloud\\Language\\V1\\AnnotateTextResponse'", ",", "'decode'", "]", ",", "$", "metadata", ",", "$", "options", ")", ";", "}" ]
A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. @param \Google\Cloud\Language\V1\AnnotateTextRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "A", "convenience", "method", "that", "provides", "all", "the", "features", "that", "analyzeSentiment", "analyzeEntities", "and", "analyzeSyntax", "provide", "in", "one", "call", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Language/src/V1/LanguageServiceGrpcClient.php#L119-L125
train
googleapis/google-cloud-php
Spanner/src/Session/Session.php
Session.exists
public function exists(array $options = []) { try { $this->connection->getSession($options + [ 'name' => $this->name(), 'database' => $this->database ]); return true; } catch (NotFoundException $e) { return false; } }
php
public function exists(array $options = []) { try { $this->connection->getSession($options + [ 'name' => $this->name(), 'database' => $this->database ]); return true; } catch (NotFoundException $e) { return false; } }
[ "public", "function", "exists", "(", "array", "$", "options", "=", "[", "]", ")", "{", "try", "{", "$", "this", "->", "connection", "->", "getSession", "(", "$", "options", "+", "[", "'name'", "=>", "$", "this", "->", "name", "(", ")", ",", "'database'", "=>", "$", "this", "->", "database", "]", ")", ";", "return", "true", ";", "}", "catch", "(", "NotFoundException", "$", "e", ")", "{", "return", "false", ";", "}", "}" ]
Check if the session exists. @param array $options [optional] Configuration options. @return bool
[ "Check", "if", "the", "session", "exists", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Session/Session.php#L101-L113
train
googleapis/google-cloud-php
Spanner/src/Session/Session.php
Session.delete
public function delete(array $options = []) { return $this->connection->deleteSession($options + [ 'name' => $this->name(), 'database' => $this->database ]); }
php
public function delete(array $options = []) { return $this->connection->deleteSession($options + [ 'name' => $this->name(), 'database' => $this->database ]); }
[ "public", "function", "delete", "(", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "connection", "->", "deleteSession", "(", "$", "options", "+", "[", "'name'", "=>", "$", "this", "->", "name", "(", ")", ",", "'database'", "=>", "$", "this", "->", "database", "]", ")", ";", "}" ]
Delete the session. @param array $options [optional] Configuration options. @return void
[ "Delete", "the", "session", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Session/Session.php#L121-L127
train
googleapis/google-cloud-php
Spanner/src/Session/Session.php
Session.name
public function name() { return SpannerClient::sessionName( $this->projectId, $this->instance, $this->database, $this->name ); }
php
public function name() { return SpannerClient::sessionName( $this->projectId, $this->instance, $this->database, $this->name ); }
[ "public", "function", "name", "(", ")", "{", "return", "SpannerClient", "::", "sessionName", "(", "$", "this", "->", "projectId", ",", "$", "this", "->", "instance", ",", "$", "this", "->", "database", ",", "$", "this", "->", "name", ")", ";", "}" ]
Format the constituent parts of a session name into a fully qualified session name. @return string
[ "Format", "the", "constituent", "parts", "of", "a", "session", "name", "into", "a", "fully", "qualified", "session", "name", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Session/Session.php#L134-L142
train
googleapis/google-cloud-php
Dialogflow/src/V2/Agent.php
Agent.setMatchMode
public function setMatchMode($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent_MatchMode::class); $this->match_mode = $var; return $this; }
php
public function setMatchMode($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent_MatchMode::class); $this->match_mode = $var; return $this; }
[ "public", "function", "setMatchMode", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dialogflow", "\\", "V2", "\\", "Agent_MatchMode", "::", "class", ")", ";", "$", "this", "->", "match_mode", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Optional. Determines how intents are detected from user queries. Generated from protobuf field <code>.google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9;</code> @param int $var @return $this
[ "Optional", ".", "Determines", "how", "intents", "are", "detected", "from", "user", "queries", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/Agent.php#L402-L408
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.create
public function create($document, array $fields, array $options = []) { // Record whether the document is empty before any filtering. $emptyDocument = count($fields) === 0; list ($fields, $sentinels, $metadata) = $this->filterFields($fields); if ($metadata['hasDelete']) { throw new \InvalidArgumentException('Cannot delete fields when creating a document.'); } // Cannot create a document that already exists! $precondition = ['exists' => false]; // Enqueue an update operation if an empty document was provided, // or if there are still fields after filtering. $transformOptions = []; if (!empty($fields) || $emptyDocument) { $this->writes[] = $this->createDatabaseWrite(self::TYPE_UPDATE, $document, [ 'fields' => $this->valueMapper->encodeValues($fields), 'precondition' => $precondition ] + $options); } else { // If no UPDATE mutation is enqueued, we need the precondition applied // to the transform mutation. $transformOptions = [ 'precondition' => $precondition ]; } // document transform operations are enqueued as a separate mutation. $this->enqueueTransforms($document, $sentinels, $transformOptions); return $this; }
php
public function create($document, array $fields, array $options = []) { // Record whether the document is empty before any filtering. $emptyDocument = count($fields) === 0; list ($fields, $sentinels, $metadata) = $this->filterFields($fields); if ($metadata['hasDelete']) { throw new \InvalidArgumentException('Cannot delete fields when creating a document.'); } // Cannot create a document that already exists! $precondition = ['exists' => false]; // Enqueue an update operation if an empty document was provided, // or if there are still fields after filtering. $transformOptions = []; if (!empty($fields) || $emptyDocument) { $this->writes[] = $this->createDatabaseWrite(self::TYPE_UPDATE, $document, [ 'fields' => $this->valueMapper->encodeValues($fields), 'precondition' => $precondition ] + $options); } else { // If no UPDATE mutation is enqueued, we need the precondition applied // to the transform mutation. $transformOptions = [ 'precondition' => $precondition ]; } // document transform operations are enqueued as a separate mutation. $this->enqueueTransforms($document, $sentinels, $transformOptions); return $this; }
[ "public", "function", "create", "(", "$", "document", ",", "array", "$", "fields", ",", "array", "$", "options", "=", "[", "]", ")", "{", "// Record whether the document is empty before any filtering.", "$", "emptyDocument", "=", "count", "(", "$", "fields", ")", "===", "0", ";", "list", "(", "$", "fields", ",", "$", "sentinels", ",", "$", "metadata", ")", "=", "$", "this", "->", "filterFields", "(", "$", "fields", ")", ";", "if", "(", "$", "metadata", "[", "'hasDelete'", "]", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Cannot delete fields when creating a document.'", ")", ";", "}", "// Cannot create a document that already exists!", "$", "precondition", "=", "[", "'exists'", "=>", "false", "]", ";", "// Enqueue an update operation if an empty document was provided,", "// or if there are still fields after filtering.", "$", "transformOptions", "=", "[", "]", ";", "if", "(", "!", "empty", "(", "$", "fields", ")", "||", "$", "emptyDocument", ")", "{", "$", "this", "->", "writes", "[", "]", "=", "$", "this", "->", "createDatabaseWrite", "(", "self", "::", "TYPE_UPDATE", ",", "$", "document", ",", "[", "'fields'", "=>", "$", "this", "->", "valueMapper", "->", "encodeValues", "(", "$", "fields", ")", ",", "'precondition'", "=>", "$", "precondition", "]", "+", "$", "options", ")", ";", "}", "else", "{", "// If no UPDATE mutation is enqueued, we need the precondition applied", "// to the transform mutation.", "$", "transformOptions", "=", "[", "'precondition'", "=>", "$", "precondition", "]", ";", "}", "// document transform operations are enqueued as a separate mutation.", "$", "this", "->", "enqueueTransforms", "(", "$", "document", ",", "$", "sentinels", ",", "$", "transformOptions", ")", ";", "return", "$", "this", ";", "}" ]
Enqueue a document creation. This operation will fail (when committed) if the document already exists. Example: ``` $batch->create($documentName, [ 'name' => 'John' ]); ``` @param DocumentReference|string $document The document to target, either as a string document name, or DocumentReference object. Please note that DocumentReferences will be used only for the document name. Field data must be provided in the `$fields` argument. @param array $fields An array containing fields, where keys are the field names, and values are field values. Nested arrays are allowed. Note that unlike {@see Google\Cloud\Firestore\DocumentReference::update()}, field paths are NOT supported by this method. @param array $options Configuration options @return WriteBatch @throws \InvalidArgumentException If `FieldValue::deleteField()` is found in the fields list. @throws \InvalidArgumentException If `FieldValue::serverTimestamp()` is found in an array value.
[ "Enqueue", "a", "document", "creation", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L122-L156
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.set
public function set($document, array $fields, array $options = []) { $merge = $this->pluck('merge', $options, false) ?: false; // Record whether the document is empty before any filtering. $emptyDocument = count($fields) === 0; list ($fields, $sentinels, $metadata) = $this->filterFields($fields); if (!$merge && $metadata['hasDelete']) { throw new \InvalidArgumentException('Delete cannot appear in data unless `$options[\'merge\']` is set.'); } // Enqueue a write if any of the following conditions are met // - if there are still fields remaining after sentinels were removed // - if the user provided an empty set to begin with // - if the user provided only transform sentinel values AND did not specify merge behavior // - if the user provided only delete sentinel field values. $updateNotRequired = count($fields) === 0 && !$emptyDocument && !$metadata['hasUpdateMask'] && $metadata['hasTransform']; $shouldEnqueueUpdate = $fields || $emptyDocument || ($updateNotRequired && !$merge) || $metadata['hasUpdateMask']; if ($shouldEnqueueUpdate) { $write = [ 'fields' => $this->valueMapper->encodeValues($fields), ]; if ($merge) { $write['updateMask'] = $this->pathsToStrings($this->encodeFieldPaths($fields), $sentinels); } $this->writes[] = $this->createDatabaseWrite(self::TYPE_UPDATE, $document, $write, $options); } // document transform operations are enqueued as a separate mutation. $this->enqueueTransforms($document, $sentinels, $options); return $this; }
php
public function set($document, array $fields, array $options = []) { $merge = $this->pluck('merge', $options, false) ?: false; // Record whether the document is empty before any filtering. $emptyDocument = count($fields) === 0; list ($fields, $sentinels, $metadata) = $this->filterFields($fields); if (!$merge && $metadata['hasDelete']) { throw new \InvalidArgumentException('Delete cannot appear in data unless `$options[\'merge\']` is set.'); } // Enqueue a write if any of the following conditions are met // - if there are still fields remaining after sentinels were removed // - if the user provided an empty set to begin with // - if the user provided only transform sentinel values AND did not specify merge behavior // - if the user provided only delete sentinel field values. $updateNotRequired = count($fields) === 0 && !$emptyDocument && !$metadata['hasUpdateMask'] && $metadata['hasTransform']; $shouldEnqueueUpdate = $fields || $emptyDocument || ($updateNotRequired && !$merge) || $metadata['hasUpdateMask']; if ($shouldEnqueueUpdate) { $write = [ 'fields' => $this->valueMapper->encodeValues($fields), ]; if ($merge) { $write['updateMask'] = $this->pathsToStrings($this->encodeFieldPaths($fields), $sentinels); } $this->writes[] = $this->createDatabaseWrite(self::TYPE_UPDATE, $document, $write, $options); } // document transform operations are enqueued as a separate mutation. $this->enqueueTransforms($document, $sentinels, $options); return $this; }
[ "public", "function", "set", "(", "$", "document", ",", "array", "$", "fields", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "merge", "=", "$", "this", "->", "pluck", "(", "'merge'", ",", "$", "options", ",", "false", ")", "?", ":", "false", ";", "// Record whether the document is empty before any filtering.", "$", "emptyDocument", "=", "count", "(", "$", "fields", ")", "===", "0", ";", "list", "(", "$", "fields", ",", "$", "sentinels", ",", "$", "metadata", ")", "=", "$", "this", "->", "filterFields", "(", "$", "fields", ")", ";", "if", "(", "!", "$", "merge", "&&", "$", "metadata", "[", "'hasDelete'", "]", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Delete cannot appear in data unless `$options[\\'merge\\']` is set.'", ")", ";", "}", "// Enqueue a write if any of the following conditions are met", "// - if there are still fields remaining after sentinels were removed", "// - if the user provided an empty set to begin with", "// - if the user provided only transform sentinel values AND did not specify merge behavior", "// - if the user provided only delete sentinel field values.", "$", "updateNotRequired", "=", "count", "(", "$", "fields", ")", "===", "0", "&&", "!", "$", "emptyDocument", "&&", "!", "$", "metadata", "[", "'hasUpdateMask'", "]", "&&", "$", "metadata", "[", "'hasTransform'", "]", ";", "$", "shouldEnqueueUpdate", "=", "$", "fields", "||", "$", "emptyDocument", "||", "(", "$", "updateNotRequired", "&&", "!", "$", "merge", ")", "||", "$", "metadata", "[", "'hasUpdateMask'", "]", ";", "if", "(", "$", "shouldEnqueueUpdate", ")", "{", "$", "write", "=", "[", "'fields'", "=>", "$", "this", "->", "valueMapper", "->", "encodeValues", "(", "$", "fields", ")", ",", "]", ";", "if", "(", "$", "merge", ")", "{", "$", "write", "[", "'updateMask'", "]", "=", "$", "this", "->", "pathsToStrings", "(", "$", "this", "->", "encodeFieldPaths", "(", "$", "fields", ")", ",", "$", "sentinels", ")", ";", "}", "$", "this", "->", "writes", "[", "]", "=", "$", "this", "->", "createDatabaseWrite", "(", "self", "::", "TYPE_UPDATE", ",", "$", "document", ",", "$", "write", ",", "$", "options", ")", ";", "}", "// document transform operations are enqueued as a separate mutation.", "$", "this", "->", "enqueueTransforms", "(", "$", "document", ",", "$", "sentinels", ",", "$", "options", ")", ";", "return", "$", "this", ";", "}" ]
Enqueue a set mutation. Unless `$options['merge']` is set to `true, this method replaces all fields in a Firestore document. Example: ``` $batch->set($documentName, [ 'name' => 'John' ]); @codingStandardsIgnoreStart @param DocumentReference|string $document The document to target, either as a string document name, or DocumentReference object. Please note that DocumentReferences will be used only for the document name. Field data must be provided in the `$fields` argument. @param array $fields An array containing fields, where keys are the field names, and values are field values. Nested arrays are allowed. Note that unlike {@see Google\Cloud\Firestore\WriteBatch::update()}, field paths are NOT supported by this method. @param array $options { Configuration Options @type bool $merge If true, unwritten fields will be preserved. Otherwise, they will be overwritten (removed). **Defaults to** `false`. } @return WriteBatch @codingStandardsIgnoreEnd @throws \InvalidArgumentException If `FieldValue::deleteField()` is found in the document when `$options.merge` is not `true`. @throws \InvalidArgumentException If `FieldValue::serverTimestamp()` is found in an array value.
[ "Enqueue", "a", "set", "mutation", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L192-L237
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.commit
public function commit(array $options = []) { unset($options['merge'], $options['precondition']); $response = $this->connection->commit(array_filter([ 'database' => $this->database, 'writes' => $this->writes, 'transaction' => $this->transaction ]) + $options); if (isset($response['commitTime'])) { $time = $this->parseTimeString($response['commitTime']); $response['commitTime'] = new Timestamp($time[0], $time[1]); } if (isset($response['writeResults'])) { foreach ($response['writeResults'] as &$result) { if (isset($result['updateTime'])) { $time = $this->parseTimeString($result['updateTime']); $result['updateTime'] = new Timestamp($time[0], $time[1]); } } } return $response; }
php
public function commit(array $options = []) { unset($options['merge'], $options['precondition']); $response = $this->connection->commit(array_filter([ 'database' => $this->database, 'writes' => $this->writes, 'transaction' => $this->transaction ]) + $options); if (isset($response['commitTime'])) { $time = $this->parseTimeString($response['commitTime']); $response['commitTime'] = new Timestamp($time[0], $time[1]); } if (isset($response['writeResults'])) { foreach ($response['writeResults'] as &$result) { if (isset($result['updateTime'])) { $time = $this->parseTimeString($result['updateTime']); $result['updateTime'] = new Timestamp($time[0], $time[1]); } } } return $response; }
[ "public", "function", "commit", "(", "array", "$", "options", "=", "[", "]", ")", "{", "unset", "(", "$", "options", "[", "'merge'", "]", ",", "$", "options", "[", "'precondition'", "]", ")", ";", "$", "response", "=", "$", "this", "->", "connection", "->", "commit", "(", "array_filter", "(", "[", "'database'", "=>", "$", "this", "->", "database", ",", "'writes'", "=>", "$", "this", "->", "writes", ",", "'transaction'", "=>", "$", "this", "->", "transaction", "]", ")", "+", "$", "options", ")", ";", "if", "(", "isset", "(", "$", "response", "[", "'commitTime'", "]", ")", ")", "{", "$", "time", "=", "$", "this", "->", "parseTimeString", "(", "$", "response", "[", "'commitTime'", "]", ")", ";", "$", "response", "[", "'commitTime'", "]", "=", "new", "Timestamp", "(", "$", "time", "[", "0", "]", ",", "$", "time", "[", "1", "]", ")", ";", "}", "if", "(", "isset", "(", "$", "response", "[", "'writeResults'", "]", ")", ")", "{", "foreach", "(", "$", "response", "[", "'writeResults'", "]", "as", "&", "$", "result", ")", "{", "if", "(", "isset", "(", "$", "result", "[", "'updateTime'", "]", ")", ")", "{", "$", "time", "=", "$", "this", "->", "parseTimeString", "(", "$", "result", "[", "'updateTime'", "]", ")", ";", "$", "result", "[", "'updateTime'", "]", "=", "new", "Timestamp", "(", "$", "time", "[", "0", "]", ",", "$", "time", "[", "1", "]", ")", ";", "}", "}", "}", "return", "$", "response", ";", "}" ]
Commit writes to the database. Example: ``` $batch->commit(); ``` @codingStandardsIgnoreStart @see https://firebase.google.com/docs/firestore/reference/rpc/google.firestore.v1beta1#google.firestore.v1beta1.Firestore.Commit Commit @param array $options Configuration Options @return array [https://firebase.google.com/docs/firestore/reference/rpc/google.firestore.v1beta1#commitresponse](CommitResponse) @codingStandardsIgnoreEnd
[ "Commit", "writes", "to", "the", "database", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L430-L455
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.enqueueTransforms
private function enqueueTransforms($document, array $transforms, array $options = []) { $operations = []; foreach ($transforms as $transform) { if (!($transform instanceof DocumentTransformInterface)) { continue; } $args = $transform->args(); if (!$transform->sendRaw()) { if (is_array($args) && !$this->isAssoc($args)) { $args = $this->valueMapper->encodeArrayValue($args); } else { $args = $this->valueMapper->encodeValue($args); } } $operations[] = [ 'fieldPath' => $transform->fieldPath()->pathString(), $transform->key() => $args ]; } if ($operations) { $this->writes[] = $this->createDatabaseWrite(self::TYPE_TRANSFORM, $document, [ 'fieldTransforms' => $operations ] + $options); } }
php
private function enqueueTransforms($document, array $transforms, array $options = []) { $operations = []; foreach ($transforms as $transform) { if (!($transform instanceof DocumentTransformInterface)) { continue; } $args = $transform->args(); if (!$transform->sendRaw()) { if (is_array($args) && !$this->isAssoc($args)) { $args = $this->valueMapper->encodeArrayValue($args); } else { $args = $this->valueMapper->encodeValue($args); } } $operations[] = [ 'fieldPath' => $transform->fieldPath()->pathString(), $transform->key() => $args ]; } if ($operations) { $this->writes[] = $this->createDatabaseWrite(self::TYPE_TRANSFORM, $document, [ 'fieldTransforms' => $operations ] + $options); } }
[ "private", "function", "enqueueTransforms", "(", "$", "document", ",", "array", "$", "transforms", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "operations", "=", "[", "]", ";", "foreach", "(", "$", "transforms", "as", "$", "transform", ")", "{", "if", "(", "!", "(", "$", "transform", "instanceof", "DocumentTransformInterface", ")", ")", "{", "continue", ";", "}", "$", "args", "=", "$", "transform", "->", "args", "(", ")", ";", "if", "(", "!", "$", "transform", "->", "sendRaw", "(", ")", ")", "{", "if", "(", "is_array", "(", "$", "args", ")", "&&", "!", "$", "this", "->", "isAssoc", "(", "$", "args", ")", ")", "{", "$", "args", "=", "$", "this", "->", "valueMapper", "->", "encodeArrayValue", "(", "$", "args", ")", ";", "}", "else", "{", "$", "args", "=", "$", "this", "->", "valueMapper", "->", "encodeValue", "(", "$", "args", ")", ";", "}", "}", "$", "operations", "[", "]", "=", "[", "'fieldPath'", "=>", "$", "transform", "->", "fieldPath", "(", ")", "->", "pathString", "(", ")", ",", "$", "transform", "->", "key", "(", ")", "=>", "$", "args", "]", ";", "}", "if", "(", "$", "operations", ")", "{", "$", "this", "->", "writes", "[", "]", "=", "$", "this", "->", "createDatabaseWrite", "(", "self", "::", "TYPE_TRANSFORM", ",", "$", "document", ",", "[", "'fieldTransforms'", "=>", "$", "operations", "]", "+", "$", "options", ")", ";", "}", "}" ]
Enqueue transforms for CREATE, UPDATE, and SET calls. @param DocumentReference|string $document The document to target, either as a string document name, or DocumentReference object. @param DocumentTransformInterface[] $transforms @param array $options @return void
[ "Enqueue", "transforms", "for", "CREATE", "UPDATE", "and", "SET", "calls", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L502-L531
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.validatePrecondition
private function validatePrecondition(array &$options) { $precondition = isset($options['precondition']) ? $options['precondition'] : null; if (!$precondition) { return; } if (isset($precondition['exists'])) { return $precondition; } if (isset($precondition['updateTime'])) { if (!($precondition['updateTime'] instanceof Timestamp)) { throw new \InvalidArgumentException( 'Precondition Update Time must be an instance of `Google\\Cloud\\Core\\Timestamp`' ); } return [ 'updateTime' => $precondition['updateTime']->formatForApi() ]; } throw new \InvalidArgumentException('Preconditions must provide either `exists` or `updateTime`.'); }
php
private function validatePrecondition(array &$options) { $precondition = isset($options['precondition']) ? $options['precondition'] : null; if (!$precondition) { return; } if (isset($precondition['exists'])) { return $precondition; } if (isset($precondition['updateTime'])) { if (!($precondition['updateTime'] instanceof Timestamp)) { throw new \InvalidArgumentException( 'Precondition Update Time must be an instance of `Google\\Cloud\\Core\\Timestamp`' ); } return [ 'updateTime' => $precondition['updateTime']->formatForApi() ]; } throw new \InvalidArgumentException('Preconditions must provide either `exists` or `updateTime`.'); }
[ "private", "function", "validatePrecondition", "(", "array", "&", "$", "options", ")", "{", "$", "precondition", "=", "isset", "(", "$", "options", "[", "'precondition'", "]", ")", "?", "$", "options", "[", "'precondition'", "]", ":", "null", ";", "if", "(", "!", "$", "precondition", ")", "{", "return", ";", "}", "if", "(", "isset", "(", "$", "precondition", "[", "'exists'", "]", ")", ")", "{", "return", "$", "precondition", ";", "}", "if", "(", "isset", "(", "$", "precondition", "[", "'updateTime'", "]", ")", ")", "{", "if", "(", "!", "(", "$", "precondition", "[", "'updateTime'", "]", "instanceof", "Timestamp", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Precondition Update Time must be an instance of `Google\\\\Cloud\\\\Core\\\\Timestamp`'", ")", ";", "}", "return", "[", "'updateTime'", "=>", "$", "precondition", "[", "'updateTime'", "]", "->", "formatForApi", "(", ")", "]", ";", "}", "throw", "new", "\\", "InvalidArgumentException", "(", "'Preconditions must provide either `exists` or `updateTime`.'", ")", ";", "}" ]
Validates a document precondition, if set. @codingStandardsIgnoreStart @param array $options Configuration Options @return array [Precondition](https://firebase.google.com/docs/firestore/reference/rpc/google.firestore.v1beta1#google.firestore.v1beta1.Precondition) @throws \InvalidArgumentException If the precondition is invalid. @codingStandardsIgnoreEnd
[ "Validates", "a", "document", "precondition", "if", "set", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L574-L601
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.createDatabaseWriteOperation
private function createDatabaseWriteOperation($type, $document, array $options = []) { switch ($type) { case self::TYPE_UPDATE: return [ 'update' => [ 'name' => $document, 'fields' => $this->pluck('fields', $options) ] ]; break; case self::TYPE_DELETE: return ['delete' => $document]; break; case self::TYPE_TRANSFORM: return [ 'transform' => [ 'document' => $document, 'fieldTransforms' => $this->pluck('fieldTransforms', $options) ] ]; break; // @codeCoverageIgnoreStart default: throw new \InvalidArgumentException(sprintf( 'Write operation type `%s is not valid. Allowed values are update, delete, verify, transform.', $type )); break; // @codeCoverageIgnoreEnd } }
php
private function createDatabaseWriteOperation($type, $document, array $options = []) { switch ($type) { case self::TYPE_UPDATE: return [ 'update' => [ 'name' => $document, 'fields' => $this->pluck('fields', $options) ] ]; break; case self::TYPE_DELETE: return ['delete' => $document]; break; case self::TYPE_TRANSFORM: return [ 'transform' => [ 'document' => $document, 'fieldTransforms' => $this->pluck('fieldTransforms', $options) ] ]; break; // @codeCoverageIgnoreStart default: throw new \InvalidArgumentException(sprintf( 'Write operation type `%s is not valid. Allowed values are update, delete, verify, transform.', $type )); break; // @codeCoverageIgnoreEnd } }
[ "private", "function", "createDatabaseWriteOperation", "(", "$", "type", ",", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "self", "::", "TYPE_UPDATE", ":", "return", "[", "'update'", "=>", "[", "'name'", "=>", "$", "document", ",", "'fields'", "=>", "$", "this", "->", "pluck", "(", "'fields'", ",", "$", "options", ")", "]", "]", ";", "break", ";", "case", "self", "::", "TYPE_DELETE", ":", "return", "[", "'delete'", "=>", "$", "document", "]", ";", "break", ";", "case", "self", "::", "TYPE_TRANSFORM", ":", "return", "[", "'transform'", "=>", "[", "'document'", "=>", "$", "document", ",", "'fieldTransforms'", "=>", "$", "this", "->", "pluck", "(", "'fieldTransforms'", ",", "$", "options", ")", "]", "]", ";", "break", ";", "// @codeCoverageIgnoreStart", "default", ":", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Write operation type `%s is not valid. Allowed values are update, delete, verify, transform.'", ",", "$", "type", ")", ")", ";", "break", ";", "// @codeCoverageIgnoreEnd", "}", "}" ]
Create the write operation object. @param string $type The write type. @param string $document The document to target, either as a string document name, or DocumentReference object. @param array $options Configuration Options. @return array @throws \InvalidArgumentException If $type is not a valid value.
[ "Create", "the", "write", "operation", "object", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L613-L647
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.formatPrecondition
private function formatPrecondition(array $options, $mustExist = false) { if (!isset($options['precondition']) && !$mustExist) { return $options; } $precondition = isset($options['precondition']) ? $options['precondition'] : []; if (isset($precondition['updateTime'])) { return $options; } if ($mustExist) { $precondition['exists'] = true; } $options['precondition'] = $precondition; return $options; }
php
private function formatPrecondition(array $options, $mustExist = false) { if (!isset($options['precondition']) && !$mustExist) { return $options; } $precondition = isset($options['precondition']) ? $options['precondition'] : []; if (isset($precondition['updateTime'])) { return $options; } if ($mustExist) { $precondition['exists'] = true; } $options['precondition'] = $precondition; return $options; }
[ "private", "function", "formatPrecondition", "(", "array", "$", "options", ",", "$", "mustExist", "=", "false", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "[", "'precondition'", "]", ")", "&&", "!", "$", "mustExist", ")", "{", "return", "$", "options", ";", "}", "$", "precondition", "=", "isset", "(", "$", "options", "[", "'precondition'", "]", ")", "?", "$", "options", "[", "'precondition'", "]", ":", "[", "]", ";", "if", "(", "isset", "(", "$", "precondition", "[", "'updateTime'", "]", ")", ")", "{", "return", "$", "options", ";", "}", "if", "(", "$", "mustExist", ")", "{", "$", "precondition", "[", "'exists'", "]", "=", "true", ";", "}", "$", "options", "[", "'precondition'", "]", "=", "$", "precondition", ";", "return", "$", "options", ";", "}" ]
Correctly formats a precondition for a write. @param array $options Configuration options input. @param bool $mustExist If true, the precondition will always include at least `exists=true` precondition. **Defaults to** `false`. @return array Modified configuration options.
[ "Correctly", "formats", "a", "precondition", "for", "a", "write", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L785-L806
train
googleapis/google-cloud-php
Firestore/src/WriteBatch.php
WriteBatch.checkPrefixes
private function checkPrefixes(array $paths) { sort($paths); for ($i = 1; $i < count($paths); $i++) { $prefix = $paths[$i-1]; $suffix = $paths[$i]; $prefix = explode('.', $prefix); $suffix = explode('.', $suffix); $isPrefix = count($prefix) < count($suffix) && $prefix === array_slice($suffix, 0, count($prefix)); if ($isPrefix) { throw new \InvalidArgumentException(sprintf( 'Field path conflict detected for field path `%s`. ' . 'Conflicts occur when a field path descends from another ' . 'path. For instance `a.b` is not allowed when `a` is also ' . 'provided.', $prefix )); } } }
php
private function checkPrefixes(array $paths) { sort($paths); for ($i = 1; $i < count($paths); $i++) { $prefix = $paths[$i-1]; $suffix = $paths[$i]; $prefix = explode('.', $prefix); $suffix = explode('.', $suffix); $isPrefix = count($prefix) < count($suffix) && $prefix === array_slice($suffix, 0, count($prefix)); if ($isPrefix) { throw new \InvalidArgumentException(sprintf( 'Field path conflict detected for field path `%s`. ' . 'Conflicts occur when a field path descends from another ' . 'path. For instance `a.b` is not allowed when `a` is also ' . 'provided.', $prefix )); } } }
[ "private", "function", "checkPrefixes", "(", "array", "$", "paths", ")", "{", "sort", "(", "$", "paths", ")", ";", "for", "(", "$", "i", "=", "1", ";", "$", "i", "<", "count", "(", "$", "paths", ")", ";", "$", "i", "++", ")", "{", "$", "prefix", "=", "$", "paths", "[", "$", "i", "-", "1", "]", ";", "$", "suffix", "=", "$", "paths", "[", "$", "i", "]", ";", "$", "prefix", "=", "explode", "(", "'.'", ",", "$", "prefix", ")", ";", "$", "suffix", "=", "explode", "(", "'.'", ",", "$", "suffix", ")", ";", "$", "isPrefix", "=", "count", "(", "$", "prefix", ")", "<", "count", "(", "$", "suffix", ")", "&&", "$", "prefix", "===", "array_slice", "(", "$", "suffix", ",", "0", ",", "count", "(", "$", "prefix", ")", ")", ";", "if", "(", "$", "isPrefix", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Field path conflict detected for field path `%s`. '", ".", "'Conflicts occur when a field path descends from another '", ".", "'path. For instance `a.b` is not allowed when `a` is also '", ".", "'provided.'", ",", "$", "prefix", ")", ")", ";", "}", "}", "}" ]
Check list of FieldPaths for prefix paths and throw exception. @param string[] $paths @throws \InvalidArgumentException If prefix paths are found.
[ "Check", "list", "of", "FieldPaths", "for", "prefix", "paths", "and", "throw", "exception", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/WriteBatch.php#L892-L916
train
googleapis/google-cloud-php
Container/src/V1/NetworkPolicy.php
NetworkPolicy.setProvider
public function setProvider($var) { GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\NetworkPolicy_Provider::class); $this->provider = $var; return $this; }
php
public function setProvider($var) { GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\NetworkPolicy_Provider::class); $this->provider = $var; return $this; }
[ "public", "function", "setProvider", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "NetworkPolicy_Provider", "::", "class", ")", ";", "$", "this", "->", "provider", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The selected network policy provider. Generated from protobuf field <code>.google.container.v1.NetworkPolicy.Provider provider = 1;</code> @param int $var @return $this
[ "The", "selected", "network", "policy", "provider", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/NetworkPolicy.php#L67-L73
train
googleapis/google-cloud-php
Monitoring/src/V3/CreateNotificationChannelRequest.php
CreateNotificationChannelRequest.setNotificationChannel
public function setNotificationChannel($var) { GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\NotificationChannel::class); $this->notification_channel = $var; return $this; }
php
public function setNotificationChannel($var) { GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\NotificationChannel::class); $this->notification_channel = $var; return $this; }
[ "public", "function", "setNotificationChannel", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Monitoring", "\\", "V3", "\\", "NotificationChannel", "::", "class", ")", ";", "$", "this", "->", "notification_channel", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The definition of the `NotificationChannel` to create. Generated from protobuf field <code>.google.monitoring.v3.NotificationChannel notification_channel = 2;</code> @param \Google\Cloud\Monitoring\V3\NotificationChannel $var @return $this
[ "The", "definition", "of", "the", "NotificationChannel", "to", "create", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Monitoring/src/V3/CreateNotificationChannelRequest.php#L112-L118
train
googleapis/google-cloud-php
Firestore/src/V1/StructuredQuery/UnaryFilter.php
UnaryFilter.setOp
public function setOp($var) { GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter_Operator::class); $this->op = $var; return $this; }
php
public function setOp($var) { GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter_Operator::class); $this->op = $var; return $this; }
[ "public", "function", "setOp", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Firestore", "\\", "V1", "\\", "StructuredQuery_UnaryFilter_Operator", "::", "class", ")", ";", "$", "this", "->", "op", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The unary operator to apply. Generated from protobuf field <code>.google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1;</code> @param int $var @return $this
[ "The", "unary", "operator", "to", "apply", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Firestore/src/V1/StructuredQuery/UnaryFilter.php#L61-L67
train
googleapis/google-cloud-php
Dlp/src/V2/ListInspectTemplatesResponse.php
ListInspectTemplatesResponse.setInspectTemplates
public function setInspectTemplates($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\InspectTemplate::class); $this->inspect_templates = $arr; return $this; }
php
public function setInspectTemplates($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\InspectTemplate::class); $this->inspect_templates = $arr; return $this; }
[ "public", "function", "setInspectTemplates", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Dlp", "\\", "V2", "\\", "InspectTemplate", "::", "class", ")", ";", "$", "this", "->", "inspect_templates", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. Generated from protobuf field <code>repeated .google.privacy.dlp.v2.InspectTemplate inspect_templates = 1;</code> @param \Google\Cloud\Dlp\V2\InspectTemplate[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "List", "of", "inspectTemplates", "up", "to", "page_size", "in", "ListInspectTemplatesRequest", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/ListInspectTemplatesResponse.php#L68-L74
train
googleapis/google-cloud-php
Container/src/V1/SetMasterAuthRequest.php
SetMasterAuthRequest.setAction
public function setAction($var) { GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\SetMasterAuthRequest_Action::class); $this->action = $var; return $this; }
php
public function setAction($var) { GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\SetMasterAuthRequest_Action::class); $this->action = $var; return $this; }
[ "public", "function", "setAction", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "SetMasterAuthRequest_Action", "::", "class", ")", ";", "$", "this", "->", "action", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
The exact form of action to be taken on the master auth. Generated from protobuf field <code>.google.container.v1.SetMasterAuthRequest.Action action = 4;</code> @param int $var @return $this
[ "The", "exact", "form", "of", "action", "to", "be", "taken", "on", "the", "master", "auth", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/SetMasterAuthRequest.php#L202-L208
train
googleapis/google-cloud-php
Container/src/V1/SetMasterAuthRequest.php
SetMasterAuthRequest.setUpdate
public function setUpdate($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuth::class); $this->update = $var; return $this; }
php
public function setUpdate($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuth::class); $this->update = $var; return $this; }
[ "public", "function", "setUpdate", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Container", "\\", "V1", "\\", "MasterAuth", "::", "class", ")", ";", "$", "this", "->", "update", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
A description of the update. Generated from protobuf field <code>.google.container.v1.MasterAuth update = 5;</code> @param \Google\Cloud\Container\V1\MasterAuth $var @return $this
[ "A", "description", "of", "the", "update", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Container/src/V1/SetMasterAuthRequest.php#L228-L234
train
googleapis/google-cloud-php
Talent/src/V4beta1/EducationRecord.php
EducationRecord.setStructuredDegree
public function setStructuredDegree($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Degree::class); $this->writeOneof(7, $var); return $this; }
php
public function setStructuredDegree($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Degree::class); $this->writeOneof(7, $var); return $this; }
[ "public", "function", "setStructuredDegree", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkMessage", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Talent", "\\", "V4beta1", "\\", "Degree", "::", "class", ")", ";", "$", "this", "->", "writeOneof", "(", "7", ",", "$", "var", ")", ";", "return", "$", "this", ";", "}" ]
Optional. The structured notation of the degree. Generated from protobuf field <code>.google.cloud.talent.v4beta1.Degree structured_degree = 7;</code> @param \Google\Cloud\Talent\V4beta1\Degree $var @return $this
[ "Optional", ".", "The", "structured", "notation", "of", "the", "degree", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/EducationRecord.php#L345-L351
train
googleapis/google-cloud-php
Debugger/src/V2/Variable.php
Variable.setMembers
public function setMembers($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Debugger\V2\Variable::class); $this->members = $arr; return $this; }
php
public function setMembers($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Debugger\V2\Variable::class); $this->members = $arr; return $this; }
[ "public", "function", "setMembers", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", "Cloud", "\\", "Debugger", "\\", "V2", "\\", "Variable", "::", "class", ")", ";", "$", "this", "->", "members", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Members contained or pointed to by the variable. Generated from protobuf field <code>repeated .google.devtools.clouddebugger.v2.Variable members = 3;</code> @param \Google\Cloud\Debugger\V2\Variable[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Members", "contained", "or", "pointed", "to", "by", "the", "variable", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Debugger/src/V2/Variable.php#L299-L305
train
googleapis/google-cloud-php
Dialogflow/src/V2/Intent.php
Intent.setWebhookState
public function setWebhookState($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent_WebhookState::class); $this->webhook_state = $var; return $this; }
php
public function setWebhookState($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent_WebhookState::class); $this->webhook_state = $var; return $this; }
[ "public", "function", "setWebhookState", "(", "$", "var", ")", "{", "GPBUtil", "::", "checkEnum", "(", "$", "var", ",", "\\", "Google", "\\", "Cloud", "\\", "Dialogflow", "\\", "V2", "\\", "Intent_WebhookState", "::", "class", ")", ";", "$", "this", "->", "webhook_state", "=", "$", "var", ";", "return", "$", "this", ";", "}" ]
Optional. Indicates whether webhooks are enabled for the intent. Generated from protobuf field <code>.google.cloud.dialogflow.v2.Intent.WebhookState webhook_state = 6;</code> @param int $var @return $this
[ "Optional", ".", "Indicates", "whether", "webhooks", "are", "enabled", "for", "the", "intent", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/Intent.php#L316-L322
train
googleapis/google-cloud-php
Dialogflow/src/V2/Intent.php
Intent.setEvents
public function setEvents($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->events = $arr; return $this; }
php
public function setEvents($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->events = $arr; return $this; }
[ "public", "function", "setEvents", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "STRING", ")", ";", "$", "this", "->", "events", "=", "$", "arr", ";", "return", "$", "this", ";", "}" ]
Optional. The collection of event names that trigger the intent. If the collection of input contexts is not empty, all of the contexts must be present in the active user session for an event to trigger this intent. Generated from protobuf field <code>repeated string events = 8;</code> @param string[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Optional", ".", "The", "collection", "of", "event", "names", "that", "trigger", "the", "intent", ".", "If", "the", "collection", "of", "input", "contexts", "is", "not", "empty", "all", "of", "the", "contexts", "must", "be", "present", "in", "the", "active", "user", "session", "for", "an", "event", "to", "trigger", "this", "intent", "." ]
ff5030ffa1f12904565509a7bc24ecc0bd794a3e
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/Intent.php#L466-L472
train