import * as gax from 'google-gax' ; import { Callback , CallOptions , Descriptors , ClientOptions , LROperation , PaginationCallback , GaxCall , } from 'google-gax' ; import { Transform } from 'stream' ; import { RequestType } from 'google-gax/build/src/apitypes' ; import * as protos from '../../protos/protos' ; import jsonProtos = require ( '../../protos/protos.json' ) ; /**
 * Client JSON configuration object, loaded from
 * `src/v1/asset_service_client_config.json`.
 * This file defines retry strategy and timeouts for all API methods in this library.
 */ import * as gapicConfig from './asset_service_client_config.json' ; import { operationsProtos } from 'google-gax' ; const version = require ( '../../../package.json' ) . version ; class memberof export class AssetServiceClient { private _terminated = false ; private _opts : ClientOptions ; private _providedCustomServicePath : boolean ; private _gaxModule : typeof gax | typeof gax . fallback ; private _gaxGrpc : gax . GrpcClient | gax . fallback . GrpcClient ; private _protos : { } ; private _defaults : { [ method ] : gax . CallSettings ; } ; auth : gax . GoogleAuth ; descriptors : Descriptors = { page : { } , stream : { } , longrunning : { } , batching : { } , } ; warn : ( code : string , message : string , warnType ? : string ) => void ; innerApiCalls : { [ name ] : Function ; } ; pathTemplates : { [ name ] : gax . PathTemplate ; } ; operationsClient : gax . OperationsClient ; assetServiceStub ? : Promise < { [ name ] : Function ; } > ; param options param options . credentials param { string } options . credentials . client_email param { string } options . credentials . private_key param { string } options . email param { string } options . keyFilename param { number } options . port param { string } options . projectId - The project ID from the Google
     *     Developer's Console, e.g. 'grape-spaceship-123'. We will also check
     *     the environment variable GCLOUD_PROJECT for your project ID. If your
     *     app is running in an environment which supports
     *      https ,
     *     your project ID will be detected automatically.
     *  param { string } options . apiEndpoint param { gax . ClientConfig } options . clientConfig - Client configuration override.
     *     Follows the structure of  gapicConfig .
     *  param { boolean } options . fallback constructor ( opts ? ) { const staticMembers = this . constructor as typeof AssetServiceClient ; const servicePath = opts ?. servicePath || opts ?. apiEndpoint || staticMembers . servicePath ; this . _providedCustomServicePath = ! ! ( opts ?. servicePath || opts ?. apiEndpoint ) ; const port = opts ?. port || staticMembers . port ; const clientConfig = opts ?. clientConfig ?? { } ; const fallback = opts ?. fallback ?? ( typeof window !== 'undefined' && typeof window ?. fetch === 'function' ) ; opts = Object . assign ( { servicePath , port , clientConfig , fallback } , opts ) ; if ( servicePath !== staticMembers . servicePath && ! ( 'scopes' in opts ) ) { opts [ 'scopes' ] = staticMembers . scopes ; } this . _gaxModule = opts . fallback ? gax . fallback : gax ; this . _gaxGrpc = new this . _gaxModule . GrpcClient ( opts ) ; this . _opts = opts ; this . auth = this . _gaxGrpc . auth as gax . GoogleAuth ; this . auth . useJWTAccessWithScope = true ; this . auth . defaultServicePath = staticMembers . servicePath ; if ( servicePath === staticMembers . servicePath ) { this . auth . defaultScopes = staticMembers . scopes ; } const clientHeader = [ `gax/${ this . _gaxModule . version }` , `gapic/${ version }` ] ; if ( typeof process !== 'undefined' && 'versions' in process ) { clientHeader . push ( `gl-node/${ process . versions . node }` ) ; } else { clientHeader . push ( `gl-web/${ this . _gaxModule . version }` ) ; } if ( ! opts . fallback ) { clientHeader . push ( `grpc/${ this . _gaxGrpc . grpcVersion }` ) ; } else if ( opts . fallback === 'rest' ) { clientHeader . push ( `rest/${ this . _gaxGrpc . grpcVersion }` ) ; } if ( opts . libName && opts . libVersion ) { clientHeader . push ( `${ opts . libName }/${ opts . libVersion }` ) ; } this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ; this . pathTemplates = { accessLevelPathTemplate : new this . _gaxModule . PathTemplate ( 'accessPolicies/{access_policy}/accessLevels/{access_level}' ) , accessPolicyPathTemplate : new this . _gaxModule . PathTemplate ( 'accessPolicies/{access_policy}' ) , folderFeedPathTemplate : new this . _gaxModule . PathTemplate ( 'folders/{folder}/feeds/{feed}' ) , inventoryPathTemplate : new this . _gaxModule . PathTemplate ( 'projects/{project}/locations/{location}/instances/{instance}/inventory' ) , organizationFeedPathTemplate : new this . _gaxModule . PathTemplate ( 'organizations/{organization}/feeds/{feed}' ) , projectFeedPathTemplate : new this . _gaxModule . PathTemplate ( 'projects/{project}/feeds/{feed}' ) , servicePerimeterPathTemplate : new this . _gaxModule . PathTemplate ( 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' ) , } ; this . descriptors . page = { listAssets : new this . _gaxModule . PageDescriptor ( 'pageToken' , 'nextPageToken' , 'assets' ) , searchAllResources : new this . _gaxModule . PageDescriptor ( 'pageToken' , 'nextPageToken' , 'results' ) , searchAllIamPolicies : new this . _gaxModule . PageDescriptor ( 'pageToken' , 'nextPageToken' , 'results' ) , } ; const protoFilesRoot = this . _gaxModule . protobuf . Root . fromJSON ( jsonProtos ) ; this . operationsClient = this . _gaxModule . lro ( { auth : this . auth , grpc : 'grpc' in this . _gaxGrpc ? this . _gaxGrpc . grpc : undefined , } ) . operationsClient ( opts ) ; const exportAssetsResponse = protoFilesRoot . lookup ( '.google.cloud.asset.v1.ExportAssetsResponse' ) as gax . protobuf . Type ; const exportAssetsMetadata = protoFilesRoot . lookup ( '.google.cloud.asset.v1.ExportAssetsRequest' ) as gax . protobuf . Type ; const analyzeIamPolicyLongrunningResponse = protoFilesRoot . lookup ( '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse' ) as gax . protobuf . Type ; const analyzeIamPolicyLongrunningMetadata = protoFilesRoot . lookup ( '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata' ) as gax . protobuf . Type ; this . descriptors . longrunning = { exportAssets : new this . _gaxModule . LongrunningDescriptor ( this . operationsClient , exportAssetsResponse . decode . bind ( exportAssetsResponse ) , exportAssetsMetadata . decode . bind ( exportAssetsMetadata ) ) , analyzeIamPolicyLongrunning : new this . _gaxModule . LongrunningDescriptor ( this . operationsClient , analyzeIamPolicyLongrunningResponse . decode . bind ( analyzeIamPolicyLongrunningResponse ) , analyzeIamPolicyLongrunningMetadata . decode . bind ( analyzeIamPolicyLongrunningMetadata ) ) , } ; this . _defaults = this . _gaxGrpc . constructSettings ( 'google.cloud.asset.v1.AssetService' , gapicConfig as gax . ClientConfig , opts . clientConfig || { } , { 'x-goog-api-client' : clientHeader . join ( ' ' ) } ) ; this . innerApiCalls = { } ; this . warn = gax . warn ; } returns { Promise } initialize ( ) { if ( this . assetServiceStub ) { return this . assetServiceStub ; } this . assetServiceStub = this . _gaxGrpc . createStub ( this . _opts . fallback ? ( this . _protos as protobuf . Root ) . lookupService ( 'google.cloud.asset.v1.AssetService' ) : ( this . _protos as any ) . google . cloud . asset . v1 . AssetService , this . _opts , this . _providedCustomServicePath ) as Promise < { [ method ] : Function ; } > ; const assetServiceStubMethods = [ 'exportAssets' , 'listAssets' , 'batchGetAssetsHistory' , 'createFeed' , 'getFeed' , 'listFeeds' , 'updateFeed' , 'deleteFeed' , 'searchAllResources' , 'searchAllIamPolicies' , 'analyzeIamPolicy' , 'analyzeIamPolicyLongrunning' , 'analyzeMove' , ] ; for ( const methodName of assetServiceStubMethods ) { const callPromise = this . assetServiceStub . then ( stub => ( ... args ) => { if ( this . _terminated ) { return Promise . reject ( 'The client has already been closed.' ) ; } const func = stub [ methodName ] ; return func . apply ( stub , args ) ; } , ( err ) => ( ) => { throw err ; } ) ; const descriptor = this . descriptors . page [ methodName ] || this . descriptors . longrunning [ methodName ] || undefined ; const apiCall = this . _gaxModule . createApiCall ( callPromise , this . _defaults [ methodName ] , descriptor ) ; this . innerApiCalls [ methodName ] = apiCall ; } return this . assetServiceStub ; } returns { string } static get servicePath ( ) { return 'cloudasset.googleapis.com' ; } returns { string } static get apiEndpoint ( ) { return 'cloudasset.googleapis.com' ; } returns { number } static get port ( ) { return 443 ; } returns { string [ ] } static get scopes ( ) { return [ 'https://www.googleapis.com/auth/cloud-platform' ] ; } getProjectId ( ) ; getProjectId ( callback ) ; returns { Promise } getProjectId ( callback ? ) { if ( callback ) { this . auth . getProjectId ( callback ) ; return ; } return this . auth . getProjectId ( ) ; } param request param { string } request . parent param { string [ ] } request . assetNames param { google . cloud . asset . v1 . ContentType } request . contentType param { google . cloud . asset . v1 . TimeWindow } request . readTimeWindow param { string [ ] } request . relationshipTypes param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [BatchGetAssetsHistoryResponse] google . cloud . asset . v1 . BatchGetAssetsHistoryResponse .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example batchGetAssetsHistory ( request ? , options ? ) ; batchGetAssetsHistory ( request , options , callback ) ; batchGetAssetsHistory ( request , callback ) ; batchGetAssetsHistory ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { parent : request . parent || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . batchGetAssetsHistory ( request , options , callback ) ; } param request param { string } request . parent param { string } request . feedId param { google . cloud . asset . v1 . Feed } request . feed param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [Feed] google . cloud . asset . v1 . Feed .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example createFeed ( request ? , options ? ) ; createFeed ( request , options , callback ) ; createFeed ( request , callback ) ; createFeed ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { parent : request . parent || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . createFeed ( request , options , callback ) ; } param request param { string } request . name param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [Feed] google . cloud . asset . v1 . Feed .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example getFeed ( request ? , options ? ) ; getFeed ( request , options , callback ) ; getFeed ( request , callback ) ; getFeed ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { name : request . name || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . getFeed ( request , options , callback ) ; } param request param { string } request . parent param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [ListFeedsResponse] google . cloud . asset . v1 . ListFeedsResponse .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example listFeeds ( request ? , options ? ) ; listFeeds ( request , options , callback ) ; listFeeds ( request , callback ) ; listFeeds ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { parent : request . parent || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . listFeeds ( request , options , callback ) ; } param request param { google . cloud . asset . v1 . Feed } request . feed param { google . protobuf . FieldMask } request . updateMask param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [Feed] google . cloud . asset . v1 . Feed .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example updateFeed ( request ? , options ? ) ; updateFeed ( request , options , callback ) ; updateFeed ( request , callback ) ; updateFeed ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { 'feed.name' : request . feed ! . name || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . updateFeed ( request , options , callback ) ; } param request param { string } request . name param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [Empty] google . protobuf . Empty .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example deleteFeed ( request ? , options ? ) ; deleteFeed ( request , options , callback ) ; deleteFeed ( request , callback ) ; deleteFeed ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { name : request . name || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . deleteFeed ( request , options , callback ) ; } param request param { google . cloud . asset . v1 . IamPolicyAnalysisQuery } request . analysisQuery param { google . protobuf . Duration } request . executionTimeout param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [AnalyzeIamPolicyResponse] google . cloud . asset . v1 . AnalyzeIamPolicyResponse .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example analyzeIamPolicy ( request ? , options ? ) ; analyzeIamPolicy ( request , options , callback ) ; analyzeIamPolicy ( request , callback ) ; analyzeIamPolicy ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { 'analysis_query.scope' : request . analysisQuery ! . scope || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . analyzeIamPolicy ( request , options , callback ) ; } param request param { string } request . resource param { string } request . destinationParent param { google . cloud . asset . v1 . AnalyzeMoveRequest . AnalysisView } request . view param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is an object representing [AnalyzeMoveResponse] google . cloud . asset . v1 . AnalyzeMoveResponse .
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     *  example analyzeMove ( request ? , options ? ) ; analyzeMove ( request , options , callback ) ; analyzeMove ( request , callback ) ; analyzeMove ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { resource : request . resource || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . analyzeMove ( request , options , callback ) ; } /**
     * Exports assets with time and resource types to a given Cloud Storage
     * location/BigQuery table. For Cloud Storage location destinations, the
     * output format is newline-delimited JSON. Each line represents a
     *  google . cloud . asset . v1 . Asset in the JSON format; for BigQuery table
     * destinations, the output table stores the fields in asset proto as columns.
     * This API implements the  google . longrunning . Operation API
     * , which allows you to keep track of the export. We recommend intervals of
     * at least 2 seconds with exponential retry to poll the export operation
     * result. For regular-size resource parent, the export operation usually
     * finishes within 5 minutes.
     *
     *  param request param { string } request . parent param { google . protobuf . Timestamp } request . readTime param { string [ ] } request . assetTypes param { google . cloud . asset . v1 . ContentType } request . contentType param { google . cloud . asset . v1 . OutputConfig } request . outputConfig param { string [ ] } request . relationshipTypes param { object } options Call options. See  https for more details.
     *  returns { Promise } example exportAssets ( request ? , options ? ) ; exportAssets ( request , options , callback ) ; exportAssets ( request , callback ) ; exportAssets ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { parent : request . parent || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . exportAssets ( request , options , callback ) ; } param { String } name returns { Promise } example async checkExportAssetsProgress ( name ) { const request = new operationsProtos . google . longrunning . GetOperationRequest ( { name } ) ; const [ operation ] = await this . operationsClient . getOperation ( request ) ; const decodeOperation = new gax . Operation ( operation , this . descriptors . longrunning . exportAssets , gax . createDefaultBackoffSettings ( ) ) ; return decodeOperation as LROperation < protos . google . cloud . asset . v1 . ExportAssetsResponse , protos . google . cloud . asset . v1 . ExportAssetsRequest > ; } /**
     * Analyzes IAM policies asynchronously to answer which identities have what
     * accesses on which resources, and writes the analysis results to a Google
     * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the
     * output format is the JSON format that represents a
     *  google . cloud . asset . v1 . AnalyzeIamPolicyResponse . This method implements the
     *  google . longrunning . Operation , which allows you to track the operation
     * status. We recommend intervals of at least 2 seconds with exponential
     * backoff retry to poll the operation result. The metadata contains the
     * metadata for the long-running operation.
     *
     *  param request param { google . cloud . asset . v1 . IamPolicyAnalysisQuery } request . analysisQuery param { google . cloud . asset . v1 . IamPolicyAnalysisOutputConfig } request . outputConfig param { object } options Call options. See  https for more details.
     *  returns { Promise } example analyzeIamPolicyLongrunning ( request ? , options ? ) ; analyzeIamPolicyLongrunning ( request , options , callback ) ; analyzeIamPolicyLongrunning ( request , callback ) ; analyzeIamPolicyLongrunning ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { 'analysis_query.scope' : request . analysisQuery ! . scope || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . analyzeIamPolicyLongrunning ( request , options , callback ) ; } param { String } name returns { Promise } example async checkAnalyzeIamPolicyLongrunningProgress ( name ) { const request = new operationsProtos . google . longrunning . GetOperationRequest ( { name } ) ; const [ operation ] = await this . operationsClient . getOperation ( request ) ; const decodeOperation = new gax . Operation ( operation , this . descriptors . longrunning . analyzeIamPolicyLongrunning , gax . createDefaultBackoffSettings ( ) ) ; return decodeOperation as LROperation < protos . google . cloud . asset . v1 . AnalyzeIamPolicyLongrunningResponse , protos . google . cloud . asset . v1 . AnalyzeIamPolicyLongrunningMetadata > ; } param request param { string } request . parent param { google . protobuf . Timestamp } request . readTime param { string [ ] } request . assetTypes param { google . cloud . asset . v1 . ContentType } request . contentType param { number } request . pageSize param { string } request . pageToken param { string [ ] } request . relationshipTypes param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is Array of [Asset] google . cloud . asset . v1 . Asset .
     *   The client library will perform auto-pagination by default: it will call the API as many
     *   times as needed and will merge results from all the pages into this array.
     *   Note that it can affect your quota.
     *   We recommend using `listAssetsAsync()`
     *   method described below for async iteration which you can stop as needed.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
      listAssets ( request ? , options ? ) ; listAssets ( request , options , callback ) ; listAssets ( request , callback ) ; listAssets ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { parent : request . parent || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . listAssets ( request , options , callback ) ; } param request param { string } request . parent param { google . protobuf . Timestamp } request . readTime param { string [ ] } request . assetTypes param { google . cloud . asset . v1 . ContentType } request . contentType param { number } request . pageSize param { string } request . pageToken param { string [ ] } request . relationshipTypes param { object } options Call options. See  https for more details.
     *  returns { Stream } *   An object stream which emits an object representing [Asset] google . cloud . asset . v1 . Asset on 'data' event.
     *   The client library will perform auto-pagination by default: it will call the API as many
     *   times as needed. Note that it can affect your quota.
     *   We recommend using `listAssetsAsync()`
     *   method described below for async iteration which you can stop as needed.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
      listAssetsStream ( request ? , options ? ) { request = request || { } ; options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { parent : request . parent || '' , } ) ; const defaultCallSettings = this . _defaults [ 'listAssets' ] ; const callSettings = defaultCallSettings . merge ( options ) ; this . initialize ( ) ; return this . descriptors . page . listAssets . createStream ( this . innerApiCalls . listAssets as gax . GaxCall , request , callSettings ) ; } param request param { string } request . parent param { google . protobuf . Timestamp } request . readTime param { string [ ] } request . assetTypes param { google . cloud . asset . v1 . ContentType } request . contentType param { number } request . pageSize param { string } request . pageToken param { string [ ] } request . relationshipTypes param { object } options Call options. See  https for more details.
     *  returns { Object } *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
     *   When you iterate the returned iterable, each element will be an object representing
     *   [Asset] google . cloud . asset . v1 . Asset . The API will be called under the hood as needed, once per the page,
     *   so you can stop the iteration when you don't need more results.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
     *  example listAssetsAsync ( request ? , options ? ) { request = request || { } ; options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { parent : request . parent || '' , } ) ; const defaultCallSettings = this . _defaults [ 'listAssets' ] ; const callSettings = defaultCallSettings . merge ( options ) ; this . initialize ( ) ; return this . descriptors . page . listAssets . asyncIterate ( this . innerApiCalls [ 'listAssets' ] as GaxCall , request as unknown as RequestType , callSettings ) as AsyncIterable < protos . google . cloud . asset . v1 . IAsset > ; } param request param { string } request . scope param { string } request . query param { string [ ] } request . assetTypes param { number } request . pageSize param { string } request . pageToken param { string } request . orderBy param { google . protobuf . FieldMask } request . readMask param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is Array of [ResourceSearchResult] google . cloud . asset . v1 . ResourceSearchResult .
     *   The client library will perform auto-pagination by default: it will call the API as many
     *   times as needed and will merge results from all the pages into this array.
     *   Note that it can affect your quota.
     *   We recommend using `searchAllResourcesAsync()`
     *   method described below for async iteration which you can stop as needed.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
      searchAllResources ( request ? , options ? ) ; searchAllResources ( request , options , callback ) ; searchAllResources ( request , callback ) ; searchAllResources ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { scope : request . scope || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . searchAllResources ( request , options , callback ) ; } param request param { string } request . scope param { string } request . query param { string [ ] } request . assetTypes param { number } request . pageSize param { string } request . pageToken param { string } request . orderBy param { google . protobuf . FieldMask } request . readMask param { object } options Call options. See  https for more details.
     *  returns { Stream } *   An object stream which emits an object representing [ResourceSearchResult] google . cloud . asset . v1 . ResourceSearchResult on 'data' event.
     *   The client library will perform auto-pagination by default: it will call the API as many
     *   times as needed. Note that it can affect your quota.
     *   We recommend using `searchAllResourcesAsync()`
     *   method described below for async iteration which you can stop as needed.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
      searchAllResourcesStream ( request ? , options ? ) { request = request || { } ; options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { scope : request . scope || '' , } ) ; const defaultCallSettings = this . _defaults [ 'searchAllResources' ] ; const callSettings = defaultCallSettings . merge ( options ) ; this . initialize ( ) ; return this . descriptors . page . searchAllResources . createStream ( this . innerApiCalls . searchAllResources as gax . GaxCall , request , callSettings ) ; } param request param { string } request . scope param { string } request . query param { string [ ] } request . assetTypes param { number } request . pageSize param { string } request . pageToken param { string } request . orderBy param { google . protobuf . FieldMask } request . readMask param { object } options Call options. See  https for more details.
     *  returns { Object } *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
     *   When you iterate the returned iterable, each element will be an object representing
     *   [ResourceSearchResult] google . cloud . asset . v1 . ResourceSearchResult . The API will be called under the hood as needed, once per the page,
     *   so you can stop the iteration when you don't need more results.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
     *  example searchAllResourcesAsync ( request ? , options ? ) { request = request || { } ; options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { scope : request . scope || '' , } ) ; const defaultCallSettings = this . _defaults [ 'searchAllResources' ] ; const callSettings = defaultCallSettings . merge ( options ) ; this . initialize ( ) ; return this . descriptors . page . searchAllResources . asyncIterate ( this . innerApiCalls [ 'searchAllResources' ] as GaxCall , request as unknown as RequestType , callSettings ) as AsyncIterable < protos . google . cloud . asset . v1 . IResourceSearchResult > ; } param request param { string } request . scope param { string } request . query param { number } request . pageSize param { string } request . pageToken param { string [ ] } request . assetTypes param { string } request . orderBy param { object } options Call options. See  https for more details.
     *  returns { Promise } - The promise which resolves to an array.
     *   The first element of the array is Array of [IamPolicySearchResult] google . cloud . asset . v1 . IamPolicySearchResult .
     *   The client library will perform auto-pagination by default: it will call the API as many
     *   times as needed and will merge results from all the pages into this array.
     *   Note that it can affect your quota.
     *   We recommend using `searchAllIamPoliciesAsync()`
     *   method described below for async iteration which you can stop as needed.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
      searchAllIamPolicies ( request ? , options ? ) ; searchAllIamPolicies ( request , options , callback ) ; searchAllIamPolicies ( request , callback ) ; searchAllIamPolicies ( request ? , optionsOrCallback ? , callback ? ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback as CallOptions ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { scope : request . scope || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . searchAllIamPolicies ( request , options , callback ) ; } param request param { string } request . scope param { string } request . query param { number } request . pageSize param { string } request . pageToken param { string [ ] } request . assetTypes param { string } request . orderBy param { object } options Call options. See  https for more details.
     *  returns { Stream } *   An object stream which emits an object representing [IamPolicySearchResult] google . cloud . asset . v1 . IamPolicySearchResult on 'data' event.
     *   The client library will perform auto-pagination by default: it will call the API as many
     *   times as needed. Note that it can affect your quota.
     *   We recommend using `searchAllIamPoliciesAsync()`
     *   method described below for async iteration which you can stop as needed.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
      searchAllIamPoliciesStream ( request ? , options ? ) { request = request || { } ; options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { scope : request . scope || '' , } ) ; const defaultCallSettings = this . _defaults [ 'searchAllIamPolicies' ] ; const callSettings = defaultCallSettings . merge ( options ) ; this . initialize ( ) ; return this . descriptors . page . searchAllIamPolicies . createStream ( this . innerApiCalls . searchAllIamPolicies as gax . GaxCall , request , callSettings ) ; } param request param { string } request . scope param { string } request . query param { number } request . pageSize param { string } request . pageToken param { string [ ] } request . assetTypes param { string } request . orderBy param { object } options Call options. See  https for more details.
     *  returns { Object } *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
     *   When you iterate the returned iterable, each element will be an object representing
     *   [IamPolicySearchResult] google . cloud . asset . v1 . IamPolicySearchResult . The API will be called under the hood as needed, once per the page,
     *   so you can stop the iteration when you don't need more results.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
     *   for more details and examples.
     *  example searchAllIamPoliciesAsync ( request ? , options ? ) { request = request || { } ; options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { scope : request . scope || '' , } ) ; const defaultCallSettings = this . _defaults [ 'searchAllIamPolicies' ] ; const callSettings = defaultCallSettings . merge ( options ) ; this . initialize ( ) ; return this . descriptors . page . searchAllIamPolicies . asyncIterate ( this . innerApiCalls [ 'searchAllIamPolicies' ] as GaxCall , request as unknown as RequestType , callSettings ) as AsyncIterable < protos . google . cloud . asset . v1 . IIamPolicySearchResult > ; } param { string } access_policy param { string } access_level returns { string } accessLevelPath ( accessPolicy , accessLevel ) { return this . pathTemplates . accessLevelPathTemplate . render ( { access_policy : accessPolicy , access_level : accessLevel , } ) ; } param { string } accessLevelName returns { string } matchAccessPolicyFromAccessLevelName ( accessLevelName ) { return this . pathTemplates . accessLevelPathTemplate . match ( accessLevelName ) . access_policy ; } param { string } accessLevelName returns { string } matchAccessLevelFromAccessLevelName ( accessLevelName ) { return this . pathTemplates . accessLevelPathTemplate . match ( accessLevelName ) . access_level ; } param { string } access_policy returns { string } accessPolicyPath ( accessPolicy ) { return this . pathTemplates . accessPolicyPathTemplate . render ( { access_policy : accessPolicy , } ) ; } param { string } accessPolicyName returns { string } matchAccessPolicyFromAccessPolicyName ( accessPolicyName ) { return this . pathTemplates . accessPolicyPathTemplate . match ( accessPolicyName ) . access_policy ; } param { string } folder param { string } feed returns { string } folderFeedPath ( folder , feed ) { return this . pathTemplates . folderFeedPathTemplate . render ( { folder : folder , feed : feed , } ) ; } param { string } folderFeedName returns { string } matchFolderFromFolderFeedName ( folderFeedName ) { return this . pathTemplates . folderFeedPathTemplate . match ( folderFeedName ) . folder ; } param { string } folderFeedName returns { string } matchFeedFromFolderFeedName ( folderFeedName ) { return this . pathTemplates . folderFeedPathTemplate . match ( folderFeedName ) . feed ; } param { string } project param { string } location param { string } instance returns { string } inventoryPath ( project , location , instance ) { return this . pathTemplates . inventoryPathTemplate . render ( { project : project , location : location , instance : instance , } ) ; } param { string } inventoryName returns { string } matchProjectFromInventoryName ( inventoryName ) { return this . pathTemplates . inventoryPathTemplate . match ( inventoryName ) . project ; } param { string } inventoryName returns { string } matchLocationFromInventoryName ( inventoryName ) { return this . pathTemplates . inventoryPathTemplate . match ( inventoryName ) . location ; } param { string } inventoryName returns { string } matchInstanceFromInventoryName ( inventoryName ) { return this . pathTemplates . inventoryPathTemplate . match ( inventoryName ) . instance ; } param { string } organization param { string } feed returns { string } organizationFeedPath ( organization , feed ) { return this . pathTemplates . organizationFeedPathTemplate . render ( { organization : organization , feed : feed , } ) ; } param { string } organizationFeedName returns { string } matchOrganizationFromOrganizationFeedName ( organizationFeedName ) { return this . pathTemplates . organizationFeedPathTemplate . match ( organizationFeedName ) . organization ; } param { string } organizationFeedName returns { string } matchFeedFromOrganizationFeedName ( organizationFeedName ) { return this . pathTemplates . organizationFeedPathTemplate . match ( organizationFeedName ) . feed ; } param { string } project param { string } feed returns { string } projectFeedPath ( project , feed ) { return this . pathTemplates . projectFeedPathTemplate . render ( { project : project , feed : feed , } ) ; } param { string } projectFeedName returns { string } matchProjectFromProjectFeedName ( projectFeedName ) { return this . pathTemplates . projectFeedPathTemplate . match ( projectFeedName ) . project ; } param { string } projectFeedName returns { string } matchFeedFromProjectFeedName ( projectFeedName ) { return this . pathTemplates . projectFeedPathTemplate . match ( projectFeedName ) . feed ; } param { string } access_policy param { string } service_perimeter returns { string } servicePerimeterPath ( accessPolicy , servicePerimeter ) { return this . pathTemplates . servicePerimeterPathTemplate . render ( { access_policy : accessPolicy , service_perimeter : servicePerimeter , } ) ; } param { string } servicePerimeterName returns { string } matchAccessPolicyFromServicePerimeterName ( servicePerimeterName ) { return this . pathTemplates . servicePerimeterPathTemplate . match ( servicePerimeterName ) . access_policy ; } param { string } servicePerimeterName returns { string } matchServicePerimeterFromServicePerimeterName ( servicePerimeterName ) { return this . pathTemplates . servicePerimeterPathTemplate . match ( servicePerimeterName ) . service_perimeter ; } returns { Promise } close ( ) { this . initialize ( ) ; if ( ! this . _terminated ) { return this . assetServiceStub ! . then ( stub => { this . _terminated = true ; stub . close ( ) ; this . operationsClient . close ( ) ; } ) ; } return Promise . resolve ( ) ; } }