Asset service definition. v1p2beta1
Package
@google-cloud/assetConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of AssetServiceClient.
opts
ClientOptions
gaxInstance
typeof gax
| typeof fallback
: 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: 'rest'}, gax); ```
Properties
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
assetServiceStub
assetServiceStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
auth
auth
:
gax
.
GoogleAuth
;
descriptors
descriptors
:
Descriptors
;
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
pathTemplates
pathTemplates
:
{
[
name
:
string
]
:
gax
.
PathTemplate
;
};
port
static
get
port
()
:
number
;
The port for this API service.
scopes
static
get
scopes
()
:
string
[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static
get
servicePath
()
:
string
;
The DNS address for this API service.
warn
warn
:
(
code
:
string
,
message
:
string
,
warnType
?:
string
)
=
>
void
;
Methods
close()
close
()
:
Promise<void>
;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Promise
<void>
{Promise} A promise that resolves when the client is closed.
createFeed(request, options)
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
]>;
Creates a feed in a parent project/folder/organization to listen to its asset updates.
request
options
Promise
<[ protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest
| undefined,
{} | undefined
]>
{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.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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").
*/
// const parent = 'abc123'
/**
* Required. This is the client-assigned asset feed identifier and it needs to
* be unique under a specific parent project/folder/organization.
*/
// const feedId = 'abc123'
/**
* 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
*/
// const feed = {}
// Imports the Asset library
const
{
AssetServiceClient
}
=
require
(
' @google-cloud/asset
'
).
v1p2beta1
;
// Instantiates a client
const
assetClient
=
new
AssetServiceClient
();
async
function
callCreateFeed
()
{
// Construct request
const
request
=
{
parent
,
feedId
,
feed
,
};
// Run request
const
response
=
await
assetClient
.
createFeed
(
request
);
console
.
log
(
response
);
}
callCreateFeed
();
createFeed(request, options, callback)
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
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest
| null | undefined, {} | null | undefined>
void
createFeed(request, callback)
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
;
request
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest
| null | undefined, {} | null | undefined>
void
deleteFeed(request, options)
deleteFeed
(
request
?:
protos
.
google
.
cloud
.
asset
.
v1p2beta1
.
IDeleteFeedRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
cloud
.
asset
.
v1p2beta1
.
IDeleteFeedRequest
|
undefined
,
{}
|
undefined
]>;
Deletes an asset feed.
request
options
Promise
<[ protos.google.protobuf.IEmpty
, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest
| undefined,
{} | undefined
]>
{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.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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
*/
// const name = 'abc123'
// Imports the Asset library
const
{
AssetServiceClient
}
=
require
(
' @google-cloud/asset
'
).
v1p2beta1
;
// Instantiates a client
const
assetClient
=
new
AssetServiceClient
();
async
function
callDeleteFeed
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
assetClient
.
deleteFeed
(
request
);
console
.
log
(
response
);
}
callDeleteFeed
();
deleteFeed(request, options, callback)
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
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest
| null | undefined, {} | null | undefined>
void
deleteFeed(request, callback)
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
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest
| null | undefined, {} | null | undefined>
void
folderFeedPath(folder, feed)
folderFeedPath
(
folder
:
string
,
feed
:
string
)
:
string
;
Return a fully-qualified folderFeed resource name string.
folder
string
feed
string
string
{string} Resource name string.
getFeed(request, options)
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
]>;
Gets details about an asset feed.
request
options
Promise
<[ protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.IGetFeedRequest
| undefined,
{} | undefined
]>
{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.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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
*/
// const name = 'abc123'
// Imports the Asset library
const
{
AssetServiceClient
}
=
require
(
' @google-cloud/asset
'
).
v1p2beta1
;
// Instantiates a client
const
assetClient
=
new
AssetServiceClient
();
async
function
callGetFeed
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
assetClient
.
getFeed
(
request
);
console
.
log
(
response
);
}
callGetFeed
();
getFeed(request, options, callback)
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
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.IGetFeedRequest
| null | undefined, {} | null | undefined>
void
getFeed(request, callback)
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
;
request
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.IGetFeedRequest
| null | undefined, {} | null | undefined>
void
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
void
initialize()
initialize
()
:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
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.
Promise
<{
[name: string]: Function
;
}>
{Promise} A promise that resolves to an authenticated service stub.
listFeeds(request, options)
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
]>;
Lists all asset feeds in a parent project/folder/organization.
request
options
Promise
<[ protos.google.cloud.asset.v1p2beta1.IListFeedsResponse
, protos.google.cloud.asset.v1p2beta1.IListFeedsRequest
| undefined,
{} | undefined
]>
{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.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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").
*/
// const parent = 'abc123'
// Imports the Asset library
const
{
AssetServiceClient
}
=
require
(
' @google-cloud/asset
'
).
v1p2beta1
;
// Instantiates a client
const
assetClient
=
new
AssetServiceClient
();
async
function
callListFeeds
()
{
// Construct request
const
request
=
{
parent
,
};
// Run request
const
response
=
await
assetClient
.
listFeeds
(
request
);
console
.
log
(
response
);
}
callListFeeds
();
listFeeds(request, options, callback)
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
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IListFeedsResponse
, protos.google.cloud.asset.v1p2beta1.IListFeedsRequest
| null | undefined, {} | null | undefined>
void
listFeeds(request, callback)
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
;
request
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IListFeedsResponse
, protos.google.cloud.asset.v1p2beta1.IListFeedsRequest
| null | undefined, {} | null | undefined>
void
matchFeedFromFolderFeedName(folderFeedName)
matchFeedFromFolderFeedName
(
folderFeedName
:
string
)
:
string
|
number
;
Parse the feed from FolderFeed resource.
folderFeedName
string
A fully-qualified path representing folder_feed resource.
string | number
{string} A string representing the feed.
matchFeedFromOrganizationFeedName(organizationFeedName)
matchFeedFromOrganizationFeedName
(
organizationFeedName
:
string
)
:
string
|
number
;
Parse the feed from OrganizationFeed resource.
organizationFeedName
string
A fully-qualified path representing organization_feed resource.
string | number
{string} A string representing the feed.
matchFeedFromProjectFeedName(projectFeedName)
matchFeedFromProjectFeedName
(
projectFeedName
:
string
)
:
string
|
number
;
Parse the feed from ProjectFeed resource.
projectFeedName
string
A fully-qualified path representing project_feed resource.
string | number
{string} A string representing the feed.
matchFolderFromFolderFeedName(folderFeedName)
matchFolderFromFolderFeedName
(
folderFeedName
:
string
)
:
string
|
number
;
Parse the folder from FolderFeed resource.
folderFeedName
string
A fully-qualified path representing folder_feed resource.
string | number
{string} A string representing the folder.
matchOrganizationFromOrganizationFeedName(organizationFeedName)
matchOrganizationFromOrganizationFeedName
(
organizationFeedName
:
string
)
:
string
|
number
;
Parse the organization from OrganizationFeed resource.
organizationFeedName
string
A fully-qualified path representing organization_feed resource.
string | number
{string} A string representing the organization.
matchProjectFromProjectFeedName(projectFeedName)
matchProjectFromProjectFeedName
(
projectFeedName
:
string
)
:
string
|
number
;
Parse the project from ProjectFeed resource.
projectFeedName
string
A fully-qualified path representing project_feed resource.
string | number
{string} A string representing the project.
organizationFeedPath(organization, feed)
organizationFeedPath
(
organization
:
string
,
feed
:
string
)
:
string
;
Return a fully-qualified organizationFeed resource name string.
organization
string
feed
string
string
{string} Resource name string.
projectFeedPath(project, feed)
projectFeedPath
(
project
:
string
,
feed
:
string
)
:
string
;
Return a fully-qualified projectFeed resource name string.
project
string
feed
string
string
{string} Resource name string.
updateFeed(request, options)
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
]>;
Updates an asset feed configuration.
request
options
Promise
<[ protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest
| undefined,
{} | undefined
]>
{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.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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.
*/
// const feed = {}
/**
* 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.
*/
// const updateMask = {}
// Imports the Asset library
const
{
AssetServiceClient
}
=
require
(
' @google-cloud/asset
'
).
v1p2beta1
;
// Instantiates a client
const
assetClient
=
new
AssetServiceClient
();
async
function
callUpdateFeed
()
{
// Construct request
const
request
=
{
feed
,
updateMask
,
};
// Run request
const
response
=
await
assetClient
.
updateFeed
(
request
);
console
.
log
(
response
);
}
callUpdateFeed
();
updateFeed(request, options, callback)
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
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest
| null | undefined, {} | null | undefined>
void
updateFeed(request, callback)
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
;
request
callback
Callback
< protos.google.cloud.asset.v1p2beta1.IFeed
, protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest
| null | undefined, {} | null | undefined>
void