Class Notification (6.11.0)

A Notification object is created from your Bucket object using . Use it to interact with Cloud Pub/Sub notifications.

See Cloud Pub/Sub Notifications for Google Cloud Storage

Inheritance

ServiceObject > Notification

Package

@google-cloud/storage

Example


const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const myBucket = storage.bucket('my-bucket');

const notification = myBucket.notification('1');

Constructors

(constructor)(bucket, id)

constructor(bucket: Bucket, id: string);

Constructs a new instance of the Notification class

Parameters
NameDescription
bucket Bucket
id string

Methods

delete(options)

delete(options?: DeleteNotificationOptions): Promise<[Metadata]>;
Parameter
NameDescription
options DeleteNotificationOptions
Returns
TypeDescription
Promise<[Metadata]>

delete(options, callback)

delete(options: DeleteNotificationOptions, callback: DeleteNotificationCallback): void;
Parameters
NameDescription
options DeleteNotificationOptions
callback DeleteNotificationCallback
Returns
TypeDescription
void

delete(callback)

delete(callback: DeleteNotificationCallback): void;
Parameter
NameDescription
callback DeleteNotificationCallback
Returns
TypeDescription
void

get(options)

get(options?: GetNotificationOptions): Promise<GetNotificationResponse>;
Parameter
NameDescription
options GetNotificationOptions
Returns
TypeDescription
Promise<GetNotificationResponse>

get(options, callback)

get(options: GetNotificationOptions, callback: GetNotificationCallback): void;
Parameters
NameDescription
options GetNotificationOptions
callback GetNotificationCallback
Returns
TypeDescription
void

get(callback)

get(callback: GetNotificationCallback): void;
Parameter
NameDescription
callback GetNotificationCallback
Returns
TypeDescription
void

getMetadata(options)

getMetadata(options?: GetNotificationMetadataOptions): Promise<GetNotificationMetadataResponse>;
Parameter
NameDescription
options GetNotificationMetadataOptions
Returns
TypeDescription
Promise<GetNotificationMetadataResponse>

getMetadata(options, callback)

getMetadata(options: GetNotificationMetadataOptions, callback: MetadataCallback): void;
Parameters
NameDescription
options GetNotificationMetadataOptions
callback MetadataCallback
Returns
TypeDescription
void

getMetadata(callback)

getMetadata(callback: MetadataCallback): void;
Parameter
NameDescription
callback MetadataCallback
Returns
TypeDescription
void