Service to manage Security and Privacy Notifications. v1
Package
@google-cloud/advisorynotificationsConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of AdvisoryNotificationsServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
advisoryNotificationsServiceStub
advisoryNotificationsServiceStub?: Promise<{
[name: string]: Function;
}>;
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
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.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
getNotification(request, options)
getNotification(request?: protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest, options?: CallOptions): Promise<[
protos.google.cloud.advisorynotifications.v1.INotification,
(protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest | undefined),
{} | undefined
]>;
Gets a notification.
Parameters | |
---|---|
Name | Description |
request |
IGetNotificationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.advisorynotifications.v1.INotification,
(protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing Notification. 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. A name of the notification to retrieve.
* Format:
* organizations/{organization}/locations/{location}/notifications/{notification}
* or projects/{projects}/locations/{location}/notifications/{notification}.
*/
// const name = 'abc123'
/**
* ISO code for requested localization language. If unset, will be
* interpereted as "en". If the requested language is valid, but not supported
* for this notification, English will be returned with an "Not applicable"
* LocalizationState. If the ISO code is invalid (i.e. not a real language),
* this RPC will throw an error.
*/
// const languageCode = 'abc123'
// Imports the Advisorynotifications library
const {AdvisoryNotificationsServiceClient} = require('@google-cloud/advisorynotifications').v1;
// Instantiates a client
const advisorynotificationsClient = new AdvisoryNotificationsServiceClient();
async function callGetNotification() {
// Construct request
const request = {
name,
};
// Run request
const response = await advisorynotificationsClient.getNotification(request);
console.log(response);
}
callGetNotification();
getNotification(request, options, callback)
getNotification(request: protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest, options: CallOptions, callback: Callback<protos.google.cloud.advisorynotifications.v1.INotification, protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetNotificationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.advisorynotifications.v1.INotification, protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getNotification(request, callback)
getNotification(request: protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest, callback: Callback<protos.google.cloud.advisorynotifications.v1.INotification, protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetNotificationRequest
|
callback |
Callback<protos.google.cloud.advisorynotifications.v1.INotification, protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
getSettings(request, options)
getSettings(request?: protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest, options?: CallOptions): Promise<[
protos.google.cloud.advisorynotifications.v1.ISettings,
(protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest | undefined),
{} | undefined
]>;
Get notification settings.
Parameters | |
---|---|
Name | Description |
request |
IGetSettingsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.advisorynotifications.v1.ISettings,
(protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing Settings. 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 resource name of the settings to retrieve.
* Format:
* organizations/{organization}/locations/{location}/settings.
*/
// const name = 'abc123'
// Imports the Advisorynotifications library
const {AdvisoryNotificationsServiceClient} = require('@google-cloud/advisorynotifications').v1;
// Instantiates a client
const advisorynotificationsClient = new AdvisoryNotificationsServiceClient();
async function callGetSettings() {
// Construct request
const request = {
name,
};
// Run request
const response = await advisorynotificationsClient.getSettings(request);
console.log(response);
}
callGetSettings();
getSettings(request, options, callback)
getSettings(request: protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest, options: CallOptions, callback: Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetSettingsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getSettings(request, callback)
getSettings(request: protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest, callback: Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetSettingsRequest
|
callback |
Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
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.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
listNotifications(request, options)
listNotifications(request?: protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, options?: CallOptions): Promise<[
protos.google.cloud.advisorynotifications.v1.INotification[],
protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest | null,
protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse
]>;
Lists notifications under a given parent.
Parameters | |
---|---|
Name | Description |
request |
IListNotificationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.advisorynotifications.v1.INotification[],
protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest | null,
protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of Notification. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listNotifications(request, options, callback)
listNotifications(request: protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse | null | undefined, protos.google.cloud.advisorynotifications.v1.INotification>): void;
Parameters | |
---|---|
Name | Description |
request |
IListNotificationsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse | null | undefined, protos.google.cloud.advisorynotifications.v1.INotification>
|
Returns | |
---|---|
Type | Description |
void |
listNotifications(request, callback)
listNotifications(request: protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, callback: PaginationCallback<protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse | null | undefined, protos.google.cloud.advisorynotifications.v1.INotification>): void;
Parameters | |
---|---|
Name | Description |
request |
IListNotificationsRequest
|
callback |
PaginationCallback<protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse | null | undefined, protos.google.cloud.advisorynotifications.v1.INotification>
|
Returns | |
---|---|
Type | Description |
void |
listNotificationsAsync(request, options)
listNotificationsAsync(request?: protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.advisorynotifications.v1.INotification>;
Equivalent to listNotifications
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListNotificationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.advisorynotifications.v1.INotification> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Notification. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation 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, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
* or "projects/{project}/locations/{location}"
*/
// const parent = 'abc123'
/**
* The maximum number of notifications to return. The service may return
* fewer than this value. If unspecified or equal to 0, at most 50
* notifications will be returned. The maximum value is 50; values above 50
* will be coerced to 50.
*/
// const pageSize = 1234
/**
* A page token returned from a previous request.
* When paginating, all other parameters provided in the request
* must match the call that returned the page token.
*/
// const pageToken = 'abc123'
/**
* Specifies which parts of the notification resource should be returned
* in the response.
*/
// const view = {}
/**
* ISO code for requested localization language. If unset, will be
* interpereted as "en". If the requested language is valid, but not supported
* for this notification, English will be returned with an "Not applicable"
* LocalizationState. If the ISO code is invalid (i.e. not a real language),
* this RPC will throw an error.
*/
// const languageCode = 'abc123'
// Imports the Advisorynotifications library
const {AdvisoryNotificationsServiceClient} = require('@google-cloud/advisorynotifications').v1;
// Instantiates a client
const advisorynotificationsClient = new AdvisoryNotificationsServiceClient();
async function callListNotifications() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await advisorynotificationsClient.listNotificationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListNotifications();
listNotificationsStream(request, options)
listNotificationsStream(request?: protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListNotificationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing Notification on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
matchLocationFromOrganizationLocationName(organizationLocationName)
matchLocationFromOrganizationLocationName(organizationLocationName: string): string | number;
Parse the location from OrganizationLocation resource.
Parameter | |
---|---|
Name | Description |
organizationLocationName |
string
A fully-qualified path representing organization_location resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromOrganizationLocationNotificationName(organizationLocationNotificationName)
matchLocationFromOrganizationLocationNotificationName(organizationLocationNotificationName: string): string | number;
Parse the location from OrganizationLocationNotification resource.
Parameter | |
---|---|
Name | Description |
organizationLocationNotificationName |
string
A fully-qualified path representing organization_location_notification resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromProjectLocationNotificationName(projectLocationNotificationName)
matchLocationFromProjectLocationNotificationName(projectLocationNotificationName: string): string | number;
Parse the location from ProjectLocationNotification resource.
Parameter | |
---|---|
Name | Description |
projectLocationNotificationName |
string
A fully-qualified path representing project_location_notification resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromSettingsName(settingsName)
matchLocationFromSettingsName(settingsName: string): string | number;
Parse the location from Settings resource.
Parameter | |
---|---|
Name | Description |
settingsName |
string
A fully-qualified path representing Settings resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchNotificationFromOrganizationLocationNotificationName(organizationLocationNotificationName)
matchNotificationFromOrganizationLocationNotificationName(organizationLocationNotificationName: string): string | number;
Parse the notification from OrganizationLocationNotification resource.
Parameter | |
---|---|
Name | Description |
organizationLocationNotificationName |
string
A fully-qualified path representing organization_location_notification resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the notification. |
matchNotificationFromProjectLocationNotificationName(projectLocationNotificationName)
matchNotificationFromProjectLocationNotificationName(projectLocationNotificationName: string): string | number;
Parse the notification from ProjectLocationNotification resource.
Parameter | |
---|---|
Name | Description |
projectLocationNotificationName |
string
A fully-qualified path representing project_location_notification resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the notification. |
matchOrganizationFromOrganizationLocationName(organizationLocationName)
matchOrganizationFromOrganizationLocationName(organizationLocationName: string): string | number;
Parse the organization from OrganizationLocation resource.
Parameter | |
---|---|
Name | Description |
organizationLocationName |
string
A fully-qualified path representing organization_location resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchOrganizationFromOrganizationLocationNotificationName(organizationLocationNotificationName)
matchOrganizationFromOrganizationLocationNotificationName(organizationLocationNotificationName: string): string | number;
Parse the organization from OrganizationLocationNotification resource.
Parameter | |
---|---|
Name | Description |
organizationLocationNotificationName |
string
A fully-qualified path representing organization_location_notification resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchOrganizationFromSettingsName(settingsName)
matchOrganizationFromSettingsName(settingsName: string): string | number;
Parse the organization from Settings resource.
Parameter | |
---|---|
Name | Description |
settingsName |
string
A fully-qualified path representing Settings resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchProjectFromProjectLocationNotificationName(projectLocationNotificationName)
matchProjectFromProjectLocationNotificationName(projectLocationNotificationName: string): string | number;
Parse the project from ProjectLocationNotification resource.
Parameter | |
---|---|
Name | Description |
projectLocationNotificationName |
string
A fully-qualified path representing project_location_notification resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
organizationLocationNotificationPath(organization, location, notification)
organizationLocationNotificationPath(organization: string, location: string, notification: string): string;
Return a fully-qualified organizationLocationNotification resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
notification |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
organizationLocationPath(organization, location)
organizationLocationPath(organization: string, location: string): string;
Return a fully-qualified organizationLocation resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectLocationNotificationPath(project, location, notification)
projectLocationNotificationPath(project: string, location: string, notification: string): string;
Return a fully-qualified projectLocationNotification resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
notification |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
settingsPath(organization, location)
settingsPath(organization: string, location: string): string;
Return a fully-qualified settings resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
updateSettings(request, options)
updateSettings(request?: protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest, options?: CallOptions): Promise<[
protos.google.cloud.advisorynotifications.v1.ISettings,
(protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest | undefined),
{} | undefined
]>;
Update notification settings.
Parameters | |
---|---|
Name | Description |
request |
IUpdateSettingsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.advisorynotifications.v1.ISettings,
(protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing Settings. 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. New settings.
*/
// const settings = {}
// Imports the Advisorynotifications library
const {AdvisoryNotificationsServiceClient} = require('@google-cloud/advisorynotifications').v1;
// Instantiates a client
const advisorynotificationsClient = new AdvisoryNotificationsServiceClient();
async function callUpdateSettings() {
// Construct request
const request = {
settings,
};
// Run request
const response = await advisorynotificationsClient.updateSettings(request);
console.log(response);
}
callUpdateSettings();
updateSettings(request, options, callback)
updateSettings(request: protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest, options: CallOptions, callback: Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateSettingsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateSettings(request, callback)
updateSettings(request: protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest, callback: Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateSettingsRequest
|
callback |
Callback<protos.google.cloud.advisorynotifications.v1.ISettings, protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |