@google-cloud/pubsub 2.18.1 → 2.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/src/iam.d.ts +180 -0
  3. package/build/src/iam.js +2 -172
  4. package/build/src/iam.js.map +1 -1
  5. package/build/src/index.d.ts +12 -4
  6. package/build/src/index.js +12 -4
  7. package/build/src/index.js.map +1 -1
  8. package/build/src/publisher/flow-publisher.d.ts +6 -0
  9. package/build/src/publisher/flow-publisher.js +6 -0
  10. package/build/src/publisher/flow-publisher.js.map +1 -1
  11. package/build/src/publisher/index.d.ts +35 -0
  12. package/build/src/publisher/index.js +0 -35
  13. package/build/src/publisher/index.js.map +1 -1
  14. package/build/src/pubsub.d.ts +354 -4
  15. package/build/src/pubsub.js +28 -322
  16. package/build/src/pubsub.js.map +1 -1
  17. package/build/src/schema.d.ts +9 -4
  18. package/build/src/schema.js +9 -4
  19. package/build/src/schema.js.map +1 -1
  20. package/build/src/snapshot.d.ts +87 -0
  21. package/build/src/snapshot.js +2 -79
  22. package/build/src/snapshot.js.map +1 -1
  23. package/build/src/subscriber.d.ts +6 -0
  24. package/build/src/subscriber.js +6 -0
  25. package/build/src/subscriber.js.map +1 -1
  26. package/build/src/subscription.d.ts +439 -9
  27. package/build/src/subscription.js +24 -400
  28. package/build/src/subscription.js.map +1 -1
  29. package/build/src/topic.d.ts +466 -1
  30. package/build/src/topic.js +17 -417
  31. package/build/src/topic.js.map +1 -1
  32. package/build/src/v1/publisher_client.d.ts +262 -0
  33. package/build/src/v1/publisher_client.js +6 -244
  34. package/build/src/v1/publisher_client.js.map +1 -1
  35. package/build/src/v1/schema_service_client.d.ts +165 -0
  36. package/build/src/v1/schema_service_client.js +2 -153
  37. package/build/src/v1/schema_service_client.js.map +1 -1
  38. package/build/src/v1/subscriber_client.d.ts +566 -0
  39. package/build/src/v1/subscriber_client.js +6 -534
  40. package/build/src/v1/subscriber_client.js.map +1 -1
  41. package/package.json +2 -2
@@ -252,10 +252,6 @@ class SubscriberClient {
252
252
  'https://www.googleapis.com/auth/pubsub',
253
253
  ];
254
254
  }
255
- /**
256
- * Return the project ID used by this class.
257
- * @returns {Promise} A promise that resolves to string containing the project ID.
258
- */
259
255
  getProjectId(callback) {
260
256
  if (callback) {
261
257
  this.auth.getProjectId(callback);
@@ -263,132 +259,6 @@ class SubscriberClient {
263
259
  }
264
260
  return this.auth.getProjectId();
265
261
  }
266
- /**
267
- * Creates a subscription to a given topic. See the [resource name rules]
268
- * (https://cloud.google.com/pubsub/docs/admin#resource_names).
269
- * If the subscription already exists, returns `ALREADY_EXISTS`.
270
- * If the corresponding topic doesn't exist, returns `NOT_FOUND`.
271
- *
272
- * If the name is not provided in the request, the server will assign a random
273
- * name for this subscription on the same project as the topic, conforming
274
- * to the [resource name format]
275
- * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated
276
- * name is populated in the returned Subscription object. Note that for REST
277
- * API requests, you must specify a name in the request.
278
- *
279
- * @param {Object} request
280
- * The request object that will be sent.
281
- * @param {string} request.name
282
- * Required. The name of the subscription. It must have the format
283
- * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
284
- * start with a letter, and contain only letters (`[A-Za-z]`), numbers
285
- * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
286
- * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
287
- * in length, and it must not start with `"goog"`.
288
- * @param {string} request.topic
289
- * Required. The name of the topic from which this subscription is receiving
290
- * messages. Format is `projects/{project}/topics/{topic}`. The value of this
291
- * field will be `_deleted-topic_` if the topic has been deleted.
292
- * @param {google.pubsub.v1.PushConfig} request.pushConfig
293
- * If push delivery is used with this subscription, this field is
294
- * used to configure it. An empty `pushConfig` signifies that the subscriber
295
- * will pull and ack messages using API methods.
296
- * @param {number} request.ackDeadlineSeconds
297
- * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
298
- * the subscriber to acknowledge receipt before resending the message. In the
299
- * interval after the message is delivered and before it is acknowledged, it
300
- * is considered to be <i>outstanding</i>. During that time period, the
301
- * message will not be redelivered (on a best-effort basis).
302
- *
303
- * For pull subscriptions, this value is used as the initial value for the ack
304
- * deadline. To override this value for a given message, call
305
- * `ModifyAckDeadline` with the corresponding `ack_id` if using
306
- * non-streaming pull or send the `ack_id` in a
307
- * `StreamingModifyAckDeadlineRequest` if using streaming pull.
308
- * The minimum custom deadline you can specify is 10 seconds.
309
- * The maximum custom deadline you can specify is 600 seconds (10 minutes).
310
- * If this parameter is 0, a default value of 10 seconds is used.
311
- *
312
- * For push delivery, this value is also used to set the request timeout for
313
- * the call to the push endpoint.
314
- *
315
- * If the subscriber never acknowledges the message, the Pub/Sub
316
- * system will eventually redeliver the message.
317
- * @param {boolean} request.retainAckedMessages
318
- * Indicates whether to retain acknowledged messages. If true, then
319
- * messages are not expunged from the subscription's backlog, even if they are
320
- * acknowledged, until they fall out of the `message_retention_duration`
321
- * window. This must be true if you would like to [`Seek` to a timestamp]
322
- * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
323
- * the past to replay previously-acknowledged messages.
324
- * @param {google.protobuf.Duration} request.messageRetentionDuration
325
- * How long to retain unacknowledged messages in the subscription's backlog,
326
- * from the moment a message is published.
327
- * If `retain_acked_messages` is true, then this also configures the retention
328
- * of acknowledged messages, and thus configures how far back in time a `Seek`
329
- * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
330
- * minutes.
331
- * @param {number[]} request.labels
332
- * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
333
- * managing labels</a>.
334
- * @param {boolean} request.enableMessageOrdering
335
- * If true, messages published with the same `ordering_key` in `PubsubMessage`
336
- * will be delivered to the subscribers in the order in which they
337
- * are received by the Pub/Sub system. Otherwise, they may be delivered in
338
- * any order.
339
- * @param {google.pubsub.v1.ExpirationPolicy} request.expirationPolicy
340
- * A policy that specifies the conditions for this subscription's expiration.
341
- * A subscription is considered active as long as any connected subscriber is
342
- * successfully consuming messages from the subscription or is issuing
343
- * operations on the subscription. If `expiration_policy` is not set, a
344
- * *default policy* with `ttl` of 31 days will be used. The minimum allowed
345
- * value for `expiration_policy.ttl` is 1 day.
346
- * @param {string} request.filter
347
- * An expression written in the Pub/Sub [filter
348
- * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
349
- * then only `PubsubMessage`s whose `attributes` field matches the filter are
350
- * delivered on this subscription. If empty, then no messages are filtered
351
- * out.
352
- * @param {google.pubsub.v1.DeadLetterPolicy} request.deadLetterPolicy
353
- * A policy that specifies the conditions for dead lettering messages in
354
- * this subscription. If dead_letter_policy is not set, dead lettering
355
- * is disabled.
356
- *
357
- * The Cloud Pub/Sub service account associated with this subscriptions's
358
- * parent project (i.e.,
359
- * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
360
- * permission to Acknowledge() messages on this subscription.
361
- * @param {google.pubsub.v1.RetryPolicy} request.retryPolicy
362
- * A policy that specifies how Pub/Sub retries message delivery for this
363
- * subscription.
364
- *
365
- * If not set, the default retry policy is applied. This generally implies
366
- * that messages will be retried as soon as possible for healthy subscribers.
367
- * RetryPolicy will be triggered on NACKs or acknowledgement deadline
368
- * exceeded events for a given message.
369
- * @param {boolean} request.detached
370
- * Indicates whether the subscription is detached from its topic. Detached
371
- * subscriptions don't receive messages from their topic and don't retain any
372
- * backlog. `Pull` and `StreamingPull` requests will return
373
- * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
374
- * the endpoint will not be made.
375
- * @param {google.protobuf.Duration} request.topicMessageRetentionDuration
376
- * Output only. Indicates the minimum duration for which a message is retained
377
- * after it is published to the subscription's topic. If this field is set,
378
- * messages published to the subscription's topic in the last
379
- * `topic_message_retention_duration` are always available to subscribers. See
380
- * the `message_retention_duration` field in `Topic`. This field is set only
381
- * in responses from the server; it is ignored if it is set in any requests.
382
- * @param {object} [options]
383
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
384
- * @returns {Promise} - The promise which resolves to an array.
385
- * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}.
386
- * Please see the
387
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
388
- * for more details and examples.
389
- * @example
390
- * const [response] = await client.createSubscription(request);
391
- */
392
262
  createSubscription(request, optionsOrCallback, callback) {
393
263
  request = request || {};
394
264
  let options;
@@ -409,24 +279,6 @@ class SubscriberClient {
409
279
  this.initialize();
410
280
  return this.innerApiCalls.createSubscription(request, options, callback);
411
281
  }
412
- /**
413
- * Gets the configuration details of a subscription.
414
- *
415
- * @param {Object} request
416
- * The request object that will be sent.
417
- * @param {string} request.subscription
418
- * Required. The name of the subscription to get.
419
- * Format is `projects/{project}/subscriptions/{sub}`.
420
- * @param {object} [options]
421
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
422
- * @returns {Promise} - The promise which resolves to an array.
423
- * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}.
424
- * Please see the
425
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
426
- * for more details and examples.
427
- * @example
428
- * const [response] = await client.getSubscription(request);
429
- */
430
282
  getSubscription(request, optionsOrCallback, callback) {
431
283
  request = request || {};
432
284
  let options;
@@ -447,27 +299,6 @@ class SubscriberClient {
447
299
  this.initialize();
448
300
  return this.innerApiCalls.getSubscription(request, options, callback);
449
301
  }
450
- /**
451
- * Updates an existing subscription. Note that certain properties of a
452
- * subscription, such as its topic, are not modifiable.
453
- *
454
- * @param {Object} request
455
- * The request object that will be sent.
456
- * @param {google.pubsub.v1.Subscription} request.subscription
457
- * Required. The updated subscription object.
458
- * @param {google.protobuf.FieldMask} request.updateMask
459
- * Required. Indicates which fields in the provided subscription to update.
460
- * Must be specified and non-empty.
461
- * @param {object} [options]
462
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
463
- * @returns {Promise} - The promise which resolves to an array.
464
- * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}.
465
- * Please see the
466
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
467
- * for more details and examples.
468
- * @example
469
- * const [response] = await client.updateSubscription(request);
470
- */
471
302
  updateSubscription(request, optionsOrCallback, callback) {
472
303
  request = request || {};
473
304
  let options;
@@ -488,28 +319,6 @@ class SubscriberClient {
488
319
  this.initialize();
489
320
  return this.innerApiCalls.updateSubscription(request, options, callback);
490
321
  }
491
- /**
492
- * Deletes an existing subscription. All messages retained in the subscription
493
- * are immediately dropped. Calls to `Pull` after deletion will return
494
- * `NOT_FOUND`. After a subscription is deleted, a new one may be created with
495
- * the same name, but the new one has no association with the old
496
- * subscription or its topic unless the same topic is specified.
497
- *
498
- * @param {Object} request
499
- * The request object that will be sent.
500
- * @param {string} request.subscription
501
- * Required. The subscription to delete.
502
- * Format is `projects/{project}/subscriptions/{sub}`.
503
- * @param {object} [options]
504
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
505
- * @returns {Promise} - The promise which resolves to an array.
506
- * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
507
- * Please see the
508
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
509
- * for more details and examples.
510
- * @example
511
- * const [response] = await client.deleteSubscription(request);
512
- */
513
322
  deleteSubscription(request, optionsOrCallback, callback) {
514
323
  request = request || {};
515
324
  let options;
@@ -530,39 +339,6 @@ class SubscriberClient {
530
339
  this.initialize();
531
340
  return this.innerApiCalls.deleteSubscription(request, options, callback);
532
341
  }
533
- /**
534
- * Modifies the ack deadline for a specific message. This method is useful
535
- * to indicate that more time is needed to process a message by the
536
- * subscriber, or to make the message available for redelivery if the
537
- * processing was interrupted. Note that this does not modify the
538
- * subscription-level `ackDeadlineSeconds` used for subsequent messages.
539
- *
540
- * @param {Object} request
541
- * The request object that will be sent.
542
- * @param {string} request.subscription
543
- * Required. The name of the subscription.
544
- * Format is `projects/{project}/subscriptions/{sub}`.
545
- * @param {string[]} request.ackIds
546
- * Required. List of acknowledgment IDs.
547
- * @param {number} request.ackDeadlineSeconds
548
- * Required. The new ack deadline with respect to the time this request was
549
- * sent to the Pub/Sub system. For example, if the value is 10, the new ack
550
- * deadline will expire 10 seconds after the `ModifyAckDeadline` call was
551
- * made. Specifying zero might immediately make the message available for
552
- * delivery to another subscriber client. This typically results in an
553
- * increase in the rate of message redeliveries (that is, duplicates).
554
- * The minimum deadline you can specify is 0 seconds.
555
- * The maximum deadline you can specify is 600 seconds (10 minutes).
556
- * @param {object} [options]
557
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
558
- * @returns {Promise} - The promise which resolves to an array.
559
- * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
560
- * Please see the
561
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
562
- * for more details and examples.
563
- * @example
564
- * const [response] = await client.modifyAckDeadline(request);
565
- */
566
342
  modifyAckDeadline(request, optionsOrCallback, callback) {
567
343
  request = request || {};
568
344
  let options;
@@ -583,34 +359,6 @@ class SubscriberClient {
583
359
  this.initialize();
584
360
  return this.innerApiCalls.modifyAckDeadline(request, options, callback);
585
361
  }
586
- /**
587
- * Acknowledges the messages associated with the `ack_ids` in the
588
- * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
589
- * from the subscription.
590
- *
591
- * Acknowledging a message whose ack deadline has expired may succeed,
592
- * but such a message may be redelivered later. Acknowledging a message more
593
- * than once will not result in an error.
594
- *
595
- * @param {Object} request
596
- * The request object that will be sent.
597
- * @param {string} request.subscription
598
- * Required. The subscription whose message is being acknowledged.
599
- * Format is `projects/{project}/subscriptions/{sub}`.
600
- * @param {string[]} request.ackIds
601
- * Required. The acknowledgment ID for the messages being acknowledged that
602
- * was returned by the Pub/Sub system in the `Pull` response. Must not be
603
- * empty.
604
- * @param {object} [options]
605
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
606
- * @returns {Promise} - The promise which resolves to an array.
607
- * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
608
- * Please see the
609
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
610
- * for more details and examples.
611
- * @example
612
- * const [response] = await client.acknowledge(request);
613
- */
614
362
  acknowledge(request, optionsOrCallback, callback) {
615
363
  request = request || {};
616
364
  let options;
@@ -631,38 +379,6 @@ class SubscriberClient {
631
379
  this.initialize();
632
380
  return this.innerApiCalls.acknowledge(request, options, callback);
633
381
  }
634
- /**
635
- * Pulls messages from the server. The server may return `UNAVAILABLE` if
636
- * there are too many concurrent pull requests pending for the given
637
- * subscription.
638
- *
639
- * @param {Object} request
640
- * The request object that will be sent.
641
- * @param {string} request.subscription
642
- * Required. The subscription from which messages should be pulled.
643
- * Format is `projects/{project}/subscriptions/{sub}`.
644
- * @param {boolean} [request.returnImmediately]
645
- * Optional. If this field set to true, the system will respond immediately
646
- * even if it there are no messages available to return in the `Pull`
647
- * response. Otherwise, the system may wait (for a bounded amount of time)
648
- * until at least one message is available, rather than returning no messages.
649
- * Warning: setting this field to `true` is discouraged because it adversely
650
- * impacts the performance of `Pull` operations. We recommend that users do
651
- * not set this field.
652
- * @param {number} request.maxMessages
653
- * Required. The maximum number of messages to return for this request. Must
654
- * be a positive integer. The Pub/Sub system may return fewer than the number
655
- * specified.
656
- * @param {object} [options]
657
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
658
- * @returns {Promise} - The promise which resolves to an array.
659
- * The first element of the array is an object representing [PullResponse]{@link google.pubsub.v1.PullResponse}.
660
- * Please see the
661
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
662
- * for more details and examples.
663
- * @example
664
- * const [response] = await client.pull(request);
665
- */
666
382
  pull(request, optionsOrCallback, callback) {
667
383
  request = request || {};
668
384
  let options;
@@ -683,36 +399,6 @@ class SubscriberClient {
683
399
  this.initialize();
684
400
  return this.innerApiCalls.pull(request, options, callback);
685
401
  }
686
- /**
687
- * Modifies the `PushConfig` for a specified subscription.
688
- *
689
- * This may be used to change a push subscription to a pull one (signified by
690
- * an empty `PushConfig`) or vice versa, or change the endpoint URL and other
691
- * attributes of a push subscription. Messages will accumulate for delivery
692
- * continuously through the call regardless of changes to the `PushConfig`.
693
- *
694
- * @param {Object} request
695
- * The request object that will be sent.
696
- * @param {string} request.subscription
697
- * Required. The name of the subscription.
698
- * Format is `projects/{project}/subscriptions/{sub}`.
699
- * @param {google.pubsub.v1.PushConfig} request.pushConfig
700
- * Required. The push configuration for future deliveries.
701
- *
702
- * An empty `pushConfig` indicates that the Pub/Sub system should
703
- * stop pushing messages from the given subscription and allow
704
- * messages to be pulled and acknowledged - effectively pausing
705
- * the subscription if `Pull` or `StreamingPull` is not called.
706
- * @param {object} [options]
707
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
708
- * @returns {Promise} - The promise which resolves to an array.
709
- * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
710
- * Please see the
711
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
712
- * for more details and examples.
713
- * @example
714
- * const [response] = await client.modifyPushConfig(request);
715
- */
716
402
  modifyPushConfig(request, optionsOrCallback, callback) {
717
403
  request = request || {};
718
404
  let options;
@@ -733,28 +419,6 @@ class SubscriberClient {
733
419
  this.initialize();
734
420
  return this.innerApiCalls.modifyPushConfig(request, options, callback);
735
421
  }
736
- /**
737
- * Gets the configuration details of a snapshot. Snapshots are used in
738
- * <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
739
- * operations, which allow you to manage message acknowledgments in bulk. That
740
- * is, you can set the acknowledgment state of messages in an existing
741
- * subscription to the state captured by a snapshot.
742
- *
743
- * @param {Object} request
744
- * The request object that will be sent.
745
- * @param {string} request.snapshot
746
- * Required. The name of the snapshot to get.
747
- * Format is `projects/{project}/snapshots/{snap}`.
748
- * @param {object} [options]
749
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
750
- * @returns {Promise} - The promise which resolves to an array.
751
- * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}.
752
- * Please see the
753
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
754
- * for more details and examples.
755
- * @example
756
- * const [response] = await client.getSnapshot(request);
757
- */
758
422
  getSnapshot(request, optionsOrCallback, callback) {
759
423
  request = request || {};
760
424
  let options;
@@ -775,56 +439,6 @@ class SubscriberClient {
775
439
  this.initialize();
776
440
  return this.innerApiCalls.getSnapshot(request, options, callback);
777
441
  }
778
- /**
779
- * Creates a snapshot from the requested subscription. Snapshots are used in
780
- * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
781
- * which allow you to manage message acknowledgments in bulk. That is, you can
782
- * set the acknowledgment state of messages in an existing subscription to the
783
- * state captured by a snapshot.
784
- * If the snapshot already exists, returns `ALREADY_EXISTS`.
785
- * If the requested subscription doesn't exist, returns `NOT_FOUND`.
786
- * If the backlog in the subscription is too old -- and the resulting snapshot
787
- * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
788
- * See also the `Snapshot.expire_time` field. If the name is not provided in
789
- * the request, the server will assign a random
790
- * name for this snapshot on the same project as the subscription, conforming
791
- * to the [resource name format]
792
- * (https://cloud.google.com/pubsub/docs/admin#resource_names). The
793
- * generated name is populated in the returned Snapshot object. Note that for
794
- * REST API requests, you must specify a name in the request.
795
- *
796
- * @param {Object} request
797
- * The request object that will be sent.
798
- * @param {string} request.name
799
- * Required. User-provided name for this snapshot. If the name is not provided
800
- * in the request, the server will assign a random name for this snapshot on
801
- * the same project as the subscription. Note that for REST API requests, you
802
- * must specify a name. See the <a
803
- * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource
804
- * name rules</a>. Format is `projects/{project}/snapshots/{snap}`.
805
- * @param {string} request.subscription
806
- * Required. The subscription whose backlog the snapshot retains.
807
- * Specifically, the created snapshot is guaranteed to retain:
808
- * (a) The existing backlog on the subscription. More precisely, this is
809
- * defined as the messages in the subscription's backlog that are
810
- * unacknowledged upon the successful completion of the
811
- * `CreateSnapshot` request; as well as:
812
- * (b) Any messages published to the subscription's topic following the
813
- * successful completion of the CreateSnapshot request.
814
- * Format is `projects/{project}/subscriptions/{sub}`.
815
- * @param {number[]} request.labels
816
- * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
817
- * managing labels</a>.
818
- * @param {object} [options]
819
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
820
- * @returns {Promise} - The promise which resolves to an array.
821
- * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}.
822
- * Please see the
823
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
824
- * for more details and examples.
825
- * @example
826
- * const [response] = await client.createSnapshot(request);
827
- */
828
442
  createSnapshot(request, optionsOrCallback, callback) {
829
443
  request = request || {};
830
444
  let options;
@@ -845,31 +459,6 @@ class SubscriberClient {
845
459
  this.initialize();
846
460
  return this.innerApiCalls.createSnapshot(request, options, callback);
847
461
  }
848
- /**
849
- * Updates an existing snapshot. Snapshots are used in
850
- * <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
851
- * operations, which allow
852
- * you to manage message acknowledgments in bulk. That is, you can set the
853
- * acknowledgment state of messages in an existing subscription to the state
854
- * captured by a snapshot.
855
- *
856
- * @param {Object} request
857
- * The request object that will be sent.
858
- * @param {google.pubsub.v1.Snapshot} request.snapshot
859
- * Required. The updated snapshot object.
860
- * @param {google.protobuf.FieldMask} request.updateMask
861
- * Required. Indicates which fields in the provided snapshot to update.
862
- * Must be specified and non-empty.
863
- * @param {object} [options]
864
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
865
- * @returns {Promise} - The promise which resolves to an array.
866
- * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}.
867
- * Please see the
868
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
869
- * for more details and examples.
870
- * @example
871
- * const [response] = await client.updateSnapshot(request);
872
- */
873
462
  updateSnapshot(request, optionsOrCallback, callback) {
874
463
  request = request || {};
875
464
  let options;
@@ -890,32 +479,6 @@ class SubscriberClient {
890
479
  this.initialize();
891
480
  return this.innerApiCalls.updateSnapshot(request, options, callback);
892
481
  }
893
- /**
894
- * Removes an existing snapshot. Snapshots are used in [Seek]
895
- * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
896
- * allow you to manage message acknowledgments in bulk. That is, you can set
897
- * the acknowledgment state of messages in an existing subscription to the
898
- * state captured by a snapshot.
899
- * When the snapshot is deleted, all messages retained in the snapshot
900
- * are immediately dropped. After a snapshot is deleted, a new one may be
901
- * created with the same name, but the new one has no association with the old
902
- * snapshot or its subscription, unless the same subscription is specified.
903
- *
904
- * @param {Object} request
905
- * The request object that will be sent.
906
- * @param {string} request.snapshot
907
- * Required. The name of the snapshot to delete.
908
- * Format is `projects/{project}/snapshots/{snap}`.
909
- * @param {object} [options]
910
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
911
- * @returns {Promise} - The promise which resolves to an array.
912
- * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
913
- * Please see the
914
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
915
- * for more details and examples.
916
- * @example
917
- * const [response] = await client.deleteSnapshot(request);
918
- */
919
482
  deleteSnapshot(request, optionsOrCallback, callback) {
920
483
  request = request || {};
921
484
  let options;
@@ -936,45 +499,6 @@ class SubscriberClient {
936
499
  this.initialize();
937
500
  return this.innerApiCalls.deleteSnapshot(request, options, callback);
938
501
  }
939
- /**
940
- * Seeks an existing subscription to a point in time or to a given snapshot,
941
- * whichever is provided in the request. Snapshots are used in [Seek]
942
- * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
943
- * allow you to manage message acknowledgments in bulk. That is, you can set
944
- * the acknowledgment state of messages in an existing subscription to the
945
- * state captured by a snapshot. Note that both the subscription and the
946
- * snapshot must be on the same topic.
947
- *
948
- * @param {Object} request
949
- * The request object that will be sent.
950
- * @param {string} request.subscription
951
- * Required. The subscription to affect.
952
- * @param {google.protobuf.Timestamp} request.time
953
- * The time to seek to.
954
- * Messages retained in the subscription that were published before this
955
- * time are marked as acknowledged, and messages retained in the
956
- * subscription that were published after this time are marked as
957
- * unacknowledged. Note that this operation affects only those messages
958
- * retained in the subscription (configured by the combination of
959
- * `message_retention_duration` and `retain_acked_messages`). For example,
960
- * if `time` corresponds to a point before the message retention
961
- * window (or to a point before the system's notion of the subscription
962
- * creation time), only retained messages will be marked as unacknowledged,
963
- * and already-expunged messages will not be restored.
964
- * @param {string} request.snapshot
965
- * The snapshot to seek to. The snapshot's topic must be the same as that of
966
- * the provided subscription.
967
- * Format is `projects/{project}/snapshots/{snap}`.
968
- * @param {object} [options]
969
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
970
- * @returns {Promise} - The promise which resolves to an array.
971
- * The first element of the array is an object representing [SeekResponse]{@link google.pubsub.v1.SeekResponse}.
972
- * Please see the
973
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
974
- * for more details and examples.
975
- * @example
976
- * const [response] = await client.seek(request);
977
- */
978
502
  seek(request, optionsOrCallback, callback) {
979
503
  request = request || {};
980
504
  let options;
@@ -1014,43 +538,18 @@ class SubscriberClient {
1014
538
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming)
1015
539
  * for more details and examples.
1016
540
  * @example
541
+ * ```
1017
542
  * const stream = client.streamingPull();
1018
543
  * stream.on('data', (response) => { ... });
1019
544
  * stream.on('end', () => { ... });
1020
545
  * stream.write(request);
1021
546
  * stream.end();
547
+ * ```
1022
548
  */
1023
549
  streamingPull(options) {
1024
550
  this.initialize();
1025
551
  return this.innerApiCalls.streamingPull(options);
1026
552
  }
1027
- /**
1028
- * Lists matching subscriptions.
1029
- *
1030
- * @param {Object} request
1031
- * The request object that will be sent.
1032
- * @param {string} request.project
1033
- * Required. The name of the project in which to list subscriptions.
1034
- * Format is `projects/{project-id}`.
1035
- * @param {number} request.pageSize
1036
- * Maximum number of subscriptions to return.
1037
- * @param {string} request.pageToken
1038
- * The value returned by the last `ListSubscriptionsResponse`; indicates that
1039
- * this is a continuation of a prior `ListSubscriptions` call, and that the
1040
- * system should return the next page of data.
1041
- * @param {object} [options]
1042
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1043
- * @returns {Promise} - The promise which resolves to an array.
1044
- * The first element of the array is Array of [Subscription]{@link google.pubsub.v1.Subscription}.
1045
- * The client library will perform auto-pagination by default: it will call the API as many
1046
- * times as needed and will merge results from all the pages into this array.
1047
- * Note that it can affect your quota.
1048
- * We recommend using `listSubscriptionsAsync()`
1049
- * method described below for async iteration which you can stop as needed.
1050
- * Please see the
1051
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1052
- * for more details and examples.
1053
- */
1054
553
  listSubscriptions(request, optionsOrCallback, callback) {
1055
554
  request = request || {};
1056
555
  let options;
@@ -1135,10 +634,12 @@ class SubscriberClient {
1135
634
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1136
635
  * for more details and examples.
1137
636
  * @example
637
+ * ```
1138
638
  * const iterable = client.listSubscriptionsAsync(request);
1139
639
  * for await (const response of iterable) {
1140
640
  * // process response
1141
641
  * }
642
+ * ```
1142
643
  */
1143
644
  listSubscriptionsAsync(request, options) {
1144
645
  request = request || {};
@@ -1154,37 +655,6 @@ class SubscriberClient {
1154
655
  this.initialize();
1155
656
  return this.descriptors.page.listSubscriptions.asyncIterate(this.innerApiCalls['listSubscriptions'], request, callSettings);
1156
657
  }
1157
- /**
1158
- * Lists the existing snapshots. Snapshots are used in [Seek](
1159
- * https://cloud.google.com/pubsub/docs/replay-overview) operations, which
1160
- * allow you to manage message acknowledgments in bulk. That is, you can set
1161
- * the acknowledgment state of messages in an existing subscription to the
1162
- * state captured by a snapshot.
1163
- *
1164
- * @param {Object} request
1165
- * The request object that will be sent.
1166
- * @param {string} request.project
1167
- * Required. The name of the project in which to list snapshots.
1168
- * Format is `projects/{project-id}`.
1169
- * @param {number} request.pageSize
1170
- * Maximum number of snapshots to return.
1171
- * @param {string} request.pageToken
1172
- * The value returned by the last `ListSnapshotsResponse`; indicates that this
1173
- * is a continuation of a prior `ListSnapshots` call, and that the system
1174
- * should return the next page of data.
1175
- * @param {object} [options]
1176
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1177
- * @returns {Promise} - The promise which resolves to an array.
1178
- * The first element of the array is Array of [Snapshot]{@link google.pubsub.v1.Snapshot}.
1179
- * The client library will perform auto-pagination by default: it will call the API as many
1180
- * times as needed and will merge results from all the pages into this array.
1181
- * Note that it can affect your quota.
1182
- * We recommend using `listSnapshotsAsync()`
1183
- * method described below for async iteration which you can stop as needed.
1184
- * Please see the
1185
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1186
- * for more details and examples.
1187
- */
1188
658
  listSnapshots(request, optionsOrCallback, callback) {
1189
659
  request = request || {};
1190
660
  let options;
@@ -1269,10 +739,12 @@ class SubscriberClient {
1269
739
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1270
740
  * for more details and examples.
1271
741
  * @example
742
+ * ```
1272
743
  * const iterable = client.listSnapshotsAsync(request);
1273
744
  * for await (const response of iterable) {
1274
745
  * // process response
1275
746
  * }
747
+ * ```
1276
748
  */
1277
749
  listSnapshotsAsync(request, options) {
1278
750
  request = request || {};