AssetServiceClient

AssetServiceClient

Asset service definition.

Constructor

new AssetServiceClient(optionsopt, fallback)

Construct an instance of AssetServiceClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. The options accepted by the constructor are described in detail in this document. The common options are:

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

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.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

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 Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

clientConfig gax.ClientConfig <optional>

client configuration override. TODO(@alexander-fenster): link to gax documentation.

fallback boolean

Use HTTP fallback mode. In fallback mode, a special browser-compatible transport implementation is used instead of gRPC transport. In browser context (if the window object is defined) the fallback mode is enabled automatically; set options.fallback to false if you need to override this behavior.

Members

apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

port

The port for this API service.

scopes

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

The DNS address for this API service.

Methods

close() → {Promise}

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns:
Type Description
Promise

A promise that resolves when the client is closed.

createFeed(request, optionsopt) → {Promise}

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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").

feedId string

Required. This is the client-assigned asset feed identifier and it needs to be unique under a specific parent project/folder/organization.

feed google.cloud.asset.v1p2beta1.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

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Feed. Please see the documentation for more details and examples.
Example
const [response] = await client.createFeed(request);

deleteFeed(request, optionsopt) → {Promise}

Deletes an asset feed.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

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

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.
Example
const [response] = await client.deleteFeed(request);

folderFeedPath(folder, feed) → {string}

Return a fully-qualified folderFeed resource name string.

Parameters:
Name Type Description
folder string
feed string
Returns:
Type Description
string

Resource name string.

getFeed(request, optionsopt) → {Promise}

Gets details about an asset feed.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

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

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Feed. Please see the documentation for more details and examples.
Example
const [response] = await client.getFeed(request);

getProjectId() → {Promise}

Return the project ID used by this class.

Returns:
Type Description
Promise

A promise that resolves to string containing the project ID.

initialize() → {Promise}

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:
Type Description
Promise

A promise that resolves to an authenticated service stub.

listFeeds(request, optionsopt) → {Promise}

Lists all asset feeds in a parent project/folder/organization.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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").

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing ListFeedsResponse. Please see the documentation for more details and examples.
Example
const [response] = await client.listFeeds(request);

matchFeedFromFolderFeedName(folderFeedName) → {string}

Parse the feed from FolderFeed resource.

Parameters:
Name Type Description
folderFeedName string

A fully-qualified path representing folder_feed resource.

Returns:
Type Description
string

A string representing the feed.

matchFeedFromOrganizationFeedName(organizationFeedName) → {string}

Parse the feed from OrganizationFeed resource.

Parameters:
Name Type Description
organizationFeedName string

A fully-qualified path representing organization_feed resource.

Returns:
Type Description
string

A string representing the feed.

matchFeedFromProjectFeedName(projectFeedName) → {string}

Parse the feed from ProjectFeed resource.

Parameters:
Name Type Description
projectFeedName string

A fully-qualified path representing project_feed resource.

Returns:
Type Description
string

A string representing the feed.

matchFolderFromFolderFeedName(folderFeedName) → {string}

Parse the folder from FolderFeed resource.

Parameters:
Name Type Description
folderFeedName string

A fully-qualified path representing folder_feed resource.

Returns:
Type Description
string

A string representing the folder.

matchOrganizationFromOrganizationFeedName(organizationFeedName) → {string}

Parse the organization from OrganizationFeed resource.

Parameters:
Name Type Description
organizationFeedName string

A fully-qualified path representing organization_feed resource.

Returns:
Type Description
string

A string representing the organization.

matchProjectFromProjectFeedName(projectFeedName) → {string}

Parse the project from ProjectFeed resource.

Parameters:
Name Type Description
projectFeedName string

A fully-qualified path representing project_feed resource.

Returns:
Type Description
string

A string representing the project.

organizationFeedPath(organization, feed) → {string}

Return a fully-qualified organizationFeed resource name string.

Parameters:
Name Type Description
organization string
feed string
Returns:
Type Description
string

Resource name string.

projectFeedPath(project, feed) → {string}

Return a fully-qualified projectFeed resource name string.

Parameters:
Name Type Description
project string
feed string
Returns:
Type Description
string

Resource name string.

updateFeed(request, optionsopt) → {Promise}

Updates an asset feed configuration.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
feed google.cloud.asset.v1p2beta1.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.

updateMask google.protobuf.FieldMask

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.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Feed. Please see the documentation for more details and examples.
Example
const [response] = await client.updateFeed(request);