Constructor

Channel

new Channel(id, resourceId)

Parameter

id

string

The ID of the channel.

resourceId

string

The resource ID of the channel.

See also

Object Change Notification

Example

const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const 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

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];
});