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 subscriptions and to
|
8 | * consume messages from a subscription via the `Pull` method or by
|
9 | * establishing a bi-directional stream using the `StreamingPull` method.
|
10 | * @class
|
11 | * @memberof v1
|
12 | */
|
13 | export declare class SubscriberClient {
|
14 | private _terminated;
|
15 | private _opts;
|
16 | private _providedCustomServicePath;
|
17 | private _gaxModule;
|
18 | private _gaxGrpc;
|
19 | private _protos;
|
20 | private _defaults;
|
21 | auth: gax.GoogleAuth;
|
22 | descriptors: Descriptors;
|
23 | warn: (code: string, message: string, warnType?: string) => void;
|
24 | innerApiCalls: {
|
25 | [name: string]: Function;
|
26 | };
|
27 | iamClient: IamClient;
|
28 | pathTemplates: {
|
29 | [name: string]: gax.PathTemplate;
|
30 | };
|
31 | subscriberStub?: Promise<{
|
32 | [name: string]: Function;
|
33 | }>;
|
34 | /**
|
35 | * Construct an instance of SubscriberClient.
|
36 | *
|
37 | * @param {object} [options] - The configuration object.
|
38 | * The options accepted by the constructor are described in detail
|
39 | * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
40 | * The common options are:
|
41 | * @param {object} [options.credentials] - Credentials object.
|
42 | * @param {string} [options.credentials.client_email]
|
43 | * @param {string} [options.credentials.private_key]
|
44 | * @param {string} [options.email] - Account email address. Required when
|
45 | * using a .pem or .p12 keyFilename.
|
46 | * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
|
47 | * .p12 key downloaded from the Google Developers Console. If you provide
|
48 | * a path to a JSON file, the projectId option below is not necessary.
|
49 | * NOTE: .pem and .p12 require you to specify options.email as well.
|
50 | * @param {number} [options.port] - The port on which to connect to
|
51 | * the remote host.
|
52 | * @param {string} [options.projectId] - The project ID from the Google
|
53 | * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
54 | * the environment variable GCLOUD_PROJECT for your project ID. If your
|
55 | * app is running in an environment which supports
|
56 | * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
|
57 | * your project ID will be detected automatically.
|
58 | * @param {string} [options.apiEndpoint] - The domain name of the
|
59 | * API remote host.
|
60 | * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
61 | * Follows the structure of {@link gapicConfig}.
|
62 | * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
|
63 | * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
64 | * For more information, please check the
|
65 | * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
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 a subscription to a given topic. See the [resource name rules]
|
108 | * (https://cloud.google.com/pubsub/docs/admin#resource_names).
|
109 | * If the subscription already exists, returns `ALREADY_EXISTS`.
|
110 | * If the corresponding topic doesn't exist, returns `NOT_FOUND`.
|
111 | *
|
112 | * If the name is not provided in the request, the server will assign a random
|
113 | * name for this subscription on the same project as the topic, conforming
|
114 | * to the [resource name format]
|
115 | * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated
|
116 | * name is populated in the returned Subscription object. Note that for REST
|
117 | * API requests, you must specify a name in the request.
|
118 | *
|
119 | * @param {Object} request
|
120 | * The request object that will be sent.
|
121 | * @param {string} request.name
|
122 | * Required. The name of the subscription. It must have the format
|
123 | * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
|
124 | * start with a letter, and contain only letters (`[A-Za-z]`), numbers
|
125 | * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
|
126 | * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
|
127 | * in length, and it must not start with `"goog"`.
|
128 | * @param {string} request.topic
|
129 | * Required. The name of the topic from which this subscription is receiving
|
130 | * messages. Format is `projects/{project}/topics/{topic}`. The value of this
|
131 | * field will be `_deleted-topic_` if the topic has been deleted.
|
132 | * @param {google.pubsub.v1.PushConfig} request.pushConfig
|
133 | * If push delivery is used with this subscription, this field is
|
134 | * used to configure it. Either `pushConfig` or `bigQueryConfig` can be set,
|
135 | * but not both. If both are empty, then the subscriber will pull and ack
|
136 | * messages using API methods.
|
137 | * @param {google.pubsub.v1.BigQueryConfig} request.bigqueryConfig
|
138 | * If delivery to BigQuery is used with this subscription, this field is
|
139 | * used to configure it. Either `pushConfig` or `bigQueryConfig` can be set,
|
140 | * but not both. If both are empty, then the subscriber will pull and ack
|
141 | * messages using API methods.
|
142 | * @param {number} request.ackDeadlineSeconds
|
143 | * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
|
144 | * the subscriber to acknowledge receipt before resending the message. In the
|
145 | * interval after the message is delivered and before it is acknowledged, it
|
146 | * is considered to be <i>outstanding</i>. During that time period, the
|
147 | * message will not be redelivered (on a best-effort basis).
|
148 | *
|
149 | * For pull subscriptions, this value is used as the initial value for the ack
|
150 | * deadline. To override this value for a given message, call
|
151 | * `ModifyAckDeadline` with the corresponding `ack_id` if using
|
152 | * non-streaming pull or send the `ack_id` in a
|
153 | * `StreamingModifyAckDeadlineRequest` if using streaming pull.
|
154 | * The minimum custom deadline you can specify is 10 seconds.
|
155 | * The maximum custom deadline you can specify is 600 seconds (10 minutes).
|
156 | * If this parameter is 0, a default value of 10 seconds is used.
|
157 | *
|
158 | * For push delivery, this value is also used to set the request timeout for
|
159 | * the call to the push endpoint.
|
160 | *
|
161 | * If the subscriber never acknowledges the message, the Pub/Sub
|
162 | * system will eventually redeliver the message.
|
163 | * @param {boolean} request.retainAckedMessages
|
164 | * Indicates whether to retain acknowledged messages. If true, then
|
165 | * messages are not expunged from the subscription's backlog, even if they are
|
166 | * acknowledged, until they fall out of the `message_retention_duration`
|
167 | * window. This must be true if you would like to [`Seek` to a timestamp]
|
168 | * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
|
169 | * the past to replay previously-acknowledged messages.
|
170 | * @param {google.protobuf.Duration} request.messageRetentionDuration
|
171 | * How long to retain unacknowledged messages in the subscription's backlog,
|
172 | * from the moment a message is published.
|
173 | * If `retain_acked_messages` is true, then this also configures the retention
|
174 | * of acknowledged messages, and thus configures how far back in time a `Seek`
|
175 | * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
|
176 | * minutes.
|
177 | * @param {number[]} request.labels
|
178 | * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
|
179 | * managing labels</a>.
|
180 | * @param {boolean} request.enableMessageOrdering
|
181 | * If true, messages published with the same `ordering_key` in `PubsubMessage`
|
182 | * will be delivered to the subscribers in the order in which they
|
183 | * are received by the Pub/Sub system. Otherwise, they may be delivered in
|
184 | * any order.
|
185 | * @param {google.pubsub.v1.ExpirationPolicy} request.expirationPolicy
|
186 | * A policy that specifies the conditions for this subscription's expiration.
|
187 | * A subscription is considered active as long as any connected subscriber is
|
188 | * successfully consuming messages from the subscription or is issuing
|
189 | * operations on the subscription. If `expiration_policy` is not set, a
|
190 | * *default policy* with `ttl` of 31 days will be used. The minimum allowed
|
191 | * value for `expiration_policy.ttl` is 1 day.
|
192 | * @param {string} request.filter
|
193 | * An expression written in the Pub/Sub [filter
|
194 | * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
|
195 | * then only `PubsubMessage`s whose `attributes` field matches the filter are
|
196 | * delivered on this subscription. If empty, then no messages are filtered
|
197 | * out.
|
198 | * @param {google.pubsub.v1.DeadLetterPolicy} request.deadLetterPolicy
|
199 | * A policy that specifies the conditions for dead lettering messages in
|
200 | * this subscription. If dead_letter_policy is not set, dead lettering
|
201 | * is disabled.
|
202 | *
|
203 | * The Cloud Pub/Sub service account associated with this subscriptions's
|
204 | * parent project (i.e.,
|
205 | * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
|
206 | * permission to Acknowledge() messages on this subscription.
|
207 | * @param {google.pubsub.v1.RetryPolicy} request.retryPolicy
|
208 | * A policy that specifies how Pub/Sub retries message delivery for this
|
209 | * subscription.
|
210 | *
|
211 | * If not set, the default retry policy is applied. This generally implies
|
212 | * that messages will be retried as soon as possible for healthy subscribers.
|
213 | * RetryPolicy will be triggered on NACKs or acknowledgement deadline
|
214 | * exceeded events for a given message.
|
215 | * @param {boolean} request.detached
|
216 | * Indicates whether the subscription is detached from its topic. Detached
|
217 | * subscriptions don't receive messages from their topic and don't retain any
|
218 | * backlog. `Pull` and `StreamingPull` requests will return
|
219 | * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
|
220 | * the endpoint will not be made.
|
221 | * @param {boolean} request.enableExactlyOnceDelivery
|
222 | * If true, Pub/Sub provides the following guarantees for the delivery of
|
223 | * a message with a given value of `message_id` on this subscription:
|
224 | *
|
225 | * * The message sent to a subscriber is guaranteed not to be resent
|
226 | * before the message's acknowledgement deadline expires.
|
227 | * * An acknowledged message will not be resent to a subscriber.
|
228 | *
|
229 | * Note that subscribers may still receive multiple copies of a message
|
230 | * when `enable_exactly_once_delivery` is true if the message was published
|
231 | * multiple times by a publisher client. These copies are considered distinct
|
232 | * by Pub/Sub and have distinct `message_id` values.
|
233 | * @param {google.protobuf.Duration} request.topicMessageRetentionDuration
|
234 | * Output only. Indicates the minimum duration for which a message is retained
|
235 | * after it is published to the subscription's topic. If this field is set,
|
236 | * messages published to the subscription's topic in the last
|
237 | * `topic_message_retention_duration` are always available to subscribers. See
|
238 | * the `message_retention_duration` field in `Topic`. This field is set only
|
239 | * in responses from the server; it is ignored if it is set in any requests.
|
240 | * @param {google.pubsub.v1.Subscription.State} request.state
|
241 | * Output only. An output-only field indicating whether or not the subscription can receive
|
242 | * messages.
|
243 | * @param {object} [options]
|
244 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
245 | * @returns {Promise} - The promise which resolves to an array.
|
246 | * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}.
|
247 | * Please see the
|
248 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
249 | * for more details and examples.
|
250 | */
|
251 | createSubscription(request?: protos.google.pubsub.v1.ISubscription, options?: CallOptions): Promise<[
|
252 | protos.google.pubsub.v1.ISubscription,
|
253 | protos.google.pubsub.v1.ISubscription | undefined,
|
254 | {} | undefined
|
255 | ]>;
|
256 | createSubscription(request: protos.google.pubsub.v1.ISubscription, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | null | undefined, {} | null | undefined>): void;
|
257 | createSubscription(request: protos.google.pubsub.v1.ISubscription, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | null | undefined, {} | null | undefined>): void;
|
258 | /**
|
259 | * Gets the configuration details of a subscription.
|
260 | *
|
261 | * @param {Object} request
|
262 | * The request object that will be sent.
|
263 | * @param {string} request.subscription
|
264 | * Required. The name of the subscription to get.
|
265 | * Format is `projects/{project}/subscriptions/{sub}`.
|
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 [Subscription]{@link google.pubsub.v1.Subscription}.
|
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 | */
|
274 | getSubscription(request?: protos.google.pubsub.v1.IGetSubscriptionRequest, options?: CallOptions): Promise<[
|
275 | protos.google.pubsub.v1.ISubscription,
|
276 | protos.google.pubsub.v1.IGetSubscriptionRequest | undefined,
|
277 | {} | undefined
|
278 | ]>;
|
279 | getSubscription(request: protos.google.pubsub.v1.IGetSubscriptionRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, {} | null | undefined>): void;
|
280 | getSubscription(request: protos.google.pubsub.v1.IGetSubscriptionRequest, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, {} | null | undefined>): void;
|
281 | /**
|
282 | * Updates an existing subscription. Note that certain properties of a
|
283 | * subscription, such as its topic, are not modifiable.
|
284 | *
|
285 | * @param {Object} request
|
286 | * The request object that will be sent.
|
287 | * @param {google.pubsub.v1.Subscription} request.subscription
|
288 | * Required. The updated subscription object.
|
289 | * @param {google.protobuf.FieldMask} request.updateMask
|
290 | * Required. Indicates which fields in the provided subscription to update.
|
291 | * Must be specified and non-empty.
|
292 | * @param {object} [options]
|
293 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
294 | * @returns {Promise} - The promise which resolves to an array.
|
295 | * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}.
|
296 | * Please see the
|
297 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
298 | * for more details and examples.
|
299 | */
|
300 | updateSubscription(request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, options?: CallOptions): Promise<[
|
301 | protos.google.pubsub.v1.ISubscription,
|
302 | protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined,
|
303 | {} | undefined
|
304 | ]>;
|
305 | updateSubscription(request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, {} | null | undefined>): void;
|
306 | updateSubscription(request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, {} | null | undefined>): void;
|
307 | /**
|
308 | * Deletes an existing subscription. All messages retained in the subscription
|
309 | * are immediately dropped. Calls to `Pull` after deletion will return
|
310 | * `NOT_FOUND`. After a subscription is deleted, a new one may be created with
|
311 | * the same name, but the new one has no association with the old
|
312 | * subscription or its topic unless the same topic is specified.
|
313 | *
|
314 | * @param {Object} request
|
315 | * The request object that will be sent.
|
316 | * @param {string} request.subscription
|
317 | * Required. The subscription to delete.
|
318 | * Format is `projects/{project}/subscriptions/{sub}`.
|
319 | * @param {object} [options]
|
320 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
321 | * @returns {Promise} - The promise which resolves to an array.
|
322 | * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
|
323 | * Please see the
|
324 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
325 | * for more details and examples.
|
326 | */
|
327 | deleteSubscription(request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, options?: CallOptions): Promise<[
|
328 | protos.google.protobuf.IEmpty,
|
329 | protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined,
|
330 | {} | undefined
|
331 | ]>;
|
332 | deleteSubscription(request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, {} | null | undefined>): void;
|
333 | deleteSubscription(request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, {} | null | undefined>): void;
|
334 | /**
|
335 | * Modifies the ack deadline for a specific message. This method is useful
|
336 | * to indicate that more time is needed to process a message by the
|
337 | * subscriber, or to make the message available for redelivery if the
|
338 | * processing was interrupted. Note that this does not modify the
|
339 | * subscription-level `ackDeadlineSeconds` used for subsequent messages.
|
340 | *
|
341 | * @param {Object} request
|
342 | * The request object that will be sent.
|
343 | * @param {string} request.subscription
|
344 | * Required. The name of the subscription.
|
345 | * Format is `projects/{project}/subscriptions/{sub}`.
|
346 | * @param {string[]} request.ackIds
|
347 | * Required. List of acknowledgment IDs.
|
348 | * @param {number} request.ackDeadlineSeconds
|
349 | * Required. The new ack deadline with respect to the time this request was
|
350 | * sent to the Pub/Sub system. For example, if the value is 10, the new ack
|
351 | * deadline will expire 10 seconds after the `ModifyAckDeadline` call was
|
352 | * made. Specifying zero might immediately make the message available for
|
353 | * delivery to another subscriber client. This typically results in an
|
354 | * increase in the rate of message redeliveries (that is, duplicates).
|
355 | * The minimum deadline you can specify is 0 seconds.
|
356 | * The maximum deadline you can specify is 600 seconds (10 minutes).
|
357 | * @param {object} [options]
|
358 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
359 | * @returns {Promise} - The promise which resolves to an array.
|
360 | * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
|
361 | * Please see the
|
362 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
363 | * for more details and examples.
|
364 | */
|
365 | modifyAckDeadline(request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, options?: CallOptions): Promise<[
|
366 | protos.google.protobuf.IEmpty,
|
367 | protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined,
|
368 | {} | undefined
|
369 | ]>;
|
370 | modifyAckDeadline(request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, {} | null | undefined>): void;
|
371 | modifyAckDeadline(request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, {} | null | undefined>): void;
|
372 | /**
|
373 | * Acknowledges the messages associated with the `ack_ids` in the
|
374 | * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
|
375 | * from the subscription.
|
376 | *
|
377 | * Acknowledging a message whose ack deadline has expired may succeed,
|
378 | * but such a message may be redelivered later. Acknowledging a message more
|
379 | * than once will not result in an error.
|
380 | *
|
381 | * @param {Object} request
|
382 | * The request object that will be sent.
|
383 | * @param {string} request.subscription
|
384 | * Required. The subscription whose message is being acknowledged.
|
385 | * Format is `projects/{project}/subscriptions/{sub}`.
|
386 | * @param {string[]} request.ackIds
|
387 | * Required. The acknowledgment ID for the messages being acknowledged that
|
388 | * was returned by the Pub/Sub system in the `Pull` response. Must not be
|
389 | * empty.
|
390 | * @param {object} [options]
|
391 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
392 | * @returns {Promise} - The promise which resolves to an array.
|
393 | * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
|
394 | * Please see the
|
395 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
396 | * for more details and examples.
|
397 | */
|
398 | acknowledge(request?: protos.google.pubsub.v1.IAcknowledgeRequest, options?: CallOptions): Promise<[
|
399 | protos.google.protobuf.IEmpty,
|
400 | protos.google.pubsub.v1.IAcknowledgeRequest | undefined,
|
401 | {} | undefined
|
402 | ]>;
|
403 | acknowledge(request: protos.google.pubsub.v1.IAcknowledgeRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, {} | null | undefined>): void;
|
404 | acknowledge(request: protos.google.pubsub.v1.IAcknowledgeRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, {} | null | undefined>): void;
|
405 | /**
|
406 | * Pulls messages from the server. The server may return `UNAVAILABLE` if
|
407 | * there are too many concurrent pull requests pending for the given
|
408 | * subscription.
|
409 | *
|
410 | * @param {Object} request
|
411 | * The request object that will be sent.
|
412 | * @param {string} request.subscription
|
413 | * Required. The subscription from which messages should be pulled.
|
414 | * Format is `projects/{project}/subscriptions/{sub}`.
|
415 | * @param {boolean} [request.returnImmediately]
|
416 | * Optional. If this field set to true, the system will respond immediately
|
417 | * even if it there are no messages available to return in the `Pull`
|
418 | * response. Otherwise, the system may wait (for a bounded amount of time)
|
419 | * until at least one message is available, rather than returning no messages.
|
420 | * Warning: setting this field to `true` is discouraged because it adversely
|
421 | * impacts the performance of `Pull` operations. We recommend that users do
|
422 | * not set this field.
|
423 | * @param {number} request.maxMessages
|
424 | * Required. The maximum number of messages to return for this request. Must
|
425 | * be a positive integer. The Pub/Sub system may return fewer than the number
|
426 | * specified.
|
427 | * @param {object} [options]
|
428 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
429 | * @returns {Promise} - The promise which resolves to an array.
|
430 | * The first element of the array is an object representing [PullResponse]{@link google.pubsub.v1.PullResponse}.
|
431 | * Please see the
|
432 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
433 | * for more details and examples.
|
434 | */
|
435 | pull(request?: protos.google.pubsub.v1.IPullRequest, options?: CallOptions): Promise<[
|
436 | protos.google.pubsub.v1.IPullResponse,
|
437 | protos.google.pubsub.v1.IPullRequest | undefined,
|
438 | {} | undefined
|
439 | ]>;
|
440 | pull(request: protos.google.pubsub.v1.IPullRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | null | undefined, {} | null | undefined>): void;
|
441 | pull(request: protos.google.pubsub.v1.IPullRequest, callback: Callback<protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | null | undefined, {} | null | undefined>): void;
|
442 | /**
|
443 | * Modifies the `PushConfig` for a specified subscription.
|
444 | *
|
445 | * This may be used to change a push subscription to a pull one (signified by
|
446 | * an empty `PushConfig`) or vice versa, or change the endpoint URL and other
|
447 | * attributes of a push subscription. Messages will accumulate for delivery
|
448 | * continuously through the call regardless of changes to the `PushConfig`.
|
449 | *
|
450 | * @param {Object} request
|
451 | * The request object that will be sent.
|
452 | * @param {string} request.subscription
|
453 | * Required. The name of the subscription.
|
454 | * Format is `projects/{project}/subscriptions/{sub}`.
|
455 | * @param {google.pubsub.v1.PushConfig} request.pushConfig
|
456 | * Required. The push configuration for future deliveries.
|
457 | *
|
458 | * An empty `pushConfig` indicates that the Pub/Sub system should
|
459 | * stop pushing messages from the given subscription and allow
|
460 | * messages to be pulled and acknowledged - effectively pausing
|
461 | * the subscription if `Pull` or `StreamingPull` is not called.
|
462 | * @param {object} [options]
|
463 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
464 | * @returns {Promise} - The promise which resolves to an array.
|
465 | * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
|
466 | * Please see the
|
467 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
468 | * for more details and examples.
|
469 | */
|
470 | modifyPushConfig(request?: protos.google.pubsub.v1.IModifyPushConfigRequest, options?: CallOptions): Promise<[
|
471 | protos.google.protobuf.IEmpty,
|
472 | protos.google.pubsub.v1.IModifyPushConfigRequest | undefined,
|
473 | {} | undefined
|
474 | ]>;
|
475 | modifyPushConfig(request: protos.google.pubsub.v1.IModifyPushConfigRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, {} | null | undefined>): void;
|
476 | modifyPushConfig(request: protos.google.pubsub.v1.IModifyPushConfigRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, {} | null | undefined>): void;
|
477 | /**
|
478 | * Gets the configuration details of a snapshot. Snapshots are used in
|
479 | * <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
|
480 | * operations, which allow you to manage message acknowledgments in bulk. That
|
481 | * is, you can set the acknowledgment state of messages in an existing
|
482 | * subscription to the state captured by a snapshot.
|
483 | *
|
484 | * @param {Object} request
|
485 | * The request object that will be sent.
|
486 | * @param {string} request.snapshot
|
487 | * Required. The name of the snapshot to get.
|
488 | * Format is `projects/{project}/snapshots/{snap}`.
|
489 | * @param {object} [options]
|
490 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
491 | * @returns {Promise} - The promise which resolves to an array.
|
492 | * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}.
|
493 | * Please see the
|
494 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
495 | * for more details and examples.
|
496 | */
|
497 | getSnapshot(request?: protos.google.pubsub.v1.IGetSnapshotRequest, options?: CallOptions): Promise<[
|
498 | protos.google.pubsub.v1.ISnapshot,
|
499 | protos.google.pubsub.v1.IGetSnapshotRequest | undefined,
|
500 | {} | undefined
|
501 | ]>;
|
502 | getSnapshot(request: protos.google.pubsub.v1.IGetSnapshotRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
503 | getSnapshot(request: protos.google.pubsub.v1.IGetSnapshotRequest, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
504 | /**
|
505 | * Creates a snapshot from the requested subscription. Snapshots are used in
|
506 | * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
|
507 | * which allow you to manage message acknowledgments in bulk. That is, you can
|
508 | * set the acknowledgment state of messages in an existing subscription to the
|
509 | * state captured by a snapshot.
|
510 | * If the snapshot already exists, returns `ALREADY_EXISTS`.
|
511 | * If the requested subscription doesn't exist, returns `NOT_FOUND`.
|
512 | * If the backlog in the subscription is too old -- and the resulting snapshot
|
513 | * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
|
514 | * See also the `Snapshot.expire_time` field. If the name is not provided in
|
515 | * the request, the server will assign a random
|
516 | * name for this snapshot on the same project as the subscription, conforming
|
517 | * to the [resource name format]
|
518 | * (https://cloud.google.com/pubsub/docs/admin#resource_names). The
|
519 | * generated name is populated in the returned Snapshot object. Note that for
|
520 | * REST API requests, you must specify a name in the request.
|
521 | *
|
522 | * @param {Object} request
|
523 | * The request object that will be sent.
|
524 | * @param {string} request.name
|
525 | * Required. User-provided name for this snapshot. If the name is not provided
|
526 | * in the request, the server will assign a random name for this snapshot on
|
527 | * the same project as the subscription. Note that for REST API requests, you
|
528 | * must specify a name. See the <a
|
529 | * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource
|
530 | * name rules</a>. Format is `projects/{project}/snapshots/{snap}`.
|
531 | * @param {string} request.subscription
|
532 | * Required. The subscription whose backlog the snapshot retains.
|
533 | * Specifically, the created snapshot is guaranteed to retain:
|
534 | * (a) The existing backlog on the subscription. More precisely, this is
|
535 | * defined as the messages in the subscription's backlog that are
|
536 | * unacknowledged upon the successful completion of the
|
537 | * `CreateSnapshot` request; as well as:
|
538 | * (b) Any messages published to the subscription's topic following the
|
539 | * successful completion of the CreateSnapshot request.
|
540 | * Format is `projects/{project}/subscriptions/{sub}`.
|
541 | * @param {number[]} request.labels
|
542 | * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
|
543 | * managing labels</a>.
|
544 | * @param {object} [options]
|
545 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
546 | * @returns {Promise} - The promise which resolves to an array.
|
547 | * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}.
|
548 | * Please see the
|
549 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
550 | * for more details and examples.
|
551 | */
|
552 | createSnapshot(request?: protos.google.pubsub.v1.ICreateSnapshotRequest, options?: CallOptions): Promise<[
|
553 | protos.google.pubsub.v1.ISnapshot,
|
554 | protos.google.pubsub.v1.ICreateSnapshotRequest | undefined,
|
555 | {} | undefined
|
556 | ]>;
|
557 | createSnapshot(request: protos.google.pubsub.v1.ICreateSnapshotRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
558 | createSnapshot(request: protos.google.pubsub.v1.ICreateSnapshotRequest, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
559 | /**
|
560 | * Updates an existing snapshot. Snapshots are used in
|
561 | * <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
|
562 | * operations, which allow
|
563 | * you to manage message acknowledgments in bulk. That is, you can set the
|
564 | * acknowledgment state of messages in an existing subscription to the state
|
565 | * captured by a snapshot.
|
566 | *
|
567 | * @param {Object} request
|
568 | * The request object that will be sent.
|
569 | * @param {google.pubsub.v1.Snapshot} request.snapshot
|
570 | * Required. The updated snapshot object.
|
571 | * @param {google.protobuf.FieldMask} request.updateMask
|
572 | * Required. Indicates which fields in the provided snapshot to update.
|
573 | * Must be specified and non-empty.
|
574 | * @param {object} [options]
|
575 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
576 | * @returns {Promise} - The promise which resolves to an array.
|
577 | * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}.
|
578 | * Please see the
|
579 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
580 | * for more details and examples.
|
581 | */
|
582 | updateSnapshot(request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, options?: CallOptions): Promise<[
|
583 | protos.google.pubsub.v1.ISnapshot,
|
584 | protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined,
|
585 | {} | undefined
|
586 | ]>;
|
587 | updateSnapshot(request: protos.google.pubsub.v1.IUpdateSnapshotRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
588 | updateSnapshot(request: protos.google.pubsub.v1.IUpdateSnapshotRequest, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
589 | /**
|
590 | * Removes an existing snapshot. Snapshots are used in [Seek]
|
591 | * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
|
592 | * allow you to manage message acknowledgments in bulk. That is, you can set
|
593 | * the acknowledgment state of messages in an existing subscription to the
|
594 | * state captured by a snapshot.
|
595 | * When the snapshot is deleted, all messages retained in the snapshot
|
596 | * are immediately dropped. After a snapshot is deleted, a new one may be
|
597 | * created with the same name, but the new one has no association with the old
|
598 | * snapshot or its subscription, unless the same subscription is specified.
|
599 | *
|
600 | * @param {Object} request
|
601 | * The request object that will be sent.
|
602 | * @param {string} request.snapshot
|
603 | * Required. The name of the snapshot to delete.
|
604 | * Format is `projects/{project}/snapshots/{snap}`.
|
605 | * @param {object} [options]
|
606 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
607 | * @returns {Promise} - The promise which resolves to an array.
|
608 | * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
|
609 | * Please see the
|
610 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
611 | * for more details and examples.
|
612 | */
|
613 | deleteSnapshot(request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, options?: CallOptions): Promise<[
|
614 | protos.google.protobuf.IEmpty,
|
615 | protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined,
|
616 | {} | undefined
|
617 | ]>;
|
618 | deleteSnapshot(request: protos.google.pubsub.v1.IDeleteSnapshotRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
619 | deleteSnapshot(request: protos.google.pubsub.v1.IDeleteSnapshotRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, {} | null | undefined>): void;
|
620 | /**
|
621 | * Seeks an existing subscription to a point in time or to a given snapshot,
|
622 | * whichever is provided in the request. Snapshots are used in [Seek]
|
623 | * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
|
624 | * allow you to manage message acknowledgments in bulk. That is, you can set
|
625 | * the acknowledgment state of messages in an existing subscription to the
|
626 | * state captured by a snapshot. Note that both the subscription and the
|
627 | * snapshot must be on the same topic.
|
628 | *
|
629 | * @param {Object} request
|
630 | * The request object that will be sent.
|
631 | * @param {string} request.subscription
|
632 | * Required. The subscription to affect.
|
633 | * @param {google.protobuf.Timestamp} request.time
|
634 | * The time to seek to.
|
635 | * Messages retained in the subscription that were published before this
|
636 | * time are marked as acknowledged, and messages retained in the
|
637 | * subscription that were published after this time are marked as
|
638 | * unacknowledged. Note that this operation affects only those messages
|
639 | * retained in the subscription (configured by the combination of
|
640 | * `message_retention_duration` and `retain_acked_messages`). For example,
|
641 | * if `time` corresponds to a point before the message retention
|
642 | * window (or to a point before the system's notion of the subscription
|
643 | * creation time), only retained messages will be marked as unacknowledged,
|
644 | * and already-expunged messages will not be restored.
|
645 | * @param {string} request.snapshot
|
646 | * The snapshot to seek to. The snapshot's topic must be the same as that of
|
647 | * the provided subscription.
|
648 | * Format is `projects/{project}/snapshots/{snap}`.
|
649 | * @param {object} [options]
|
650 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
651 | * @returns {Promise} - The promise which resolves to an array.
|
652 | * The first element of the array is an object representing [SeekResponse]{@link google.pubsub.v1.SeekResponse}.
|
653 | * Please see the
|
654 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
655 | * for more details and examples.
|
656 | */
|
657 | seek(request?: protos.google.pubsub.v1.ISeekRequest, options?: CallOptions): Promise<[
|
658 | protos.google.pubsub.v1.ISeekResponse,
|
659 | protos.google.pubsub.v1.ISeekRequest | undefined,
|
660 | {} | undefined
|
661 | ]>;
|
662 | seek(request: protos.google.pubsub.v1.ISeekRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | null | undefined, {} | null | undefined>): void;
|
663 | seek(request: protos.google.pubsub.v1.ISeekRequest, callback: Callback<protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | null | undefined, {} | null | undefined>): void;
|
664 | /**
|
665 | * Establishes a stream with the server, which sends messages down to the
|
666 | * client. The client streams acknowledgements and ack deadline modifications
|
667 | * back to the server. The server will close the stream and return the status
|
668 | * on any error. The server may close the stream with status `UNAVAILABLE` to
|
669 | * reassign server-side resources, in which case, the client should
|
670 | * re-establish the stream. Flow control can be achieved by configuring the
|
671 | * underlying RPC channel.
|
672 | *
|
673 | * @param {object} [options]
|
674 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
675 | * @returns {Stream}
|
676 | * An object stream which is both readable and writable. It accepts objects
|
677 | * representing [StreamingPullRequest]{@link google.pubsub.v1.StreamingPullRequest} for write() method, and
|
678 | * will emit objects representing [StreamingPullResponse]{@link google.pubsub.v1.StreamingPullResponse} on 'data' event asynchronously.
|
679 | * Please see the
|
680 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming)
|
681 | * for more details and examples.
|
682 | */
|
683 | streamingPull(options?: CallOptions): gax.CancellableStream;
|
684 | /**
|
685 | * Lists matching subscriptions.
|
686 | *
|
687 | * @param {Object} request
|
688 | * The request object that will be sent.
|
689 | * @param {string} request.project
|
690 | * Required. The name of the project in which to list subscriptions.
|
691 | * Format is `projects/{project-id}`.
|
692 | * @param {number} request.pageSize
|
693 | * Maximum number of subscriptions to return.
|
694 | * @param {string} request.pageToken
|
695 | * The value returned by the last `ListSubscriptionsResponse`; indicates that
|
696 | * this is a continuation of a prior `ListSubscriptions` call, and that the
|
697 | * system should return the next page of data.
|
698 | * @param {object} [options]
|
699 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
700 | * @returns {Promise} - The promise which resolves to an array.
|
701 | * The first element of the array is Array of [Subscription]{@link google.pubsub.v1.Subscription}.
|
702 | * The client library will perform auto-pagination by default: it will call the API as many
|
703 | * times as needed and will merge results from all the pages into this array.
|
704 | * Note that it can affect your quota.
|
705 | * We recommend using `listSubscriptionsAsync()`
|
706 | * method described below for async iteration which you can stop as needed.
|
707 | * Please see the
|
708 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
709 | * for more details and examples.
|
710 | */
|
711 | listSubscriptions(request?: protos.google.pubsub.v1.IListSubscriptionsRequest, options?: CallOptions): Promise<[
|
712 | protos.google.pubsub.v1.ISubscription[],
|
713 | protos.google.pubsub.v1.IListSubscriptionsRequest | null,
|
714 | protos.google.pubsub.v1.IListSubscriptionsResponse
|
715 | ]>;
|
716 | listSubscriptions(request: protos.google.pubsub.v1.IListSubscriptionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>): void;
|
717 | listSubscriptions(request: protos.google.pubsub.v1.IListSubscriptionsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>): void;
|
718 | /**
|
719 | * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
|
720 | * @param {Object} request
|
721 | * The request object that will be sent.
|
722 | * @param {string} request.project
|
723 | * Required. The name of the project in which to list subscriptions.
|
724 | * Format is `projects/{project-id}`.
|
725 | * @param {number} request.pageSize
|
726 | * Maximum number of subscriptions to return.
|
727 | * @param {string} request.pageToken
|
728 | * The value returned by the last `ListSubscriptionsResponse`; indicates that
|
729 | * this is a continuation of a prior `ListSubscriptions` call, and that the
|
730 | * system should return the next page of data.
|
731 | * @param {object} [options]
|
732 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
733 | * @returns {Stream}
|
734 | * An object stream which emits an object representing [Subscription]{@link google.pubsub.v1.Subscription} on 'data' event.
|
735 | * The client library will perform auto-pagination by default: it will call the API as many
|
736 | * times as needed. Note that it can affect your quota.
|
737 | * We recommend using `listSubscriptionsAsync()`
|
738 | * method described below for async iteration which you can stop as needed.
|
739 | * Please see the
|
740 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
741 | * for more details and examples.
|
742 | */
|
743 | listSubscriptionsStream(request?: protos.google.pubsub.v1.IListSubscriptionsRequest, options?: CallOptions): Transform;
|
744 | /**
|
745 | * Equivalent to `listSubscriptions`, but returns an iterable object.
|
746 | *
|
747 | * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
748 | * @param {Object} request
|
749 | * The request object that will be sent.
|
750 | * @param {string} request.project
|
751 | * Required. The name of the project in which to list subscriptions.
|
752 | * Format is `projects/{project-id}`.
|
753 | * @param {number} request.pageSize
|
754 | * Maximum number of subscriptions to return.
|
755 | * @param {string} request.pageToken
|
756 | * The value returned by the last `ListSubscriptionsResponse`; indicates that
|
757 | * this is a continuation of a prior `ListSubscriptions` call, and that the
|
758 | * system should return the next page of data.
|
759 | * @param {object} [options]
|
760 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
761 | * @returns {Object}
|
762 | * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
|
763 | * When you iterate the returned iterable, each element will be an object representing
|
764 | * [Subscription]{@link google.pubsub.v1.Subscription}. The API will be called under the hood as needed, once per the page,
|
765 | * so you can stop the iteration when you don't need more results.
|
766 | * Please see the
|
767 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
768 | * for more details and examples.
|
769 | */
|
770 | listSubscriptionsAsync(request?: protos.google.pubsub.v1.IListSubscriptionsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISubscription>;
|
771 | /**
|
772 | * Lists the existing snapshots. Snapshots are used in [Seek](
|
773 | * https://cloud.google.com/pubsub/docs/replay-overview) operations, which
|
774 | * allow you to manage message acknowledgments in bulk. That is, you can set
|
775 | * the acknowledgment state of messages in an existing subscription to the
|
776 | * state captured by a snapshot.
|
777 | *
|
778 | * @param {Object} request
|
779 | * The request object that will be sent.
|
780 | * @param {string} request.project
|
781 | * Required. The name of the project in which to list snapshots.
|
782 | * Format is `projects/{project-id}`.
|
783 | * @param {number} request.pageSize
|
784 | * Maximum number of snapshots to return.
|
785 | * @param {string} request.pageToken
|
786 | * The value returned by the last `ListSnapshotsResponse`; indicates that this
|
787 | * is a continuation of a prior `ListSnapshots` call, and that the system
|
788 | * should return the next page of data.
|
789 | * @param {object} [options]
|
790 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
791 | * @returns {Promise} - The promise which resolves to an array.
|
792 | * The first element of the array is Array of [Snapshot]{@link google.pubsub.v1.Snapshot}.
|
793 | * The client library will perform auto-pagination by default: it will call the API as many
|
794 | * times as needed and will merge results from all the pages into this array.
|
795 | * Note that it can affect your quota.
|
796 | * We recommend using `listSnapshotsAsync()`
|
797 | * method described below for async iteration which you can stop as needed.
|
798 | * Please see the
|
799 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
800 | * for more details and examples.
|
801 | */
|
802 | listSnapshots(request?: protos.google.pubsub.v1.IListSnapshotsRequest, options?: CallOptions): Promise<[
|
803 | protos.google.pubsub.v1.ISnapshot[],
|
804 | protos.google.pubsub.v1.IListSnapshotsRequest | null,
|
805 | protos.google.pubsub.v1.IListSnapshotsResponse
|
806 | ]>;
|
807 | listSnapshots(request: protos.google.pubsub.v1.IListSnapshotsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>): void;
|
808 | listSnapshots(request: protos.google.pubsub.v1.IListSnapshotsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>): void;
|
809 | /**
|
810 | * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
|
811 | * @param {Object} request
|
812 | * The request object that will be sent.
|
813 | * @param {string} request.project
|
814 | * Required. The name of the project in which to list snapshots.
|
815 | * Format is `projects/{project-id}`.
|
816 | * @param {number} request.pageSize
|
817 | * Maximum number of snapshots to return.
|
818 | * @param {string} request.pageToken
|
819 | * The value returned by the last `ListSnapshotsResponse`; indicates that this
|
820 | * is a continuation of a prior `ListSnapshots` call, and that the system
|
821 | * should return the next page of data.
|
822 | * @param {object} [options]
|
823 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
824 | * @returns {Stream}
|
825 | * An object stream which emits an object representing [Snapshot]{@link google.pubsub.v1.Snapshot} on 'data' event.
|
826 | * The client library will perform auto-pagination by default: it will call the API as many
|
827 | * times as needed. Note that it can affect your quota.
|
828 | * We recommend using `listSnapshotsAsync()`
|
829 | * method described below for async iteration which you can stop as needed.
|
830 | * Please see the
|
831 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
832 | * for more details and examples.
|
833 | */
|
834 | listSnapshotsStream(request?: protos.google.pubsub.v1.IListSnapshotsRequest, options?: CallOptions): Transform;
|
835 | /**
|
836 | * Equivalent to `listSnapshots`, but returns an iterable object.
|
837 | *
|
838 | * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
839 | * @param {Object} request
|
840 | * The request object that will be sent.
|
841 | * @param {string} request.project
|
842 | * Required. The name of the project in which to list snapshots.
|
843 | * Format is `projects/{project-id}`.
|
844 | * @param {number} request.pageSize
|
845 | * Maximum number of snapshots to return.
|
846 | * @param {string} request.pageToken
|
847 | * The value returned by the last `ListSnapshotsResponse`; indicates that this
|
848 | * is a continuation of a prior `ListSnapshots` call, and that the system
|
849 | * should return the next page of data.
|
850 | * @param {object} [options]
|
851 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
852 | * @returns {Object}
|
853 | * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
|
854 | * When you iterate the returned iterable, each element will be an object representing
|
855 | * [Snapshot]{@link google.pubsub.v1.Snapshot}. The API will be called under the hood as needed, once per the page,
|
856 | * so you can stop the iteration when you don't need more results.
|
857 | * Please see the
|
858 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
859 | * for more details and examples.
|
860 | */
|
861 | listSnapshotsAsync(request?: protos.google.pubsub.v1.IListSnapshotsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISnapshot>;
|
862 | /**
|
863 | * Gets the access control policy for a resource. Returns an empty policy
|
864 | * if the resource exists and does not have a policy set.
|
865 | *
|
866 | * @param {Object} request
|
867 | * The request object that will be sent.
|
868 | * @param {string} request.resource
|
869 | * REQUIRED: The resource for which the policy is being requested.
|
870 | * See the operation documentation for the appropriate value for this field.
|
871 | * @param {Object} [request.options]
|
872 | * OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
873 | * `GetIamPolicy`. This field is only used by Cloud IAM.
|
874 | *
|
875 | * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions}
|
876 | * @param {Object} [options]
|
877 | * Optional parameters. You can override the default settings for this call, e.g, timeout,
|
878 | * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
|
879 | * @param {function(?Error, ?Object)} [callback]
|
880 | * The function which will be called with the result of the API call.
|
881 | *
|
882 | * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}.
|
883 | * @returns {Promise} - The promise which resolves to an array.
|
884 | * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
|
885 | * The promise has a method named "cancel" which cancels the ongoing API call.
|
886 | */
|
887 | 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>;
|
888 | /**
|
889 | * Returns permissions that a caller has on the specified resource. If the
|
890 | * resource does not exist, this will return an empty set of
|
891 | * permissions, not a NOT_FOUND error.
|
892 | *
|
893 | * Note: This operation is designed to be used for building
|
894 | * permission-aware UIs and command-line tools, not for authorization
|
895 | * checking. This operation may "fail open" without warning.
|
896 | *
|
897 | * @param {Object} request
|
898 | * The request object that will be sent.
|
899 | * @param {string} request.resource
|
900 | * REQUIRED: The resource for which the policy detail is being requested.
|
901 | * See the operation documentation for the appropriate value for this field.
|
902 | * @param {string[]} request.permissions
|
903 | * The set of permissions to check for the `resource`. Permissions with
|
904 | * wildcards (such as '*' or 'storage.*') are not allowed. For more
|
905 | * information see
|
906 | * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
907 | * @param {Object} [options]
|
908 | * Optional parameters. You can override the default settings for this call, e.g, timeout,
|
909 | * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
|
910 | * @param {function(?Error, ?Object)} [callback]
|
911 | * The function which will be called with the result of the API call.
|
912 | *
|
913 | * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
|
914 | * @returns {Promise} - The promise which resolves to an array.
|
915 | * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
|
916 | * The promise has a method named "cancel" which cancels the ongoing API call.
|
917 | */
|
918 | 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>;
|
919 | /**
|
920 | * Returns permissions that a caller has on the specified resource. If the
|
921 | * resource does not exist, this will return an empty set of
|
922 | * permissions, not a NOT_FOUND error.
|
923 | *
|
924 | * Note: This operation is designed to be used for building
|
925 | * permission-aware UIs and command-line tools, not for authorization
|
926 | * checking. This operation may "fail open" without warning.
|
927 | *
|
928 | * @param {Object} request
|
929 | * The request object that will be sent.
|
930 | * @param {string} request.resource
|
931 | * REQUIRED: The resource for which the policy detail is being requested.
|
932 | * See the operation documentation for the appropriate value for this field.
|
933 | * @param {string[]} request.permissions
|
934 | * The set of permissions to check for the `resource`. Permissions with
|
935 | * wildcards (such as '*' or 'storage.*') are not allowed. For more
|
936 | * information see
|
937 | * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
938 | * @param {Object} [options]
|
939 | * Optional parameters. You can override the default settings for this call, e.g, timeout,
|
940 | * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
|
941 | * @param {function(?Error, ?Object)} [callback]
|
942 | * The function which will be called with the result of the API call.
|
943 | *
|
944 | * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
|
945 | * @returns {Promise} - The promise which resolves to an array.
|
946 | * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
|
947 | * The promise has a method named "cancel" which cancels the ongoing API call.
|
948 | *
|
949 | */
|
950 | 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>;
|
951 | /**
|
952 | * Return a fully-qualified project resource name string.
|
953 | *
|
954 | * @param {string} project
|
955 | * @returns {string} Resource name string.
|
956 | */
|
957 | projectPath(project: string): string;
|
958 | /**
|
959 | * Parse the project from Project resource.
|
960 | *
|
961 | * @param {string} projectName
|
962 | * A fully-qualified path representing Project resource.
|
963 | * @returns {string} A string representing the project.
|
964 | */
|
965 | matchProjectFromProjectName(projectName: string): string | number;
|
966 | /**
|
967 | * Return a fully-qualified projectTopic resource name string.
|
968 | *
|
969 | * @param {string} project
|
970 | * @param {string} topic
|
971 | * @returns {string} Resource name string.
|
972 | */
|
973 | projectTopicPath(project: string, topic: string): string;
|
974 | /**
|
975 | * Parse the project from ProjectTopic resource.
|
976 | *
|
977 | * @param {string} projectTopicName
|
978 | * A fully-qualified path representing project_topic resource.
|
979 | * @returns {string} A string representing the project.
|
980 | */
|
981 | matchProjectFromProjectTopicName(projectTopicName: string): string | number;
|
982 | /**
|
983 | * Parse the topic from ProjectTopic resource.
|
984 | *
|
985 | * @param {string} projectTopicName
|
986 | * A fully-qualified path representing project_topic resource.
|
987 | * @returns {string} A string representing the topic.
|
988 | */
|
989 | matchTopicFromProjectTopicName(projectTopicName: string): string | number;
|
990 | /**
|
991 | * Return a fully-qualified schema resource name string.
|
992 | *
|
993 | * @param {string} project
|
994 | * @param {string} schema
|
995 | * @returns {string} Resource name string.
|
996 | */
|
997 | schemaPath(project: string, schema: string): string;
|
998 | /**
|
999 | * Parse the project from Schema resource.
|
1000 | *
|
1001 | * @param {string} schemaName
|
1002 | * A fully-qualified path representing Schema resource.
|
1003 | * @returns {string} A string representing the project.
|
1004 | */
|
1005 | matchProjectFromSchemaName(schemaName: string): string | number;
|
1006 | /**
|
1007 | * Parse the schema from Schema resource.
|
1008 | *
|
1009 | * @param {string} schemaName
|
1010 | * A fully-qualified path representing Schema resource.
|
1011 | * @returns {string} A string representing the schema.
|
1012 | */
|
1013 | matchSchemaFromSchemaName(schemaName: string): string | number;
|
1014 | /**
|
1015 | * Return a fully-qualified snapshot resource name string.
|
1016 | *
|
1017 | * @param {string} project
|
1018 | * @param {string} snapshot
|
1019 | * @returns {string} Resource name string.
|
1020 | */
|
1021 | snapshotPath(project: string, snapshot: string): string;
|
1022 | /**
|
1023 | * Parse the project from Snapshot resource.
|
1024 | *
|
1025 | * @param {string} snapshotName
|
1026 | * A fully-qualified path representing Snapshot resource.
|
1027 | * @returns {string} A string representing the project.
|
1028 | */
|
1029 | matchProjectFromSnapshotName(snapshotName: string): string | number;
|
1030 | /**
|
1031 | * Parse the snapshot from Snapshot resource.
|
1032 | *
|
1033 | * @param {string} snapshotName
|
1034 | * A fully-qualified path representing Snapshot resource.
|
1035 | * @returns {string} A string representing the snapshot.
|
1036 | */
|
1037 | matchSnapshotFromSnapshotName(snapshotName: string): string | number;
|
1038 | /**
|
1039 | * Return a fully-qualified subscription resource name string.
|
1040 | *
|
1041 | * @param {string} project
|
1042 | * @param {string} subscription
|
1043 | * @returns {string} Resource name string.
|
1044 | */
|
1045 | subscriptionPath(project: string, subscription: string): string;
|
1046 | /**
|
1047 | * Parse the project from Subscription resource.
|
1048 | *
|
1049 | * @param {string} subscriptionName
|
1050 | * A fully-qualified path representing Subscription resource.
|
1051 | * @returns {string} A string representing the project.
|
1052 | */
|
1053 | matchProjectFromSubscriptionName(subscriptionName: string): string | number;
|
1054 | /**
|
1055 | * Parse the subscription from Subscription resource.
|
1056 | *
|
1057 | * @param {string} subscriptionName
|
1058 | * A fully-qualified path representing Subscription resource.
|
1059 | * @returns {string} A string representing the subscription.
|
1060 | */
|
1061 | matchSubscriptionFromSubscriptionName(subscriptionName: string): string | number;
|
1062 | /**
|
1063 | * Terminate the gRPC channel and close the client.
|
1064 | *
|
1065 | * The client will no longer be usable and all future behavior is undefined.
|
1066 | * @returns {Promise} A promise that resolves when the client is closed.
|
1067 | */
|
1068 | close(): Promise<void>;
|
1069 | }
|