A Notification object is created from your Bucket object using . Use it to interact with Cloud Pub/Sub notifications.
Inheritance
ServiceObject > NotificationPackage
@google-cloud/storageExample
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
Methods
delete(options)
delete
(
options
?:
DeleteNotificationOptions
)
:
Promise
< [
Metadata
]>;
Returns
Type
Description
Promise
<[ Metadata
]>
delete(options, callback)
delete
(
options
:
DeleteNotificationOptions
,
callback
:
DeleteNotificationCallback
)
:
void
;
Returns
Type
Description
void
delete(callback)
delete
(
callback
:
DeleteNotificationCallback
)
:
void
;
Returns
Type
Description
void
get(options)
get
(
options
?:
GetNotificationOptions
)
:
Promise<GetNotificationResponse>
;
get(options, callback)
get
(
options
:
GetNotificationOptions
,
callback
:
GetNotificationCallback
)
:
void
;
Returns
Type
Description
void
get(callback)
get
(
callback
:
GetNotificationCallback
)
:
void
;
Returns
Type
Description
void
getMetadata(options)
getMetadata
(
options
?:
GetNotificationMetadataOptions
)
:
Promise<GetNotificationMetadataResponse>
;
getMetadata(options, callback)
getMetadata
(
options
:
GetNotificationMetadataOptions
,
callback
:
MetadataCallback
)
:
void
;
Returns
Type
Description
void
getMetadata(callback)
getMetadata
(
callback
:
MetadataCallback
)
:
void
;
Parameter
Name
Description
callback
MetadataCallback
Returns
Type
Description
void