idx
int64 0
60.3k
| question
stringlengths 101
6.21k
| target
stringlengths 7
803
|
|---|---|---|
2,700
|
public function setManagedGroupConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dataproc \ V1beta2 \ ManagedGroupConfig :: class ) ; $ this -> managed_group_config = $ var ; return $ this ; }
|
Output only . The config for Compute Engine Instance Group Manager that manages this group . This is only used for preemptible instance groups .
|
2,701
|
public function setFinding ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ SecurityCenter \ V1 \ Finding :: class ) ; $ this -> finding = $ var ; return $ this ; }
|
The finding resource to update or create if it does not already exist . parent security_marks and update_time will be ignored . In the case of creation the finding id portion of the name must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length .
|
2,702
|
public function setSnapshots ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Bigtable \ Admin \ V2 \ Snapshot :: class ) ; $ this -> snapshots = $ arr ; return $ this ; }
|
The snapshots present in the requested cluster .
|
2,703
|
public function setPosixAccounts ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ OsLogin \ Common \ PosixAccount :: class ) ; $ this -> posix_accounts = $ arr ; return $ this ; }
|
The list of POSIX accounts associated with the user .
|
2,704
|
public function setSshPublicKeys ( $ var ) { $ arr = GPBUtil :: checkMapField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ OsLogin \ Common \ SshPublicKey :: class ) ; $ this -> ssh_public_keys = $ arr ; return $ this ; }
|
A map from SSH public key fingerprint to the associated key object .
|
2,705
|
public function setQueues ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Tasks \ V2 \ Queue :: class ) ; $ this -> queues = $ arr ; return $ this ; }
|
The list of queues .
|
2,706
|
public function next ( ) { $ this -> position ++ ; $ this -> page = $ this -> nextResultToken ( ) ? $ this -> executeCall ( ) : null ; }
|
Advances to the next page .
|
2,707
|
private function executeCall ( ) { $ call = $ this -> call ; list ( $ results , $ shouldContinue ) = $ this -> mapResults ( $ call ( $ this -> callOptions ) ) ; $ this -> set ( $ this -> resultTokenPath , $ this -> callOptions , $ this -> determineNextResultToken ( $ results , $ shouldContinue ) ) ; return $ results ; }
|
Executes the provided call to get a set of results .
|
2,708
|
public function setMetrics ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Logging \ V2 \ LogMetric :: class ) ; $ this -> metrics = $ arr ; return $ this ; }
|
A list of logs - based metrics .
|
2,709
|
public function setLabel ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Language \ V1 \ DependencyEdge_Label :: class ) ; $ this -> label = $ var ; return $ this ; }
|
The parse label for the token .
|
2,710
|
public function setType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Trace \ V2 \ Span_Link_Type :: class ) ; $ this -> type = $ var ; return $ this ; }
|
The relationship of the current span relative to the linked span .
|
2,711
|
public function setThreats ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ WebRisk \ V1beta1 \ SearchHashesResponse \ ThreatHash :: class ) ; $ this -> threats = $ arr ; return $ this ; }
|
The full hashes that matched the requested prefixes . The hash will be populated in the key .
|
2,712
|
public function setSupportedBy ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: ENUM , \ Google \ Cloud \ Dlp \ V2 \ InfoTypeSupportedBy :: class ) ; $ this -> supported_by = $ arr ; return $ this ; }
|
Which parts of the API supports this InfoType .
|
2,713
|
public function setLabelDetectionMode ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ VideoIntelligence \ V1 \ LabelDetectionMode :: class ) ; $ this -> label_detection_mode = $ var ; return $ this ; }
|
What labels should be detected with LABEL_DETECTION in addition to video - level labels or segment - level labels . If unspecified defaults to SHOT_MODE .
|
2,714
|
public function translate ( $ string , array $ options = [ ] ) { $ res = $ this -> translateBatch ( [ $ string ] , $ options ) ; if ( count ( $ res ) > 0 ) { return $ res [ 0 ] ; } }
|
Translate a string from one language to another .
|
2,715
|
public function translateBatch ( array $ strings , array $ options = [ ] ) { $ options += [ 'model' => null , ] ; $ options = array_filter ( $ options + [ 'q' => $ strings , 'key' => $ this -> key , 'target' => $ this -> targetLanguage , 'model' => $ options [ 'model' ] ] , function ( $ opt ) { return ! is_null ( $ opt ) ; } ) ; $ response = $ this -> connection -> listTranslations ( $ options ) ; $ translations = [ ] ; $ strings = array_values ( $ strings ) ; if ( isset ( $ response [ 'data' ] [ 'translations' ] ) ) { foreach ( $ response [ 'data' ] [ 'translations' ] as $ key => $ translation ) { $ source = isset ( $ translation [ 'detectedSourceLanguage' ] ) ? $ translation [ 'detectedSourceLanguage' ] : $ options [ 'source' ] ; $ model = ( isset ( $ translation [ 'model' ] ) ) ? $ translation [ 'model' ] : null ; $ translations [ ] = [ 'source' => $ source , 'input' => $ strings [ $ key ] , 'text' => $ translation [ 'translatedText' ] , 'model' => $ model ] ; } } return $ translations ; }
|
Translate multiple strings from one language to another .
|
2,716
|
public function detectLanguageBatch ( array $ strings , array $ options = [ ] ) { $ response = $ this -> connection -> listDetections ( $ options + [ 'q' => $ strings , 'key' => $ this -> key ] ) ; $ detections = [ ] ; foreach ( $ response [ 'data' ] [ 'detections' ] as $ key => $ detection ) { $ detection = $ detection [ 0 ] ; $ detections [ ] = array_filter ( [ 'languageCode' => $ detection [ 'language' ] , 'input' => $ strings [ $ key ] , 'confidence' => isset ( $ detection [ 'confidence' ] ) ? $ detection [ 'confidence' ] : null ] ) ; } return $ detections ; }
|
Detect the language of multiple strings .
|
2,717
|
public function languages ( array $ options = [ ] ) { $ response = $ this -> localizedLanguages ( $ options + [ 'target' => null ] ) ; return array_map ( function ( $ language ) { return $ language [ 'code' ] ; } , $ response ) ; }
|
Get all supported languages .
|
2,718
|
public function localizedLanguages ( array $ options = [ ] ) { $ response = $ this -> connection -> listLanguages ( $ options + [ 'key' => $ this -> key , 'target' => $ this -> targetLanguage ] ) ; return array_map ( function ( $ language ) { return array_filter ( [ 'code' => $ language [ 'language' ] , 'name' => isset ( $ language [ 'name' ] ) ? $ language [ 'name' ] : null ] ) ; } , $ response [ 'data' ] [ 'languages' ] ) ; }
|
Get the supported languages for translation in the targeted language .
|
2,719
|
public function setOp ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Datastore \ V1 \ CompositeFilter_Operator :: class ) ; $ this -> op = $ var ; return $ this ; }
|
The operator for combining multiple filters .
|
2,720
|
public function setDeviceStates ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Iot \ V1 \ DeviceState :: class ) ; $ this -> device_states = $ arr ; return $ this ; }
|
The last few device states . States are listed in descending order of server update time starting from the most recent one .
|
2,721
|
public function setEntityTypeBatchInline ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ EntityTypeBatch :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
|
The collection of entity types to update or create .
|
2,722
|
public function reload ( array $ options = [ ] ) { return $ this -> info = $ this -> connection -> getNotification ( $ options + $ this -> identity ) ; }
|
Triggers a network request to reload the notification s details .
|
2,723
|
public function setOutputPath ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ CloudStoragePath :: class ) ; $ this -> output_path = $ var ; return $ this ; }
|
Location to store dictionary artifacts in Google Cloud Storage . These files will only be accessible by project owners and the DLP API . If any of these artifacts are modified the dictionary is considered invalid and can no longer be used .
|
2,724
|
public function setCloudStorageFileSet ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ CloudStorageFileSet :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
|
Set of files containing newline - delimited lists of dictionary phrases .
|
2,725
|
public function setBigQueryField ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ BigQueryField :: class ) ; $ this -> writeOneof ( 3 , $ var ) ; return $ this ; }
|
Field in a BigQuery table where each cell represents a dictionary phrase .
|
2,726
|
public function setClientEvent ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ ClientEvent :: class ) ; $ this -> client_event = $ var ; return $ this ; }
|
Required . Events issued when end user interacts with customer s application that uses Cloud Talent Solution .
|
2,727
|
public static function productName ( $ project , $ location , $ product ) { return self :: getProductNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'product' => $ product , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a product resource .
|
2,728
|
public static function productSetName ( $ project , $ location , $ productSet ) { return self :: getProductSetNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'product_set' => $ productSet , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a product_set resource .
|
2,729
|
public static function referenceImageName ( $ project , $ location , $ product , $ referenceImage ) { return self :: getReferenceImageNameTemplate ( ) -> render ( [ 'project' => $ project , 'location' => $ location , 'product' => $ product , 'reference_image' => $ referenceImage , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a reference_image resource .
|
2,730
|
public function attribute ( $ key ) { return ( isset ( $ this -> message [ 'attributes' ] [ $ key ] ) ) ? $ this -> message [ 'attributes' ] [ $ key ] : null ; }
|
Retrieve a single message attribute .
|
2,731
|
private function getRetryFunction ( $ shouldRetryMessages = true ) { $ httpRetryCodes = $ this -> httpRetryCodes ; $ httpRetryMessages = $ this -> httpRetryMessages ; return function ( \ Exception $ ex ) use ( $ httpRetryCodes , $ httpRetryMessages , $ shouldRetryMessages ) { $ statusCode = $ ex -> getCode ( ) ; if ( in_array ( $ statusCode , $ httpRetryCodes ) ) { return true ; } if ( ! $ shouldRetryMessages ) { return false ; } $ message = ( $ ex instanceof RequestException && $ ex -> hasResponse ( ) ) ? ( string ) $ ex -> getResponse ( ) -> getBody ( ) : $ ex -> getMessage ( ) ; try { $ message = $ this -> jsonDecode ( $ message , true ) ; } catch ( \ InvalidArgumentException $ ex ) { return false ; } if ( ! isset ( $ message [ 'error' ] [ 'errors' ] ) ) { return false ; } foreach ( $ message [ 'error' ] [ 'errors' ] as $ error ) { if ( in_array ( $ error [ 'reason' ] , $ httpRetryMessages ) ) { return true ; } } return false ; } ; }
|
Determines whether or not the request should be retried .
|
2,732
|
public function setType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ TextAnnotation_DetectedBreak_BreakType :: class ) ; $ this -> type = $ var ; return $ this ; }
|
Detected break type .
|
2,733
|
public function setMasterAuth ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ MasterAuth :: class ) ; $ this -> master_auth = $ var ; return $ this ; }
|
The authentication information for accessing the master endpoint .
|
2,734
|
public function setLegacyAbac ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ LegacyAbac :: class ) ; $ this -> legacy_abac = $ var ; return $ this ; }
|
Configuration for the legacy ABAC authorization mode .
|
2,735
|
public function setIpAllocationPolicy ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ IPAllocationPolicy :: class ) ; $ this -> ip_allocation_policy = $ var ; return $ this ; }
|
Configuration for cluster IP allocation .
|
2,736
|
public function setMasterAuthorizedNetworksConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ MasterAuthorizedNetworksConfig :: class ) ; $ this -> master_authorized_networks_config = $ var ; return $ this ; }
|
The configuration options for master authorized networks feature .
|
2,737
|
public function setNetworkConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ NetworkConfig :: class ) ; $ this -> network_config = $ var ; return $ this ; }
|
Configuration for cluster networking .
|
2,738
|
public function setPrivateClusterConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ PrivateClusterConfig :: class ) ; $ this -> private_cluster_config = $ var ; return $ this ; }
|
Configuration for private cluster .
|
2,739
|
public function setAuthors ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> authors = $ arr ; return $ this ; }
|
Optional . A list of author names . Number of characters allowed is 100 .
|
2,740
|
public function setAnnotationSpecId ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> annotation_spec_id = $ arr ; return $ this ; }
|
Output only . IDs of the annotation specs used in the confusion matrix .
|
2,741
|
public function setRemovedTargetIds ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: INT32 ) ; $ this -> removed_target_ids = $ arr ; return $ this ; }
|
A set of target IDs for targets that previously matched this entity .
|
2,742
|
public static function projectRunName ( $ project , $ transferConfig , $ run ) { return self :: getProjectRunNameTemplate ( ) -> render ( [ 'project' => $ project , 'transfer_config' => $ transferConfig , 'run' => $ run , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a project_run resource .
|
2,743
|
public function setNodePool ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ NodePool :: class ) ; $ this -> node_pool = $ var ; return $ this ; }
|
The node pool to create .
|
2,744
|
public function setGcsDestination ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Asset \ V1 \ GcsDestination :: class ) ; $ this -> writeOneof ( 1 , $ var ) ; return $ this ; }
|
Destination on Cloud Storage .
|
2,745
|
public static function findingSecurityMarksName ( $ organization , $ source , $ finding ) { return self :: getFindingSecurityMarksNameTemplate ( ) -> render ( [ 'organization' => $ organization , 'source' => $ source , 'finding' => $ finding , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a finding_security_marks resource .
|
2,746
|
public static function findingName ( $ organization , $ source , $ finding ) { return self :: getFindingNameTemplate ( ) -> render ( [ 'organization' => $ organization , 'source' => $ source , 'finding' => $ finding , ] ) ; }
|
Formats a string containing the fully - qualified path to represent a finding resource .
|
2,747
|
public function getIamPolicy ( $ resource , array $ optionalArgs = [ ] ) { $ request = new GetIamPolicyRequest ( ) ; $ request -> setResource ( $ resource ) ; return $ this -> startCall ( 'GetIamPolicy' , Policy :: class , $ optionalArgs , $ request ) -> wait ( ) ; }
|
Gets the access control policy on the specified Source .
|
2,748
|
public function setConfidenceMetricsEntry ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ AutoMl \ V1beta1 \ ClassificationEvaluationMetrics \ ConfidenceMetricsEntry :: class ) ; $ this -> confidence_metrics_entry = $ arr ; return $ this ; }
|
Output only . Metrics that have confidence thresholds . Precision - recall curve can be derived from it .
|
2,749
|
public function setConfusionMatrix ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ AutoMl \ V1beta1 \ ClassificationEvaluationMetrics_ConfusionMatrix :: class ) ; $ this -> confusion_matrix = $ var ; return $ this ; }
|
Output only . Confusion matrix of the evaluation . Only set for MULTICLASS classification problems where number of labels is no more than 10 . Only set for model level evaluation not for evaluation per label .
|
2,750
|
public function setMessageTypes ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: ENUM , \ Google \ Cloud \ BigQuery \ DataTransfer \ V1 \ TransferMessage \ MessageSeverity :: class ) ; $ this -> message_types = $ arr ; return $ this ; }
|
Message types to return . If not populated - INFO WARNING and ERROR messages are returned .
|
2,751
|
public function setSource ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ SecurityCenter \ V1 \ Source :: class ) ; $ this -> source = $ var ; return $ this ; }
|
The Source being created only the display_name and description will be used . All other fields will be ignored .
|
2,752
|
public function setOrganizationSettings ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ SecurityCenter \ V1 \ OrganizationSettings :: class ) ; $ this -> organization_settings = $ var ; return $ this ; }
|
The organization settings resource to update .
|
2,753
|
public function setSubscription ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ PubSub \ V1 \ Subscription :: class ) ; $ this -> subscription = $ var ; return $ this ; }
|
The updated subscription object .
|
2,754
|
public function update ( array $ metadata , array $ options = [ ] ) { $ options += $ metadata ; $ options += $ this -> info ( $ options ) ; return $ this -> info = $ this -> connection -> updateMetric ( $ options + [ 'metricName' => $ this -> formattedName ] ) ; }
|
Update the metric . Please note this will trigger a network request if cached data is not available to perform the update with .
|
2,755
|
public function reload ( array $ options = [ ] ) { return $ this -> info = $ this -> connection -> getMetric ( $ options + [ 'metricName' => $ this -> formattedName ] ) ; }
|
Triggers a network request to reload the metric s details .
|
2,756
|
public function setImage ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ Image :: class ) ; $ this -> image = $ var ; return $ this ; }
|
The image to be processed .
|
2,757
|
public function run ( DebuggerClient $ client = null , $ asDaemon = true ) { $ client = $ client ? : $ this -> defaultClient ( ) ; $ extSourceContexts = $ this -> extSourceContext ? [ $ this -> extSourceContext ] : [ ] ; $ uniquifier = $ this -> uniquifier ? : $ this -> defaultUniquifier ( ) ; do { $ debuggee = $ client -> debuggee ( null , [ 'uniquifier' => $ uniquifier , 'description' => $ this -> description , 'extSourceContexts' => $ extSourceContexts , 'labels' => $ this -> labels ] ) ; $ backoff = new ExponentialBackoff ( ) ; $ backoff -> execute ( function ( ) use ( $ debuggee ) { $ debuggee -> register ( ) ; } ) ; try { $ options = [ ] ; do { try { $ resp = $ debuggee -> breakpointsWithWaitToken ( $ options ) ; $ this -> setBreakpoints ( $ debuggee , $ resp [ 'breakpoints' ] ) ; $ options [ 'waitToken' ] = $ resp [ 'nextWaitToken' ] ; } catch ( ConflictException $ e ) { } gc_collect_cycles ( ) ; } while ( $ asDaemon ) ; } catch ( ServiceException $ e ) { } gc_collect_cycles ( ) ; } while ( $ asDaemon ) ; }
|
Main loop for the daemon . Fetches breakpoints from the DebuggerClient and stores them in shared storage for the application to read . This function runs indefinitely .
|
2,758
|
public function setTrueFilter ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Bigtable \ V2 \ RowFilter :: class ) ; $ this -> true_filter = $ var ; return $ this ; }
|
The filter to apply to the input row if predicate_filter returns any results . If not provided no results will be returned in the true case .
|
2,759
|
public function setFalseFilter ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Bigtable \ V2 \ RowFilter :: class ) ; $ this -> false_filter = $ var ; return $ this ; }
|
The filter to apply to the input row if predicate_filter does not return any results . If not provided no results will be returned in the false case .
|
2,760
|
public function annotateText ( $ document , $ features , array $ optionalArgs = [ ] ) { $ request = new AnnotateTextRequest ( ) ; $ request -> setDocument ( $ document ) ; $ request -> setFeatures ( $ features ) ; if ( isset ( $ optionalArgs [ 'encodingType' ] ) ) { $ request -> setEncodingType ( $ optionalArgs [ 'encodingType' ] ) ; } return $ this -> startCall ( 'AnnotateText' , AnnotateTextResponse :: class , $ optionalArgs , $ request ) -> wait ( ) ; }
|
A convenience method that provides all syntax sentiment entity and classification features in one call .
|
2,761
|
public function setInteractionType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Speech \ V1p1beta1 \ RecognitionMetadata_InteractionType :: class ) ; $ this -> interaction_type = $ var ; return $ this ; }
|
The use case most closely describing the audio content to be recognized .
|
2,762
|
public function setMicrophoneDistance ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Speech \ V1p1beta1 \ RecognitionMetadata_MicrophoneDistance :: class ) ; $ this -> microphone_distance = $ var ; return $ this ; }
|
The audio type that most closely describes the audio being recognized .
|
2,763
|
public function setOriginalMediaType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Speech \ V1p1beta1 \ RecognitionMetadata_OriginalMediaType :: class ) ; $ this -> original_media_type = $ var ; return $ this ; }
|
The original media the speech was recorded on .
|
2,764
|
public function setRecordingDeviceType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Speech \ V1p1beta1 \ RecognitionMetadata_RecordingDeviceType :: class ) ; $ this -> recording_device_type = $ var ; return $ this ; }
|
The type of device the speech was recorded with .
|
2,765
|
public function responseToEntityProperties ( array $ entityData , $ className = Entity :: class ) { if ( ! is_subclass_of ( $ className , EntityInterface :: class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Class %s must implement EntityInterface.' , $ className ) ) ; } $ properties = [ ] ; $ excludes = [ ] ; $ meanings = [ ] ; $ mappings = $ className :: mappings ( ) ; foreach ( $ entityData as $ key => $ property ) { $ mapClassName = Entity :: class ; if ( array_key_exists ( $ key , $ mappings ) ) { $ mapClassName = $ mappings [ $ key ] ; } if ( $ mapClassName ) { if ( ! is_subclass_of ( $ mapClassName , EntityInterface :: class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Class %s must implement EntityInterface. (Found in mappings on %s)' , $ mapClassName , $ className ) ) ; } } $ properties [ $ key ] = $ this -> getPropertyValue ( $ property , $ mapClassName ) ; if ( isset ( $ property [ 'excludeFromIndexes' ] ) && $ property [ 'excludeFromIndexes' ] ) { $ excludes [ ] = $ key ; } if ( isset ( $ property [ 'meaning' ] ) && $ property [ 'meaning' ] ) { $ meanings [ $ key ] = $ property [ 'meaning' ] ; } } return [ 'properties' => $ properties , 'excludes' => $ excludes , 'meanings' => $ meanings ] ; }
|
Convert an entity response to properties excludes and meanings .
|
2,766
|
public function objectToRequest ( EntityInterface $ entity ) { $ data = $ entity -> get ( ) ; $ properties = [ ] ; foreach ( $ data as $ key => $ value ) { $ exclude = in_array ( $ key , $ entity -> excludedProperties ( ) ) ; $ meaning = ( isset ( $ entity -> meanings ( ) [ $ key ] ) ) ? $ entity -> meanings ( ) [ $ key ] : null ; $ properties [ $ key ] = $ this -> valueObject ( $ value , $ exclude , $ meaning ) ; } $ key = $ entity -> key ( ) ? $ entity -> key ( ) -> keyObject ( ) : null ; return array_filter ( [ 'key' => $ key , 'properties' => $ properties ] ) ; }
|
Translate an Entity to a datastore representation .
|
2,767
|
public function valueObject ( $ value , $ exclude = false , $ meaning = null ) { switch ( gettype ( $ value ) ) { case 'boolean' : $ propertyValue = [ 'booleanValue' => $ value ] ; break ; case 'integer' : $ propertyValue = [ 'integerValue' => $ value ] ; break ; case 'double' : $ propertyValue = [ 'doubleValue' => $ value ] ; break ; case 'string' : $ propertyValue = [ 'stringValue' => $ value ] ; break ; case 'array' : if ( ! empty ( $ value ) && $ this -> isAssoc ( $ value ) ) { $ propertyValue = $ this -> convertArrayToEntityValue ( $ value ) ; } else { $ propertyValue = $ this -> convertArrayToArrayValue ( $ value ) ; } break ; case 'object' : $ propertyValue = $ this -> objectProperty ( $ value ) ; break ; case 'resource' : $ content = stream_get_contents ( $ value ) ; $ propertyValue = [ 'blobValue' => ( $ this -> encode ) ? base64_encode ( $ content ) : $ content ] ; break ; case 'NULL' : $ propertyValue = [ 'nullValue' => null ] ; break ; case 'unknown type' : throw new \ InvalidArgumentException ( sprintf ( 'Unknown type for `%s' , $ content ) ) ; break ; default : throw new \ InvalidArgumentException ( sprintf ( 'Invalid type for `%s' , $ content ) ) ; break ; } if ( $ exclude ) { $ propertyValue [ 'excludeFromIndexes' ] = true ; } if ( $ meaning ) { $ propertyValue [ 'meaning' ] = $ meaning ; } return $ propertyValue ; }
|
Format values for the API
|
2,768
|
public function objectProperty ( $ value ) { switch ( true ) { case $ value instanceof Int64 : return [ 'integerValue' => $ value -> get ( ) ] ; break ; case $ value instanceof Blob : return [ 'blobValue' => ( $ this -> encode ) ? base64_encode ( ( string ) $ value ) : ( string ) $ value ] ; break ; case $ value instanceof \ DateTimeInterface : return [ 'timestampValue' => $ value -> format ( self :: DATE_FORMAT ) ] ; break ; case $ value instanceof EntityInterface : return [ 'entityValue' => $ this -> objectToRequest ( $ value ) ] ; break ; case $ value instanceof GeoPoint : return [ 'geoPointValue' => $ value -> point ( ) ] ; break ; case $ value instanceof Key : return [ 'keyValue' => $ value -> keyObject ( ) ] ; break ; case $ value instanceof \ stdClass : return $ this -> convertArrayToEntityValue ( ( array ) $ value ) ; default : throw new \ InvalidArgumentException ( sprintf ( 'Value of type `%s` could not be serialized' , get_class ( $ value ) ) ) ; break ; } }
|
Convert different object types to API values
|
2,769
|
private function convertArrayToArrayValue ( array $ value ) { $ values = [ ] ; foreach ( $ value as $ val ) { if ( is_array ( $ val ) && empty ( $ val ) ) { $ val = ( object ) $ val ; } $ values [ ] = $ this -> valueObject ( $ val ) ; } return [ 'arrayValue' => [ 'values' => $ values ] ] ; }
|
Convert a non - associative array to a datastore arrayValue type
|
2,770
|
private function convertArrayToEntityValue ( array $ value ) { $ excludes = $ this -> pluck ( Entity :: EXCLUDE_FROM_INDEXES , $ value , false ) ? : [ ] ; $ properties = [ ] ; foreach ( $ value as $ key => $ val ) { $ properties [ $ key ] = $ this -> valueObject ( $ val , in_array ( $ key , $ excludes ) ) ; } if ( ! $ properties ) { $ properties = ( object ) $ properties ; } return [ 'entityValue' => [ 'properties' => $ properties ] ] ; }
|
Convert an associative array to a datastore entityValue type
|
2,771
|
private function getPropertyValue ( array $ property , $ className = Entity :: class ) { $ type = $ this -> getValueType ( $ property ) ; return $ this -> convertValue ( $ type , $ property [ $ type ] , $ className ) ; }
|
Determine the property type and return a converted value
|
2,772
|
private function getValueType ( array $ value ) { $ keys = array_keys ( $ value ) ; $ types = array_values ( array_filter ( $ keys , function ( $ key ) { return strpos ( $ key , 'Value' ) !== false ; } ) ) ; if ( ! empty ( $ types ) ) { return $ types [ 0 ] ; } throw new \ RuntimeException ( 'Invalid entity property value given' ) ; }
|
Get the value type from a value object .
|
2,773
|
public function setAddTarget ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Firestore \ V1 \ Target :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; }
|
A target to add to this stream .
|
2,774
|
public function DeleteCluster ( \ Google \ Cloud \ Container \ V1 \ DeleteClusterRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/google.container.v1.ClusterManager/DeleteCluster' , $ argument , [ '\Google\Cloud\Container\V1\Operation' , 'decode' ] , $ metadata , $ options ) ; }
|
Deletes the cluster including the Kubernetes endpoint and all worker nodes .
|
2,775
|
public function RollbackNodePoolUpgrade ( \ Google \ Cloud \ Container \ V1 \ RollbackNodePoolUpgradeRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/google.container.v1.ClusterManager/RollbackNodePoolUpgrade' , $ argument , [ '\Google\Cloud\Container\V1\Operation' , 'decode' ] , $ metadata , $ options ) ; }
|
Roll back the previously Aborted or Failed NodePool upgrade . This will be an no - op if the last upgrade successfully completed .
|
2,776
|
public function setQueryTextSentiment ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Sentiment :: class ) ; $ this -> query_text_sentiment = $ var ; return $ this ; }
|
The sentiment analysis result for query_text .
|
2,777
|
public function AnnotateText ( \ Google \ Cloud \ Language \ V1 \ AnnotateTextRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/google.cloud.language.v1.LanguageService/AnnotateText' , $ argument , [ '\Google\Cloud\Language\V1\AnnotateTextResponse' , 'decode' ] , $ metadata , $ options ) ; }
|
A convenience method that provides all the features that analyzeSentiment analyzeEntities and analyzeSyntax provide in one call .
|
2,778
|
public function exists ( array $ options = [ ] ) { try { $ this -> connection -> getSession ( $ options + [ 'name' => $ this -> name ( ) , 'database' => $ this -> database ] ) ; return true ; } catch ( NotFoundException $ e ) { return false ; } }
|
Check if the session exists .
|
2,779
|
public function delete ( array $ options = [ ] ) { return $ this -> connection -> deleteSession ( $ options + [ 'name' => $ this -> name ( ) , 'database' => $ this -> database ] ) ; }
|
Delete the session .
|
2,780
|
public function name ( ) { return SpannerClient :: sessionName ( $ this -> projectId , $ this -> instance , $ this -> database , $ this -> name ) ; }
|
Format the constituent parts of a session name into a fully qualified session name .
|
2,781
|
public function setMatchMode ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Agent_MatchMode :: class ) ; $ this -> match_mode = $ var ; return $ this ; }
|
Optional . Determines how intents are detected from user queries .
|
2,782
|
public function create ( $ document , array $ fields , array $ options = [ ] ) { $ emptyDocument = count ( $ fields ) === 0 ; list ( $ fields , $ sentinels , $ metadata ) = $ this -> filterFields ( $ fields ) ; if ( $ metadata [ 'hasDelete' ] ) { throw new \ InvalidArgumentException ( 'Cannot delete fields when creating a document.' ) ; } $ precondition = [ 'exists' => false ] ; $ transformOptions = [ ] ; if ( ! empty ( $ fields ) || $ emptyDocument ) { $ this -> writes [ ] = $ this -> createDatabaseWrite ( self :: TYPE_UPDATE , $ document , [ 'fields' => $ this -> valueMapper -> encodeValues ( $ fields ) , 'precondition' => $ precondition ] + $ options ) ; } else { $ transformOptions = [ 'precondition' => $ precondition ] ; } $ this -> enqueueTransforms ( $ document , $ sentinels , $ transformOptions ) ; return $ this ; }
|
Enqueue a document creation .
|
2,783
|
public function set ( $ document , array $ fields , array $ options = [ ] ) { $ merge = $ this -> pluck ( 'merge' , $ options , false ) ? : false ; $ emptyDocument = count ( $ fields ) === 0 ; list ( $ fields , $ sentinels , $ metadata ) = $ this -> filterFields ( $ fields ) ; if ( ! $ merge && $ metadata [ 'hasDelete' ] ) { throw new \ InvalidArgumentException ( 'Delete cannot appear in data unless `$options[\'merge\']` is set.' ) ; } $ updateNotRequired = count ( $ fields ) === 0 && ! $ emptyDocument && ! $ metadata [ 'hasUpdateMask' ] && $ metadata [ 'hasTransform' ] ; $ shouldEnqueueUpdate = $ fields || $ emptyDocument || ( $ updateNotRequired && ! $ merge ) || $ metadata [ 'hasUpdateMask' ] ; if ( $ shouldEnqueueUpdate ) { $ write = [ 'fields' => $ this -> valueMapper -> encodeValues ( $ fields ) , ] ; if ( $ merge ) { $ write [ 'updateMask' ] = $ this -> pathsToStrings ( $ this -> encodeFieldPaths ( $ fields ) , $ sentinels ) ; } $ this -> writes [ ] = $ this -> createDatabaseWrite ( self :: TYPE_UPDATE , $ document , $ write , $ options ) ; } $ this -> enqueueTransforms ( $ document , $ sentinels , $ options ) ; return $ this ; }
|
Enqueue a set mutation .
|
2,784
|
public function commit ( array $ options = [ ] ) { unset ( $ options [ 'merge' ] , $ options [ 'precondition' ] ) ; $ response = $ this -> connection -> commit ( array_filter ( [ 'database' => $ this -> database , 'writes' => $ this -> writes , 'transaction' => $ this -> transaction ] ) + $ options ) ; if ( isset ( $ response [ 'commitTime' ] ) ) { $ time = $ this -> parseTimeString ( $ response [ 'commitTime' ] ) ; $ response [ 'commitTime' ] = new Timestamp ( $ time [ 0 ] , $ time [ 1 ] ) ; } if ( isset ( $ response [ 'writeResults' ] ) ) { foreach ( $ response [ 'writeResults' ] as & $ result ) { if ( isset ( $ result [ 'updateTime' ] ) ) { $ time = $ this -> parseTimeString ( $ result [ 'updateTime' ] ) ; $ result [ 'updateTime' ] = new Timestamp ( $ time [ 0 ] , $ time [ 1 ] ) ; } } } return $ response ; }
|
Commit writes to the database .
|
2,785
|
private function enqueueTransforms ( $ document , array $ transforms , array $ options = [ ] ) { $ operations = [ ] ; foreach ( $ transforms as $ transform ) { if ( ! ( $ transform instanceof DocumentTransformInterface ) ) { continue ; } $ args = $ transform -> args ( ) ; if ( ! $ transform -> sendRaw ( ) ) { if ( is_array ( $ args ) && ! $ this -> isAssoc ( $ args ) ) { $ args = $ this -> valueMapper -> encodeArrayValue ( $ args ) ; } else { $ args = $ this -> valueMapper -> encodeValue ( $ args ) ; } } $ operations [ ] = [ 'fieldPath' => $ transform -> fieldPath ( ) -> pathString ( ) , $ transform -> key ( ) => $ args ] ; } if ( $ operations ) { $ this -> writes [ ] = $ this -> createDatabaseWrite ( self :: TYPE_TRANSFORM , $ document , [ 'fieldTransforms' => $ operations ] + $ options ) ; } }
|
Enqueue transforms for CREATE UPDATE and SET calls .
|
2,786
|
private function validatePrecondition ( array & $ options ) { $ precondition = isset ( $ options [ 'precondition' ] ) ? $ options [ 'precondition' ] : null ; if ( ! $ precondition ) { return ; } if ( isset ( $ precondition [ 'exists' ] ) ) { return $ precondition ; } if ( isset ( $ precondition [ 'updateTime' ] ) ) { if ( ! ( $ precondition [ 'updateTime' ] instanceof Timestamp ) ) { throw new \ InvalidArgumentException ( 'Precondition Update Time must be an instance of `Google\\Cloud\\Core\\Timestamp`' ) ; } return [ 'updateTime' => $ precondition [ 'updateTime' ] -> formatForApi ( ) ] ; } throw new \ InvalidArgumentException ( 'Preconditions must provide either `exists` or `updateTime`.' ) ; }
|
Validates a document precondition if set .
|
2,787
|
private function createDatabaseWriteOperation ( $ type , $ document , array $ options = [ ] ) { switch ( $ type ) { case self :: TYPE_UPDATE : return [ 'update' => [ 'name' => $ document , 'fields' => $ this -> pluck ( 'fields' , $ options ) ] ] ; break ; case self :: TYPE_DELETE : return [ 'delete' => $ document ] ; break ; case self :: TYPE_TRANSFORM : return [ 'transform' => [ 'document' => $ document , 'fieldTransforms' => $ this -> pluck ( 'fieldTransforms' , $ options ) ] ] ; break ; default : throw new \ InvalidArgumentException ( sprintf ( 'Write operation type `%s is not valid. Allowed values are update, delete, verify, transform.' , $ type ) ) ; break ; } }
|
Create the write operation object .
|
2,788
|
private function formatPrecondition ( array $ options , $ mustExist = false ) { if ( ! isset ( $ options [ 'precondition' ] ) && ! $ mustExist ) { return $ options ; } $ precondition = isset ( $ options [ 'precondition' ] ) ? $ options [ 'precondition' ] : [ ] ; if ( isset ( $ precondition [ 'updateTime' ] ) ) { return $ options ; } if ( $ mustExist ) { $ precondition [ 'exists' ] = true ; } $ options [ 'precondition' ] = $ precondition ; return $ options ; }
|
Correctly formats a precondition for a write .
|
2,789
|
private function checkPrefixes ( array $ paths ) { sort ( $ paths ) ; for ( $ i = 1 ; $ i < count ( $ paths ) ; $ i ++ ) { $ prefix = $ paths [ $ i - 1 ] ; $ suffix = $ paths [ $ i ] ; $ prefix = explode ( '.' , $ prefix ) ; $ suffix = explode ( '.' , $ suffix ) ; $ isPrefix = count ( $ prefix ) < count ( $ suffix ) && $ prefix === array_slice ( $ suffix , 0 , count ( $ prefix ) ) ; if ( $ isPrefix ) { throw new \ InvalidArgumentException ( sprintf ( 'Field path conflict detected for field path `%s`. ' . 'Conflicts occur when a field path descends from another ' . 'path. For instance `a.b` is not allowed when `a` is also ' . 'provided.' , $ prefix ) ) ; } } }
|
Check list of FieldPaths for prefix paths and throw exception .
|
2,790
|
public function setProvider ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Container \ V1 \ NetworkPolicy_Provider :: class ) ; $ this -> provider = $ var ; return $ this ; }
|
The selected network policy provider .
|
2,791
|
public function setNotificationChannel ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Monitoring \ V3 \ NotificationChannel :: class ) ; $ this -> notification_channel = $ var ; return $ this ; }
|
The definition of the NotificationChannel to create .
|
2,792
|
public function setOp ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Firestore \ V1 \ StructuredQuery_UnaryFilter_Operator :: class ) ; $ this -> op = $ var ; return $ this ; }
|
The unary operator to apply .
|
2,793
|
public function setInspectTemplates ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dlp \ V2 \ InspectTemplate :: class ) ; $ this -> inspect_templates = $ arr ; return $ this ; }
|
List of inspectTemplates up to page_size in ListInspectTemplatesRequest .
|
2,794
|
public function setAction ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Container \ V1 \ SetMasterAuthRequest_Action :: class ) ; $ this -> action = $ var ; return $ this ; }
|
The exact form of action to be taken on the master auth .
|
2,795
|
public function setUpdate ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Container \ V1 \ MasterAuth :: class ) ; $ this -> update = $ var ; return $ this ; }
|
A description of the update .
|
2,796
|
public function setStructuredDegree ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Talent \ V4beta1 \ Degree :: class ) ; $ this -> writeOneof ( 7 , $ var ) ; return $ this ; }
|
Optional . The structured notation of the degree .
|
2,797
|
public function setMembers ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Debugger \ V2 \ Variable :: class ) ; $ this -> members = $ arr ; return $ this ; }
|
Members contained or pointed to by the variable .
|
2,798
|
public function setWebhookState ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ Intent_WebhookState :: class ) ; $ this -> webhook_state = $ var ; return $ this ; }
|
Optional . Indicates whether webhooks are enabled for the intent .
|
2,799
|
public function setEvents ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: STRING ) ; $ this -> events = $ arr ; return $ this ; }
|
Optional . The collection of event names that trigger the intent . If the collection of input contexts is not empty all of the contexts must be present in the active user session for an event to trigger this intent .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.