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