idx
int64
0
60.3k
question
stringlengths
101
6.21k
target
stringlengths
7
803
2,100
public function setMetricDescriptors ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Api \ MetricDescriptor :: class ) ; $ this -> metric_descriptors = $ arr ; return $ this ; }
The metric descriptors that are available to the project and that match the value of filter if present .
2,101
public function setProductSets ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ ProductSet :: class ) ; $ this -> product_sets = $ arr ; return $ this ; }
List of ProductSets .
2,102
public function setHttpMethod ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Scheduler \ V1beta1 \ HttpMethod :: class ) ; $ this -> http_method = $ var ; return $ this ; }
Which HTTP method to use for the request .
2,103
public function setKeyValue ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Datastore \ V1 \ Key :: class ) ; $ this -> writeOneof ( 5 , $ var ) ; return $ this ; }
A key value .
2,104
public function setAlertPolicy ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Monitoring \ V3 \ AlertPolicy :: class ) ; $ this -> alert_policy = $ var ; return $ this ; }
Required . The updated alerting policy or the updated values for the fields listed in update_mask . If update_mask is not empty any fields in this policy that are not in update_mask are ignored .
2,105
public function batch ( ) { return new WriteBatch ( $ this -> connection , $ this -> valueMapper , $ this -> databaseName ( $ this -> projectId , $ this -> database ) ) ; }
Get a Batch Writer
2,106
public function collection ( $ name ) { return $ this -> getCollectionReference ( $ this -> connection , $ this -> valueMapper , $ this -> projectId , $ this -> database , $ name ) ; }
Lazily instantiate a Collection reference .
2,107
public function collections ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( $ collectionId ) { return $ this -> collection ( $ collectionId ) ; } , [ $ this -> connection , 'listCollectionIds' ] , [ 'parent' => $ this -> fullName ( $ this -> projectId , $ this -> database ) , ] + $ options , [ 'itemsKey' => 'collectionIds' , 'resultLimit' => $ resultLimit ] ) ) ; }
List root - level collections in the database .
2,108
public function document ( $ name ) { return $ this -> getDocumentReference ( $ this -> connection , $ this -> valueMapper , $ this -> projectId , $ this -> database , $ name ) ; }
Get a reference to a Firestore document .
2,109
public function runTransaction ( callable $ callable , array $ options = [ ] ) { $ options += [ 'maxRetries' => self :: MAX_RETRIES , 'begin' => [ ] , 'commit' => [ ] , 'rollback' => [ ] ] ; $ retryableErrors = [ AbortedException :: class ] ; $ delayFn = function ( ) { return [ 'seconds' => 0 , 'nanos' => 0 ] ; } ; $ retryFn = function ( \ Exception $ e ) use ( $ retryableErrors ) { return in_array ( get_class ( $ e ) , $ retryableErrors ) ; } ; $ transactionId = null ; $ retry = new Retry ( $ options [ 'maxRetries' ] , $ delayFn , $ retryFn ) ; return $ retry -> execute ( function ( callable $ callable , array $ options ) use ( & $ transactionId ) { $ database = $ this -> databaseName ( $ this -> projectId , $ this -> database ) ; $ beginTransaction = $ this -> connection -> beginTransaction ( array_filter ( [ 'database' => $ database , 'retryTransaction' => $ transactionId ] ) + $ options [ 'begin' ] ) ; $ transactionId = $ beginTransaction [ 'transaction' ] ; $ transaction = new Transaction ( $ this -> connection , $ this -> valueMapper , $ database , $ transactionId ) ; try { $ res = $ callable ( $ transaction ) ; if ( ! $ transaction -> writer ( ) -> isEmpty ( ) ) { $ transaction -> writer ( ) -> commit ( [ 'transaction' => $ transactionId ] + $ options [ 'commit' ] ) ; } else { $ transaction -> writer ( ) -> rollback ( $ options [ 'rollback' ] ) ; } return $ res ; } catch ( \ Exception $ e ) { $ transaction -> writer ( ) -> rollback ( $ options [ 'rollback' ] ) ; throw $ e ; } } , [ $ callable , $ options ] ) ; }
Executes a function in a Firestore transaction .
2,110
public function setField ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ Admin \ V1 \ Field :: class ) ; $ this -> field = $ var ; return $ this ; }
The field to be updated .
2,111
public function setDelete ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Spanner \ V1 \ Mutation_Delete :: class ) ; $ this -> writeOneof ( 5 , $ var ) ; return $ this ; }
Delete rows from a table . Succeeds whether or not the named rows were present .
2,112
public function setThreat ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ WebRisk \ V1beta1 \ SearchUrisResponse_ThreatUri :: class ) ; $ this -> threat = $ var ; return $ this ; }
The threat list matches . This may be empty if the URI is on no list .
2,113
public function setDataSourceIds ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> data_source_ids = $ arr ; return $ this ; }
When specified only configurations of requested data sources are returned .
2,114
private function getConnectionType ( array $ config ) { $ isGrpcExtensionLoaded = $ this -> isGrpcLoaded ( ) ; $ defaultTransport = $ isGrpcExtensionLoaded ? 'grpc' : 'rest' ; $ transport = isset ( $ config [ 'transport' ] ) ? strtolower ( $ config [ 'transport' ] ) : $ defaultTransport ; if ( $ transport === 'grpc' ) { if ( ! $ isGrpcExtensionLoaded ) { throw new GoogleException ( 'gRPC support has been requested but required dependencies ' . 'have not been found. ' . $ this -> getGrpcInstallationMessage ( ) ) ; } } return $ transport ; }
Get either a gRPC or REST connection based on the provided config and the system dependencies available .
2,115
private function configureAuthentication ( array $ config ) { $ config [ 'keyFile' ] = $ this -> getKeyFile ( $ config ) ; $ this -> projectId = $ this -> detectProjectId ( $ config ) ; return $ config ; }
Fetch and validate the keyfile and set the project ID .
2,116
private function getKeyFile ( array $ config = [ ] ) { $ config += [ 'keyFile' => null , 'keyFilePath' => null , ] ; if ( $ config [ 'keyFile' ] ) { return $ config [ 'keyFile' ] ; } if ( $ config [ 'keyFilePath' ] ) { if ( ! file_exists ( $ config [ 'keyFilePath' ] ) ) { throw new GoogleException ( sprintf ( 'Given keyfile path %s does not exist' , $ config [ 'keyFilePath' ] ) ) ; } try { $ keyFileData = $ this -> jsonDecode ( file_get_contents ( $ config [ 'keyFilePath' ] ) , true ) ; } catch ( \ InvalidArgumentException $ ex ) { throw new GoogleException ( sprintf ( 'Given keyfile at path %s was invalid' , $ config [ 'keyFilePath' ] ) ) ; } return $ keyFileData ; } return CredentialsLoader :: fromEnv ( ) ? : CredentialsLoader :: fromWellKnownFile ( ) ; }
Get a keyfile if it exists .
2,117
private function detectProjectId ( array $ config ) { $ config += [ 'httpHandler' => null , 'projectId' => null , 'projectIdRequired' => false , 'hasEmulator' => false , 'preferNumericProjectId' => false , 'suppressKeyFileNotice' => false ] ; if ( $ config [ 'projectId' ] ) { return $ config [ 'projectId' ] ; } if ( $ config [ 'hasEmulator' ] ) { return 'emulator-project' ; } if ( isset ( $ config [ 'keyFile' ] ) ) { if ( isset ( $ config [ 'keyFile' ] [ 'project_id' ] ) ) { return $ config [ 'keyFile' ] [ 'project_id' ] ; } if ( $ config [ 'suppressKeyFileNotice' ] !== true ) { $ serviceAccountUri = 'https://cloud.google.com/iam/docs/' . 'creating-managing-service-account-keys#creating_service_account_keys' ; trigger_error ( sprintf ( 'A keyfile was given, but it does not contain a project ' . 'ID. This can indicate an old and obsolete keyfile, ' . 'in which case you should create a new one. To suppress ' . 'this message, set `suppressKeyFileNotice` to `true` in your client configuration. ' . 'To learn more about generating new keys, see this URL: %s' , $ serviceAccountUri ) , E_USER_NOTICE ) ; } } if ( getenv ( 'GOOGLE_CLOUD_PROJECT' ) ) { return getenv ( 'GOOGLE_CLOUD_PROJECT' ) ; } if ( getenv ( 'GCLOUD_PROJECT' ) ) { return getenv ( 'GCLOUD_PROJECT' ) ; } if ( $ this -> onGce ( $ config [ 'httpHandler' ] ) ) { $ metadata = $ this -> getMetaData ( ) ; $ projectId = $ config [ 'preferNumericProjectId' ] ? $ metadata -> getNumericProjectId ( ) : $ metadata -> getProjectId ( ) ; if ( $ projectId ) { return $ projectId ; } } if ( $ config [ 'projectIdRequired' ] ) { throw new GoogleException ( 'No project ID was provided, ' . 'and we were unable to detect a default project ID.' ) ; } }
Detect and return a project ID .
2,118
public function setHorizontalPodAutoscaling ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ HorizontalPodAutoscaling :: class ) ; $ this -> horizontal_pod_autoscaling = $ var ; return $ this ; }
Configuration for the horizontal pod autoscaling feature which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods .
2,119
public function setKubernetesDashboard ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ KubernetesDashboard :: class ) ; $ this -> kubernetes_dashboard = $ var ; return $ this ; }
Configuration for the Kubernetes Dashboard .
2,120
public function setNetworkPolicyConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ NetworkPolicyConfig :: class ) ; $ this -> network_policy_config = $ var ; return $ this ; }
Configuration for NetworkPolicy . This only tracks whether the addon is enabled or not on the Master it does not track whether network policy is enabled for the nodes .
2,121
public function setTenants ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ Tenant :: class ) ; $ this -> tenants = $ arr ; return $ this ; }
Tenants for the current client .
2,122
public function setQuery ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1 \ Target_QueryTarget :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
A target specified by a query .
2,123
public function setDocuments ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1 \ Target_DocumentsTarget :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
A target specified by a set of document names .
2,124
private function createSnapshot ( ConnectionInterface $ connection , ValueMapper $ valueMapper , DocumentReference $ reference , array $ options = [ ] ) { $ document = [ ] ; $ fields = [ ] ; $ exists = true ; try { $ document = $ this -> getSnapshot ( $ connection , $ reference -> name ( ) , $ options ) ; } catch ( NotFoundException $ e ) { $ exists = false ; } return $ this -> createSnapshotWithData ( $ valueMapper , $ reference , $ document , $ exists ) ; }
Execute a service request to retrieve a document snapshot .
2,125
private function createSnapshotWithData ( ValueMapper $ valueMapper , DocumentReference $ reference , array $ document , $ exists = true ) { $ fields = $ exists ? $ valueMapper -> decodeValues ( $ this -> pluck ( 'fields' , $ document ) ) : [ ] ; $ document = $ this -> transformSnapshotTimestamps ( $ document ) ; return new DocumentSnapshot ( $ reference , $ valueMapper , $ document , $ fields , $ exists ) ; }
Create a document snapshot by providing a dataset .
2,126
private function getSnapshot ( ConnectionInterface $ connection , $ name , array $ options = [ ] ) { if ( isset ( $ options [ 'readTime' ] ) ) { if ( ! ( $ options [ 'readTime' ] instanceof Timestamp ) ) { throw new \ InvalidArgumentException ( sprintf ( '`$options.readTime` must be an instance of %s' , Timestamp :: class ) ) ; } $ options [ 'readTime' ] = $ options [ 'readTime' ] -> formatForApi ( ) ; } $ snapshot = $ connection -> batchGetDocuments ( [ 'database' => $ this -> databaseFromName ( $ name ) , 'documents' => [ $ name ] , ] + $ options ) -> current ( ) ; if ( ! isset ( $ snapshot [ 'found' ] ) ) { throw new NotFoundException ( sprintf ( 'Document %s does not exist' , $ name ) ) ; } return $ snapshot [ 'found' ] ; }
Send a service request for a snapshot and return the raw data
2,127
private function getDocumentReference ( ConnectionInterface $ connection , ValueMapper $ mapper , $ projectId , $ database , $ name ) { if ( $ this -> isRelative ( $ name ) ) { try { $ name = $ this -> fullName ( $ projectId , $ database , $ name ) ; } catch ( ValidationException $ e ) { $ hasSpecialChars = preg_match ( '/[!@#$%^&*(),.?":{}|<>]/' , $ name ) === 1 ; if ( ! $ hasSpecialChars ) { throw $ e ; } $ base = $ this -> databaseName ( $ projectId , $ database ) ; $ name = $ base . '/documents/' . $ name ; } } if ( ! $ this -> isDocument ( $ name ) ) { throw new \ InvalidArgumentException ( 'Given path is not a valid document path.' ) ; } return new DocumentReference ( $ connection , $ mapper , $ this -> getCollectionReference ( $ connection , $ mapper , $ projectId , $ database , $ this -> parentPath ( $ name ) ) , $ name ) ; }
Creates a DocumentReference object .
2,128
private function getCollectionReference ( ConnectionInterface $ connection , ValueMapper $ mapper , $ projectId , $ database , $ name ) { if ( $ this -> isRelative ( $ name ) ) { $ name = $ this -> fullName ( $ projectId , $ database , $ name ) ; } if ( ! $ this -> isCollection ( $ name ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Given path `%s` is not a valid collection path.' , $ name ) ) ; } return new CollectionReference ( $ connection , $ mapper , $ name ) ; }
Creates a CollectionReference object .
2,129
private function transformSnapshotTimestamps ( array $ data ) { foreach ( [ 'createTime' , 'updateTime' , 'readTime' ] as $ timestampField ) { if ( ! isset ( $ data [ $ timestampField ] ) ) { continue ; } list ( $ dt , $ nanos ) = $ this -> parseTimeString ( $ data [ $ timestampField ] ) ; $ data [ $ timestampField ] = new Timestamp ( $ dt , $ nanos ) ; } return $ data ; }
Convert snapshot timestamps to Google Cloud PHP types .
2,130
public function setMetadata ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Spanner \ V1 \ ResultSetMetadata :: class ) ; $ this -> metadata = $ var ; return $ this ; }
Metadata about the result set such as row type information .
2,131
public function setInstance ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Spanner \ Admin \ Instance \ V1 \ Instance :: class ) ; $ this -> instance = $ var ; return $ this ; }
The desired end state of the update .
2,132
public function setMetric ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Logging \ V2 \ LogMetric :: class ) ; $ this -> metric = $ var ; return $ this ; }
The updated metric .
2,133
public function setApplications ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ Application :: class ) ; $ this -> applications = $ arr ; return $ this ; }
Applications for the current client .
2,134
public function setQuickReplies ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_QuickReplies :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
The quick replies response .
2,135
public function setCard ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_Card :: class ) ; $ this -> writeOneof ( 4 , $ var ) ; return $ this ; }
The card response .
2,136
public function setSimpleResponses ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_SimpleResponses :: class ) ; $ this -> writeOneof ( 7 , $ var ) ; return $ this ; }
The voice and text - only responses for Actions on Google .
2,137
public function setBasicCard ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_BasicCard :: class ) ; $ this -> writeOneof ( 8 , $ var ) ; return $ this ; }
The basic card response for Actions on Google .
2,138
public function setSuggestions ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_Suggestions :: class ) ; $ this -> writeOneof ( 9 , $ var ) ; return $ this ; }
The suggestion chips for Actions on Google .
2,139
public function setLinkOutSuggestion ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_LinkOutSuggestion :: class ) ; $ this -> writeOneof ( 10 , $ var ) ; return $ this ; }
The link out suggestion chip for Actions on Google .
2,140
public function setListSelect ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_ListSelect :: class ) ; $ this -> writeOneof ( 11 , $ var ) ; return $ this ; }
The list card response for Actions on Google .
2,141
public function setCarouselSelect ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_CarouselSelect :: class ) ; $ this -> writeOneof ( 12 , $ var ) ; return $ this ; }
The carousel card response for Actions on Google .
2,142
public function setPlatform ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_Message_Platform :: class ) ; $ this -> platform = $ var ; return $ this ; }
Optional . The platform that this message is intended for .
2,143
public function setOperationState ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Firestore \ Admin \ V1 \ OperationState :: class ) ; $ this -> operation_state = $ var ; return $ this ; }
The state of the export operation .
2,144
public function setProgressDocuments ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ Admin \ V1 \ Progress :: class ) ; $ this -> progress_documents = $ var ; return $ this ; }
The progress in documents of this operation .
2,145
public function setProgressBytes ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ Admin \ V1 \ Progress :: class ) ; $ this -> progress_bytes = $ var ; return $ this ; }
The progress in bytes of this operation .
2,146
public function setCollectionIds ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> collection_ids = $ arr ; return $ this ; }
Which collection ids are being exported .
2,147
public function reload ( array $ options = [ ] ) { return $ this -> info = $ this -> connection -> getDatabase ( [ 'name' => $ this -> name ] + $ options ) ; }
Reload the database info from the Cloud Spanner API .
2,148
public function create ( array $ options = [ ] ) { $ options += [ 'statements' => [ ] , ] ; $ databaseId = DatabaseAdminClient :: parseName ( $ this -> name ( ) ) [ 'database' ] ; $ statement = sprintf ( 'CREATE DATABASE `%s`' , $ databaseId ) ; $ operation = $ this -> connection -> createDatabase ( [ 'instance' => $ this -> instance -> name ( ) , 'createStatement' => $ statement , 'extraStatements' => $ options [ 'statements' ] ] ) ; return $ this -> resumeOperation ( $ operation [ 'name' ] , $ operation ) ; }
Create a new Cloud Spanner database .
2,149
public function updateDdlBatch ( array $ statements , array $ options = [ ] ) { $ operation = $ this -> connection -> updateDatabaseDdl ( $ options + [ 'name' => $ this -> name , 'statements' => $ statements , ] ) ; return $ this -> resumeOperation ( $ operation [ 'name' ] , $ operation ) ; }
Update the Database schema by running a set of SQL statements .
2,150
public function drop ( array $ options = [ ] ) { $ this -> connection -> dropDatabase ( $ options + [ 'name' => $ this -> name ] ) ; if ( $ this -> sessionPool ) { $ this -> sessionPool -> clear ( ) ; } if ( $ this -> session ) { $ this -> session -> delete ( $ options ) ; $ this -> session = null ; } }
Drop the database .
2,151
public function ddl ( array $ options = [ ] ) { $ ddl = $ this -> connection -> getDatabaseDDL ( $ options + [ 'name' => $ this -> name ] ) ; if ( isset ( $ ddl [ 'statements' ] ) ) { return $ ddl [ 'statements' ] ; } return [ ] ; }
Get a list of all database DDL statements .
2,152
public function iam ( ) { if ( ! $ this -> iam ) { $ this -> iam = new Iam ( new IamDatabase ( $ this -> connection ) , $ this -> name ) ; } return $ this -> iam ; }
Manage the database IAM policy
2,153
public function snapshot ( array $ options = [ ] ) { if ( $ this -> isRunningTransaction ) { throw new \ BadMethodCallException ( 'Nested transactions are not supported by this client.' ) ; } $ options += [ 'singleUse' => false ] ; $ options [ 'transactionOptions' ] = $ this -> configureSnapshotOptions ( $ options ) ; $ session = $ this -> selectSession ( SessionPoolInterface :: CONTEXT_READ , $ this -> pluck ( 'sessionOptions' , $ options , false ) ? : [ ] ) ; try { return $ this -> operation -> snapshot ( $ session , $ options ) ; } finally { $ session -> setExpiration ( ) ; } }
Create a snapshot to read from a database at a point in time .
2,154
public function insertBatch ( $ table , array $ dataSet , array $ options = [ ] ) { $ mutations = [ ] ; foreach ( $ dataSet as $ data ) { $ mutations [ ] = $ this -> operation -> mutation ( Operation :: OP_INSERT , $ table , $ data ) ; } return $ this -> commitInSingleUseTransaction ( $ mutations , $ options ) ; }
Insert multiple rows .
2,155
public function updateBatch ( $ table , array $ dataSet , array $ options = [ ] ) { $ mutations = [ ] ; foreach ( $ dataSet as $ data ) { $ mutations [ ] = $ this -> operation -> mutation ( Operation :: OP_UPDATE , $ table , $ data ) ; } return $ this -> commitInSingleUseTransaction ( $ mutations , $ options ) ; }
Update multiple rows .
2,156
public function insertOrUpdateBatch ( $ table , array $ dataSet , array $ options = [ ] ) { $ mutations = [ ] ; foreach ( $ dataSet as $ data ) { $ mutations [ ] = $ this -> operation -> mutation ( Operation :: OP_INSERT_OR_UPDATE , $ table , $ data ) ; } return $ this -> commitInSingleUseTransaction ( $ mutations , $ options ) ; }
Insert or update multiple rows .
2,157
public function replaceBatch ( $ table , array $ dataSet , array $ options = [ ] ) { $ mutations = [ ] ; foreach ( $ dataSet as $ data ) { $ mutations [ ] = $ this -> operation -> mutation ( Operation :: OP_REPLACE , $ table , $ data ) ; } return $ this -> commitInSingleUseTransaction ( $ mutations , $ options ) ; }
Replace multiple rows .
2,158
public function delete ( $ table , KeySet $ keySet , array $ options = [ ] ) { $ mutations = [ $ this -> operation -> deleteMutation ( $ table , $ keySet ) ] ; return $ this -> commitInSingleUseTransaction ( $ mutations , $ options ) ; }
Delete one or more rows .
2,159
public function executePartitionedUpdate ( $ statement , array $ options = [ ] ) { $ session = $ this -> selectSession ( SessionPoolInterface :: CONTEXT_READWRITE ) ; $ transaction = $ this -> operation -> transaction ( $ session , [ 'transactionOptions' => [ 'partitionedDml' => [ ] ] ] ) ; try { return $ this -> operation -> executeUpdate ( $ session , $ transaction , $ statement , [ 'statsItem' => 'rowCountLowerBound' ] + $ options ) ; } finally { $ session -> setExpiration ( ) ; } }
Execute a partitioned DML update .
2,160
public function close ( ) { if ( $ this -> session ) { if ( $ this -> sessionPool ) { $ this -> sessionPool -> release ( $ this -> session ) ; } else { $ this -> session -> delete ( ) ; } $ this -> session = null ; } }
Closes the database connection by returning the active session back to the session pool queue or by deleting the session if there is no pool associated .
2,161
public function identity ( ) { $ databaseParts = explode ( '/' , $ this -> name ) ; $ instanceParts = explode ( '/' , $ this -> instance -> name ( ) ) ; return [ 'projectId' => $ this -> projectId , 'database' => end ( $ databaseParts ) , 'instance' => end ( $ instanceParts ) , ] ; }
Retrieves the database s identity .
2,162
private function selectSession ( $ context = SessionPoolInterface :: CONTEXT_READ , array $ options = [ ] ) { if ( $ this -> session ) { return $ this -> session ; } if ( $ this -> sessionPool ) { return $ this -> session = $ this -> sessionPool -> acquire ( $ context ) ; } return $ this -> session = $ this -> operation -> createSession ( $ this -> name , $ options ) ; }
If no session is already associated with the database use the session pool implementation to retrieve a session one - otherwise create on demand .
2,163
private function commitInSingleUseTransaction ( array $ mutations , array $ options = [ ] ) { $ options [ 'mutations' ] = $ mutations ; return $ this -> runTransaction ( function ( Transaction $ t ) use ( $ options ) { return $ t -> commit ( $ options ) ; } , [ 'singleUse' => true ] ) ; }
Common method to run mutations within a single - use transaction .
2,164
private function fullyQualifiedDatabaseName ( $ name ) { $ instance = InstanceAdminClient :: parseName ( $ this -> instance -> name ( ) ) [ 'instance' ] ; try { return GapicSpannerClient :: databaseName ( $ this -> projectId , $ instance , $ name ) ; } catch ( ValidationException $ e ) { return $ name ; } }
Convert the simple database name to a fully qualified name .
2,165
public function read ( $ path ) { $ url = self :: BASE_URL . $ path ; return file_get_contents ( $ url , false , $ this -> context ) ; }
A method to read the metadata value for a given path .
2,166
public static function autoSelect ( $ server ) { if ( isset ( $ server [ 'GAE_SERVICE' ] ) ) { if ( isset ( $ server [ 'GAE_ENV' ] ) && $ server [ 'GAE_ENV' ] === 'standard' ) { return new GAEStandardMetadataProvider ( $ server ) ; } return new GAEFlexMetadataProvider ( $ server ) ; } return new EmptyMetadataProvider ( ) ; }
Automatically choose the most appropriate MetadataProvider and return it .
2,167
public function setSeverity ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ BigQuery \ DataTransfer \ V1 \ TransferMessage_MessageSeverity :: class ) ; $ this -> severity = $ var ; return $ this ; }
Message severity .
2,168
public function setAuxiliaryTables ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dlp \ V2 \ PrivacyMetric \ KMapEstimationConfig \ AuxiliaryTable :: class ) ; $ this -> auxiliary_tables = $ arr ; return $ this ; }
Several auxiliary tables can be used in the analysis . Each custom_tag used to tag a quasi - identifiers column must appear in exactly one column of one auxiliary table .
2,169
public function setUpgradeOptions ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ AutoUpgradeOptions :: class ) ; $ this -> upgrade_options = $ var ; return $ this ; }
Specifies the Auto Upgrade knobs for the node pool .
2,170
private function updatePrefixes ( ) { foreach ( $ this -> page [ 'prefixes' ] as $ prefix ) { if ( ! in_array ( $ prefix , $ this -> prefixes ) ) { $ this -> prefixes [ ] = $ prefix ; } } }
Add new prefixes to the list .
2,171
public function setPlacement ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1 \ JobPlacement :: class ) ; $ this -> placement = $ var ; return $ this ; }
Required . Job information including how when and where to run the job .
2,172
public function setHiveJob ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1 \ HiveJob :: class ) ; $ this -> writeOneof ( 6 , $ var ) ; return $ this ; }
Job is a Hive job .
2,173
public function setPigJob ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1 \ PigJob :: class ) ; $ this -> writeOneof ( 7 , $ var ) ; return $ this ; }
Job is a Pig job .
2,174
public function setScheduling ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1 \ JobScheduling :: class ) ; $ this -> scheduling = $ var ; return $ this ; }
Optional . Job scheduling configuration .
2,175
public function setSegmentLabelAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1beta2 \ LabelAnnotation :: class ) ; $ this -> segment_label_annotations = $ arr ; return $ this ; }
Label annotations on video level or user specified segment level . There is exactly one element for each unique label .
2,176
public function setShotLabelAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1beta2 \ LabelAnnotation :: class ) ; $ this -> shot_label_annotations = $ arr ; return $ this ; }
Label annotations on shot level . There is exactly one element for each unique label .
2,177
public function readAll ( ) { $ tries = 0 ; $ argumentFunction = $ this -> argumentFunction ; $ retryFunction = $ this -> retryFunction ; do { $ ex = null ; $ stream = $ this -> createExponentialBackoff ( ) -> execute ( $ this -> apiFunction , $ argumentFunction ( ) ) ; try { foreach ( $ stream -> readAll ( ) as $ item ) { yield $ item ; } } catch ( \ Exception $ ex ) { } $ tries ++ ; } while ( ( ! $ this -> retryFunction || $ retryFunction ( $ ex ) ) && $ tries <= $ this -> retries ) ; if ( $ ex !== null ) { throw $ ex ; } }
Starts executing the call and reading elements from server stream .
2,178
public function setSegments ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1beta2 \ VideoSegment :: class ) ; $ this -> segments = $ arr ; return $ this ; }
Video segments to annotate . The segments may overlap and are not required to be contiguous or span the whole video . If unspecified each video is treated as a single segment .
2,179
public function setLabelDetectionConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ VideoIntelligence \ V1beta2 \ LabelDetectionConfig :: class ) ; $ this -> label_detection_config = $ var ; return $ this ; }
Config for LABEL_DETECTION .
2,180
public function setFaceDetectionConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ VideoIntelligence \ V1beta2 \ FaceDetectionConfig :: class ) ; $ this -> face_detection_config = $ var ; return $ this ; }
Config for FACE_DETECTION .
2,181
public function listDebuggees ( array $ args = [ ] ) { return $ this -> send ( [ $ this -> debuggerClient , 'listDebuggees' ] , [ $ this -> pluck ( 'project' , $ args ) , DebuggerClient :: getDefaultAgentVersion ( ) , $ args ] ) ; }
List all registered debuggees .
2,182
public function registerDebuggee ( array $ args = [ ] ) { return $ this -> send ( [ $ this -> controllerClient , 'registerDebuggee' ] , [ $ this -> serializer -> decodeMessage ( new Debuggee ( ) , $ this -> pluck ( 'debuggee' , $ args ) ) , $ args ] ) ; }
Register this process as a debuggee .
2,183
public function listBreakpoints ( array $ args = [ ] ) { return $ this -> send ( [ $ this -> controllerClient , 'listActiveBreakpoints' ] , [ $ this -> pluck ( 'debuggeeId' , $ args ) , $ args ] ) ; }
List the breakpoints set for the specified debuggee .
2,184
public function updateBreakpoint ( array $ args ) { return $ this -> send ( [ $ this -> controllerClient , 'updateActiveBreakpoint' ] , [ $ this -> pluck ( 'debuggeeId' , $ args ) , $ this -> serializer -> decodeMessage ( new Breakpoint ( ) , $ this -> pluck ( 'breakpoint' , $ args ) ) , $ args ] ) ; }
Update the provided breakpoint .
2,185
public function setBreakpoint ( array $ args ) { $ breakpointArgs = $ this -> pluckArray ( [ 'action' , 'condition' , 'expressions' , 'logMessageFormat' , 'logLevel' , 'location' ] , $ args ) ; return $ this -> send ( [ $ this -> debuggerClient , 'setBreakpoint' ] , [ $ this -> pluck ( 'debuggeeId' , $ args ) , $ this -> serializer -> decodeMessage ( new Breakpoint ( ) , $ breakpointArgs ) , DebuggerClient :: getDefaultAgentVersion ( ) , $ args ] ) ; }
Sets a breakpoint .
2,186
public function setErrorEvents ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ ErrorReporting \ V1beta1 \ ErrorEvent :: class ) ; $ this -> error_events = $ arr ; return $ this ; }
The error events which match the given request .
2,187
public function setRules ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dlp \ V2 \ InspectionRule :: class ) ; $ this -> rules = $ arr ; return $ this ; }
Set of rules to be applied to infoTypes . The rules are applied in order .
2,188
public function setSuffixes ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> suffixes = $ arr ; return $ this ; }
Optional . Suffixes . Number of characters allowed is 20 .
2,189
public function setPrefixes ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> prefixes = $ arr ; return $ this ; }
Optional . Prefixes . Number of characters allowed is 20 .
2,190
public function setInstance ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Redis \ V1 \ Instance :: class ) ; $ this -> instance = $ var ; return $ this ; }
Required . Update description . Only fields specified in update_mask are updated .
2,191
public static function anyPathName ( $ project , $ database , $ document , $ anyPath ) { return self :: getAnyPathNameTemplate ( ) -> render ( [ 'project' => $ project , 'database' => $ database , 'document' => $ document , 'any_path' => $ anyPath , ] ) ; }
Formats a string containing the fully - qualified path to represent a any_path resource .
2,192
public static function documentPathName ( $ project , $ database , $ documentPath ) { return self :: getDocumentPathNameTemplate ( ) -> render ( [ 'project' => $ project , 'database' => $ database , 'document_path' => $ documentPath , ] ) ; }
Formats a string containing the fully - qualified path to represent a document_path resource .
2,193
public function commit ( $ database , $ writes , array $ optionalArgs = [ ] ) { $ request = new CommitRequest ( ) ; $ request -> setDatabase ( $ database ) ; $ request -> setWrites ( $ writes ) ; if ( isset ( $ optionalArgs [ 'transaction' ] ) ) { $ request -> setTransaction ( $ optionalArgs [ 'transaction' ] ) ; } $ requestParams = new RequestParamsHeaderDescriptor ( [ 'database' => $ request -> getDatabase ( ) , ] ) ; $ optionalArgs [ 'headers' ] = isset ( $ optionalArgs [ 'headers' ] ) ? array_merge ( $ requestParams -> getHeader ( ) , $ optionalArgs [ 'headers' ] ) : $ requestParams -> getHeader ( ) ; return $ this -> startCall ( 'Commit' , CommitResponse :: class , $ optionalArgs , $ request ) -> wait ( ) ; }
Commits a transaction while optionally updating documents .
2,194
private function setSimpleJobProperties ( array $ options = [ ] ) { if ( ! isset ( $ options [ 'identifier' ] ) ) { throw new \ InvalidArgumentException ( 'A valid identifier is required in order to register a job.' ) ; } $ options += [ 'configStorage' => null , ] ; $ this -> setSerializableClientOptions ( $ options ) ; $ identifier = $ options [ 'identifier' ] ; $ configStorage = $ options [ 'configStorage' ] ? : $ this -> defaultConfigStorage ( ) ; $ result = $ configStorage -> lock ( ) ; if ( $ result === false ) { return false ; } $ config = $ configStorage -> load ( ) ; $ config -> registerJob ( $ identifier , function ( $ id ) use ( $ identifier , $ options ) { return new SimpleJob ( $ identifier , [ $ this , 'run' ] , $ id , $ options ) ; } ) ; try { $ result = $ configStorage -> save ( $ config ) ; } finally { $ configStorage -> unlock ( ) ; } return $ result ; }
Registers this object as a SimpleJob .
2,195
public static function psrBatchLogger ( $ name , array $ options = [ ] ) { $ client = array_key_exists ( 'clientConfig' , $ options ) ? new self ( $ options [ 'clientConfig' ] ) : new self ( ) ; $ options [ 'batchEnabled' ] = true ; return $ client -> psrLogger ( $ name , $ options ) ; }
Create a PsrLogger with batching enabled .
2,196
public function createSink ( $ name , $ destination , array $ options = [ ] ) { $ response = $ this -> connection -> createSink ( $ options + [ 'parent' => $ this -> formattedProjectName , 'name' => $ name , 'destination' => $ destination , 'outputVersionFormat' => 'VERSION_FORMAT_UNSPECIFIED' ] ) ; return new Sink ( $ this -> connection , $ name , $ this -> projectId , $ response ) ; }
Create a sink .
2,197
public function sinks ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( array $ sink ) { return new Sink ( $ this -> connection , $ sink [ 'name' ] , $ this -> projectId , $ sink ) ; } , [ $ this -> connection , 'listSinks' ] , $ options + [ 'parent' => $ this -> formattedProjectName ] , [ 'itemsKey' => 'sinks' , 'resultLimit' => $ resultLimit ] ) ) ; }
Fetches sinks associated with your project .
2,198
public function createMetric ( $ name , $ filter , array $ options = [ ] ) { $ response = $ this -> connection -> createMetric ( $ options + [ 'parent' => $ this -> formattedProjectName , 'name' => $ name , 'filter' => $ filter ] ) ; return new Metric ( $ this -> connection , $ name , $ this -> projectId , $ response ) ; }
Create a metric .
2,199
public function metrics ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( array $ metric ) { return new Metric ( $ this -> connection , $ metric [ 'name' ] , $ this -> projectId , $ metric ) ; } , [ $ this -> connection , 'listMetrics' ] , $ options + [ 'parent' => $ this -> formattedProjectName ] , [ 'itemsKey' => 'metrics' , 'resultLimit' => $ resultLimit ] ) ) ; }
Fetches metrics associated with your project .