Constructor

Channel

new Channel(id, resourceId)

Create a channel object to interact with a Cloud Storage channel.

Parameter

id

string

The ID of the channel.

resourceId

string

The resource ID of the channel.

See also

Object Change Notification

Example

var storage = require('@google-cloud/storage')();
var channel = storage.channel('id', 'resource-id');

Method

stop

stop(callback) returns Promise containing StopResponse

Stop this channel.

Parameter

callback

Optional

StopCallback

Callback function.

Returns

Promise containing StopResponse 

Example

var storage = require('@google-cloud/storage')();
var 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) {
  var apiResponse = data[0];
});