UNPKG

@google-cloud/asset

Version:
404 lines (403 loc) 21.4 kB
import type * as gax from 'google-gax'; import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; import * as protos from '../../protos/protos'; /** * Asset service definition. * @class * @memberof v1p2beta1 */ 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; }; 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; /** * 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.v1p2beta1.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.v1p2beta1.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/v1p2beta1/asset_service.create_feed.js</caption> * region_tag:cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async */ createFeed(request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, {} | undefined ]>; createFeed(request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, {} | null | undefined>): void; createFeed(request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, callback: Callback<protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.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.v1p2beta1.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/v1p2beta1/asset_service.get_feed.js</caption> * region_tag:cloudasset_v1p2beta1_generated_AssetService_GetFeed_async */ getFeed(request?: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, {} | undefined ]>; getFeed(request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | null | undefined, {} | null | undefined>): void; getFeed(request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, callback: Callback<protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.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.v1p2beta1.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/v1p2beta1/asset_service.list_feeds.js</caption> * region_tag:cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async */ listFeeds(request?: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, {} | undefined ]>; listFeeds(request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | null | undefined, {} | null | undefined>): void; listFeeds(request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, callback: Callback<protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, protos.google.cloud.asset.v1p2beta1.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.v1p2beta1.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.v1p2beta1.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/v1p2beta1/asset_service.update_feed.js</caption> * region_tag:cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async */ updateFeed(request?: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, options?: CallOptions): Promise<[ protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, {} | undefined ]>; updateFeed(request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | null | undefined, {} | null | undefined>): void; updateFeed(request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, callback: Callback<protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.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/v1p2beta1/asset_service.delete_feed.js</caption> * region_tag:cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async */ deleteFeed(request?: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, {} | undefined ]>; deleteFeed(request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | null | undefined, {} | null | undefined>): void; deleteFeed(request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | null | undefined, {} | null | undefined>): void; /** * Return a fully-qualified accessLevel resource name string. * * @param {string} access_policy * @param {string} access_level * @returns {string} Resource name string. */ accessLevelPath(accessPolicy: string, accessLevel: string): string; /** * Parse the access_policy from AccessLevel resource. * * @param {string} accessLevelName * A fully-qualified path representing AccessLevel resource. * @returns {string} A string representing the access_policy. */ matchAccessPolicyFromAccessLevelName(accessLevelName: string): string | number; /** * Parse the access_level from AccessLevel resource. * * @param {string} accessLevelName * A fully-qualified path representing AccessLevel resource. * @returns {string} A string representing the access_level. */ matchAccessLevelFromAccessLevelName(accessLevelName: string): string | number; /** * Return a fully-qualified accessPolicy resource name string. * * @param {string} access_policy * @returns {string} Resource name string. */ accessPolicyPath(accessPolicy: string): string; /** * Parse the access_policy from AccessPolicy resource. * * @param {string} accessPolicyName * A fully-qualified path representing AccessPolicy resource. * @returns {string} A string representing the access_policy. */ matchAccessPolicyFromAccessPolicyName(accessPolicyName: string): string | number; /** * Return a fully-qualified folderFeed resource name string. * * @param {string} folder * @param {string} feed * @returns {string} Resource name string. */ folderFeedPath(folder: string, feed: string): string; /** * Parse the folder from FolderFeed resource. * * @param {string} folderFeedName * A fully-qualified path representing folder_feed resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderFeedName(folderFeedName: string): string | number; /** * Parse the feed from FolderFeed resource. * * @param {string} folderFeedName * A fully-qualified path representing folder_feed resource. * @returns {string} A string representing the feed. */ matchFeedFromFolderFeedName(folderFeedName: string): string | number; /** * Return a fully-qualified organizationFeed resource name string. * * @param {string} organization * @param {string} feed * @returns {string} Resource name string. */ organizationFeedPath(organization: string, feed: string): string; /** * Parse the organization from OrganizationFeed resource. * * @param {string} organizationFeedName * A fully-qualified path representing organization_feed resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationFeedName(organizationFeedName: string): string | number; /** * Parse the feed from OrganizationFeed resource. * * @param {string} organizationFeedName * A fully-qualified path representing organization_feed resource. * @returns {string} A string representing the feed. */ matchFeedFromOrganizationFeedName(organizationFeedName: string): string | number; /** * Return a fully-qualified projectFeed resource name string. * * @param {string} project * @param {string} feed * @returns {string} Resource name string. */ projectFeedPath(project: string, feed: string): string; /** * Parse the project from ProjectFeed resource. * * @param {string} projectFeedName * A fully-qualified path representing project_feed resource. * @returns {string} A string representing the project. */ matchProjectFromProjectFeedName(projectFeedName: string): string | number; /** * Parse the feed from ProjectFeed resource. * * @param {string} projectFeedName * A fully-qualified path representing project_feed resource. * @returns {string} A string representing the feed. */ matchFeedFromProjectFeedName(projectFeedName: string): string | number; /** * Return a fully-qualified servicePerimeter resource name string. * * @param {string} access_policy * @param {string} service_perimeter * @returns {string} Resource name string. */ servicePerimeterPath(accessPolicy: string, servicePerimeter: string): string; /** * Parse the access_policy from ServicePerimeter resource. * * @param {string} servicePerimeterName * A fully-qualified path representing ServicePerimeter resource. * @returns {string} A string representing the access_policy. */ matchAccessPolicyFromServicePerimeterName(servicePerimeterName: string): string | number; /** * Parse the service_perimeter from ServicePerimeter resource. * * @param {string} servicePerimeterName * A fully-qualified path representing ServicePerimeter resource. * @returns {string} A string representing the service_perimeter. */ matchServicePerimeterFromServicePerimeterName(servicePerimeterName: string): string | number; /** * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise<void>; }