idx
int64
0
60.3k
question
stringlengths
101
6.21k
target
stringlengths
7
803
1,400
private static function is_optional ( $ token ) { if ( '[' === substr ( $ token , 0 , 1 ) && ']' === substr ( $ token , - 1 ) ) { return array ( true , substr ( $ token , 1 , - 1 ) ) ; } return array ( false , $ token ) ; }
An optional parameter is surrounded by square brackets .
1,401
public function setRefersTo ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Debugger \ V2 \ StatusMessage_Reference :: class ) ; $ this -> refers_to = $ var ; return $ this ; }
Reference to which the message applies .
1,402
public function setDescription ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Debugger \ V2 \ FormatMessage :: class ) ; $ this -> description = $ var ; return $ this ; }
Status message text .
1,403
public function setContentType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Asset \ V1 \ ContentType :: class ) ; $ this -> content_type = $ var ; return $ this ; }
Asset content type . If not specified no content but the asset name will be returned .
1,404
public function setDataSources ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ BigQuery \ DataTransfer \ V1 \ DataSource :: class ) ; $ this -> data_sources = $ arr ; return $ this ; }
List of supported data sources and their transfer settings .
1,405
public function setPoints ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Monitoring \ V3 \ Point :: class ) ; $ this -> points = $ arr ; return $ this ; }
The data points of this time series . When listing time series points are returned in reverse time order . When creating a time series this field must contain exactly one point and the point s type must be the same as the value type of the associated metric . If the associated metric s descriptor must be auto - created then the value type of the descriptor is determined by the point s type which must be BOOL INT64 DOUBLE or DISTRIBUTION .
1,406
public static function createFromValues ( $ year , $ month , $ day ) { $ value = sprintf ( '%s-%s-%s' , $ year , $ month , $ day ) ; $ dt = \ DateTimeImmutable :: createFromFormat ( self :: FORMAT , $ value ) ; return new static ( $ dt ) ; }
Create a Date from integer or string values .
1,407
public function flush ( array $ items = [ ] ) { if ( ! $ this -> callFunc ( $ items ) ) { $ this -> handleFailure ( $ this -> id , $ items ) ; return false ; } return true ; }
Finish any pending activity for this job .
1,408
public function setIndex ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ Admin \ V1 \ Index :: class ) ; $ this -> index = $ var ; return $ this ; }
The composite index to create .
1,409
public function GetInstance ( \ Google \ Cloud \ Spanner \ Admin \ Instance \ V1 \ GetInstanceRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/google.spanner.admin.instance.v1.InstanceAdmin/GetInstance' , $ argument , [ '\Google\Cloud\Spanner\Admin\Instance\V1\Instance' , 'decode' ] , $ metadata , $ options ) ; }
Gets information about a particular instance .
1,410
public function DeleteInstance ( \ Google \ Cloud \ Spanner \ Admin \ Instance \ V1 \ DeleteInstanceRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/google.spanner.admin.instance.v1.InstanceAdmin/DeleteInstance' , $ argument , [ '\Google\Protobuf\GPBEmpty' , 'decode' ] , $ metadata , $ options ) ; }
Deletes an instance .
1,411
public function setEntityKey ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ Key :: class ) ; $ this -> entity_key = $ var ; return $ this ; }
Datastore entity key .
1,412
public function setCreateCluster ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1beta2 \ ClusterOperation :: class ) ; $ this -> create_cluster = $ var ; return $ this ; }
Output only . The create cluster operation metadata .
1,413
public function setGraph ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1beta2 \ WorkflowGraph :: class ) ; $ this -> graph = $ var ; return $ this ; }
Output only . The workflow graph .
1,414
public function setParameters ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> parameters = $ arr ; return $ this ; }
Map from parameter names to values that were used for those parameters .
1,415
public function setWrites ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Firestore \ V1beta1 \ Write :: class ) ; $ this -> writes = $ arr ; return $ this ; }
The writes to apply . Always executed atomically and in order .
1,416
public function setSubscriptions ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> subscriptions = $ arr ; return $ this ; }
The names of the subscriptions that match the request .
1,417
public function setMask ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1 \ DocumentMask :: class ) ; $ this -> mask = $ var ; return $ this ; }
The fields to return . If not set returns all fields . If the document has a field that is not present in this mask that field will not be returned in the response .
1,418
public function setCurrentDocument ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1 \ Precondition :: class ) ; $ this -> current_document = $ var ; return $ this ; }
An optional precondition on the document . The request will fail if this is set and not met by the target document .
1,419
public function setMetadata ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> metadata = $ arr ; return $ this ; }
Metadata associated with the entity . Currently Wikipedia URLs and Knowledge Graph MIDs are provided if available . The associated keys are wikipedia_url and mid respectively .
1,420
public function setMentions ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Language \ V1beta2 \ EntityMention :: class ) ; $ this -> mentions = $ arr ; return $ this ; }
The mentions of this entity in the input document . The API currently supports proper noun mentions .
1,421
public function setLogEntryErrors ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: INT32 , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Rpc \ Status :: class ) ; $ this -> log_entry_errors = $ arr ; return $ this ; }
When WriteLogEntriesRequest . partial_success is true records the error status for entries that were not written due to a permanent error keyed by the entry s zero - based index in WriteLogEntriesRequest . entries . Failed requests for which no entries are written will not include per - entry errors .
1,422
public function setItem ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ ContentItem :: class ) ; $ this -> item = $ var ; return $ this ; }
The de - identified item .
1,423
public function setOverview ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ TransformationOverview :: class ) ; $ this -> overview = $ var ; return $ this ; }
An overview of the changes that were made on the item .
1,424
public function setIntents ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dialogflow \ V2 \ Intent :: class ) ; $ this -> intents = $ arr ; return $ this ; }
A collection of intents .
1,425
public function setDeviceRegistry ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Iot \ V1 \ DeviceRegistry :: class ) ; $ this -> device_registry = $ var ; return $ this ; }
The device registry . The field name must be empty . The server will generate that field from the device registry id provided and the parent field .
1,426
public function setRepoId ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ DevTools \ Source \ V1 \ RepoId :: class ) ; $ this -> repo_id = $ var ; return $ this ; }
The ID of the repo containing the workspace .
1,427
public function setAction ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Debugger \ V2 \ Breakpoint_Action :: class ) ; $ this -> action = $ var ; return $ this ; }
Action that the agent should perform when the code at the breakpoint location is hit .
1,428
public function setLocation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Debugger \ V2 \ SourceLocation :: class ) ; $ this -> location = $ var ; return $ this ; }
Breakpoint source location .
1,429
public function setExpressions ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> expressions = $ arr ; return $ this ; }
List of read - only expressions to evaluate at the breakpoint location . The expressions are composed using expressions in the programming language at the source location . If the breakpoint action is LOG the evaluated expressions are included in log statements .
1,430
public function setLogLevel ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Debugger \ V2 \ Breakpoint_LogLevel :: class ) ; $ this -> log_level = $ var ; return $ this ; }
Indicates the severity of the log . Only relevant when action is LOG .
1,431
public function setEvaluatedExpressions ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Debugger \ V2 \ Variable :: class ) ; $ this -> evaluated_expressions = $ arr ; return $ this ; }
Values of evaluated expressions at breakpoint time . The evaluated expressions appear in exactly the same order they are listed in the expressions field . The name field holds the original expression text the value or members field holds the result of the evaluated expression . If the expression cannot be evaluated the status inside the Variable will indicate an error and contain the error text .
1,432
public function setVariableTable ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Debugger \ V2 \ Variable :: class ) ; $ this -> variable_table = $ arr ; return $ this ; }
The variable_table exists to aid with computation memory and network traffic optimization . It enables storing a variable once and reference it from multiple variables including variables stored in the variable_table itself . For example the same this object which may appear at many levels of the stack can have all of its data stored once in this table . The stack frame variables then would hold only a reference to it . The variable var_table_index field is an index into this repeated field . The stored objects are nameless and get their name from the referencing variable . The effective variable is a merge of the referencing variable and the referenced variable .
1,433
public function setLabels ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> labels = $ arr ; return $ this ; }
A set of custom breakpoint properties populated by the agent to be displayed to the user .
1,434
public function setState ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ SecurityCenter \ V1 \ Finding_State :: class ) ; $ this -> state = $ var ; return $ this ; }
The state of the finding .
1,435
public function setSourceProperties ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Protobuf \ Value :: class ) ; $ this -> source_properties = $ arr ; return $ this ; }
Source specific properties . These properties are managed by the source that writes the finding . The key names in the source_properties map must be between 1 and 255 characters and must start with a letter and contain alphanumeric characters or underscores only .
1,436
public function setSecurityMarks ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ SecurityCenter \ V1 \ SecurityMarks :: class ) ; $ this -> security_marks = $ var ; return $ this ; }
Output only . User specified security marks . These marks are entirely managed by the user and come from the SecurityMarks resource that belongs to the finding .
1,437
public function accept ( ) { $ candidate = $ this -> getInnerIterator ( ) -> current ( ) ; return strrpos ( $ candidate , $ this -> file ) === strlen ( $ candidate ) - strlen ( $ this -> file ) ; }
FilterIterator callback to determine whether or not the value should be accepted .
1,438
public function setGroup ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Monitoring \ V3 \ Group :: class ) ; $ this -> group = $ var ; return $ this ; }
A group definition . It is an error to define the name field because the system assigns the name .
1,439
public function setRecordLocation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ RecordLocation :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
Location within a row or record of a database table .
1,440
public function setImageLocation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ ImageLocation :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
Location within an image s pixels .
1,441
public function setDocumentLocation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ DocumentLocation :: class ) ; $ this -> writeOneof ( 5 , $ var ) ; return $ this ; }
Location data for document files .
1,442
public function submit ( $ item , $ idNum ) { if ( ! array_key_exists ( $ idNum , $ this -> sysvQs ) ) { $ this -> sysvQs [ $ idNum ] = msg_get_queue ( $ this -> getSysvKey ( $ idNum ) ) ; } $ result = @ msg_send ( $ this -> sysvQs [ $ idNum ] , self :: $ typeDirect , $ item ) ; if ( $ result === false ) { $ tempFile = tempnam ( sys_get_temp_dir ( ) , 'Item' ) ; $ result = file_put_contents ( $ tempFile , serialize ( $ item ) ) ; if ( $ result === false ) { throw new \ RuntimeException ( "Failed to write to $tempFile while submiting the item" ) ; } $ result = @ msg_send ( $ this -> sysvQs [ $ idNum ] , self :: $ typeFile , $ tempFile ) ; if ( $ result === false ) { @ unlink ( $ tempFile ) ; throw new \ RuntimeException ( "Failed to submit the filename: $tempFile" ) ; } } }
Submit an item for async processing .
1,443
public function setDesiredAddonsConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ AddonsConfig :: class ) ; $ this -> desired_addons_config = $ var ; return $ this ; }
Configurations for the various addons available to run in the cluster .
1,444
public function setDesiredNodePoolAutoscaling ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ NodePoolAutoscaling :: class ) ; $ this -> desired_node_pool_autoscaling = $ var ; return $ this ; }
Autoscaler configuration for the node pool specified in desired_node_pool_id . If there is only one pool in the cluster and desired_node_pool_id is not provided then the change applies to that single node pool .
1,445
public function setDesiredMasterAuthorizedNetworksConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ MasterAuthorizedNetworksConfig :: class ) ; $ this -> desired_master_authorized_networks_config = $ var ; return $ this ; }
The desired configuration options for master authorized networks feature .
1,446
public function setMessageType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ StreamingRecognitionResult_MessageType :: class ) ; $ this -> message_type = $ var ; return $ this ; }
Type of the result message .
1,447
public function setTranslation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ AutoMl \ V1beta1 \ TranslationAnnotation :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
Annotation details for translation .
1,448
public function setClassification ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ AutoMl \ V1beta1 \ ClassificationAnnotation :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
Annotation details for content or image classification .
1,449
public function setAuxiliaryTables ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dlp \ V2 \ StatisticalTable :: 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 field must appear in exactly one field of one auxiliary table .
1,450
public function setDeviceRegistries ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Iot \ V1 \ DeviceRegistry :: class ) ; $ this -> device_registries = $ arr ; return $ this ; }
The registries that matched the query .
1,451
public function setTemplate ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1beta2 \ WorkflowTemplate :: class ) ; $ this -> template = $ var ; return $ this ; }
Required . The workflow template to instantiate .
1,452
public function setTranslatedContent ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ AutoMl \ V1beta1 \ TextSnippet :: class ) ; $ this -> translated_content = $ var ; return $ this ; }
Output only . The translated content .
1,453
public function addAttributes ( array $ attributes ) { foreach ( $ attributes as $ key => $ value ) { $ this -> addAttribute ( $ key , $ value ) ; } }
Attach labels to this span .
1,454
public function addAttribute ( $ key , $ value ) { if ( ! $ this -> attributes ) { $ this -> attributes = new Attributes ( ) ; } $ this -> attributes [ $ key ] = $ value ; }
Attach a single label to this span .
1,455
public function encodeValuesAsSimpleType ( array $ values , $ allowMixedArrayType = false ) { $ res = [ ] ; foreach ( $ values as $ value ) { $ type = null ; $ definition = null ; if ( is_array ( $ value ) && ( empty ( $ value ) || ! $ this -> isAssoc ( $ value ) ) ) { $ type = Database :: TYPE_ARRAY ; $ definition = new ArrayType ( null ) ; } $ res [ ] = $ this -> paramType ( $ value , $ type , $ definition , $ allowMixedArrayType ) [ 0 ] ; } return $ res ; }
Accepts a list of values and encodes the value into a format accepted by the Spanner API .
1,456
private function resolveTypeDefinition ( $ type , $ key = null ) { $ definition = null ; if ( is_array ( $ type ) ) { $ type += [ 1 => null , 2 => null ] ; $ definition = new ArrayType ( $ type [ 1 ] , $ type [ 2 ] ) ; $ type = Database :: TYPE_ARRAY ; } elseif ( $ type instanceof ArrayType ) { $ definition = $ type ; $ type = Database :: TYPE_ARRAY ; } elseif ( $ type instanceof StructType ) { $ definition = $ type ; $ type = Database :: TYPE_STRUCT ; } return [ $ type , $ definition ] ; }
Infer the type of a parameter and ensure that the definition if given is valid .
1,457
private function decodeValue ( $ value , array $ type ) { if ( $ value === null || $ value === '' ) { return $ value ; } switch ( $ type [ 'code' ] ) { case self :: TYPE_INT64 : $ value = $ this -> returnInt64AsObject ? new Int64 ( $ value ) : ( int ) $ value ; break ; case self :: TYPE_TIMESTAMP : $ value = $ this -> parseTimeString ( $ value ) ; $ value = new Timestamp ( $ value [ 0 ] , $ value [ 1 ] ) ; break ; case self :: TYPE_DATE : $ value = new Date ( new \ DateTimeImmutable ( $ value ) ) ; break ; case self :: TYPE_BYTES : $ value = new Bytes ( base64_decode ( $ value ) ) ; break ; case self :: TYPE_ARRAY : $ res = [ ] ; foreach ( $ value as $ item ) { $ res [ ] = $ this -> decodeValue ( $ item , $ type [ 'arrayElementType' ] ) ; } $ value = $ res ; break ; case self :: TYPE_STRUCT : $ fields = isset ( $ type [ 'structType' ] [ 'fields' ] ) ? $ type [ 'structType' ] [ 'fields' ] : [ ] ; $ value = $ this -> decodeValues ( $ fields , $ value , Result :: RETURN_ASSOCIATIVE ) ; break ; case self :: TYPE_FLOAT64 : if ( is_string ( $ value ) ) { switch ( $ value ) { case 'NaN' : $ value = NAN ; break ; case 'Infinity' : $ value = INF ; break ; case '-Infinity' : $ value = - INF ; break ; default : throw new \ RuntimeException ( sprintf ( 'Unexpected string value %s encountered in FLOAT64 field.' , $ value ) ) ; } } break ; } return $ value ; }
Convert a single value to its corresponding PHP type .
1,458
private function paramType ( $ value , $ givenType = null , $ definition = null , $ allowMixedArrayType = false ) { $ valueType = gettype ( $ value ) ; if ( $ definition !== null ) { $ valueType = 'array' ; } switch ( $ valueType ) { case 'boolean' : $ type = $ this -> typeObject ( $ givenType ? : self :: TYPE_BOOL ) ; break ; case 'integer' : $ value = ( string ) $ value ; $ type = $ this -> typeObject ( $ givenType ? : self :: TYPE_INT64 ) ; break ; case 'double' : $ type = $ this -> typeObject ( $ givenType ? : self :: TYPE_FLOAT64 ) ; switch ( $ value ) { case INF : $ value = 'Infinity' ; break ; case - INF : $ value = '-Infinity' ; break ; } if ( ! is_string ( $ value ) && is_nan ( $ value ) ) { $ value = 'NaN' ; } break ; case 'string' : $ type = $ this -> typeObject ( $ givenType ? : self :: TYPE_STRING ) ; break ; case 'resource' : $ type = $ this -> typeObject ( $ givenType ? : self :: TYPE_BYTES ) ; $ value = base64_encode ( stream_get_contents ( $ value ) ) ; break ; case 'object' : list ( $ type , $ value ) = $ this -> objectParam ( $ value ) ; break ; case 'array' : if ( $ givenType === Database :: TYPE_STRUCT ) { if ( ! ( $ definition instanceof StructType ) ) { throw new \ InvalidArgumentException ( 'Struct parameter types must be declared explicitly, and must ' . 'be an instance of Google\Cloud\Spanner\StructType.' ) ; } if ( $ value instanceof \ stdClass ) { $ value = ( array ) $ value ; } list ( $ value , $ type ) = $ this -> structParam ( $ value , $ definition ) ; } else { if ( ! ( $ definition instanceof ArrayType ) ) { throw new \ InvalidArgumentException ( 'Array parameter types must be an instance of Google\Cloud\Spanner\ArrayType.' ) ; } list ( $ value , $ type ) = $ this -> arrayParam ( $ value , $ definition , $ allowMixedArrayType ) ; } break ; case 'NULL' : $ type = $ this -> typeObject ( $ givenType ) ; break ; default : throw new \ InvalidArgumentException ( sprintf ( 'Unrecognized value type %s. ' . 'Please ensure you are using the latest version of google/cloud or google/cloud-spanner.' , get_class ( $ value ) ) ) ; break ; } return [ $ value , $ type ] ; }
Create a spanner parameter type value object from a PHP value type .
1,459
private function arrayParam ( $ value , ArrayType $ arrayType , $ allowMixedArrayType = false ) { if ( ! is_array ( $ value ) && $ value !== null ) { throw new \ InvalidArgumentException ( 'Array value must be an array or null.' ) ; } $ inferredTypes = [ ] ; $ res = null ; if ( $ value !== null ) { $ res = [ ] ; foreach ( $ value as $ element ) { $ type = $ this -> paramType ( $ element , $ arrayType -> type ( ) === Database :: TYPE_STRUCT ? $ arrayType -> type ( ) : null , $ arrayType -> structType ( ) ) ; $ res [ ] = $ type [ 0 ] ; if ( isset ( $ type [ 1 ] [ 'code' ] ) ) { $ inferredTypes [ ] = $ type [ 1 ] [ 'code' ] ; } } } if ( ! $ allowMixedArrayType && count ( array_unique ( $ inferredTypes ) ) > 1 ) { throw new \ InvalidArgumentException ( 'Array values may not be of mixed type' ) ; } $ nested = $ arrayType -> structType ( ) ; $ arrayType = $ arrayType -> type ( ) ; if ( ! empty ( $ value ) && $ arrayType && $ arrayType !== $ inferredTypes [ 0 ] ) { throw new \ InvalidArgumentException ( 'Array data does not match given array parameter type.' ) ; } $ typeCode = $ arrayType === null && $ inferredTypes ? $ inferredTypes [ 0 ] : $ arrayType ; if ( $ nested ) { $ nestedDefType = $ this -> resolveTypeDefinition ( $ nested ) ; $ nestedDef = $ this -> paramType ( null , $ nestedDefType [ 0 ] , $ nestedDefType [ 1 ] ) ; $ typeObject = $ nestedDef [ 1 ] ; } else { $ typeObject = $ this -> typeObject ( $ typeCode ) ; } $ type = $ this -> typeObject ( self :: TYPE_ARRAY , $ typeObject , 'arrayElementType' ) ; return [ $ res , $ type ] ; }
Create value and paramater type declarations for array SQL parameters .
1,460
private function objectParam ( $ value ) { if ( $ value instanceof \ stdClass ) { throw new \ InvalidArgumentException ( 'Values of type `\stdClass` are interpreted as structs and must define their types.' ) ; } if ( $ value instanceof ValueInterface ) { return [ $ this -> typeObject ( $ value -> type ( ) ) , $ value -> formatAsString ( ) ] ; } if ( $ value instanceof Int64 ) { return [ $ this -> typeObject ( self :: TYPE_INT64 ) , $ value -> get ( ) ] ; } throw new \ InvalidArgumentException ( sprintf ( 'Unrecognized value type %s. ' . 'Please ensure you are using the latest version of google/cloud or google/cloud-spanner.' , get_class ( $ value ) ) ) ; }
Handle query parameter mappings for various types of objects .
1,461
private function getColumnName ( $ columns , $ index ) { return ( isset ( $ columns [ $ index ] [ 'name' ] ) && $ columns [ $ index ] [ 'name' ] ) ? $ columns [ $ index ] [ 'name' ] : $ index ; }
Return the column name given a list of columns and a field index .
1,462
public function setIntersection ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Bigtable \ Admin \ V2 \ GcRule_Intersection :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
Delete cells that would be deleted by every nested rule .
1,463
public function setUnion ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Bigtable \ Admin \ V2 \ GcRule_Union :: class ) ; $ this -> writeOneof ( 4 , $ var ) ; return $ this ; }
Delete cells that would be deleted by any nested rule .
1,464
public function recognize ( $ audio , array $ options = [ ] ) { $ results = [ ] ; $ response = $ this -> connection -> recognize ( $ this -> formatRequest ( $ audio , $ options ) ) ; if ( ! isset ( $ response [ 'results' ] ) ) { return $ results ; } foreach ( $ response [ 'results' ] as $ result ) { $ results [ ] = new Result ( $ result ) ; } return $ results ; }
Runs a recognize request and returns the results immediately . Ideal when working with audio up to approximately one minute in length .
1,465
public function beginRecognizeOperation ( $ audio , array $ options = [ ] ) { $ response = $ this -> connection -> longRunningRecognize ( $ this -> formatRequest ( $ audio , $ options ) ) ; return new Operation ( $ this -> connection , $ response [ 'name' ] , $ response ) ; }
Runs a recognize request as an operation . Ideal when working with audio longer than approximately one minute . Requires polling of the returned operation in order to fetch results .
1,466
public function setChildLinks ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Spanner \ V1 \ PlanNode \ ChildLink :: class ) ; $ this -> child_links = $ arr ; return $ this ; }
List of child node index es and their relationship to this parent .
1,467
public function exists ( ) { try { $ this -> connection -> getDataset ( $ this -> identity + [ 'fields' => 'datasetReference' ] ) ; } catch ( NotFoundException $ ex ) { return false ; } return true ; }
Check whether or not the dataset exists .
1,468
public function tables ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( array $ table ) { return new Table ( $ this -> connection , $ table [ 'tableReference' ] [ 'tableId' ] , $ this -> identity [ 'datasetId' ] , $ this -> identity [ 'projectId' ] , $ this -> mapper , $ table ) ; } , [ $ this -> connection , 'listTables' ] , $ options + $ this -> identity , [ 'itemsKey' => 'tables' , 'resultLimit' => $ resultLimit ] ) ) ; }
Fetches tables in the dataset .
1,469
public function reload ( array $ options = [ ] ) { return $ this -> info = $ this -> connection -> getDataset ( $ options + $ this -> identity ) ; }
Triggers a network request to reload the dataset s details .
1,470
public function setRecordKey ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ RecordKey :: class ) ; $ this -> record_key = $ var ; return $ this ; }
Key of the finding .
1,471
public function setFieldId ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ FieldId :: class ) ; $ this -> field_id = $ var ; return $ this ; }
Field id of the field containing the finding .
1,472
public function setTableLocation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ TableLocation :: class ) ; $ this -> table_location = $ var ; return $ this ; }
Location within a ContentItem . Table .
1,473
public function setType ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Spanner \ V1 \ Type :: class ) ; $ this -> type = $ var ; return $ this ; }
The type of the field .
1,474
public function snapshot ( array $ options = [ ] ) { $ options += [ 'transactionOptions' => [ ] , ] ; $ options [ 'transactionOptions' ] [ 'singleUse' ] = false ; $ transactionOptions = $ this -> pluck ( 'transactionOptions' , $ options ) ; $ transactionOptions [ 'returnReadTimestamp' ] = true ; $ transactionOptions = $ this -> configureSnapshotOptions ( $ transactionOptions ) ; $ session = $ this -> operation -> createSession ( $ this -> databaseName , $ this -> pluck ( 'sessionOptions' , $ options , false ) ? : [ ] ) ; return $ this -> operation -> snapshot ( $ session , [ 'className' => BatchSnapshot :: class , 'transactionOptions' => $ transactionOptions ] + $ options ) ; }
Create a batch snapshot .
1,475
public function setFrameLabelAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1 \ LabelAnnotation :: class ) ; $ this -> frame_label_annotations = $ arr ; return $ this ; }
Label annotations on frame level . There is exactly one element for each unique label .
1,476
public function setFaceAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1 \ FaceAnnotation :: class ) ; $ this -> face_annotations = $ arr ; return $ this ; }
Face annotations . There is exactly one element for each unique face .
1,477
public function setShotAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1 \ VideoSegment :: class ) ; $ this -> shot_annotations = $ arr ; return $ this ; }
Shot annotations . Each shot is represented as a video segment .
1,478
public function setExplicitAnnotation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ VideoIntelligence \ V1 \ ExplicitContentAnnotation :: class ) ; $ this -> explicit_annotation = $ var ; return $ this ; }
Explicit content annotation .
1,479
public function setSpeechTranscriptions ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1 \ SpeechTranscription :: class ) ; $ this -> speech_transcriptions = $ arr ; return $ this ; }
Speech transcription .
1,480
public function setTextAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1 \ TextAnnotation :: class ) ; $ this -> text_annotations = $ arr ; return $ this ; }
OCR text detection and tracking . Annotations for list of detected text snippets . Each will have list of frame information associated with it .
1,481
public function setObjectAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ VideoIntelligence \ V1 \ ObjectTrackingAnnotation :: class ) ; $ this -> object_annotations = $ arr ; return $ this ; }
Annotations for list of objects detected and tracked in video .
1,482
public function setPornographyLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ VideoIntelligence \ V1 \ Likelihood :: class ) ; $ this -> pornography_likelihood = $ var ; return $ this ; }
Likelihood of the pornography content ..
1,483
public function setOriginalRequest ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Bigtable \ Admin \ V2 \ CreateTableFromSnapshotRequest :: class ) ; $ this -> original_request = $ var ; return $ this ; }
The request that prompted the initiation of this CreateTableFromSnapshot operation .
1,484
public function setFulfillmentMessages ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dialogflow \ V2 \ Intent \ Message :: class ) ; $ this -> fulfillment_messages = $ arr ; return $ this ; }
The collection of rich messages to present to the user .
1,485
public function setSentimentAnalysisResult ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ SentimentAnalysisResult :: class ) ; $ this -> sentiment_analysis_result = $ var ; return $ this ; }
The sentiment analysis result which depends on the sentiment_analysis_request_config specified in the request .
1,486
public function setTargetChangeType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Firestore \ V1 \ TargetChange_TargetChangeType :: class ) ; $ this -> target_change_type = $ var ; return $ this ; }
The type of change that occurred .
1,487
public function setTargetIds ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: INT32 ) ; $ this -> target_ids = $ arr ; return $ this ; }
The target IDs of targets that have changed . If empty the change applies to all targets . For target_change_type = ADD the order of the target IDs matches the order of the requests to add the targets . This allows clients to unambiguously associate server - assigned target IDs with added targets . For other states the order of the target IDs is not defined .
1,488
public function setRawHashes ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ WebRisk \ V1beta1 \ RawHashes :: class ) ; $ this -> raw_hashes = $ arr ; return $ this ; }
The raw SHA256 - formatted entries . Repeated to allow returning sets of hashes with different prefix sizes .
1,489
public function setRiceHashes ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ WebRisk \ V1beta1 \ RiceDeltaEncoding :: class ) ; $ this -> rice_hashes = $ var ; return $ this ; }
The encoded 4 - byte prefixes of SHA256 - formatted entries using a Golomb - Rice encoding . The hashes are converted to uint32 sorted in ascending order then delta encoded and stored as encoded_data .
1,490
public function setFileSet ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ CloudStorageOptions_FileSet :: class ) ; $ this -> file_set = $ var ; return $ this ; }
The set of one or more files to scan .
1,491
public function setFileTypes ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: ENUM , \ Google \ Cloud \ Dlp \ V2 \ FileType :: class ) ; $ this -> file_types = $ arr ; return $ this ; }
List of file type groups to include in the scan . If empty all files are scanned and available data format processors are applied . In addition the binary content of the selected files is always scanned as well .
1,492
public function setState ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Spanner \ Admin \ Database \ V1 \ Database_State :: class ) ; $ this -> state = $ var ; return $ this ; }
Output only . The current database state .
1,493
public function setRegexFileSet ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ CloudStorageRegexFileSet :: class ) ; $ this -> regex_file_set = $ var ; return $ this ; }
The regex - filtered set of files to scan . Exactly one of url or regex_file_set must be set .
1,494
public function state ( array $ options = [ ] ) { if ( ! $ this -> done ( $ options ) ) { return self :: STATE_IN_PROGRESS ; } if ( $ this -> done ( ) && $ this -> result ( ) ) { return self :: STATE_SUCCESS ; } return self :: STATE_ERROR ; }
Get the state of the Operation .
1,495
public function reload ( array $ options = [ ] ) { $ res = $ this -> connection -> get ( [ 'name' => $ this -> name , ] + $ options ) ; $ this -> result = null ; $ this -> error = null ; if ( isset ( $ res [ 'done' ] ) && $ res [ 'done' ] ) { $ type = $ res [ 'metadata' ] [ 'typeUrl' ] ; $ this -> result = $ this -> executeDoneCallback ( $ type , $ res [ 'response' ] ) ; $ this -> error = ( isset ( $ res [ 'error' ] ) ) ? $ res [ 'error' ] : null ; } return $ this -> info = $ res ; }
Reload the Operation to check its status .
1,496
public function pollUntilComplete ( array $ options = [ ] ) { $ options += [ 'pollingIntervalSeconds' => $ this :: WAIT_INTERVAL , 'maxPollingDurationSeconds' => 0.0 , ] ; $ pollingIntervalMicros = $ options [ 'pollingIntervalSeconds' ] * 1000000 ; $ maxPollingDuration = $ options [ 'maxPollingDurationSeconds' ] ; $ hasMaxPollingDuration = $ maxPollingDuration > 0.0 ; $ endTime = microtime ( true ) + $ maxPollingDuration ; do { usleep ( $ pollingIntervalMicros ) ; $ this -> reload ( $ options ) ; } while ( ! $ this -> done ( ) && ( ! $ hasMaxPollingDuration || microtime ( true ) < $ endTime ) ) ; return $ this -> result ; }
Reload the operation until it is complete .
1,497
private function executeDoneCallback ( $ type , $ response ) { if ( is_null ( $ response ) ) { return null ; } $ callables = array_filter ( $ this -> callablesMap , function ( $ callable ) use ( $ type ) { return $ callable [ 'typeUrl' ] === $ type ; } ) ; if ( count ( $ callables ) === 0 ) { return $ response ; } $ callable = current ( $ callables ) ; $ fn = $ callable [ 'callable' ] ; return call_user_func ( $ fn , $ response ) ; }
When the Operation is complete there may be a callback enqueued to handle the response . If so execute it and return the result .
1,498
public function setSsmlGender ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ SsmlVoiceGender :: class ) ; $ this -> ssml_gender = $ var ; return $ this ; }
Optional . The preferred gender of the voice . If not set the service will choose a voice based on the other parameters such as language_code and name . Note that this is only a preference not requirement . If a voice of the appropriate gender is not available the synthesizer should substitute a voice with a different gender rather than failing the request .
1,499
public function setStatements ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> statements = $ arr ; return $ this ; }
A list of formatted DDL statements defining the schema of the database specified in the request .