/**
* 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}".
*/
// 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 = newAdvisoryNotificationsServiceClient();
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();
Samples
Samples are in thesamples/directory. Each sample'sREADME.mdhas instructions for running its sample.
Our client libraries follow theNode.js release schedule.
Libraries are compatible with all currentactiveandmaintenanceversions of
Node.js.
If you are using an end-of-life version of Node.js, we recommend that you update
as soon as possible to an actively supported LTS version.
Google's client libraries support legacy versions of Node.js runtimes on a
best-efforts basis with the following warnings:
Legacy versions are not tested in continuous integration.
Some security patches and features cannot be backported.
Dependencies cannot be kept up-to-date.
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed through npmdist-tags.
The dist-tags follow the naming conventionlegacy-(version).
For example,npm install @google-cloud/advisorynotifications@legacy-8installs client libraries
for versions compatible with Node.js 8.
This library is considered to be inpreview. This means it is still a
work-in-progress and under active development. Any release is subject to
backwards-incompatible changes at any time.
Please note that thisREADME.md, thesamples/README.md,
and a variety of configuration files in this repository (including.nycrcandtsconfig.json)
are generated from a central template. To edit one of these files, make an edit
to its templates indirectory.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/nodejs/docs/reference/advisorynotifications/latest)\n- [0.2.1](/nodejs/docs/reference/advisorynotifications/0.2.1)\n- [0.1.0](/nodejs/docs/reference/advisorynotifications/0.1.0) \n\n[Advisory Notifications API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-advisorynotifications)\n===================================================================================================================================================\n\n[](https://cloud.google.com/terms/launch-stages)\n[](https://www.npmjs.org/package/@google-cloud/advisorynotifications)\n\nAdvisory Notifications API client for Node.js\n\nA comprehensive list of changes in each version may be found in\n[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-advisorynotifications/CHANGELOG.md).\n\n- [Advisory Notifications API Node.js Client API Reference](https://cloud.google.com/nodejs/docs/reference/advisorynotifications/latest)\n- [Advisory Notifications API Documentation](https://cloud.google.com/advisory-notifications/docs/overview)\n- [github.com/googleapis/google-cloud-node/packages/google-cloud-advisorynotifications](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-advisorynotifications)\n\nRead more about the client libraries for Cloud APIs, including the older\nGoogle APIs Client Libraries, in [Client Libraries Explained](https://cloud.google.com/apis/docs/client-libraries-explained).\n\n**Table of contents:**\n\n- [Quickstart](#quickstart)\n - [Before you begin](#before-you-begin)\n - [Installing the client library](#installing-the-client-library)\n - [Using the client library](#using-the-client-library)\n- [Samples](#samples)\n- [Versioning](#versioning)\n- [Contributing](#contributing)\n- [License](#license)\n\nQuickstart\n----------\n\n### Before you begin\n\n1. [Select or create a Cloud Platform project](https://console.cloud.google.com/project).\n2. [Enable billing for your project](https://support.google.com/cloud/answer/6293499#enable-billing).\n3. [Enable the Advisory Notifications API API](https://console.cloud.google.com/flows/enableapi?apiid=advisorynotifications.googleapis.com).\n4. [Set up authentication with a service account](https://cloud.google.com/docs/authentication/getting-started) so you can access the API from your local workstation.\n\n### Installing the client library\n\n npm install @google-cloud/advisorynotifications\n\n### Using the client library\n\n /**\n * This snippet has been automatically generated and should be regarded as a code template only.\n * It will require modifications to work.\n * It may require correct/in-range values for request initialization.\n * TODO(developer): Uncomment these variables before running the sample.\n */\n /**\n * Required. The parent, which owns this collection of notifications.\n * Must be of the form \"organizations/{organization}/locations/{location}\".\n */\n // const parent = 'abc123'\n /**\n * The maximum number of notifications to return. The service may return\n * fewer than this value. If unspecified or equal to 0, at most 50\n * notifications will be returned. The maximum value is 50; values above 50\n * will be coerced to 50.\n */\n // const pageSize = 1234\n /**\n * A page token returned from a previous request.\n * When paginating, all other parameters provided in the request\n * must match the call that returned the page token.\n */\n // const pageToken = 'abc123'\n /**\n * Specifies which parts of the notification resource should be returned\n * in the response.\n */\n // const view = {}\n /**\n * ISO code for requested localization language. If unset, will be\n * interpereted as \"en\". If the requested language is valid, but not supported\n * for this notification, English will be returned with an \"Not applicable\"\n * LocalizationState. If the ISO code is invalid (i.e. not a real language),\n * this RPC will throw an error.\n */\n // const languageCode = 'abc123'\n\n // Imports the Advisorynotifications library\n const {AdvisoryNotificationsServiceClient} =\n require('https://cloud.google.com/nodejs/docs/reference/advisorynotifications/latest/overview.html').v1;\n\n // Instantiates a client\n const advisorynotificationsClient = new https://cloud.google.com/nodejs/docs/reference/advisorynotifications/latest/overview.html();\n\n async function callListNotifications() {\n // Construct request\n const request = {\n parent,\n };\n\n // Run request\n const iterable =\n await advisorynotificationsClient.https://cloud.google.com/nodejs/docs/reference/advisorynotifications/latest/advisorynotifications/v1.advisorynotificationsserviceclient.html(request);\n for await (const response of iterable) {\n console.log(response);\n }\n }\n\n callListNotifications();\n\nSamples\n-------\n\nSamples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-advisorynotifications/samples) directory. Each sample's `README.md` has instructions for running its sample.\n\nThe [Advisory Notifications API Node.js Client API Reference](https://cloud.google.com/nodejs/docs/reference/advisorynotifications/latest) documentation\nalso contains samples.\n\nSupported Node.js Versions\n--------------------------\n\nOur client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule).\nLibraries are compatible with all current *active* and *maintenance* versions of\nNode.js.\nIf you are using an end-of-life version of Node.js, we recommend that you update\nas soon as possible to an actively supported LTS version.\n\nGoogle's client libraries support legacy versions of Node.js runtimes on a\nbest-efforts basis with the following warnings:\n\n- Legacy versions are not tested in continuous integration.\n- Some security patches and features cannot be backported.\n- Dependencies cannot be kept up-to-date.\n\nClient libraries targeting some end-of-life versions of Node.js are available, and\ncan be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).\nThe dist-tags follow the naming convention `legacy-(version)`.\nFor example, `npm install @google-cloud/advisorynotifications@legacy-8` installs client libraries\nfor versions compatible with Node.js 8.\n\nVersioning\n----------\n\nThis library follows [Semantic Versioning](http://semver.org/).\n\nThis library is considered to be in **preview**. This means it is still a\nwork-in-progress and under active development. Any release is subject to\nbackwards-incompatible changes at any time.\n\nMore Information: [Google Cloud Platform Launch Stages](https://cloud.google.com/terms/launch-stages)\n\nContributing\n------------\n\nContributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md).\n\nPlease note that this `README.md`, the `samples/README.md`,\nand a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)\nare generated from a central template. To edit one of these files, make an edit\nto its templates in\n[directory](https://github.com/googleapis/synthtool).\n\nLicense\n-------\n\nApache Version 2.0\n\nSee [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)"]]