Constructor
new Channel(id, resourceId)
Parameters:
Name | Type | Description |
---|---|---|
id |
string |
The ID of the channel. |
resourceId |
string |
The resource ID of the channel. |
Methods
stop(callbackopt) → {Promise.<StopResponse>}
Stop this channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
StopCallback |
<optional> |
Callback function. |
Returns:
Type | Description |
---|---|
Promise.<StopResponse> |
Example
```
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const channel = storage.channel('id', 'resource-id');
channel.stop(function(err, apiResponse) {
if (!err) {
// Channel stopped successfully.
}
});
//-
// If the callback is omitted, we'll return a Promise.
//-
channel.stop().then(function(data) {
const apiResponse = data[0];
});
```