UNPKG

45.2 kBTypeScriptView Raw
1/// <reference types="node" />
2import * as gax from 'google-gax';
3import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, IamClient, IamProtos } from 'google-gax';
4import { Transform } from 'stream';
5import * as protos from '../../protos/protos';
6/**
7 * The service that an application uses to manipulate topics, and to send
8 * messages to a topic.
9 * @class
10 * @memberof v1
11 */
12export declare class PublisherClient {
13 private _terminated;
14 private _opts;
15 private _providedCustomServicePath;
16 private _gaxModule;
17 private _gaxGrpc;
18 private _protos;
19 private _defaults;
20 auth: gax.GoogleAuth;
21 descriptors: Descriptors;
22 warn: (code: string, message: string, warnType?: string) => void;
23 innerApiCalls: {
24 [name: string]: Function;
25 };
26 iamClient: IamClient;
27 pathTemplates: {
28 [name: string]: gax.PathTemplate;
29 };
30 publisherStub?: Promise<{
31 [name: string]: Function;
32 }>;
33 /**
34 * Construct an instance of PublisherClient.
35 *
36 * @param {object} [options] - The configuration object.
37 * The options accepted by the constructor are described in detail
38 * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
39 * The common options are:
40 * @param {object} [options.credentials] - Credentials object.
41 * @param {string} [options.credentials.client_email]
42 * @param {string} [options.credentials.private_key]
43 * @param {string} [options.email] - Account email address. Required when
44 * using a .pem or .p12 keyFilename.
45 * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
46 * .p12 key downloaded from the Google Developers Console. If you provide
47 * a path to a JSON file, the projectId option below is not necessary.
48 * NOTE: .pem and .p12 require you to specify options.email as well.
49 * @param {number} [options.port] - The port on which to connect to
50 * the remote host.
51 * @param {string} [options.projectId] - The project ID from the Google
52 * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
53 * the environment variable GCLOUD_PROJECT for your project ID. If your
54 * app is running in an environment which supports
55 * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
56 * your project ID will be detected automatically.
57 * @param {string} [options.apiEndpoint] - The domain name of the
58 * API remote host.
59 * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
60 * Follows the structure of {@link gapicConfig}.
61 * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
62 * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
63 * For more information, please check the
64 * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
65 */
66 constructor(opts?: ClientOptions);
67 /**
68 * Initialize the client.
69 * Performs asynchronous operations (such as authentication) and prepares the client.
70 * This function will be called automatically when any class method is called for the
71 * first time, but if you need to initialize it before calling an actual method,
72 * feel free to call initialize() directly.
73 *
74 * You can await on this method if you want to make sure the client is initialized.
75 *
76 * @returns {Promise} A promise that resolves to an authenticated service stub.
77 */
78 initialize(): Promise<{
79 [name: string]: Function;
80 }>;
81 /**
82 * The DNS address for this API service.
83 * @returns {string} The DNS address for this service.
84 */
85 static get servicePath(): string;
86 /**
87 * The DNS address for this API service - same as servicePath(),
88 * exists for compatibility reasons.
89 * @returns {string} The DNS address for this service.
90 */
91 static get apiEndpoint(): string;
92 /**
93 * The port for this API service.
94 * @returns {number} The default port for this service.
95 */
96 static get port(): number;
97 /**
98 * The scopes needed to make gRPC calls for every method defined
99 * in this service.
100 * @returns {string[]} List of default scopes.
101 */
102 static get scopes(): string[];
103 getProjectId(): Promise<string>;
104 getProjectId(callback: Callback<string, undefined, undefined>): void;
105 /**
106 * Creates the given topic with the given name. See the [resource name rules]
107 * (https://cloud.google.com/pubsub/docs/admin#resource_names).
108 *
109 * @param {Object} request
110 * The request object that will be sent.
111 * @param {string} request.name
112 * Required. The name of the topic. It must have the format
113 * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
114 * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
115 * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
116 * signs (`%`). It must be between 3 and 255 characters in length, and it
117 * must not start with `"goog"`.
118 * @param {number[]} request.labels
119 * See [Creating and managing labels]
120 * (https://cloud.google.com/pubsub/docs/labels).
121 * @param {google.pubsub.v1.MessageStoragePolicy} request.messageStoragePolicy
122 * Policy constraining the set of Google Cloud Platform regions where messages
123 * published to the topic may be stored. If not present, then no constraints
124 * are in effect.
125 * @param {string} request.kmsKeyName
126 * The resource name of the Cloud KMS CryptoKey to be used to protect access
127 * to messages published on this topic.
128 *
129 * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`.
130 * @param {google.pubsub.v1.SchemaSettings} request.schemaSettings
131 * Settings for validating messages published against a schema.
132 * @param {boolean} request.satisfiesPzs
133 * Reserved for future use. This field is set only in responses from the
134 * server; it is ignored if it is set in any requests.
135 * @param {google.protobuf.Duration} request.messageRetentionDuration
136 * Indicates the minimum duration to retain a message after it is published to
137 * the topic. If this field is set, messages published to the topic in the
138 * last `message_retention_duration` are always available to subscribers. For
139 * instance, it allows any attached subscription to [seek to a
140 * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
141 * that is up to `message_retention_duration` in the past. If this field is
142 * not set, message retention is controlled by settings on individual
143 * subscriptions. Cannot be more than 7 days or less than 10 minutes.
144 * @param {object} [options]
145 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
146 * @returns {Promise} - The promise which resolves to an array.
147 * The first element of the array is an object representing [Topic]{@link google.pubsub.v1.Topic}.
148 * Please see the
149 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
150 * for more details and examples.
151 */
152 createTopic(request?: protos.google.pubsub.v1.ITopic, options?: CallOptions): Promise<[
153 protos.google.pubsub.v1.ITopic,
154 protos.google.pubsub.v1.ITopic | undefined,
155 {} | undefined
156 ]>;
157 createTopic(request: protos.google.pubsub.v1.ITopic, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ITopic, protos.google.pubsub.v1.ITopic | null | undefined, {} | null | undefined>): void;
158 createTopic(request: protos.google.pubsub.v1.ITopic, callback: Callback<protos.google.pubsub.v1.ITopic, protos.google.pubsub.v1.ITopic | null | undefined, {} | null | undefined>): void;
159 /**
160 * Updates an existing topic. Note that certain properties of a
161 * topic are not modifiable.
162 *
163 * @param {Object} request
164 * The request object that will be sent.
165 * @param {google.pubsub.v1.Topic} request.topic
166 * Required. The updated topic object.
167 * @param {google.protobuf.FieldMask} request.updateMask
168 * Required. Indicates which fields in the provided topic to update. Must be
169 * specified and non-empty. Note that if `update_mask` contains
170 * "message_storage_policy" but the `message_storage_policy` is not set in
171 * the `topic` provided above, then the updated value is determined by the
172 * policy configured at the project or organization level.
173 * @param {object} [options]
174 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
175 * @returns {Promise} - The promise which resolves to an array.
176 * The first element of the array is an object representing [Topic]{@link google.pubsub.v1.Topic}.
177 * Please see the
178 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
179 * for more details and examples.
180 */
181 updateTopic(request?: protos.google.pubsub.v1.IUpdateTopicRequest, options?: CallOptions): Promise<[
182 protos.google.pubsub.v1.ITopic,
183 protos.google.pubsub.v1.IUpdateTopicRequest | undefined,
184 {} | undefined
185 ]>;
186 updateTopic(request: protos.google.pubsub.v1.IUpdateTopicRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ITopic, protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, {} | null | undefined>): void;
187 updateTopic(request: protos.google.pubsub.v1.IUpdateTopicRequest, callback: Callback<protos.google.pubsub.v1.ITopic, protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, {} | null | undefined>): void;
188 /**
189 * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
190 * does not exist.
191 *
192 * @param {Object} request
193 * The request object that will be sent.
194 * @param {string} request.topic
195 * Required. The messages in the request will be published on this topic.
196 * Format is `projects/{project}/topics/{topic}`.
197 * @param {number[]} request.messages
198 * Required. The messages to publish.
199 * @param {object} [options]
200 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
201 * @returns {Promise} - The promise which resolves to an array.
202 * The first element of the array is an object representing [PublishResponse]{@link google.pubsub.v1.PublishResponse}.
203 * Please see the
204 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
205 * for more details and examples.
206 */
207 publish(request?: protos.google.pubsub.v1.IPublishRequest, options?: CallOptions): Promise<[
208 protos.google.pubsub.v1.IPublishResponse,
209 protos.google.pubsub.v1.IPublishRequest | undefined,
210 {} | undefined
211 ]>;
212 publish(request: protos.google.pubsub.v1.IPublishRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.IPublishResponse, protos.google.pubsub.v1.IPublishRequest | null | undefined, {} | null | undefined>): void;
213 publish(request: protos.google.pubsub.v1.IPublishRequest, callback: Callback<protos.google.pubsub.v1.IPublishResponse, protos.google.pubsub.v1.IPublishRequest | null | undefined, {} | null | undefined>): void;
214 /**
215 * Gets the configuration of a topic.
216 *
217 * @param {Object} request
218 * The request object that will be sent.
219 * @param {string} request.topic
220 * Required. The name of the topic to get.
221 * Format is `projects/{project}/topics/{topic}`.
222 * @param {object} [options]
223 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
224 * @returns {Promise} - The promise which resolves to an array.
225 * The first element of the array is an object representing [Topic]{@link google.pubsub.v1.Topic}.
226 * Please see the
227 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
228 * for more details and examples.
229 */
230 getTopic(request?: protos.google.pubsub.v1.IGetTopicRequest, options?: CallOptions): Promise<[
231 protos.google.pubsub.v1.ITopic,
232 protos.google.pubsub.v1.IGetTopicRequest | undefined,
233 {} | undefined
234 ]>;
235 getTopic(request: protos.google.pubsub.v1.IGetTopicRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ITopic, protos.google.pubsub.v1.IGetTopicRequest | null | undefined, {} | null | undefined>): void;
236 getTopic(request: protos.google.pubsub.v1.IGetTopicRequest, callback: Callback<protos.google.pubsub.v1.ITopic, protos.google.pubsub.v1.IGetTopicRequest | null | undefined, {} | null | undefined>): void;
237 /**
238 * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
239 * does not exist. After a topic is deleted, a new topic may be created with
240 * the same name; this is an entirely new topic with none of the old
241 * configuration or subscriptions. Existing subscriptions to this topic are
242 * not deleted, but their `topic` field is set to `_deleted-topic_`.
243 *
244 * @param {Object} request
245 * The request object that will be sent.
246 * @param {string} request.topic
247 * Required. Name of the topic to delete.
248 * Format is `projects/{project}/topics/{topic}`.
249 * @param {object} [options]
250 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
251 * @returns {Promise} - The promise which resolves to an array.
252 * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
253 * Please see the
254 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
255 * for more details and examples.
256 */
257 deleteTopic(request?: protos.google.pubsub.v1.IDeleteTopicRequest, options?: CallOptions): Promise<[
258 protos.google.protobuf.IEmpty,
259 protos.google.pubsub.v1.IDeleteTopicRequest | undefined,
260 {} | undefined
261 ]>;
262 deleteTopic(request: protos.google.pubsub.v1.IDeleteTopicRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, {} | null | undefined>): void;
263 deleteTopic(request: protos.google.pubsub.v1.IDeleteTopicRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, {} | null | undefined>): void;
264 /**
265 * Detaches a subscription from this topic. All messages retained in the
266 * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
267 * will return FAILED_PRECONDITION. If the subscription is a push
268 * subscription, pushes to the endpoint will stop.
269 *
270 * @param {Object} request
271 * The request object that will be sent.
272 * @param {string} request.subscription
273 * Required. The subscription to detach.
274 * Format is `projects/{project}/subscriptions/{subscription}`.
275 * @param {object} [options]
276 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
277 * @returns {Promise} - The promise which resolves to an array.
278 * The first element of the array is an object representing [DetachSubscriptionResponse]{@link google.pubsub.v1.DetachSubscriptionResponse}.
279 * Please see the
280 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
281 * for more details and examples.
282 */
283 detachSubscription(request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, options?: CallOptions): Promise<[
284 protos.google.pubsub.v1.IDetachSubscriptionResponse,
285 protos.google.pubsub.v1.IDetachSubscriptionRequest | undefined,
286 {} | undefined
287 ]>;
288 detachSubscription(request: protos.google.pubsub.v1.IDetachSubscriptionRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.IDetachSubscriptionResponse, protos.google.pubsub.v1.IDetachSubscriptionRequest | null | undefined, {} | null | undefined>): void;
289 detachSubscription(request: protos.google.pubsub.v1.IDetachSubscriptionRequest, callback: Callback<protos.google.pubsub.v1.IDetachSubscriptionResponse, protos.google.pubsub.v1.IDetachSubscriptionRequest | null | undefined, {} | null | undefined>): void;
290 /**
291 * Lists matching topics.
292 *
293 * @param {Object} request
294 * The request object that will be sent.
295 * @param {string} request.project
296 * Required. The name of the project in which to list topics.
297 * Format is `projects/{project-id}`.
298 * @param {number} request.pageSize
299 * Maximum number of topics to return.
300 * @param {string} request.pageToken
301 * The value returned by the last `ListTopicsResponse`; indicates that this is
302 * a continuation of a prior `ListTopics` call, and that the system should
303 * return the next page of data.
304 * @param {object} [options]
305 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
306 * @returns {Promise} - The promise which resolves to an array.
307 * The first element of the array is Array of [Topic]{@link google.pubsub.v1.Topic}.
308 * The client library will perform auto-pagination by default: it will call the API as many
309 * times as needed and will merge results from all the pages into this array.
310 * Note that it can affect your quota.
311 * We recommend using `listTopicsAsync()`
312 * method described below for async iteration which you can stop as needed.
313 * Please see the
314 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
315 * for more details and examples.
316 */
317 listTopics(request?: protos.google.pubsub.v1.IListTopicsRequest, options?: CallOptions): Promise<[
318 protos.google.pubsub.v1.ITopic[],
319 protos.google.pubsub.v1.IListTopicsRequest | null,
320 protos.google.pubsub.v1.IListTopicsResponse
321 ]>;
322 listTopics(request: protos.google.pubsub.v1.IListTopicsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicsRequest, protos.google.pubsub.v1.IListTopicsResponse | null | undefined, protos.google.pubsub.v1.ITopic>): void;
323 listTopics(request: protos.google.pubsub.v1.IListTopicsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicsRequest, protos.google.pubsub.v1.IListTopicsResponse | null | undefined, protos.google.pubsub.v1.ITopic>): void;
324 /**
325 * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
326 * @param {Object} request
327 * The request object that will be sent.
328 * @param {string} request.project
329 * Required. The name of the project in which to list topics.
330 * Format is `projects/{project-id}`.
331 * @param {number} request.pageSize
332 * Maximum number of topics to return.
333 * @param {string} request.pageToken
334 * The value returned by the last `ListTopicsResponse`; indicates that this is
335 * a continuation of a prior `ListTopics` call, and that the system should
336 * return the next page of data.
337 * @param {object} [options]
338 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
339 * @returns {Stream}
340 * An object stream which emits an object representing [Topic]{@link google.pubsub.v1.Topic} on 'data' event.
341 * The client library will perform auto-pagination by default: it will call the API as many
342 * times as needed. Note that it can affect your quota.
343 * We recommend using `listTopicsAsync()`
344 * method described below for async iteration which you can stop as needed.
345 * Please see the
346 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
347 * for more details and examples.
348 */
349 listTopicsStream(request?: protos.google.pubsub.v1.IListTopicsRequest, options?: CallOptions): Transform;
350 /**
351 * Equivalent to `listTopics`, but returns an iterable object.
352 *
353 * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
354 * @param {Object} request
355 * The request object that will be sent.
356 * @param {string} request.project
357 * Required. The name of the project in which to list topics.
358 * Format is `projects/{project-id}`.
359 * @param {number} request.pageSize
360 * Maximum number of topics to return.
361 * @param {string} request.pageToken
362 * The value returned by the last `ListTopicsResponse`; indicates that this is
363 * a continuation of a prior `ListTopics` call, and that the system should
364 * return the next page of data.
365 * @param {object} [options]
366 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
367 * @returns {Object}
368 * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
369 * When you iterate the returned iterable, each element will be an object representing
370 * [Topic]{@link google.pubsub.v1.Topic}. The API will be called under the hood as needed, once per the page,
371 * so you can stop the iteration when you don't need more results.
372 * Please see the
373 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
374 * for more details and examples.
375 */
376 listTopicsAsync(request?: protos.google.pubsub.v1.IListTopicsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ITopic>;
377 /**
378 * Lists the names of the attached subscriptions on this topic.
379 *
380 * @param {Object} request
381 * The request object that will be sent.
382 * @param {string} request.topic
383 * Required. The name of the topic that subscriptions are attached to.
384 * Format is `projects/{project}/topics/{topic}`.
385 * @param {number} request.pageSize
386 * Maximum number of subscription names to return.
387 * @param {string} request.pageToken
388 * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
389 * that this is a continuation of a prior `ListTopicSubscriptions` call, and
390 * that the system should return the next page of data.
391 * @param {object} [options]
392 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
393 * @returns {Promise} - The promise which resolves to an array.
394 * The first element of the array is Array of string.
395 * The client library will perform auto-pagination by default: it will call the API as many
396 * times as needed and will merge results from all the pages into this array.
397 * Note that it can affect your quota.
398 * We recommend using `listTopicSubscriptionsAsync()`
399 * method described below for async iteration which you can stop as needed.
400 * Please see the
401 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
402 * for more details and examples.
403 */
404 listTopicSubscriptions(request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, options?: CallOptions): Promise<[
405 string[],
406 protos.google.pubsub.v1.IListTopicSubscriptionsRequest | null,
407 protos.google.pubsub.v1.IListTopicSubscriptionsResponse
408 ]>;
409 listTopicSubscriptions(request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSubscriptionsRequest, protos.google.pubsub.v1.IListTopicSubscriptionsResponse | null | undefined, string>): void;
410 listTopicSubscriptions(request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSubscriptionsRequest, protos.google.pubsub.v1.IListTopicSubscriptionsResponse | null | undefined, string>): void;
411 /**
412 * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
413 * @param {Object} request
414 * The request object that will be sent.
415 * @param {string} request.topic
416 * Required. The name of the topic that subscriptions are attached to.
417 * Format is `projects/{project}/topics/{topic}`.
418 * @param {number} request.pageSize
419 * Maximum number of subscription names to return.
420 * @param {string} request.pageToken
421 * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
422 * that this is a continuation of a prior `ListTopicSubscriptions` call, and
423 * that the system should return the next page of data.
424 * @param {object} [options]
425 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
426 * @returns {Stream}
427 * An object stream which emits an object representing string on 'data' event.
428 * The client library will perform auto-pagination by default: it will call the API as many
429 * times as needed. Note that it can affect your quota.
430 * We recommend using `listTopicSubscriptionsAsync()`
431 * method described below for async iteration which you can stop as needed.
432 * Please see the
433 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
434 * for more details and examples.
435 */
436 listTopicSubscriptionsStream(request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, options?: CallOptions): Transform;
437 /**
438 * Equivalent to `listTopicSubscriptions`, but returns an iterable object.
439 *
440 * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
441 * @param {Object} request
442 * The request object that will be sent.
443 * @param {string} request.topic
444 * Required. The name of the topic that subscriptions are attached to.
445 * Format is `projects/{project}/topics/{topic}`.
446 * @param {number} request.pageSize
447 * Maximum number of subscription names to return.
448 * @param {string} request.pageToken
449 * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
450 * that this is a continuation of a prior `ListTopicSubscriptions` call, and
451 * that the system should return the next page of data.
452 * @param {object} [options]
453 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
454 * @returns {Object}
455 * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
456 * When you iterate the returned iterable, each element will be an object representing
457 * string. The API will be called under the hood as needed, once per the page,
458 * so you can stop the iteration when you don't need more results.
459 * Please see the
460 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
461 * for more details and examples.
462 */
463 listTopicSubscriptionsAsync(request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, options?: CallOptions): AsyncIterable<string>;
464 /**
465 * Lists the names of the snapshots on this topic. Snapshots are used in
466 * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
467 * which allow you to manage message acknowledgments in bulk. That is, you can
468 * set the acknowledgment state of messages in an existing subscription to the
469 * state captured by a snapshot.
470 *
471 * @param {Object} request
472 * The request object that will be sent.
473 * @param {string} request.topic
474 * Required. The name of the topic that snapshots are attached to.
475 * Format is `projects/{project}/topics/{topic}`.
476 * @param {number} request.pageSize
477 * Maximum number of snapshot names to return.
478 * @param {string} request.pageToken
479 * The value returned by the last `ListTopicSnapshotsResponse`; indicates
480 * that this is a continuation of a prior `ListTopicSnapshots` call, and
481 * that the system should return the next page of data.
482 * @param {object} [options]
483 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
484 * @returns {Promise} - The promise which resolves to an array.
485 * The first element of the array is Array of string.
486 * The client library will perform auto-pagination by default: it will call the API as many
487 * times as needed and will merge results from all the pages into this array.
488 * Note that it can affect your quota.
489 * We recommend using `listTopicSnapshotsAsync()`
490 * method described below for async iteration which you can stop as needed.
491 * Please see the
492 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
493 * for more details and examples.
494 */
495 listTopicSnapshots(request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, options?: CallOptions): Promise<[
496 string[],
497 protos.google.pubsub.v1.IListTopicSnapshotsRequest | null,
498 protos.google.pubsub.v1.IListTopicSnapshotsResponse
499 ]>;
500 listTopicSnapshots(request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSnapshotsRequest, protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, string>): void;
501 listTopicSnapshots(request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSnapshotsRequest, protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, string>): void;
502 /**
503 * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
504 * @param {Object} request
505 * The request object that will be sent.
506 * @param {string} request.topic
507 * Required. The name of the topic that snapshots are attached to.
508 * Format is `projects/{project}/topics/{topic}`.
509 * @param {number} request.pageSize
510 * Maximum number of snapshot names to return.
511 * @param {string} request.pageToken
512 * The value returned by the last `ListTopicSnapshotsResponse`; indicates
513 * that this is a continuation of a prior `ListTopicSnapshots` call, and
514 * that the system should return the next page of data.
515 * @param {object} [options]
516 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
517 * @returns {Stream}
518 * An object stream which emits an object representing string on 'data' event.
519 * The client library will perform auto-pagination by default: it will call the API as many
520 * times as needed. Note that it can affect your quota.
521 * We recommend using `listTopicSnapshotsAsync()`
522 * method described below for async iteration which you can stop as needed.
523 * Please see the
524 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
525 * for more details and examples.
526 */
527 listTopicSnapshotsStream(request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, options?: CallOptions): Transform;
528 /**
529 * Equivalent to `listTopicSnapshots`, but returns an iterable object.
530 *
531 * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
532 * @param {Object} request
533 * The request object that will be sent.
534 * @param {string} request.topic
535 * Required. The name of the topic that snapshots are attached to.
536 * Format is `projects/{project}/topics/{topic}`.
537 * @param {number} request.pageSize
538 * Maximum number of snapshot names to return.
539 * @param {string} request.pageToken
540 * The value returned by the last `ListTopicSnapshotsResponse`; indicates
541 * that this is a continuation of a prior `ListTopicSnapshots` call, and
542 * that the system should return the next page of data.
543 * @param {object} [options]
544 * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
545 * @returns {Object}
546 * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
547 * When you iterate the returned iterable, each element will be an object representing
548 * string. The API will be called under the hood as needed, once per the page,
549 * so you can stop the iteration when you don't need more results.
550 * Please see the
551 * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
552 * for more details and examples.
553 */
554 listTopicSnapshotsAsync(request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, options?: CallOptions): AsyncIterable<string>;
555 /**
556 * Gets the access control policy for a resource. Returns an empty policy
557 * if the resource exists and does not have a policy set.
558 *
559 * @param {Object} request
560 * The request object that will be sent.
561 * @param {string} request.resource
562 * REQUIRED: The resource for which the policy is being requested.
563 * See the operation documentation for the appropriate value for this field.
564 * @param {Object} [request.options]
565 * OPTIONAL: A `GetPolicyOptions` object for specifying options to
566 * `GetIamPolicy`. This field is only used by Cloud IAM.
567 *
568 * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions}
569 * @param {Object} [options]
570 * Optional parameters. You can override the default settings for this call, e.g, timeout,
571 * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
572 * @param {function(?Error, ?Object)} [callback]
573 * The function which will be called with the result of the API call.
574 *
575 * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}.
576 * @returns {Promise} - The promise which resolves to an array.
577 * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
578 * The promise has a method named "cancel" which cancels the ongoing API call.
579 */
580 getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.Policy>;
581 /**
582 * Returns permissions that a caller has on the specified resource. If the
583 * resource does not exist, this will return an empty set of
584 * permissions, not a NOT_FOUND error.
585 *
586 * Note: This operation is designed to be used for building
587 * permission-aware UIs and command-line tools, not for authorization
588 * checking. This operation may "fail open" without warning.
589 *
590 * @param {Object} request
591 * The request object that will be sent.
592 * @param {string} request.resource
593 * REQUIRED: The resource for which the policy detail is being requested.
594 * See the operation documentation for the appropriate value for this field.
595 * @param {string[]} request.permissions
596 * The set of permissions to check for the `resource`. Permissions with
597 * wildcards (such as '*' or 'storage.*') are not allowed. For more
598 * information see
599 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
600 * @param {Object} [options]
601 * Optional parameters. You can override the default settings for this call, e.g, timeout,
602 * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
603 * @param {function(?Error, ?Object)} [callback]
604 * The function which will be called with the result of the API call.
605 *
606 * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
607 * @returns {Promise} - The promise which resolves to an array.
608 * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
609 * The promise has a method named "cancel" which cancels the ongoing API call.
610 */
611 setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.Policy>;
612 /**
613 * Returns permissions that a caller has on the specified resource. If the
614 * resource does not exist, this will return an empty set of
615 * permissions, not a NOT_FOUND error.
616 *
617 * Note: This operation is designed to be used for building
618 * permission-aware UIs and command-line tools, not for authorization
619 * checking. This operation may "fail open" without warning.
620 *
621 * @param {Object} request
622 * The request object that will be sent.
623 * @param {string} request.resource
624 * REQUIRED: The resource for which the policy detail is being requested.
625 * See the operation documentation for the appropriate value for this field.
626 * @param {string[]} request.permissions
627 * The set of permissions to check for the `resource`. Permissions with
628 * wildcards (such as '*' or 'storage.*') are not allowed. For more
629 * information see
630 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
631 * @param {Object} [options]
632 * Optional parameters. You can override the default settings for this call, e.g, timeout,
633 * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
634 * @param {function(?Error, ?Object)} [callback]
635 * The function which will be called with the result of the API call.
636 *
637 * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
638 * @returns {Promise} - The promise which resolves to an array.
639 * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
640 * The promise has a method named "cancel" which cancels the ongoing API call.
641 *
642 */
643 testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse>;
644 /**
645 * Return a fully-qualified project resource name string.
646 *
647 * @param {string} project
648 * @returns {string} Resource name string.
649 */
650 projectPath(project: string): string;
651 /**
652 * Parse the project from Project resource.
653 *
654 * @param {string} projectName
655 * A fully-qualified path representing Project resource.
656 * @returns {string} A string representing the project.
657 */
658 matchProjectFromProjectName(projectName: string): string | number;
659 /**
660 * Return a fully-qualified projectTopic resource name string.
661 *
662 * @param {string} project
663 * @param {string} topic
664 * @returns {string} Resource name string.
665 */
666 projectTopicPath(project: string, topic: string): string;
667 /**
668 * Parse the project from ProjectTopic resource.
669 *
670 * @param {string} projectTopicName
671 * A fully-qualified path representing project_topic resource.
672 * @returns {string} A string representing the project.
673 */
674 matchProjectFromProjectTopicName(projectTopicName: string): string | number;
675 /**
676 * Parse the topic from ProjectTopic resource.
677 *
678 * @param {string} projectTopicName
679 * A fully-qualified path representing project_topic resource.
680 * @returns {string} A string representing the topic.
681 */
682 matchTopicFromProjectTopicName(projectTopicName: string): string | number;
683 /**
684 * Return a fully-qualified schema resource name string.
685 *
686 * @param {string} project
687 * @param {string} schema
688 * @returns {string} Resource name string.
689 */
690 schemaPath(project: string, schema: string): string;
691 /**
692 * Parse the project from Schema resource.
693 *
694 * @param {string} schemaName
695 * A fully-qualified path representing Schema resource.
696 * @returns {string} A string representing the project.
697 */
698 matchProjectFromSchemaName(schemaName: string): string | number;
699 /**
700 * Parse the schema from Schema resource.
701 *
702 * @param {string} schemaName
703 * A fully-qualified path representing Schema resource.
704 * @returns {string} A string representing the schema.
705 */
706 matchSchemaFromSchemaName(schemaName: string): string | number;
707 /**
708 * Return a fully-qualified snapshot resource name string.
709 *
710 * @param {string} project
711 * @param {string} snapshot
712 * @returns {string} Resource name string.
713 */
714 snapshotPath(project: string, snapshot: string): string;
715 /**
716 * Parse the project from Snapshot resource.
717 *
718 * @param {string} snapshotName
719 * A fully-qualified path representing Snapshot resource.
720 * @returns {string} A string representing the project.
721 */
722 matchProjectFromSnapshotName(snapshotName: string): string | number;
723 /**
724 * Parse the snapshot from Snapshot resource.
725 *
726 * @param {string} snapshotName
727 * A fully-qualified path representing Snapshot resource.
728 * @returns {string} A string representing the snapshot.
729 */
730 matchSnapshotFromSnapshotName(snapshotName: string): string | number;
731 /**
732 * Return a fully-qualified subscription resource name string.
733 *
734 * @param {string} project
735 * @param {string} subscription
736 * @returns {string} Resource name string.
737 */
738 subscriptionPath(project: string, subscription: string): string;
739 /**
740 * Parse the project from Subscription resource.
741 *
742 * @param {string} subscriptionName
743 * A fully-qualified path representing Subscription resource.
744 * @returns {string} A string representing the project.
745 */
746 matchProjectFromSubscriptionName(subscriptionName: string): string | number;
747 /**
748 * Parse the subscription from Subscription resource.
749 *
750 * @param {string} subscriptionName
751 * A fully-qualified path representing Subscription resource.
752 * @returns {string} A string representing the subscription.
753 */
754 matchSubscriptionFromSubscriptionName(subscriptionName: string): string | number;
755 /**
756 * Terminate the gRPC channel and close the client.
757 *
758 * The client will no longer be usable and all future behavior is undefined.
759 * @returns {Promise} A promise that resolves when the client is closed.
760 */
761 close(): Promise<void>;
762}