idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
2,000 | public function datasets ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; return new ItemIterator ( new PageIterator ( function ( array $ dataset ) { return new Dataset ( $ this -> connection , $ dataset [ 'datasetReference' ] [ 'datasetId' ] , $ this -> projectId , $ this -> mapper , $ dataset ) ; } , [ $ this -> connection , 'listDatasets' ] , $ options + [ 'projectId' => $ this -> projectId ] , [ 'itemsKey' => 'datasets' , 'resultLimit' => $ resultLimit ] ) ) ; } | Fetches datasets in the project . |
2,001 | public function getServiceAccount ( array $ options = [ ] ) { $ resp = $ this -> connection -> getServiceAccount ( $ options + [ 'projectId' => $ this -> projectId ] ) ; return $ resp [ 'email' ] ; } | Get a service account for the KMS integration . |
2,002 | public function setColors ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ ColorInfo :: class ) ; $ this -> colors = $ arr ; return $ this ; } | RGB color values with their score and pixel fraction . |
2,003 | public function setPropertyFilter ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Datastore \ V1 \ PropertyFilter :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; } | A filter on a property . |
2,004 | public function setWorkExperienceFilter ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ WorkExperienceFilter :: class ) ; $ this -> work_experience_filter = $ arr ; return $ this ; } | Optional . Work experience filter specifies the total working experience of profiles to match on . If a work experience filter isn t specified profiles with any professional experience are retrieved . If multiple work experience filters are specified profiles that match any work experience filters are retrieved . For example search for profiles with 10 years of work experience . |
2,005 | public function setApplicationDateFilters ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ ApplicationDateFilter :: class ) ; $ this -> application_date_filters = $ arr ; return $ this ; } | Optional . The application date filters specify application date ranges to match on . |
2,006 | public function setApplicationOutcomeNotesFilters ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ ApplicationOutcomeNotesFilter :: class ) ; $ this -> application_outcome_notes_filters = $ arr ; return $ this ; } | Optional . The application outcome notes filters specify the notes for the outcome of the job application . |
2,007 | public function setApplicationLastStageFilters ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ ApplicationLastStageFilter :: class ) ; $ this -> application_last_stage_filters = $ arr ; return $ this ; } | Optional . The application last stage filters specify the last stage of job application . |
2,008 | public function setApplicationJobFilters ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ ApplicationJobFilter :: class ) ; $ this -> application_job_filters = $ arr ; return $ this ; } | Optional . The application job filters specify the job applied for in the application . |
2,009 | public function setApplicationStatusFilters ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Talent \ V4beta1 \ ApplicationStatusFilter :: class ) ; $ this -> application_status_filters = $ arr ; return $ this ; } | Optional . The application status filters specify the status of job application . |
2,010 | public function setAnnotation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Trace \ V2 \ Span_TimeEvent_Annotation :: class ) ; $ this -> writeOneof ( 2 , $ var ) ; return $ this ; } | Text annotation with a set of attributes . |
2,011 | public function setNotificationChannels ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Monitoring \ V3 \ NotificationChannel :: class ) ; $ this -> notification_channels = $ arr ; return $ this ; } | The notification channels defined for the specified project . |
2,012 | public function setFixedLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dlp \ V2 \ Likelihood :: class ) ; $ this -> writeOneof ( 1 , $ var ) ; return $ this ; } | Set the likelihood of a finding to a fixed value . |
2,013 | public static function databaseName ( $ project , $ instance , $ database ) { return self :: getDatabaseNameTemplate ( ) -> render ( [ 'project' => $ project , 'instance' => $ instance , 'database' => $ database , ] ) ; } | Formats a string containing the fully - qualified path to represent a database resource . |
2,014 | public static function sessionName ( $ project , $ instance , $ database , $ session ) { return self :: getSessionNameTemplate ( ) -> render ( [ 'project' => $ project , 'instance' => $ instance , 'database' => $ database , 'session' => $ session , ] ) ; } | Formats a string containing the fully - qualified path to represent a session resource . |
2,015 | public function setMultiClusterRoutingUseAny ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Bigtable \ Admin \ V2 \ AppProfile_MultiClusterRoutingUseAny :: class ) ; $ this -> writeOneof ( 5 , $ var ) ; return $ this ; } | Use a multi - cluster routing policy that may pick any cluster . |
2,016 | public function setSingleClusterRouting ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Bigtable \ Admin \ V2 \ AppProfile_SingleClusterRouting :: class ) ; $ this -> writeOneof ( 6 , $ var ) ; return $ this ; } | Use a single - cluster routing policy . |
2,017 | public function allocateId ( Key $ key , array $ options = [ ] ) { $ res = $ this -> allocateIds ( [ $ key ] , $ options ) ; return $ res [ 0 ] ; } | Allocates an available ID to a given incomplete key |
2,018 | public function transaction ( array $ options = [ ] ) { $ transaction = $ this -> operation -> beginTransaction ( [ 'readWrite' => $ this -> pluck ( 'transactionOptions' , $ options , false ) ? : ( object ) [ ] ] , $ options ) ; return new Transaction ( $ this -> operation , $ this -> projectId , $ transaction ) ; } | Create a Transaction . |
2,019 | public function readOnlyTransaction ( array $ options = [ ] ) { $ transaction = $ this -> operation -> beginTransaction ( [ 'readOnly' => $ this -> pluck ( 'transactionOptions' , $ options , false ) ? : ( object ) [ ] ] , $ options ) ; return new ReadOnlyTransaction ( $ this -> operation , $ this -> projectId , $ transaction ) ; } | Create a Read - Only Transaction . |
2,020 | public function insert ( EntityInterface $ entity , array $ options = [ ] ) { $ res = $ this -> insertBatch ( [ $ entity ] , $ options ) ; return $ this -> parseSingleMutationResult ( $ res ) ; } | Insert an entity |
2,021 | public function update ( EntityInterface $ entity , array $ options = [ ] ) { $ res = $ this -> updateBatch ( [ $ entity ] , $ options ) ; return $ this -> parseSingleMutationResult ( $ res ) ; } | Update an entity |
2,022 | public function upsert ( EntityInterface $ entity , array $ options = [ ] ) { $ res = $ this -> upsertBatch ( [ $ entity ] , $ options ) ; return $ this -> parseSingleMutationResult ( $ res ) ; } | Upsert an entity |
2,023 | public function deleteBatch ( array $ keys , array $ options = [ ] ) { $ options += [ 'baseVersion' => null ] ; $ mutations = [ ] ; foreach ( $ keys as $ key ) { $ mutations [ ] = $ this -> operation -> mutation ( 'delete' , $ key , Key :: class , $ options [ 'baseVersion' ] ) ; } return $ this -> operation -> commit ( $ mutations , $ options ) ; } | Delete multiple entities |
2,024 | public function lookup ( Key $ key , array $ options = [ ] ) { $ res = $ this -> lookupBatch ( [ $ key ] , $ options ) ; return ( isset ( $ res [ 'found' ] [ 0 ] ) ) ? $ res [ 'found' ] [ 0 ] : null ; } | Retrieve an entity from the datastore |
2,025 | private function parseSingleMutationResult ( array $ res ) { $ mutationResult = $ res [ 'mutationResults' ] [ 0 ] ; if ( isset ( $ mutationResult [ 'conflictDetected' ] ) && $ mutationResult [ 'conflictDetected' ] ) { throw new DomainException ( 'A conflict was detected in the mutation. ' . 'The operation failed.' ) ; } return ( string ) $ mutationResult [ 'version' ] ; } | Handle mutation results |
2,026 | public function setInstances ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Bigtable \ Admin \ V2 \ Instance :: class ) ; $ this -> instances = $ arr ; return $ this ; } | The list of requested instances . |
2,027 | public function projection ( $ properties ) { if ( ! is_array ( $ properties ) ) { $ properties = [ $ properties ] ; } foreach ( $ properties as $ property ) { $ this -> query [ 'projection' ] [ ] = [ 'property' => $ this -> propertyName ( $ property ) ] ; } return $ this ; } | Set the Query Projection . |
2,028 | public function kind ( $ kinds ) { if ( ! is_array ( $ kinds ) ) { $ kinds = [ $ kinds ] ; } foreach ( $ kinds as $ kind ) { $ this -> query [ 'kind' ] [ ] = $ this -> propertyName ( $ kind ) ; } return $ this ; } | Set the Kind to query . |
2,029 | public function filter ( $ property , $ operator , $ value ) { if ( ! isset ( $ this -> query [ 'filter' ] ) || ! isset ( $ this -> query [ 'filter' ] [ 'compositeFilter' ] ) ) { $ this -> initializeFilter ( ) ; } $ this -> query [ 'filter' ] [ 'compositeFilter' ] [ 'filters' ] [ ] = [ 'propertyFilter' => [ 'property' => $ this -> propertyName ( $ property ) , 'value' => $ this -> entityMapper -> valueObject ( $ value ) , 'op' => $ this -> mapOperator ( $ operator ) ] ] ; return $ this ; } | Add a filter to the query . |
2,030 | public function order ( $ property , $ direction = self :: ORDER_DEFAULT ) { $ this -> query [ 'order' ] [ ] = [ 'property' => $ this -> propertyName ( $ property ) , 'direction' => $ direction ] ; return $ this ; } | Specify an order for the query . |
2,031 | public function distinctOn ( $ property ) { if ( ! is_array ( $ property ) ) { $ property = [ $ property ] ; } foreach ( $ property as $ prop ) { $ this -> query [ 'distinctOn' ] [ ] = $ this -> propertyName ( $ prop ) ; } return $ this ; } | The properties to make distinct . |
2,032 | private function mapOperator ( $ operator ) { if ( array_key_exists ( $ operator , $ this -> shortOperators ) ) { $ operator = $ this -> shortOperators [ $ operator ] ; } if ( ! in_array ( $ operator , $ this -> allowedOperators ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid operator `%s` given. Valid operators are %s.' , $ operator , implode ( ', ' , $ this -> allowedOperators ) ) ) ; } return $ operator ; } | Convert given operator to API - compatible operator . |
2,033 | public function setJobs ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Scheduler \ V1 \ Job :: class ) ; $ this -> jobs = $ arr ; return $ this ; } | The list of jobs . |
2,034 | public function setMutations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Spanner \ V1 \ Mutation :: class ) ; $ this -> mutations = $ arr ; return $ this ; } | The mutations to be executed when this transaction commits . All mutations are applied atomically in the order they appear in this list . |
2,035 | public function setAudioEncoding ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ OutputAudioEncoding :: class ) ; $ this -> audio_encoding = $ var ; return $ this ; } | Required . Audio encoding of the synthesized audio content . |
2,036 | public function setSynthesizeSpeechConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ SynthesizeSpeechConfig :: class ) ; $ this -> synthesize_speech_config = $ var ; return $ this ; } | Optional . Configuration of how speech should be synthesized . |
2,037 | public function setClassificationType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ AutoMl \ V1beta1 \ ClassificationType :: class ) ; $ this -> classification_type = $ var ; return $ this ; } | Required . Type of the classification problem . |
2,038 | public function setDetectedLanguages ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ TextAnnotation \ DetectedLanguage :: class ) ; $ this -> detected_languages = $ arr ; return $ this ; } | A list of detected languages together with confidence . |
2,039 | public function setDetectedBreak ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ TextAnnotation_DetectedBreak :: class ) ; $ this -> detected_break = $ var ; return $ this ; } | Detected start or end of a text segment . |
2,040 | public function setLandmarkAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ EntityAnnotation :: class ) ; $ this -> landmark_annotations = $ arr ; return $ this ; } | If present landmark detection has completed successfully . |
2,041 | public function setLogoAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ EntityAnnotation :: class ) ; $ this -> logo_annotations = $ arr ; return $ this ; } | If present logo detection has completed successfully . |
2,042 | public function setLabelAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ EntityAnnotation :: class ) ; $ this -> label_annotations = $ arr ; return $ this ; } | If present label detection has completed successfully . |
2,043 | public function setLocalizedObjectAnnotations ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ LocalizedObjectAnnotation :: class ) ; $ this -> localized_object_annotations = $ arr ; return $ this ; } | If present localized object detection has completed successfully . This will be sorted descending by confidence score . |
2,044 | public function setSafeSearchAnnotation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ SafeSearchAnnotation :: class ) ; $ this -> safe_search_annotation = $ var ; return $ this ; } | If present safe - search annotation has completed successfully . |
2,045 | public function setImagePropertiesAnnotation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ ImageProperties :: class ) ; $ this -> image_properties_annotation = $ var ; return $ this ; } | If present image properties were extracted successfully . |
2,046 | public function setCropHintsAnnotation ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ CropHintsAnnotation :: class ) ; $ this -> crop_hints_annotation = $ var ; return $ this ; } | If present crop hints have completed successfully . |
2,047 | public function setWebDetection ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ WebDetection :: class ) ; $ this -> web_detection = $ var ; return $ this ; } | If present web detection has completed successfully . |
2,048 | public function setProductSearchResults ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ ProductSearchResults :: class ) ; $ this -> product_search_results = $ var ; return $ this ; } | If present product search has completed successfully . |
2,049 | public function setContext ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ ImageAnnotationContext :: class ) ; $ this -> context = $ var ; return $ this ; } | If present contextual information is needed to understand where this image comes from . |
2,050 | public function open ( $ savePath , $ sessionName ) { $ this -> kind = $ sessionName ; if ( preg_match ( self :: NAMESPACE_ALLOWED_PATTERN , $ savePath ) !== 1 || preg_match ( self :: NAMESPACE_RESERVED_PATTERN , $ savePath ) === 1 ) { throw new InvalidArgumentException ( sprintf ( 'The given save_path "%s" not allowed' , $ savePath ) ) ; } $ this -> namespaceId = $ savePath ; $ this -> transaction = $ this -> datastore -> transaction ( ) ; return true ; } | Start a session by creating a transaction for the later write . |
2,051 | public function read ( $ id ) { try { $ key = $ this -> datastore -> key ( $ this -> kind , $ id , [ 'namespaceId' => $ this -> namespaceId ] ) ; $ entity = $ this -> transaction -> lookup ( $ key ) ; if ( $ entity !== null && isset ( $ entity [ 'data' ] ) ) { return $ entity [ 'data' ] ; } } catch ( Exception $ e ) { trigger_error ( sprintf ( 'Datastore lookup failed: %s' , $ e -> getMessage ( ) ) , E_USER_WARNING ) ; } return '' ; } | Read the session data from Cloud Datastore . |
2,052 | public function write ( $ id , $ data ) { try { $ key = $ this -> datastore -> key ( $ this -> kind , $ id , [ 'namespaceId' => $ this -> namespaceId ] ) ; $ entity = $ this -> datastore -> entity ( $ key , [ 'data' => $ data , 't' => time ( ) ] , $ this -> options [ 'entityOptions' ] ) ; $ this -> transaction -> upsert ( $ entity ) ; $ this -> transaction -> commit ( ) ; } catch ( Exception $ e ) { trigger_error ( sprintf ( 'Datastore upsert failed: %s' , $ e -> getMessage ( ) ) , E_USER_WARNING ) ; return false ; } return true ; } | Write the session data to Cloud Datastore . |
2,053 | public function destroy ( $ id ) { try { $ key = $ this -> datastore -> key ( $ this -> kind , $ id , [ 'namespaceId' => $ this -> namespaceId ] ) ; $ this -> transaction -> delete ( $ key ) ; $ this -> transaction -> commit ( ) ; } catch ( Exception $ e ) { trigger_error ( sprintf ( 'Datastore delete failed: %s' , $ e -> getMessage ( ) ) , E_USER_WARNING ) ; return false ; } return true ; } | Delete the session data from Cloud Datastore . |
2,054 | public function gc ( $ maxlifetime ) { if ( $ this -> gcLimit === 0 ) { return true ; } try { $ query = $ this -> datastore -> query ( ) -> kind ( $ this -> kind ) -> filter ( 't' , '<' , time ( ) - $ maxlifetime ) -> order ( 't' ) -> keysOnly ( ) -> limit ( $ this -> gcLimit ) ; $ result = $ this -> datastore -> runQuery ( $ query , [ 'namespaceId' => $ this -> namespaceId ] ) ; $ keys = [ ] ; foreach ( $ result as $ e ) { $ keys [ ] = $ e -> key ( ) ; } if ( ! empty ( $ keys ) ) { $ this -> datastore -> deleteBatch ( $ keys ) ; } } catch ( Exception $ e ) { trigger_error ( sprintf ( 'Session gc failed: %s' , $ e -> getMessage ( ) ) , E_USER_WARNING ) ; return false ; } return true ; } | Delete the old session data from Cloud Datastore . |
2,055 | public function setVertices ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ Vertex :: class ) ; $ this -> vertices = $ arr ; return $ this ; } | The bounding polygon vertices . |
2,056 | public function setNormalizedVertices ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ NormalizedVertex :: class ) ; $ this -> normalized_vertices = $ arr ; return $ this ; } | The bounding polygon normalized vertices . |
2,057 | public function setLandmarks ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ FaceAnnotation \ Landmark :: class ) ; $ this -> landmarks = $ arr ; return $ this ; } | Detected face landmarks . |
2,058 | public function setJoyLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ Likelihood :: class ) ; $ this -> joy_likelihood = $ var ; return $ this ; } | Joy likelihood . |
2,059 | public function setSorrowLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ Likelihood :: class ) ; $ this -> sorrow_likelihood = $ var ; return $ this ; } | Sorrow likelihood . |
2,060 | public function setAngerLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ Likelihood :: class ) ; $ this -> anger_likelihood = $ var ; return $ this ; } | Anger likelihood . |
2,061 | public function setSurpriseLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ Likelihood :: class ) ; $ this -> surprise_likelihood = $ var ; return $ this ; } | Surprise likelihood . |
2,062 | public function setUnderExposedLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ Likelihood :: class ) ; $ this -> under_exposed_likelihood = $ var ; return $ this ; } | Under - exposed likelihood . |
2,063 | public function setBlurredLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ Likelihood :: class ) ; $ this -> blurred_likelihood = $ var ; return $ this ; } | Blurred likelihood . |
2,064 | public function setHeadwearLikelihood ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Vision \ V1 \ Likelihood :: class ) ; $ this -> headwear_likelihood = $ var ; return $ this ; } | Headwear likelihood . |
2,065 | public function setAssets ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Asset \ V1 \ TemporalAsset :: class ) ; $ this -> assets = $ arr ; return $ this ; } | A list of assets with valid time windows . |
2,066 | public function rows ( $ format = self :: RETURN_ASSOCIATIVE ) { $ bufferedResults = [ ] ; $ call = $ this -> call ; $ generator = null ; $ shouldRetry = false ; $ backoff = new ExponentialBackoff ( $ this -> retries , function ( $ ex ) { if ( $ ex instanceof ServiceException ) { return $ ex -> getCode ( ) === Grpc \ STATUS_UNAVAILABLE ; } return false ; } ) ; $ valid = $ backoff -> execute ( function ( ) use ( $ call , & $ generator ) { $ generator = $ call ( ) ; return $ generator -> valid ( ) ; } ) ; while ( $ valid ) { try { $ result = $ generator -> current ( ) ; $ bufferedResults [ ] = $ result ; $ this -> setResultData ( $ result , $ format ) ; $ empty = false ; if ( ! isset ( $ result [ 'values' ] ) || $ this -> columnCount === 0 ) { $ empty = true ; } $ hasResumeToken = $ this -> isSetAndTrue ( $ result , 'resumeToken' ) ; if ( $ hasResumeToken || count ( $ bufferedResults ) >= self :: BUFFER_RESULT_LIMIT ) { $ chunkedResult = null ; if ( ! $ empty ) { list ( $ yieldableRows , $ chunkedResult ) = $ this -> parseRowsFromBufferedResults ( $ bufferedResults ) ; foreach ( $ yieldableRows as $ row ) { yield $ this -> mapper -> decodeValues ( $ this -> columns , $ row , $ format ) ; } } $ bufferedResults = [ ] ; $ shouldRetry = $ hasResumeToken ; if ( $ chunkedResult ) { $ bufferedResults [ ] = $ chunkedResult ; } } $ generator -> next ( ) ; $ valid = $ generator -> valid ( ) ; } catch ( ServiceException $ ex ) { if ( $ shouldRetry && $ ex -> getCode ( ) === Grpc \ STATUS_UNAVAILABLE ) { $ generator = $ backoff -> execute ( $ call , [ $ this -> resumeToken ] ) ; $ bufferedResults = [ ] ; continue ; } throw $ ex ; } } if ( $ bufferedResults ) { list ( $ yieldableRows , $ chunkedResult ) = $ this -> parseRowsFromBufferedResults ( $ bufferedResults ) ; foreach ( $ yieldableRows as $ row ) { yield $ this -> mapper -> decodeValues ( $ this -> columns , $ row , $ format ) ; } } } | Return the formatted and decoded rows . If the stream is interrupted and a resume token is available attempts will be made on your behalf to resume . |
2,067 | private function mergeValues ( array $ set1 , array $ set2 ) { if ( empty ( $ set2 ) ) { return $ set1 ; } $ lastItemSet1 = array_pop ( $ set1 ) ; $ firstItemSet2 = array_shift ( $ set2 ) ; $ item = $ firstItemSet2 ; if ( is_string ( $ lastItemSet1 ) && is_string ( $ firstItemSet2 ) ) { $ item = $ lastItemSet1 . $ firstItemSet2 ; } elseif ( is_array ( $ lastItemSet1 ) ) { $ item = $ this -> mergeValues ( $ lastItemSet1 , $ firstItemSet2 ) ; } else { array_push ( $ set1 , $ lastItemSet1 ) ; } array_push ( $ set1 , $ item ) ; return array_merge ( $ set1 , $ set2 ) ; } | Merge result set values together . |
2,068 | public function setKind ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ DevTools \ Source \ V1 \ AliasContext_Kind :: class ) ; $ this -> kind = $ var ; return $ this ; } | The alias kind . |
2,069 | public function setKind ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ EntityType_Kind :: class ) ; $ this -> kind = $ var ; return $ this ; } | Required . Indicates the kind of entity type . |
2,070 | public function setAutoExpansionMode ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Dialogflow \ V2 \ EntityType_AutoExpansionMode :: class ) ; $ this -> auto_expansion_mode = $ var ; return $ this ; } | Optional . Indicates whether the entity type can be automatically expanded . |
2,071 | public function setInstanceConfigs ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Spanner \ Admin \ Instance \ V1 \ InstanceConfig :: class ) ; $ this -> instance_configs = $ arr ; return $ this ; } | The list of requested instance configurations . |
2,072 | public function setExclusions ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Logging \ V2 \ LogExclusion :: class ) ; $ this -> exclusions = $ arr ; return $ this ; } | A list of exclusions . |
2,073 | public function setMessage ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ PubSub \ V1 \ PubsubMessage :: class ) ; $ this -> message = $ var ; return $ this ; } | The message . |
2,074 | public function setReferenceImages ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Vision \ V1 \ ReferenceImage :: class ) ; $ this -> reference_images = $ arr ; return $ this ; } | The list of reference_images that are imported successfully . |
2,075 | public function setStorageConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ StorageConfig :: class ) ; $ this -> storage_config = $ var ; return $ this ; } | The data to scan . |
2,076 | public function setInspectConfig ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ InspectConfig :: class ) ; $ this -> inspect_config = $ var ; return $ this ; } | How and what to scan for . |
2,077 | public function setActions ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dlp \ V2 \ Action :: class ) ; $ this -> actions = $ arr ; return $ this ; } | Actions to execute at the completion of the job . Are executed in the order provided . |
2,078 | public function registerJob ( $ identifier , $ func , array $ options = [ ] ) { if ( $ func instanceof \ Closure ) { throw new \ InvalidArgumentException ( 'Closure is not allowed' ) ; } $ result = $ this -> configStorage -> lock ( ) ; if ( $ result === false ) { return false ; } $ this -> config = $ this -> configStorage -> load ( ) ; $ this -> config -> registerJob ( $ identifier , function ( $ id ) use ( $ identifier , $ func , $ options ) { return new BatchJob ( $ identifier , $ func , $ id , $ options ) ; } ) ; try { $ result = $ this -> configStorage -> save ( $ this -> config ) ; } finally { $ this -> configStorage -> unlock ( ) ; } return $ result ; } | Register a job for batch execution . |
2,079 | public function submitItem ( $ identifier , $ item ) { $ job = $ this -> getJobFromId ( $ identifier ) ; if ( $ job === null ) { throw new \ RuntimeException ( "The identifier does not exist: $identifier" ) ; } $ idNum = $ job -> id ( ) ; return $ this -> processor -> submit ( $ item , $ idNum ) ; } | Submit an item . |
2,080 | public function loadConfig ( ) { $ result = $ this -> configStorage -> lock ( ) ; if ( $ result === false ) { throw new \ RuntimeException ( 'Failed to lock the configStorage' ) ; } try { $ result = $ this -> configStorage -> load ( ) ; } catch ( \ RuntimeException $ e ) { $ this -> configStorage -> clear ( ) ; throw $ e ; } finally { $ this -> configStorage -> unlock ( ) ; } $ this -> config = $ result ; return true ; } | Load the config from the storage . |
2,081 | public function createAudioStreamFromResource ( $ resource , $ chunkSize = 32000 ) { while ( ! feof ( $ resource ) ) { $ chunk = fread ( $ resource , $ chunkSize ) ; if ( strlen ( $ chunk ) > 0 ) { yield $ chunk ; } } } | Convert a PHP resource instance into an iterable of data chunks . |
2,082 | public function setInfoType ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ InfoType :: class ) ; $ this -> writeOneof ( 1 , $ var ) ; return $ this ; } | Only one per info_type should be provided per request . If not specified and redact_all_text is false the DLP API will redact all text that it matches against all info_types that are found but not specified in another ImageRedactionConfig . |
2,083 | public function setRedactionColor ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Dlp \ V2 \ Color :: class ) ; $ this -> redaction_color = $ var ; return $ this ; } | The color to use when redacting content from an image . If not specified the default is black . |
2,084 | public function register ( array $ options = [ ] ) { $ resp = $ this -> connection -> registerDebuggee ( [ 'debuggee' => $ this -> info ( ) ] + $ options ) ; if ( array_key_exists ( 'debuggee' , $ resp ) ) { $ this -> id = $ resp [ 'debuggee' ] [ 'id' ] ; return true ; } return false ; } | Register this debuggee with the Stackdriver backend . |
2,085 | public function breakpointsWithWaitToken ( array $ options = [ ] ) { $ ret = $ this -> connection -> listBreakpoints ( [ 'debuggeeId' => $ this -> id ] + $ options ) ; if ( array_key_exists ( 'breakpoints' , $ ret ) ) { $ ret [ 'breakpoints' ] = array_map ( function ( $ breakpointData ) { return new Breakpoint ( $ breakpointData ) ; } , $ ret [ 'breakpoints' ] ) ; } else { $ ret [ 'breakpoints' ] = [ ] ; } return $ ret ; } | Fetch the list of breakpoints this debugee should try to handle and a wait token for the next request . The return value is an associative array with keys of breakpoints and nextWaitToken . |
2,086 | public function updateBreakpoint ( Breakpoint $ breakpoint , array $ options = [ ] ) { $ this -> connection -> updateBreakpoint ( [ 'debuggeeId' => $ this -> id , 'id' => $ breakpoint -> id ( ) , 'breakpoint' => $ breakpoint -> info ( ) ] + $ options ) ; } | Update the provided modified breakpoint . |
2,087 | public function setBreakpoint ( $ path , $ line , array $ options = [ ] ) { $ resp = $ this -> connection -> setBreakpoint ( [ 'debuggeeId' => $ this -> id , 'location' => [ 'path' => $ path , 'line' => $ line ] ] + $ options ) ; return new Breakpoint ( $ resp [ 'breakpoint' ] ) ; } | Set a breakpoint for this debuggee . |
2,088 | public function updateBreakpointBatch ( array $ breakpoints , array $ options = [ ] ) { foreach ( $ breakpoints as $ breakpoint ) { $ this -> updateBreakpoint ( $ breakpoint , $ options ) ; } } | Update multiple breakpoints . |
2,089 | private function handleResponse ( $ response ) { if ( $ response instanceof PagedListResponse || $ response instanceof GaxPagedListResponse ) { $ response = $ response -> getPage ( ) -> getResponseObject ( ) ; } if ( $ response instanceof Message ) { return $ this -> serializer -> encodeMessage ( $ response ) ; } if ( $ response instanceof OperationResponse || $ response instanceof GaxOperationResponse ) { return $ response ; } if ( $ response instanceof ServerStream || $ response instanceof GaxServerStream ) { return $ this -> handleStream ( $ response ) ; } return null ; } | Serializes a gRPC response . |
2,090 | private function handleStream ( $ response ) { try { foreach ( $ response -> readAll ( ) as $ count => $ result ) { $ res = $ this -> serializer -> encodeMessage ( $ result ) ; yield $ res ; } } catch ( \ Exception $ ex ) { throw $ this -> convertToGoogleException ( $ ex ) ; } } | Handles a streaming response . |
2,091 | private function convertToGoogleException ( $ ex ) { switch ( $ ex -> getCode ( ) ) { case Code :: INVALID_ARGUMENT : $ exception = Exception \ BadRequestException :: class ; break ; case Code :: NOT_FOUND : case Code :: UNIMPLEMENTED : $ exception = Exception \ NotFoundException :: class ; break ; case Code :: ALREADY_EXISTS : $ exception = Exception \ ConflictException :: class ; break ; case Code :: FAILED_PRECONDITION : $ exception = Exception \ FailedPreconditionException :: class ; break ; case Code :: UNKNOWN : $ exception = Exception \ ServerException :: class ; break ; case Code :: INTERNAL : $ exception = Exception \ ServerException :: class ; break ; case Code :: ABORTED : $ exception = Exception \ AbortedException :: class ; break ; case Code :: DEADLINE_EXCEEDED : $ exception = Exception \ DeadlineExceededException :: class ; break ; default : $ exception = Exception \ ServiceException :: class ; break ; } $ metadata = [ ] ; if ( $ ex -> getMetadata ( ) ) { foreach ( $ ex -> getMetadata ( ) as $ type => $ binaryValue ) { if ( ! isset ( $ this -> metadataTypes [ $ type ] ) ) { continue ; } $ metadataElement = new $ this -> metadataTypes [ $ type ] ; $ metadataElement -> mergeFromString ( $ binaryValue [ 0 ] ) ; $ metadata [ ] = $ this -> serializer -> encodeMessage ( $ metadataElement ) ; } } return new $ exception ( $ ex -> getMessage ( ) , $ ex -> getCode ( ) , $ ex , $ metadata ) ; } | Convert a ApiCore exception to a Google Exception . |
2,092 | public function setLatLongRect ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ LatLongRect :: class ) ; $ this -> lat_long_rect = $ var ; return $ this ; } | Not used . |
2,093 | public function setCropHintsParams ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ CropHintsParams :: class ) ; $ this -> crop_hints_params = $ var ; return $ this ; } | Parameters for crop hints annotation request . |
2,094 | public function setProductSearchParams ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ ProductSearchParams :: class ) ; $ this -> product_search_params = $ var ; return $ this ; } | Parameters for product search . |
2,095 | public function setWebDetectionParams ( $ var ) { GPBUtil :: checkMessage ( $ var , \ Google \ Cloud \ Vision \ V1 \ WebDetectionParams :: class ) ; $ this -> web_detection_params = $ var ; return $ this ; } | Parameters for web detection . |
2,096 | public function setEntityResultType ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Datastore \ V1 \ EntityResult_ResultType :: class ) ; $ this -> entity_result_type = $ var ; return $ this ; } | The result type for every entity in entity_results . |
2,097 | public function setEntityResults ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Datastore \ V1 \ EntityResult :: class ) ; $ this -> entity_results = $ arr ; return $ this ; } | The results for this batch . |
2,098 | public function setMoreResults ( $ var ) { GPBUtil :: checkEnum ( $ var , \ Google \ Cloud \ Datastore \ V1 \ QueryResultBatch_MoreResultsType :: class ) ; $ this -> more_results = $ var ; return $ this ; } | The state of the query after the current batch . |
2,099 | public function setInfoTypeStats ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ Dlp \ V2 \ InfoTypeStats :: class ) ; $ this -> info_type_stats = $ arr ; return $ this ; } | Statistics of how many instances of each info type were found during inspect job . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.