idx
int64 0
60.3k
| question
stringlengths 101
6.21k
| target
stringlengths 7
803
|
|---|---|---|
1,900
|
public function insertBatch ( $ table , array $ dataSet ) { $ this -> enqueue ( Operation :: OP_INSERT , $ table , $ dataSet ) ; return $ this ; }
|
Enqueue one or more insert mutations .
|
1,901
|
public function updateBatch ( $ table , array $ dataSet ) { $ this -> enqueue ( Operation :: OP_UPDATE , $ table , $ dataSet ) ; return $ this ; }
|
Enqueue one or more update mutations .
|
1,902
|
public function insertOrUpdateBatch ( $ table , array $ dataSet ) { $ this -> enqueue ( Operation :: OP_INSERT_OR_UPDATE , $ table , $ dataSet ) ; return $ this ; }
|
Enqueue one or more insert or update mutations .
|
1,903
|
public function replaceBatch ( $ table , array $ dataSet ) { $ this -> enqueue ( Operation :: OP_REPLACE , $ table , $ dataSet ) ; return $ this ; }
|
Enqueue one or more replace mutations .
|
1,904
|
public function delete ( $ table , KeySet $ keySet ) { $ this -> enqueue ( Operation :: OP_DELETE , $ table , [ $ keySet ] ) ; return $ this ; }
|
Enqueue an delete mutation .
|
1,905
|
public function executeUpdate ( $ sql , array $ options = [ ] ) { $ options [ 'seqno' ] = $ this -> seqno ; $ this -> seqno ++ ; return $ this -> operation -> executeUpdate ( $ this -> session , $ this , $ sql , $ options ) ; }
|
Execute a Cloud Spanner DML statement .
|
1,906
|
public function commit ( array $ options = [ ] ) { if ( $ this -> state !== self :: STATE_ACTIVE ) { throw new \ BadMethodCallException ( 'The transaction cannot be committed because it is not active' ) ; } if ( ! $ this -> singleUseState ( ) ) { $ this -> state = self :: STATE_COMMITTED ; } $ options += [ 'mutations' => [ ] ] ; $ options [ 'mutations' ] += $ this -> mutations ; $ options [ 'transactionId' ] = $ this -> transactionId ; $ t = $ this -> transactionOptions ( $ options ) ; $ options [ $ t [ 1 ] ] = $ t [ 0 ] ; return $ this -> operation -> commit ( $ this -> session , $ this -> pluck ( 'mutations' , $ options ) , $ options ) ; }
|
Commit and end the transaction .
|
1,907
|
private function enqueue ( $ op , $ table , array $ dataSet ) { foreach ( $ dataSet as $ data ) { if ( $ op === Operation :: OP_DELETE ) { $ this -> mutations [ ] = $ this -> operation -> deleteMutation ( $ table , $ data ) ; } else { $ this -> mutations [ ] = $ this -> operation -> mutation ( $ op , $ table , $ data ) ; } } }
|
Format validate and enqueue mutations in the transaction .
|
1,908
|
public function setTemplates ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dataproc \ V1 \ WorkflowTemplate :: class ) ; $ this -> templates = $ arr ; return $ this ; }
|
Output only . WorkflowTemplates list .
|
1,909
|
public function setAliasContext ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ DevTools \ Source \ V1 \ AliasContext :: class ) ; $ this -> writeOneof ( 5 , $ var ) ; return $ this ; }
|
An alias which may be a branch or tag .
|
1,910
|
public function create ( array $ fields = [ ] , array $ options = [ ] ) { return $ this -> writeResult ( $ this -> batchFactory ( ) -> create ( $ this -> name , $ fields , $ options ) -> commit ( $ options ) ) ; }
|
Create a new document in Firestore .
|
1,911
|
public function set ( array $ fields , array $ options = [ ] ) { return $ this -> writeResult ( $ this -> batchFactory ( ) -> set ( $ this -> name , $ fields , $ options ) -> commit ( $ options ) ) ; }
|
Write to a Firestore document with optional merge behavior .
|
1,912
|
public function update ( array $ data , array $ options = [ ] ) { return $ this -> writeResult ( $ this -> batchFactory ( ) -> update ( $ this -> name , $ data , $ options ) -> commit ( $ options ) ) ; }
|
Update a Firestore document using field paths and values .
|
1,913
|
public function snapshot ( array $ options = [ ] ) { return $ this -> createSnapshot ( $ this -> connection , $ this -> valueMapper , $ this , $ options ) ; }
|
Get a read - only snapshot of the document .
|
1,914
|
public function collection ( $ collectionId ) { return new CollectionReference ( $ this -> connection , $ this -> valueMapper , $ this -> childPath ( $ this -> name , $ collectionId ) ) ; }
|
Get a reference to a collection which is a child of the current document .
|
1,915
|
public function collections ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( $ collectionId ) { return new CollectionReference ( $ this -> connection , $ this -> valueMapper , $ this -> childPath ( $ this -> name , $ collectionId ) ) ; } , [ $ this -> connection , 'listCollectionIds' ] , $ options + [ 'parent' => $ this -> name ] , [ 'itemsKey' => 'collectionIds' , 'resultLimit' => $ resultLimit ] ) ) ; }
|
List all collections which are children of the current document .
|
1,916
|
protected function batchFactory ( ) { return new WriteBatch ( $ this -> connection , $ this -> valueMapper , $ this -> databaseFromName ( $ this -> name ) ) ; }
|
Create a Batch Writer for single - use mutations in this class .
|
1,917
|
public function setConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1beta2 \ ClusterConfig :: class ) ; $ this -> config = $ var ; return $ this ; }
|
Required . The cluster config . Note that Cloud Dataproc may set default values and values may change when clusters are updated .
|
1,918
|
public function setField ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1beta1 \ StructuredQuery_FieldReference :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
|
The field to which to apply the operator .
|
1,919
|
public function setGcsSource ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Redis \ V1 \ GcsSource :: class ) ; $ this -> writeOneof ( 1 , $ var ) ; return $ this ; }
|
Google Cloud Storage location where input content is located .
|
1,920
|
public function setRange ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ CompensationInfo_CompensationRange :: class ) ; $ this -> writeOneof ( 4 , $ var ) ; return $ this ; }
|
Optional . Compensation range .
|
1,921
|
public function setMqttConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Iot \ V1 \ MqttConfig :: class ) ; $ this -> mqtt_config = $ var ; return $ this ; }
|
The MQTT configuration for this device registry .
|
1,922
|
public function setProductSet ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ ProductSet :: class ) ; $ this -> product_set = $ var ; return $ this ; }
|
The ProductSet to create .
|
1,923
|
public function update ( array $ metadata , array $ options = [ ] ) { $ options = $ this -> applyEtagHeader ( $ options + $ metadata + $ this -> identity ) ; if ( ! isset ( $ options [ 'etag' ] ) && ! isset ( $ options [ 'retries' ] ) ) { $ options [ 'retries' ] = 0 ; } return $ this -> info = $ this -> connection -> patchTable ( $ options ) ; }
|
Update the table .
|
1,924
|
public function runJob ( JobConfigurationInterface $ config , array $ options = [ ] ) { $ maxRetries = $ this -> pluck ( 'maxRetries' , $ options , false ) ; $ job = $ this -> startJob ( $ config , $ options ) ; $ job -> waitUntilComplete ( [ 'maxRetries' => $ maxRetries ] ) ; return $ job ; }
|
Starts a job in an synchronous fashion waiting for the job to complete before returning .
|
1,925
|
public function startJob ( JobConfigurationInterface $ config , array $ options = [ ] ) { $ response = null ; $ config = $ config -> toArray ( ) + $ options ; if ( isset ( $ config [ 'data' ] ) ) { $ response = $ this -> connection -> insertJobUpload ( $ config ) -> upload ( ) ; } else { $ response = $ this -> connection -> insertJob ( $ config ) ; } return new Job ( $ this -> connection , $ config [ 'jobReference' ] [ 'jobId' ] , $ this -> identity [ 'projectId' ] , $ this -> mapper , $ response ) ; }
|
Starts a job in an asynchronous fashion . In this case it will be required to manually trigger a call to wait for job completion .
|
1,926
|
public function insertRow ( array $ row , array $ options = [ ] ) { $ row = [ 'data' => $ row ] ; if ( isset ( $ options [ 'insertId' ] ) ) { $ row [ 'insertId' ] = $ options [ 'insertId' ] ; unset ( $ options [ 'insertId' ] ) ; } return $ this -> insertRows ( [ $ row ] , $ options ) ; }
|
Insert a record into the table without running a load job .
|
1,927
|
public function insertRows ( array $ rows , array $ options = [ ] ) { if ( count ( $ rows ) === 0 ) { throw new \ InvalidArgumentException ( 'Must provide at least a single row.' ) ; } foreach ( $ rows as $ row ) { if ( ! isset ( $ row [ 'data' ] ) ) { throw new \ InvalidArgumentException ( 'A row must have a data key.' ) ; } if ( ! isset ( $ options [ 'retries' ] ) && ! isset ( $ row [ 'insertId' ] ) ) { $ options [ 'retries' ] = 0 ; } foreach ( $ row [ 'data' ] as $ key => $ item ) { $ row [ 'data' ] [ $ key ] = $ this -> mapper -> toBigQuery ( $ item ) ; } $ row [ 'json' ] = $ row [ 'data' ] ; unset ( $ row [ 'data' ] ) ; $ options [ 'rows' ] [ ] = $ row ; } return new InsertResponse ( $ this -> handleInsert ( $ options ) , $ options [ 'rows' ] ) ; }
|
Insert records into the table without running a load job .
|
1,928
|
public function reload ( array $ options = [ ] ) { return $ this -> info = $ this -> connection -> getTable ( $ options + $ this -> identity ) ; }
|
Triggers a network request to reload the table s details .
|
1,929
|
private function handleInsert ( array $ options ) { $ attempt = 0 ; $ metadata = $ this -> pluck ( 'tableMetadata' , $ options , false ) ? : [ ] ; $ autoCreate = $ this -> pluck ( 'autoCreate' , $ options , false ) ? : false ; $ maxRetries = $ this -> pluck ( 'maxRetries' , $ options , false ) ? : self :: MAX_RETRIES ; while ( true ) { try { return $ this -> connection -> insertAllTableData ( $ this -> identity + $ options ) ; } catch ( NotFoundException $ ex ) { if ( $ autoCreate === true && $ attempt <= $ maxRetries ) { if ( ! isset ( $ metadata [ 'schema' ] ) ) { throw new \ InvalidArgumentException ( 'A schema is required when creating a table.' ) ; } $ this -> usleep ( mt_rand ( 1 , self :: INSERT_CREATE_MAX_DELAY_MICROSECONDS ) ) ; try { $ this -> connection -> insertTable ( $ metadata + [ 'projectId' => $ this -> identity [ 'projectId' ] , 'datasetId' => $ this -> identity [ 'datasetId' ] , 'tableReference' => $ this -> identity , 'retries' => 0 ] ) ; } catch ( ConflictException $ ex ) { } catch ( \ Exception $ ex ) { $ retryFunction = $ this -> getRetryFunction ( ) ; if ( ! $ retryFunction ( $ ex ) ) { throw $ ex ; } } $ this -> usleep ( self :: INSERT_CREATE_MAX_DELAY_MICROSECONDS ) ; $ attempt ++ ; } else { throw $ ex ; } } } }
|
Handles inserting table data and manages custom retry logic in the case a table needs to be created .
|
1,930
|
public function setMembers ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Api \ MonitoredResource :: class ) ; $ this -> members = $ arr ; return $ this ; }
|
A set of monitored resources in the group .
|
1,931
|
public function setType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ BigQuery \ DataTransfer \ V1 \ DataSourceParameter_Type :: class ) ; $ this -> type = $ var ; return $ this ; }
|
Parameter type .
|
1,932
|
public function setAllowedValues ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> allowed_values = $ arr ; return $ this ; }
|
All possible values for the parameter .
|
1,933
|
public function setFields ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ BigQuery \ DataTransfer \ V1 \ DataSourceParameter :: class ) ; $ this -> fields = $ arr ; return $ this ; }
|
When parameter is a record describes child fields .
|
1,934
|
public function debuggees ( array $ extras = [ ] ) { $ res = $ this -> connection -> listDebuggees ( [ 'project' => $ this -> projectId ] + $ extras ) ; if ( is_array ( $ res ) && array_key_exists ( 'debuggees' , $ res ) ) { return array_map ( function ( $ info ) { return new Debuggee ( $ this -> connection , $ info ) ; } , $ res [ 'debuggees' ] ) ; } return [ ] ; }
|
Fetches all the debuggees in the project .
|
1,935
|
public function setProperty ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Datastore \ V1 \ PropertyReference :: class ) ; $ this -> property = $ var ; return $ this ; }
|
The property to project .
|
1,936
|
public function setWriteResults ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Firestore \ V1beta1 \ WriteResult :: class ) ; $ this -> write_results = $ arr ; return $ this ; }
|
The result of applying the writes . This i - th write result corresponds to the i - th write in the request .
|
1,937
|
public function handleSnapshot ( array $ snapshot ) { if ( array_key_exists ( $ snapshot [ 'id' ] , $ this -> breakpointsById ) ) { $ breakpoint = $ this -> breakpointsById [ $ snapshot [ 'id' ] ] ; $ evaluatedExpressions = $ snapshot [ 'evaluatedExpressions' ] ; $ stackframes = $ snapshot [ 'stackframes' ] ; $ breakpoint -> evaluate ( $ evaluatedExpressions , $ stackframes , $ this -> evaluationOptions ) ; $ this -> batchRunner -> submitItem ( $ this -> identifier , [ $ this -> debuggeeId , $ breakpoint ] ) ; } }
|
Callback for reporting a snapshot .
|
1,938
|
public function reportBreakpoints ( array $ breakpointsInfo ) { $ client = $ this -> defaultClient ( ) ; foreach ( $ breakpointsInfo as $ breakpointInfo ) { list ( $ debuggeeId , $ breakpoint ) = $ breakpointInfo ; $ debuggee = $ client -> debuggee ( $ debuggeeId ) ; $ backoff = new ExponentialBackoff ( ) ; try { $ backoff -> execute ( function ( ) use ( $ breakpoint , $ debuggee ) { $ debuggee -> updateBreakpoint ( $ breakpoint ) ; } ) ; } catch ( ServiceException $ e ) { } } }
|
Callback for batch runner to report a breakpoint .
|
1,939
|
public function setQuickReplies ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> quick_replies = $ arr ; return $ this ; }
|
Optional . The collection of quick replies .
|
1,940
|
public function insertBatch ( array $ traces , array $ options = [ ] ) { $ spans = [ ] ; foreach ( $ traces as $ trace ) { foreach ( $ trace -> spans ( ) as $ span ) { $ spans [ ] = $ this -> transformSpan ( $ span ) ; } } $ this -> connection -> traceBatchWrite ( [ 'projectsId' => $ this -> projectId , 'spans' => $ spans ] + $ options ) ; return true ; }
|
Sends multiple Trace logs in a simple fashion .
|
1,941
|
public function setGceClusterConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1 \ GceClusterConfig :: class ) ; $ this -> gce_cluster_config = $ var ; return $ this ; }
|
Required . The shared Compute Engine config settings for all instances in a cluster .
|
1,942
|
public function setMasterConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1 \ InstanceGroupConfig :: class ) ; $ this -> master_config = $ var ; return $ this ; }
|
Optional . The Compute Engine config settings for the master instance in a cluster .
|
1,943
|
public function setWorkerConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1 \ InstanceGroupConfig :: class ) ; $ this -> worker_config = $ var ; return $ this ; }
|
Optional . The Compute Engine config settings for worker instances in a cluster .
|
1,944
|
public function setJobTrigger ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ JobTrigger :: class ) ; $ this -> job_trigger = $ var ; return $ this ; }
|
New JobTrigger value .
|
1,945
|
public function setFound ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Datastore \ V1 \ EntityResult :: class ) ; $ this -> found = $ arr ; return $ this ; }
|
Entities found as ResultType . FULL entities . The order of results in this field is undefined and has no relation to the order of the keys in the input .
|
1,946
|
public function setMissing ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Datastore \ V1 \ EntityResult :: class ) ; $ this -> missing = $ arr ; return $ this ; }
|
Entities not found as ResultType . KEY_ONLY entities . The order of results in this field is undefined and has no relation to the order of the keys in the input .
|
1,947
|
public function setDeferred ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Datastore \ V1 \ Key :: class ) ; $ this -> deferred = $ arr ; return $ this ; }
|
A list of keys that were not looked up due to resource constraints . The order of results in this field is undefined and has no relation to the order of the keys in the input .
|
1,948
|
public function setReferenceImage ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ ReferenceImage :: class ) ; $ this -> reference_image = $ var ; return $ this ; }
|
The reference image to create . If an image ID is specified it is ignored .
|
1,949
|
public function setFound ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1 \ Document :: class ) ; $ this -> writeOneof ( 1 , $ var ) ; return $ this ; }
|
A document that was requested .
|
1,950
|
public function setOutputConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Asset \ V1beta1 \ OutputConfig :: class ) ; $ this -> output_config = $ var ; return $ this ; }
|
Required . Output configuration indicating where the results will be output to . All results will be in newline delimited JSON format .
|
1,951
|
public function setIntentView ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ IntentView :: class ) ; $ this -> intent_view = $ var ; return $ this ; }
|
Optional . The resource view to apply to the returned intent .
|
1,952
|
public static function isSystemLittleEndian ( ) { if ( self :: $ isLittleEndian === null ) { self :: $ isLittleEndian = ( pack ( "P" , 2 ) === pack ( "Q" , 2 ) ) ; } return self :: $ isLittleEndian ; }
|
Check if system is little - endian .
|
1,953
|
public static function intToByteString ( $ intValue ) { if ( ! self :: isSupported ( ) ) { throw new \ RuntimeException ( 'This utility is only supported on 64 bit machines with PHP version > 5.5.' ) ; } if ( ! is_int ( $ intValue ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Expected argument to be of type int, instead got \'%s\'.' , gettype ( $ intValue ) ) ) ; } $ bytes = pack ( "J" , $ intValue ) ; return $ bytes ; }
|
Utility method to convert an integer to a 64 - bit big - endian signed integer byte string .
|
1,954
|
public static function byteStringToInt ( $ bytes ) { if ( ! self :: isSupported ( ) ) { throw new \ RuntimeException ( 'This utility is only supported on 64 bit machines with PHP version > 5.5.' ) ; } if ( self :: isSystemLittleEndian ( ) ) { $ bytes = strrev ( $ bytes ) ; } return unpack ( "q" , $ bytes ) [ 1 ] ; }
|
Converts a 64 - bit big - endian signed integer represented as a byte string to an integer .
|
1,955
|
public function setMutations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Bigtable \ V2 \ Mutation :: class ) ; $ this -> mutations = $ arr ; return $ this ; }
|
Changes to be atomically applied to the specified row . Entries are applied in order meaning that earlier mutations can be masked by later ones . Must contain at least one entry and at most 100000 .
|
1,956
|
public function build ( $ resource , $ method , array $ options = [ ] ) { $ root = $ this -> resourceRoot ; array_push ( $ root , 'resources' ) ; $ root = array_merge ( $ root , explode ( '.' , $ resource ) ) ; array_push ( $ root , 'methods' , $ method ) ; $ action = $ this -> service ; foreach ( $ root as $ rootItem ) { if ( ! isset ( $ action [ $ rootItem ] ) ) { throw new \ InvalidArgumentException ( 'Provided path item ' . $ rootItem . ' does not exist.' ) ; } $ action = $ action [ $ rootItem ] ; } $ path = [ ] ; $ query = [ ] ; $ body = [ ] ; if ( isset ( $ action [ 'parameters' ] ) ) { foreach ( $ action [ 'parameters' ] as $ parameter => $ parameterOptions ) { if ( $ parameterOptions [ 'location' ] === 'path' && array_key_exists ( $ parameter , $ options ) ) { $ path [ $ parameter ] = $ options [ $ parameter ] ; unset ( $ options [ $ parameter ] ) ; } if ( $ parameterOptions [ 'location' ] === 'query' && array_key_exists ( $ parameter , $ options ) ) { $ query [ $ parameter ] = $ options [ $ parameter ] ; } } } if ( isset ( $ this -> service [ 'parameters' ] ) ) { foreach ( $ this -> service [ 'parameters' ] as $ parameter => $ parameterOptions ) { if ( $ parameterOptions [ 'location' ] === 'query' && array_key_exists ( $ parameter , $ options ) ) { $ query [ $ parameter ] = $ options [ $ parameter ] ; } } } if ( isset ( $ action [ 'request' ] ) ) { $ schema = $ action [ 'request' ] [ '$ref' ] ; foreach ( $ this -> service [ 'schemas' ] [ $ schema ] [ 'properties' ] as $ property => $ propertyOptions ) { if ( array_key_exists ( $ property , $ options ) ) { $ body [ $ property ] = $ options [ $ property ] ; } } } $ uri = $ this -> buildUriWithQuery ( $ this -> expandUri ( $ this -> baseUri . $ action [ 'path' ] , $ path ) , $ query ) ; return new Request ( $ action [ 'httpMethod' ] , $ uri , [ 'Content-Type' => 'application/json' ] , $ body ? $ this -> jsonEncode ( $ body ) : null ) ; }
|
Build the request .
|
1,957
|
public function setTransferConfigs ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ BigQuery \ DataTransfer \ V1 \ TransferConfig :: class ) ; $ this -> transfer_configs = $ arr ; return $ this ; }
|
Output only . The stored pipeline transfer configurations .
|
1,958
|
public function evaluate ( array $ evaluatedExpressions , array $ stackframes , array $ options = [ ] ) { $ this -> variableTable -> setOptions ( $ options ) ; $ this -> addEvaluatedExpressions ( $ evaluatedExpressions ) ; $ this -> addStackFrames ( $ stackframes ) ; $ this -> finalize ( ) ; }
|
Evaluate this breakpoint with the provided evaluated expressions and captured stackframe data .
|
1,959
|
public function finalize ( ) { list ( $ usec , $ sec ) = explode ( ' ' , microtime ( ) ) ; $ micro = sprintf ( "%06d" , $ usec * 1000000 ) ; $ when = new \ DateTime ( date ( 'Y-m-d H:i:s.' . $ micro ) ) ; $ when -> setTimezone ( new \ DateTimeZone ( 'UTC' ) ) ; $ this -> finalTime = $ when -> format ( 'Y-m-d\TH:i:s.u\Z' ) ; $ this -> isFinalState = true ; }
|
Mark this breakpoint as final state and record the current timestamp .
|
1,960
|
public function addStackFrame ( $ stackFrameData ) { $ stackFrameData += [ 'function' => '' , 'locals' => [ ] ] ; $ sf = new StackFrame ( $ stackFrameData [ 'function' ] , new SourceLocation ( $ stackFrameData [ 'filename' ] , $ stackFrameData [ 'line' ] ) ) ; foreach ( $ stackFrameData [ 'locals' ] as $ local ) { if ( $ this -> variableTable -> isFull ( ) ) { break ; } $ value = isset ( $ local [ 'value' ] ) ? $ local [ 'value' ] : null ; $ hash = isset ( $ local [ 'id' ] ) ? $ local [ 'id' ] : null ; try { $ variable = $ this -> addVariable ( $ local [ 'name' ] , $ value , $ hash ) ; } catch ( BufferFullException $ e ) { $ sf -> addLocal ( $ this -> variableTable -> bufferFullVariable ( ) ) ; break ; } $ sf -> addLocal ( $ variable ) ; } array_push ( $ this -> stackFrames , $ sf ) ; }
|
Add single stackframe of data to this breakpoint .
|
1,961
|
public function addEvaluatedExpressions ( array $ expressions ) { foreach ( $ expressions as $ expression => $ result ) { try { $ this -> evaluatedExpressions [ ] = $ this -> addVariable ( $ expression , $ result ) ; } catch ( BufferFullException $ e ) { $ this -> evaluatedExpressions [ ] = $ this -> variableTable -> bufferFullVariable ( ) ; } } }
|
Add evaluated expression results to this breakpoint .
|
1,962
|
public function setImage ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ AutoMl \ V1beta1 \ Image :: class ) ; $ this -> writeOneof ( 1 , $ var ) ; return $ this ; }
|
An example image .
|
1,963
|
public function setTextSnippet ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ AutoMl \ V1beta1 \ TextSnippet :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
|
Example text .
|
1,964
|
public static function tableName ( $ project , $ instance , $ table ) { return self :: getTableNameTemplate ( ) -> render ( [ 'project' => $ project , 'instance' => $ instance , 'table' => $ table , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a table resource .
|
1,965
|
public static function modelName ( $ project , $ location , $ model ) { return self :: getModelNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'model' => $ model , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a model resource .
|
1,966
|
public function setSetToServerValue ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Firestore \ V1beta1 \ DocumentTransform_FieldTransform_ServerValue :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
|
Sets the field to the given server value .
|
1,967
|
public function nanoSeconds ( ) { return $ this -> nanoSeconds === null ? ( int ) $ this -> value -> format ( 'u' ) * 1000 : $ this -> nanoSeconds ; }
|
Return the number of nanoseconds .
|
1,968
|
public function setState ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ Application_ApplicationState :: class ) ; $ this -> state = $ var ; return $ this ; }
|
Optional . The application state .
|
1,969
|
public function setOutcome ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ Outcome :: class ) ; $ this -> outcome = $ var ; return $ this ; }
|
Optional . Outcome positiveness shows how positive the outcome is .
|
1,970
|
public static function deviceName ( $ project , $ location , $ registry , $ device ) { return self :: getDeviceNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'registry' => $ registry , 'device' => $ device , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a device resource .
|
1,971
|
public static function registryName ( $ project , $ location , $ registry ) { return self :: getRegistryNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'registry' => $ registry , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a registry resource .
|
1,972
|
public function setExpressions ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ RecordCondition_Expressions :: class ) ; $ this -> expressions = $ var ; return $ this ; }
|
An expression .
|
1,973
|
public function setContexts ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dialogflow \ V2 \ Context :: class ) ; $ this -> contexts = $ arr ; return $ this ; }
|
Optional . The collection of contexts to be activated before this query is executed .
|
1,974
|
public function setSessionEntityTypes ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dialogflow \ V2 \ SessionEntityType :: class ) ; $ this -> session_entity_types = $ arr ; return $ this ; }
|
Optional . Additional session entity types to replace or extend developer entity types with . The entity synonyms apply to all languages and persist for the session of this query .
|
1,975
|
public function setSentimentAnalysisRequestConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ SentimentAnalysisRequestConfig :: class ) ; $ this -> sentiment_analysis_request_config = $ var ; return $ this ; }
|
Optional . Configures the type of sentiment analysis to perform . If not provided sentiment analysis is not performed .
|
1,976
|
public function setRawIndices ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ WebRisk \ V1beta1 \ RawIndices :: class ) ; $ this -> raw_indices = $ var ; return $ this ; }
|
The raw removal indices for a local list .
|
1,977
|
public function setProfile ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ Profile :: class ) ; $ this -> profile = $ var ; return $ this ; }
|
The profile parsed from resume .
|
1,978
|
public function setRequestedOptions ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ InspectDataSourceDetails_RequestedOptions :: class ) ; $ this -> requested_options = $ var ; return $ this ; }
|
The configuration used for this job .
|
1,979
|
public function setResult ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ InspectDataSourceDetails_Result :: class ) ; $ this -> result = $ var ; return $ this ; }
|
A summary of the outcome of this inspect job .
|
1,980
|
public function GetIamPolicy ( \ Google \ Cloud \ Iam \ V1 \ GetIamPolicyRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/google.spanner.admin.database.v1.DatabaseAdmin/GetIamPolicy' , $ argument , [ '\Google\Cloud\Iam\V1\Policy' , 'decode' ] , $ metadata , $ options ) ; }
|
Gets the access control policy for a database resource . Returns an empty policy if a database exists but does not have a policy set .
|
1,981
|
public function setHdfsMetrics ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING , \ Google \ Protobuf \ Internal \ GPBType :: INT64 ) ; $ this -> hdfs_metrics = $ arr ; return $ this ; }
|
The HDFS metrics .
|
1,982
|
public function setYarnMetrics ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING , \ Google \ Protobuf \ Internal \ GPBType :: INT64 ) ; $ this -> yarn_metrics = $ arr ; return $ this ; }
|
The YARN metrics .
|
1,983
|
public static function cryptoKeyName ( $ project , $ location , $ keyRing , $ cryptoKey ) { return self :: getCryptoKeyNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'key_ring' => $ keyRing , 'crypto_key' => $ cryptoKey , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a crypto_key resource .
|
1,984
|
public static function cryptoKeyPathName ( $ project , $ location , $ keyRing , $ cryptoKeyPath ) { return self :: getCryptoKeyPathNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'key_ring' => $ keyRing , 'crypto_key_path' => $ cryptoKeyPath , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a crypto_key_path resource .
|
1,985
|
public static function cryptoKeyVersionName ( $ project , $ location , $ keyRing , $ cryptoKey , $ cryptoKeyVersion ) { return self :: getCryptoKeyVersionNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'key_ring' => $ keyRing , 'crypto_key' => $ cryptoKey , 'crypto_key_version' => $ cryptoKeyVersion , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a crypto_key_version resource .
|
1,986
|
public static function keyRingName ( $ project , $ location , $ keyRing ) { return self :: getKeyRingNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'key_ring' => $ keyRing , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a key_ring resource .
|
1,987
|
public function setIamPolicy ( $ resource , $ policy , array $ optionalArgs = [ ] ) { $ request = new SetIamPolicyRequest ( ) ; $ request -> setResource ( $ resource ) ; $ request -> setPolicy ( $ policy ) ; $ requestParams = new RequestParamsHeaderDescriptor ( [ 'resource' => $ request -> getResource ( ) , ] ) ; $ optionalArgs [ 'headers' ] = isset ( $ optionalArgs [ 'headers' ] ) ? array_merge ( $ requestParams -> getHeader ( ) , $ optionalArgs [ 'headers' ] ) : $ requestParams -> getHeader ( ) ; return $ this -> startCall ( 'SetIamPolicy' , Policy :: class , $ optionalArgs , $ request , Call :: UNARY_CALL , 'google.iam.v1.IAMPolicy' ) -> wait ( ) ; }
|
Sets the access control policy on the specified resource . Replaces any existing policy .
|
1,988
|
public function getIamPolicy ( $ resource , array $ optionalArgs = [ ] ) { $ request = new GetIamPolicyRequest ( ) ; $ request -> setResource ( $ resource ) ; $ requestParams = new RequestParamsHeaderDescriptor ( [ 'resource' => $ request -> getResource ( ) , ] ) ; $ optionalArgs [ 'headers' ] = isset ( $ optionalArgs [ 'headers' ] ) ? array_merge ( $ requestParams -> getHeader ( ) , $ optionalArgs [ 'headers' ] ) : $ requestParams -> getHeader ( ) ; return $ this -> startCall ( 'GetIamPolicy' , Policy :: class , $ optionalArgs , $ request , Call :: UNARY_CALL , 'google.iam.v1.IAMPolicy' ) -> wait ( ) ; }
|
Gets the access control policy for a resource . Returns an empty policy if the resource exists and does not have a policy set .
|
1,989
|
private function getSizeFromMetadata ( ) { foreach ( $ this -> stream -> getMetadata ( 'wrapper_data' ) as $ value ) { if ( substr ( $ value , 0 , 15 ) == "Content-Length:" ) { return ( int ) substr ( $ value , 16 ) ; } } return 0 ; }
|
Attempt to fetch the size from the Content - Length response header . If we cannot return 0 .
|
1,990
|
public function read ( $ length ) { $ data = '' ; do { $ moreData = $ this -> stream -> read ( $ length ) ; $ data .= $ moreData ; $ readLength = strlen ( $ moreData ) ; $ length -= $ readLength ; } while ( $ length > 0 && $ readLength > 0 ) ; return $ data ; }
|
Read bytes from the underlying buffer retrying until we have read enough bytes or we cannot read any more . We do this because the internal C code for filling a buffer does not account for when we try to read large chunks from a user - land stream that does not return enough bytes .
|
1,991
|
public function setCommuteMethod ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ CommuteMethod :: class ) ; $ this -> commute_method = $ var ; return $ this ; }
|
Required . The method of transportation for which to calculate the commute time .
|
1,992
|
public function setRoadTraffic ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ CommuteFilter_RoadTraffic :: class ) ; $ this -> writeOneof ( 5 , $ var ) ; return $ this ; }
|
Optional . Specifies the traffic density to use when calculating commute time .
|
1,993
|
public function generate ( $ basePath , $ pretty ) { $ fileReflectorRegister = new ReflectorRegister ( ) ; $ rootPath = $ this -> executionPath ; foreach ( $ this -> files as $ file ) { $ currentFileArr = $ this -> isComponent ? explode ( "/$basePath/" , $ file ) : explode ( "$rootPath" , $ file ) ; if ( isset ( $ currentFileArr [ 1 ] ) ) { $ currentFile = str_replace ( 'src/' , '' , $ currentFileArr [ 1 ] ) ; } else { throw new \ Exception ( sprintf ( 'Failed to determine currentFile: %s' , $ file ) ) ; } $ isPhp = strrpos ( $ file , '.php' ) == strlen ( $ file ) - strlen ( '.php' ) ; $ pathInfo = pathinfo ( $ currentFile ) ; $ servicePath = $ pathInfo [ 'dirname' ] === '.' ? strtolower ( $ pathInfo [ 'filename' ] ) : strtolower ( $ pathInfo [ 'dirname' ] . '/' . $ pathInfo [ 'filename' ] ) ; $ id = $ this -> isComponent ? strtolower ( $ basePath ) . '/' . $ servicePath : $ servicePath ; if ( $ isPhp ) { $ parser = new CodeParser ( $ file , $ fileReflectorRegister , $ rootPath , $ this -> componentId , $ this -> manifestPath , $ this -> release , $ this -> output , $ id , $ this -> isComponent ) ; } else { $ content = file_get_contents ( $ file ) ; $ parser = new MarkdownParser ( $ currentFile , $ content , $ id ) ; } $ document = $ parser -> parse ( ) ; if ( $ document ) { $ writer = new Writer ( $ document , $ this -> outputPath , $ pretty ) ; $ writer -> write ( $ currentFile ) ; $ this -> types -> addType ( [ 'id' => $ id , 'title' => $ document [ 'title' ] , 'contents' => $ servicePath . '.json' ] ) ; } } }
|
Generates JSON documentation from provided files .
|
1,994
|
public function setWordList ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ CustomInfoType_Dictionary_WordList :: class ) ; $ this -> writeOneof ( 1 , $ var ) ; return $ this ; }
|
List of words or phrases to search for .
|
1,995
|
public function setCloudStoragePath ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ CloudStoragePath :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
|
Newline - delimited file of words in Cloud Storage . Only a single file is accepted .
|
1,996
|
public function setValue ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1beta1 \ Value :: class ) ; $ this -> value = $ var ; return $ this ; }
|
The value to compare to .
|
1,997
|
public function runQuery ( JobConfigurationInterface $ query , array $ options = [ ] ) { $ queryResultsOptions = $ this -> pluckArray ( [ 'maxResults' , 'startIndex' , 'timeoutMs' , 'maxRetries' ] , $ options ) ; $ queryResultsOptions [ 'initialTimeoutMs' ] = 10000 ; $ queryResults = $ this -> startQuery ( $ query , $ options ) -> queryResults ( $ queryResultsOptions + $ options ) ; $ queryResults -> waitUntilComplete ( ) ; return $ queryResults ; }
|
Runs a BigQuery SQL query in a synchronous fashion .
|
1,998
|
public function startQuery ( JobConfigurationInterface $ query , array $ options = [ ] ) { $ config = $ query -> toArray ( ) ; $ response = $ this -> connection -> insertJob ( $ config + $ options ) ; return new Job ( $ this -> connection , $ config [ 'jobReference' ] [ 'jobId' ] , $ this -> projectId , $ this -> mapper , $ response ) ; }
|
Runs a BigQuery SQL query in an asynchronous fashion .
|
1,999
|
public function jobs ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( array $ job ) { return new Job ( $ this -> connection , $ job [ 'jobReference' ] [ 'jobId' ] , $ this -> projectId , $ this -> mapper , $ job ) ; } , [ $ this -> connection , 'listJobs' ] , $ options + [ 'projectId' => $ this -> projectId ] , [ 'itemsKey' => 'jobs' , 'resultLimit' => $ resultLimit ] ) ) ; }
|
Fetches jobs in the project .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.