UNPKG

@google-cloud/asset

Version:
764 lines 188 kB
import type * as gax from 'google-gax'; import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; import { Transform } from 'stream'; import * as protos from '../../protos/protos'; /** * Asset service definition. * @class * @memberof v1 */ export declare class AssetServiceClient { private _terminated; private _opts; private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; private _universeDomain; private _servicePath; private _log; auth: gax.GoogleAuth; descriptors: Descriptors; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; pathTemplates: { [name: string]: gax.PathTemplate; }; operationsClient: gax.OperationsClient; assetServiceStub?: Promise<{ [name: string]: Function; }>; /** * Construct an instance of AssetServiceClient. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @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 * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you * need to avoid loading the default gRPC version and want to use the fallback * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC * const client = new AssetServiceClient({fallback: true}, gax); * ``` */ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize(): Promise<{ [name: string]: Function; }>; /** * The DNS address for this API service. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get servicePath(): string; /** * The DNS address for this API service - same as servicePath. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get apiEndpoint(): string; /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ get apiEndpoint(): string; get universeDomain(): string; /** * The port for this API service. * @returns {number} The default port for this service. */ static get port(): number; /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes(): string[]; getProjectId(): Promise<string>; getProjectId(callback: Callback<string, undefined, undefined>): void; /** * Batch gets the update history of assets that overlap a time window. * For IAM_POLICY content, this API outputs history when the asset and its * attached IAM POLICY both exist. This can create gaps in the output history. * Otherwise, this API outputs history with asset in both non-delete or * deleted status. * If a specified asset does not exist, this API returns an INVALID_ARGUMENT * error. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The relative name of the root asset. It can only be an * organization number (such as "organizations/123"), a project ID (such as * "projects/my-project-id")", or a project number (such as "projects/12345"). * @param {string[]} request.assetNames * A list of the full names of the assets. * See: https://cloud.google.com/asset-inventory/docs/resource-name-format * Example: * * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. * * The request becomes a no-op if the asset name list is empty, and the max * size of the asset name list is 100 in one request. * @param {google.cloud.asset.v1.ContentType} [request.contentType] * Optional. The content type. * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] * Optional. The time window for the asset history. Both start_time and * end_time are optional and if set, it must be after the current time minus * 35 days. If end_time is not set, it is default to current timestamp. * If start_time is not set, the snapshot of the assets at end_time will be * returned. The returned results contain all temporal assets whose time * window overlap with read_time_window. * @param {string[]} [request.relationshipTypes] * Optional. A list of relationship types to output, for example: * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if * content_type=RELATIONSHIP. * * If specified: * it outputs specified relationships' history on the [asset_names]. It * returns an error if any of the [relationship_types] doesn't belong to the * supported relationship types of the [asset_names] or if any of the * [asset_names]'s types doesn't belong to the source types of the * [relationship_types]. * * Otherwise: * it outputs the supported relationships' history on the [asset_names] or * returns an error if any of the [asset_names]'s types has no relationship * support. * See [Introduction to Cloud Asset * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all * supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse|BatchGetAssetsHistoryResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.batch_get_assets_history.js</caption> * region_tag:cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async */ batchGetAssetsHistory(request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest | undefined, {} | undefined ]>; batchGetAssetsHistory(request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest | null | undefined, {} | null | undefined>): void; batchGetAssetsHistory(request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: Callback<protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest | null | undefined, {} | null | undefined>): void; /** * Creates a feed in a parent project/folder/organization to listen to its * asset updates. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project/folder/organization where this feed * should be created in. It can only be an organization number (such as * "organizations/123"), a folder number (such as "folders/123"), a project ID * (such as "projects/my-project-id"), or a project number (such as * "projects/12345"). * @param {string} request.feedId * Required. This is the client-assigned asset feed identifier and it needs to * be unique under a specific parent project/folder/organization. * @param {google.cloud.asset.v1.Feed} request.feed * Required. The feed details. The field `name` must be empty and it will be * generated in the format of: projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.Feed|Feed}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.create_feed.js</caption> * region_tag:cloudasset_v1_generated_AssetService_CreateFeed_async */ createFeed(request?: protos.google.cloud.asset.v1.ICreateFeedRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.ICreateFeedRequest | undefined, {} | undefined ]>; createFeed(request: protos.google.cloud.asset.v1.ICreateFeedRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, {} | null | undefined>): void; createFeed(request: protos.google.cloud.asset.v1.ICreateFeedRequest, callback: Callback<protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, {} | null | undefined>): void; /** * Gets details about an asset feed. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the Feed and it must be in the format of: * projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.Feed|Feed}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.get_feed.js</caption> * region_tag:cloudasset_v1_generated_AssetService_GetFeed_async */ getFeed(request?: protos.google.cloud.asset.v1.IGetFeedRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IGetFeedRequest | undefined, {} | undefined ]>; getFeed(request: protos.google.cloud.asset.v1.IGetFeedRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, {} | null | undefined>): void; getFeed(request: protos.google.cloud.asset.v1.IGetFeedRequest, callback: Callback<protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, {} | null | undefined>): void; /** * Lists all asset feeds in a parent project/folder/organization. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent project/folder/organization whose feeds are to be * listed. It can only be using project/folder/organization number (such as * "folders/12345")", or a project ID (such as "projects/my-project-id"). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.ListFeedsResponse|ListFeedsResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.list_feeds.js</caption> * region_tag:cloudasset_v1_generated_AssetService_ListFeeds_async */ listFeeds(request?: protos.google.cloud.asset.v1.IListFeedsRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IListFeedsResponse, protos.google.cloud.asset.v1.IListFeedsRequest | undefined, {} | undefined ]>; listFeeds(request: protos.google.cloud.asset.v1.IListFeedsRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IListFeedsResponse, protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, {} | null | undefined>): void; listFeeds(request: protos.google.cloud.asset.v1.IListFeedsRequest, callback: Callback<protos.google.cloud.asset.v1.IListFeedsResponse, protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, {} | null | undefined>): void; /** * Updates an asset feed configuration. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.Feed} request.feed * Required. The new values of feed details. It must match an existing feed * and the field `name` must be in the format of: * projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. * @param {google.protobuf.FieldMask} request.updateMask * Required. Only updates the `feed` fields indicated by this mask. * The field mask must not be empty, and it must not contain fields that * are immutable or only set by the server. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.Feed|Feed}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.update_feed.js</caption> * region_tag:cloudasset_v1_generated_AssetService_UpdateFeed_async */ updateFeed(request?: protos.google.cloud.asset.v1.IUpdateFeedRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IUpdateFeedRequest | undefined, {} | undefined ]>; updateFeed(request: protos.google.cloud.asset.v1.IUpdateFeedRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, {} | null | undefined>): void; updateFeed(request: protos.google.cloud.asset.v1.IUpdateFeedRequest, callback: Callback<protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, {} | null | undefined>): void; /** * Deletes an asset feed. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the feed and it must be in the format of: * projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.delete_feed.js</caption> * region_tag:cloudasset_v1_generated_AssetService_DeleteFeed_async */ deleteFeed(request?: protos.google.cloud.asset.v1.IDeleteFeedRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteFeedRequest | undefined, {} | undefined ]>; deleteFeed(request: protos.google.cloud.asset.v1.IDeleteFeedRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, {} | null | undefined>): void; deleteFeed(request: protos.google.cloud.asset.v1.IDeleteFeedRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, {} | null | undefined>): void; /** * Analyzes IAM policies to answer which identities have what accesses on * which resources. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery * Required. The request query. * @param {string} [request.savedAnalysisQuery] * Optional. The name of a saved query, which must be in the format of: * * * projects/project_number/savedQueries/saved_query_id * * folders/folder_number/savedQueries/saved_query_id * * organizations/organization_number/savedQueries/saved_query_id * * If both `analysis_query` and `saved_analysis_query` are provided, they * will be merged together with the `saved_analysis_query` as base and * the `analysis_query` as overrides. For more details of the merge behavior, * refer to the * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) * page. * * Note that you cannot override primitive fields with default value, such as * 0 or empty string, etc., because we use proto3, which doesn't support field * presence yet. * @param {google.protobuf.Duration} [request.executionTimeout] * Optional. Amount of time executable has to complete. See JSON * representation of * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). * * If this field is set with a value less than the RPC deadline, and the * execution of your query hasn't finished in the specified * execution timeout, you will get a response with partial result. * Otherwise, your query's execution will continue until the RPC deadline. * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. * * Default is empty. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.analyze_iam_policy.js</caption> * region_tag:cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async */ analyzeIamPolicy(request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | undefined, {} | undefined ]>; analyzeIamPolicy(request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, {} | null | undefined>): void; analyzeIamPolicy(request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, callback: Callback<protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, {} | null | undefined>): void; /** * Analyze moving a resource to a specified destination without kicking off * the actual move. The analysis is best effort depending on the user's * permissions of viewing different hierarchical policies and configurations. * The policies and configuration are subject to change before the actual * resource migration takes place. * * @param {Object} request * The request object that will be sent. * @param {string} request.resource * Required. Name of the resource to perform the analysis against. * Only Google Cloud projects are supported as of today. Hence, this can only * be a project ID (such as "projects/my-project-id") or a project number * (such as "projects/12345"). * @param {string} request.destinationParent * Required. Name of the Google Cloud folder or organization to reparent the * target resource. The analysis will be performed against hypothetically * moving the resource to this specified destination parent. This can only be * a folder number (such as "folders/123") or an organization number (such as * "organizations/123"). * @param {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} request.view * Analysis view indicating what information should be included in the * analysis response. If unspecified, the default view is FULL. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.AnalyzeMoveResponse|AnalyzeMoveResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.analyze_move.js</caption> * region_tag:cloudasset_v1_generated_AssetService_AnalyzeMove_async */ analyzeMove(request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IAnalyzeMoveResponse, protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, {} | undefined ]>; analyzeMove(request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IAnalyzeMoveResponse, protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, {} | null | undefined>): void; analyzeMove(request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, callback: Callback<protos.google.cloud.asset.v1.IAnalyzeMoveResponse, protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, {} | null | undefined>): void; /** * Issue a job that queries assets using a SQL statement compatible with * [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql). * * If the query execution finishes within timeout and there's no pagination, * the full query results will be returned in the `QueryAssetsResponse`. * * Otherwise, full query results can be obtained by issuing extra requests * with the `job_reference` from the a previous `QueryAssets` call. * * Note, the query result has approximately 10 GB limitation enforced by * [BigQuery](https://cloud.google.com/bigquery/docs/best-practices-performance-output). * Queries return larger results will result in errors. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The relative name of the root asset. This can only be an * organization number (such as "organizations/123"), a project ID (such as * "projects/my-project-id"), or a project number (such as "projects/12345"), * or a folder number (such as "folders/123"). * * Only assets belonging to the `parent` will be returned. * @param {string} [request.statement] * Optional. A SQL statement that's compatible with [BigQuery * SQL](https://cloud.google.com/bigquery/docs/introduction-sql). * @param {string} [request.jobReference] * Optional. Reference to the query job, which is from the * `QueryAssetsResponse` of previous `QueryAssets` call. * @param {number} [request.pageSize] * Optional. The maximum number of rows to return in the results. Responses * are limited to 10 MB and 1000 rows. * * By default, the maximum row count is 1000. When the byte or row count limit * is reached, the rest of the query results will be paginated. * * The field will be ignored when [output_config] is specified. * @param {string} [request.pageToken] * Optional. A page token received from previous `QueryAssets`. * * The field will be ignored when [output_config] is specified. * @param {google.protobuf.Duration} [request.timeout] * Optional. Specifies the maximum amount of time that the client is willing * to wait for the query to complete. By default, this limit is 5 min for the * first query, and 1 minute for the following queries. If the query is * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise * false. * * Like BigQuery [jobs.query * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) * The call is not guaranteed to wait for the specified timeout; it typically * returns after around 200 seconds (200,000 milliseconds), even if the query * is not complete. * * The field will be ignored when [output_config] is specified. * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] * Optional. [start_time] is required. [start_time] must be less than * [end_time] Defaults [end_time] to now if [start_time] is set and * [end_time] isn't. Maximum permitted time range is 7 days. * @param {google.protobuf.Timestamp} [request.readTime] * Optional. Queries cloud assets as they appeared at the specified point in * time. * @param {google.cloud.asset.v1.QueryAssetsOutputConfig} [request.outputConfig] * Optional. Destination where the query results will be saved. * * When this field is specified, the query results won't be saved in the * [QueryAssetsResponse.query_result]. Instead * [QueryAssetsResponse.output_config] will be set. * * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used * to check the status of the query job when passed to a following * [QueryAssets] API call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.QueryAssetsResponse|QueryAssetsResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.query_assets.js</caption> * region_tag:cloudasset_v1_generated_AssetService_QueryAssets_async */ queryAssets(request?: protos.google.cloud.asset.v1.IQueryAssetsRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IQueryAssetsResponse, protos.google.cloud.asset.v1.IQueryAssetsRequest | undefined, {} | undefined ]>; queryAssets(request: protos.google.cloud.asset.v1.IQueryAssetsRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IQueryAssetsResponse, protos.google.cloud.asset.v1.IQueryAssetsRequest | null | undefined, {} | null | undefined>): void; queryAssets(request: protos.google.cloud.asset.v1.IQueryAssetsRequest, callback: Callback<protos.google.cloud.asset.v1.IQueryAssetsResponse, protos.google.cloud.asset.v1.IQueryAssetsRequest | null | undefined, {} | null | undefined>): void; /** * Creates a saved query in a parent project/folder/organization. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project/folder/organization where this * saved_query should be created in. It can only be an organization number * (such as "organizations/123"), a folder number (such as "folders/123"), a * project ID (such as "projects/my-project-id"), or a project number (such as * "projects/12345"). * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery * Required. The saved_query details. The `name` field must be empty as it * will be generated based on the parent and saved_query_id. * @param {string} request.savedQueryId * Required. The ID to use for the saved query, which must be unique in the * specified parent. It will become the final component of the saved query's * resource name. * * This value should be 4-63 characters, and valid characters * are `{@link protos.0-9|a-z}-`. * * Notice that this field is required in the saved query creation, and the * `name` field of the `saved_query` will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.create_saved_query.js</caption> * region_tag:cloudasset_v1_generated_AssetService_CreateSavedQuery_async */ createSavedQuery(request?: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.ICreateSavedQueryRequest | undefined, {} | undefined ]>; createSavedQuery(request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, {} | null | undefined>): void; createSavedQuery(request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, callback: Callback<protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, {} | null | undefined>): void; /** * Gets details about a saved query. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the saved query and it must be in the format of: * * * projects/project_number/savedQueries/saved_query_id * * folders/folder_number/savedQueries/saved_query_id * * organizations/organization_number/savedQueries/saved_query_id * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.get_saved_query.js</caption> * region_tag:cloudasset_v1_generated_AssetService_GetSavedQuery_async */ getSavedQuery(request?: protos.google.cloud.asset.v1.IGetSavedQueryRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.IGetSavedQueryRequest | undefined, {} | undefined ]>; getSavedQuery(request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, {} | null | undefined>): void; getSavedQuery(request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, callback: Callback<protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, {} | null | undefined>): void; /** * Updates a saved query. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery * Required. The saved query to update. * * The saved query's `name` field is used to identify the one to update, * which has format as below: * * * projects/project_number/savedQueries/saved_query_id * * folders/folder_number/savedQueries/saved_query_id * * organizations/organization_number/savedQueries/saved_query_id * @param {google.protobuf.FieldMask} request.updateMask * Required. The list of fields to update. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.update_saved_query.js</caption> * region_tag:cloudasset_v1_generated_AssetService_UpdateSavedQuery_async */ updateSavedQuery(request?: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | undefined, {} | undefined ]>; updateSavedQuery(request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, {} | null | undefined>): void; updateSavedQuery(request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, callback: Callback<protos.google.cloud.asset.v1.ISavedQuery, protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, {} | null | undefined>): void; /** * Deletes a saved query. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the saved query to delete. It must be in the format * of: * * * projects/project_number/savedQueries/saved_query_id * * folders/folder_number/savedQueries/saved_query_id * * organizations/organization_number/savedQueries/saved_query_id * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.delete_saved_query.js</caption> * region_tag:cloudasset_v1_generated_AssetService_DeleteSavedQuery_async */ deleteSavedQuery(request?: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | undefined, {} | undefined ]>; deleteSavedQuery(request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, {} | null | undefined>): void; deleteSavedQuery(request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, {} | null | undefined>): void; /** * Gets effective IAM policies for a batch of resources. * * @param {Object} request * The request object that will be sent. * @param {string} request.scope * Required. Only IAM policies on or below the scope will be returned. * * This can only be an organization number (such as "organizations/123"), a * folder number (such as "folders/123"), a project ID (such as * "projects/my-project-id"), or a project number (such as "projects/12345"). * * To know how to get organization ID, visit [here * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). * * To know how to get folder or project ID, visit [here * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). * @param {string[]} request.names * Required. The names refer to the [full_resource_names] * (https://cloud.google.com/asset-inventory/docs/resource-name-format) * of the asset types [supported by search * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). * A maximum of 20 resources' effective policies can be retrieved in a batch. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse|BatchGetEffectiveIamPoliciesResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.batch_get_effective_iam_policies.js</caption> * region_tag:cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async */ batchGetEffectiveIamPolicies(request?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest | undefined, {} | undefined ]>; batchGetEffectiveIamPolicies(request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest | null | undefined, {} | null | undefined>): void; batchGetEffectiveIamPolicies(request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, callback: Callback<protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest | null | undefined, {} | null | undefined>): void; /** * 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 * {@link protos.google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON * format; for BigQuery table destinations, the output table stores the fields * in asset Protobuf as columns. This API implements the * {@link protos.google.longrunning.Operation|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 {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The relative name of the root asset. This can only be an * organization number (such as "organizations/123"), a project ID (such as * "projects/my-project-id"), or a project number (such as "projects/12345"), * or a folder number (such as "folders/123"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). * If not specified, the current time will be used. Due to delays in resource * data collection and indexing, there is a volatile window during which * running the same query may get different results. * @param {string[]} request.assetTypes * A list of asset types to take a snapshot for. For example: * "compute.googleapis.com/Disk". * * Regular expressions are also supported. For example: * * * "compute.googleapis.com.*" snapshots resources whose asset type starts * with "compute.googleapis.com". * * ".*Instance" snapshots resources whose asset type ends with "Instance". * * ".*Instance.*" snapshots resources whose asset type contains "Instance". * * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * * If specified, only matching assets will be returned, otherwise, it will * snapshot all asset types. See [Introduction to Cloud Asset * Inventory](https://cloud.google.com/asset-inventory/docs/overview) * for all supported asset types. * @param {google.cloud.asset.v1.ContentType} request.contentType * Asset content type. If not specified, no content but the asset name will be * returned. * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig * Required. Output configuration indicating where the results will be output * to. * @param {string[]} request.relationshipTypes * A list of relationship types to export, for example: * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if * content_type=RELATIONSHIP. * * If specified: * it snapshots specified relationships. It returns an error if * any of the [relationship_types] doesn't belong to the supported * relationship types of the [asset_types] or if any of the [asset_types] * doesn't belong to the source types of the [relationship_types]. * * Otherwise: * it snapshots the supported relationships for all [asset_types] or returns * an error if any of the [asset_types] has no relationship support. * An unspecified asset types field means all supported asset_types. * See [Introduction to Cloud Asset * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all * supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/asset_service.export_assets.js</caption> * region_tag:cloudasset_v1_generated_AssetService_ExportAssets_async */ exportAssets(request?: protos.google.cloud.asset.v1.IExportAssetsRequest, options?: CallOptions): Promise<[ LROperation<protos.google.cloud.asset.v1.IExportAssetsResponse, protos.google.cloud.asset.v1.IExportAssetsRequest>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>; exportAssets(request: protos.google.cloud.asset.v1.IExportAssetsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.asset.v1.IExportAssetsResponse, protos.google.cloud.asset.v1.IExportAssetsRequest>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; exportAssets(request: protos.google.cloud.asset.v1.IExportAssetsRequest, callback: Callback<LROperation<protos.google.cloud.asset.v1.IExportAssetsResponse, protos.google.cloud.asset.v1.IExportAssetsRequest>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; /** * Check the status of the long running operation returned by `exportAssets()`. * @param {String} name * The operation name that will be passed. * @retu