Class Notification (6.5.4)

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
Name Description
bucket Bucket
id string

Methods

delete(options)

  delete 
 ( 
 options 
 ?: 
  
 DeleteNotificationOptions 
 ) 
 : 
  
 Promise 
< [ 
 Metadata 
 ]>; 
 
Parameter
Name Description
options DeleteNotificationOptions
Returns
Type Description
Promise <[ Metadata ]>

delete(options, callback)

  delete 
 ( 
 options 
 : 
  
 DeleteNotificationOptions 
 , 
  
 callback 
 : 
  
 DeleteNotificationCallback 
 ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
options DeleteNotificationOptions
callback DeleteNotificationCallback
Returns
Type Description
void

delete(callback)

  delete 
 ( 
 callback 
 : 
  
 DeleteNotificationCallback 
 ) 
 : 
  
 void 
 ; 
 
Parameter
Name Description
callback DeleteNotificationCallback
Returns
Type Description
void

get(options)

  get 
 ( 
 options 
 ?: 
  
 GetNotificationOptions 
 ) 
 : 
  
 Promise<GetNotificationResponse> 
 ; 
 
Parameter
Name Description
options GetNotificationOptions
Returns
Type Description
Promise < GetNotificationResponse >

get(options, callback)

  get 
 ( 
 options 
 : 
  
 GetNotificationOptions 
 , 
  
 callback 
 : 
  
 GetNotificationCallback 
 ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
options GetNotificationOptions
callback GetNotificationCallback
Returns
Type Description
void

get(callback)

  get 
 ( 
 callback 
 : 
  
 GetNotificationCallback 
 ) 
 : 
  
 void 
 ; 
 
Parameter
Name Description
callback GetNotificationCallback
Returns
Type Description
void
  getMetadata 
 ( 
 options 
 ?: 
  
 GetNotificationMetadataOptions 
 ) 
 : 
  
 Promise<GetNotificationMetadataResponse> 
 ; 
 
Parameter
Name Description
options GetNotificationMetadataOptions
Returns
Type Description
Promise < GetNotificationMetadataResponse >
  getMetadata 
 ( 
 options 
 : 
  
 GetNotificationMetadataOptions 
 , 
  
 callback 
 : 
  
 MetadataCallback 
 ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
options GetNotificationMetadataOptions
callback MetadataCallback
Returns
Type Description
void
  getMetadata 
 ( 
 callback 
 : 
  
 MetadataCallback 
 ) 
 : 
  
 void 
 ; 
 
Parameter
Name Description
callback MetadataCallback
Returns
Type Description
void
Design a Mobile Site
View Site in Mobile | Classic
Share by: