1 | import { Metadata, ServiceObject } from './nodejs-common';
|
2 | import { Storage } from './storage';
|
3 | export interface StopCallback {
|
4 | (err: Error | null, apiResponse?: Metadata): void;
|
5 | }
|
6 | /**
|
7 | * Create a channel object to interact with a Cloud Storage channel.
|
8 | *
|
9 | * See {@link https://cloud.google.com/storage/docs/object-change-notification| Object Change Notification}
|
10 | *
|
11 | * @class
|
12 | *
|
13 | * @param {string} id The ID of the channel.
|
14 | * @param {string} resourceId The resource ID of the channel.
|
15 | *
|
16 | * @example
|
17 | * ```
|
18 | * const {Storage} = require('@google-cloud/storage');
|
19 | * const storage = new Storage();
|
20 | * const channel = storage.channel('id', 'resource-id');
|
21 | * ```
|
22 | */
|
23 | declare class Channel extends ServiceObject {
|
24 | constructor(storage: Storage, id: string, resourceId: string);
|
25 | stop(): Promise<Metadata>;
|
26 | stop(callback: StopCallback): void;
|
27 | }
|
28 | /**
|
29 | * Reference to the {class.
Channel} |
30 | * module:@google-cloud/storage.Channel
|
31 | * @see Channel
|
32 | */
|
33 | export { Channel };
|