@google-cloud/pubsub 4.1.1 → 4.3.0

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.
@@ -18,6 +18,8 @@ export declare class SubscriberClient {
18
18
  private _gaxGrpc;
19
19
  private _protos;
20
20
  private _defaults;
21
+ private _universeDomain;
22
+ private _servicePath;
21
23
  auth: gax.GoogleAuth;
22
24
  descriptors: Descriptors;
23
25
  warn: (code: string, message: string, warnType?: string) => void;
@@ -87,15 +89,28 @@ export declare class SubscriberClient {
87
89
  }>;
88
90
  /**
89
91
  * The DNS address for this API service.
92
+ * @deprecated
90
93
  * @returns {string} The DNS address for this service.
91
94
  */
92
95
  static get servicePath(): string;
93
96
  /**
94
- * The DNS address for this API service - same as servicePath(),
97
+ * The DNS address for this API service - same as servicePath,
95
98
  * exists for compatibility reasons.
99
+ * @deprecated
96
100
  * @returns {string} The DNS address for this service.
97
101
  */
98
102
  static get apiEndpoint(): string;
103
+ /**
104
+ * The DNS address for this API service.
105
+ * @returns {string} The DNS address for this service.
106
+ */
107
+ get servicePath(): string;
108
+ /**
109
+ * The DNS address for this API service - same as servicePath().
110
+ * @returns {string} The DNS address for this service.
111
+ */
112
+ get apiEndpoint(): string;
113
+ get universeDomain(): string;
99
114
  /**
100
115
  * The port for this API service.
101
116
  * @returns {number} The default port for this service.
@@ -135,21 +150,21 @@ export declare class SubscriberClient {
135
150
  * Required. The name of the topic from which this subscription is receiving
136
151
  * messages. Format is `projects/{project}/topics/{topic}`. The value of this
137
152
  * field will be `_deleted-topic_` if the topic has been deleted.
138
- * @param {google.pubsub.v1.PushConfig} request.pushConfig
139
- * If push delivery is used with this subscription, this field is
140
- * used to configure it.
141
- * @param {google.pubsub.v1.BigQueryConfig} request.bigqueryConfig
142
- * If delivery to BigQuery is used with this subscription, this field is
153
+ * @param {google.pubsub.v1.PushConfig} [request.pushConfig]
154
+ * Optional. If push delivery is used with this subscription, this field is
143
155
  * used to configure it.
144
- * @param {google.pubsub.v1.CloudStorageConfig} request.cloudStorageConfig
145
- * If delivery to Google Cloud Storage is used with this subscription, this
156
+ * @param {google.pubsub.v1.BigQueryConfig} [request.bigqueryConfig]
157
+ * Optional. If delivery to BigQuery is used with this subscription, this
146
158
  * field is used to configure it.
147
- * @param {number} request.ackDeadlineSeconds
148
- * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
149
- * the subscriber to acknowledge receipt before resending the message. In the
150
- * interval after the message is delivered and before it is acknowledged, it
151
- * is considered to be _outstanding_. During that time period, the
152
- * message will not be redelivered (on a best-effort basis).
159
+ * @param {google.pubsub.v1.CloudStorageConfig} [request.cloudStorageConfig]
160
+ * Optional. If delivery to Google Cloud Storage is used with this
161
+ * subscription, this field is used to configure it.
162
+ * @param {number} [request.ackDeadlineSeconds]
163
+ * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
164
+ * waits for the subscriber to acknowledge receipt before resending the
165
+ * message. In the interval after the message is delivered and before it is
166
+ * acknowledged, it is considered to be _outstanding_. During that time
167
+ * period, the message will not be redelivered (on a best-effort basis).
153
168
  *
154
169
  * For pull subscriptions, this value is used as the initial value for the ack
155
170
  * deadline. To override this value for a given message, call
@@ -165,68 +180,68 @@ export declare class SubscriberClient {
165
180
  *
166
181
  * If the subscriber never acknowledges the message, the Pub/Sub
167
182
  * system will eventually redeliver the message.
168
- * @param {boolean} request.retainAckedMessages
169
- * Indicates whether to retain acknowledged messages. If true, then
183
+ * @param {boolean} [request.retainAckedMessages]
184
+ * Optional. Indicates whether to retain acknowledged messages. If true, then
170
185
  * messages are not expunged from the subscription's backlog, even if they are
171
186
  * acknowledged, until they fall out of the `message_retention_duration`
172
187
  * window. This must be true if you would like to [`Seek` to a timestamp]
173
188
  * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
174
189
  * the past to replay previously-acknowledged messages.
175
- * @param {google.protobuf.Duration} request.messageRetentionDuration
176
- * How long to retain unacknowledged messages in the subscription's backlog,
177
- * from the moment a message is published.
178
- * If `retain_acked_messages` is true, then this also configures the retention
179
- * of acknowledged messages, and thus configures how far back in time a `Seek`
180
- * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
181
- * minutes.
182
- * @param {number[]} request.labels
183
- * See [Creating and managing
190
+ * @param {google.protobuf.Duration} [request.messageRetentionDuration]
191
+ * Optional. How long to retain unacknowledged messages in the subscription's
192
+ * backlog, from the moment a message is published. If `retain_acked_messages`
193
+ * is true, then this also configures the retention of acknowledged messages,
194
+ * and thus configures how far back in time a `Seek` can be done. Defaults to
195
+ * 7 days. Cannot be more than 7 days or less than 10 minutes.
196
+ * @param {number[]} [request.labels]
197
+ * Optional. See [Creating and managing
184
198
  * labels](https://cloud.google.com/pubsub/docs/labels).
185
- * @param {boolean} request.enableMessageOrdering
186
- * If true, messages published with the same `ordering_key` in `PubsubMessage`
187
- * will be delivered to the subscribers in the order in which they
188
- * are received by the Pub/Sub system. Otherwise, they may be delivered in
189
- * any order.
190
- * @param {google.pubsub.v1.ExpirationPolicy} request.expirationPolicy
191
- * A policy that specifies the conditions for this subscription's expiration.
192
- * A subscription is considered active as long as any connected subscriber is
193
- * successfully consuming messages from the subscription or is issuing
194
- * operations on the subscription. If `expiration_policy` is not set, a
195
- * *default policy* with `ttl` of 31 days will be used. The minimum allowed
199
+ * @param {boolean} [request.enableMessageOrdering]
200
+ * Optional. If true, messages published with the same `ordering_key` in
201
+ * `PubsubMessage` will be delivered to the subscribers in the order in which
202
+ * they are received by the Pub/Sub system. Otherwise, they may be delivered
203
+ * in any order.
204
+ * @param {google.pubsub.v1.ExpirationPolicy} [request.expirationPolicy]
205
+ * Optional. A policy that specifies the conditions for this subscription's
206
+ * expiration. A subscription is considered active as long as any connected
207
+ * subscriber is successfully consuming messages from the subscription or is
208
+ * issuing operations on the subscription. If `expiration_policy` is not set,
209
+ * a *default policy* with `ttl` of 31 days will be used. The minimum allowed
196
210
  * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
197
211
  * but `expiration_policy.ttl` is not set, the subscription never expires.
198
- * @param {string} request.filter
199
- * An expression written in the Pub/Sub [filter
212
+ * @param {string} [request.filter]
213
+ * Optional. An expression written in the Pub/Sub [filter
200
214
  * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
201
215
  * then only `PubsubMessage`s whose `attributes` field matches the filter are
202
216
  * delivered on this subscription. If empty, then no messages are filtered
203
217
  * out.
204
- * @param {google.pubsub.v1.DeadLetterPolicy} request.deadLetterPolicy
205
- * A policy that specifies the conditions for dead lettering messages in
206
- * this subscription. If dead_letter_policy is not set, dead lettering
207
- * is disabled.
218
+ * @param {google.pubsub.v1.DeadLetterPolicy} [request.deadLetterPolicy]
219
+ * Optional. A policy that specifies the conditions for dead lettering
220
+ * messages in this subscription. If dead_letter_policy is not set, dead
221
+ * lettering is disabled.
208
222
  *
209
- * The Cloud Pub/Sub service account associated with this subscriptions's
223
+ * The Pub/Sub service account associated with this subscriptions's
210
224
  * parent project (i.e.,
211
225
  * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
212
226
  * permission to Acknowledge() messages on this subscription.
213
- * @param {google.pubsub.v1.RetryPolicy} request.retryPolicy
214
- * A policy that specifies how Pub/Sub retries message delivery for this
215
- * subscription.
227
+ * @param {google.pubsub.v1.RetryPolicy} [request.retryPolicy]
228
+ * Optional. A policy that specifies how Pub/Sub retries message delivery for
229
+ * this subscription.
216
230
  *
217
231
  * If not set, the default retry policy is applied. This generally implies
218
232
  * that messages will be retried as soon as possible for healthy subscribers.
219
233
  * RetryPolicy will be triggered on NACKs or acknowledgement deadline
220
234
  * exceeded events for a given message.
221
- * @param {boolean} request.detached
222
- * Indicates whether the subscription is detached from its topic. Detached
223
- * subscriptions don't receive messages from their topic and don't retain any
224
- * backlog. `Pull` and `StreamingPull` requests will return
235
+ * @param {boolean} [request.detached]
236
+ * Optional. Indicates whether the subscription is detached from its topic.
237
+ * Detached subscriptions don't receive messages from their topic and don't
238
+ * retain any backlog. `Pull` and `StreamingPull` requests will return
225
239
  * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
226
240
  * the endpoint will not be made.
227
- * @param {boolean} request.enableExactlyOnceDelivery
228
- * If true, Pub/Sub provides the following guarantees for the delivery of
229
- * a message with a given value of `message_id` on this subscription:
241
+ * @param {boolean} [request.enableExactlyOnceDelivery]
242
+ * Optional. If true, Pub/Sub provides the following guarantees for the
243
+ * delivery of a message with a given value of `message_id` on this
244
+ * subscription:
230
245
  *
231
246
  * * The message sent to a subscriber is guaranteed not to be resent
232
247
  * before the message's acknowledgement deadline expires.
@@ -283,8 +298,9 @@ export declare class SubscriberClient {
283
298
  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;
284
299
  getSubscription(request: protos.google.pubsub.v1.IGetSubscriptionRequest, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, {} | null | undefined>): void;
285
300
  /**
286
- * Updates an existing subscription. Note that certain properties of a
287
- * subscription, such as its topic, are not modifiable.
301
+ * Updates an existing subscription by updating the fields specified in the
302
+ * update mask. Note that certain properties of a subscription, such as its
303
+ * topic, are not modifiable.
288
304
  *
289
305
  * @param {Object} request
290
306
  * The request object that will be sent.
@@ -355,7 +371,8 @@ export declare class SubscriberClient {
355
371
  * delivery to another subscriber client. This typically results in an
356
372
  * increase in the rate of message redeliveries (that is, duplicates).
357
373
  * The minimum deadline you can specify is 0 seconds.
358
- * The maximum deadline you can specify is 600 seconds (10 minutes).
374
+ * The maximum deadline you can specify in a single request is 600 seconds
375
+ * (10 minutes).
359
376
  * @param {object} [options]
360
377
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
361
378
  * @returns {Promise} - The promise which resolves to an array.
@@ -533,8 +550,8 @@ export declare class SubscriberClient {
533
550
  * (b) Any messages published to the subscription's topic following the
534
551
  * successful completion of the CreateSnapshot request.
535
552
  * Format is `projects/{project}/subscriptions/{sub}`.
536
- * @param {number[]} request.labels
537
- * See [Creating and managing
553
+ * @param {number[]} [request.labels]
554
+ * Optional. See [Creating and managing
538
555
  * labels](https://cloud.google.com/pubsub/docs/labels).
539
556
  * @param {object} [options]
540
557
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
@@ -551,7 +568,8 @@ export declare class SubscriberClient {
551
568
  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;
552
569
  createSnapshot(request: protos.google.pubsub.v1.ICreateSnapshotRequest, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, {} | null | undefined>): void;
553
570
  /**
554
- * Updates an existing snapshot. Snapshots are used in
571
+ * Updates an existing snapshot by updating the fields specified in the update
572
+ * mask. Snapshots are used in
555
573
  * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
556
574
  * which allow you to manage message acknowledgments in bulk. That is, you can
557
575
  * set the acknowledgment state of messages in an existing subscription to the
@@ -621,8 +639,8 @@ export declare class SubscriberClient {
621
639
  * The request object that will be sent.
622
640
  * @param {string} request.subscription
623
641
  * Required. The subscription to affect.
624
- * @param {google.protobuf.Timestamp} request.time
625
- * The time to seek to.
642
+ * @param {google.protobuf.Timestamp} [request.time]
643
+ * Optional. The time to seek to.
626
644
  * Messages retained in the subscription that were published before this
627
645
  * time are marked as acknowledged, and messages retained in the
628
646
  * subscription that were published after this time are marked as
@@ -633,10 +651,10 @@ export declare class SubscriberClient {
633
651
  * window (or to a point before the system's notion of the subscription
634
652
  * creation time), only retained messages will be marked as unacknowledged,
635
653
  * and already-expunged messages will not be restored.
636
- * @param {string} request.snapshot
637
- * The snapshot to seek to. The snapshot's topic must be the same as that of
638
- * the provided subscription.
639
- * Format is `projects/{project}/snapshots/{snap}`.
654
+ * @param {string} [request.snapshot]
655
+ * Optional. The snapshot to seek to. The snapshot's topic must be the same
656
+ * as that of the provided subscription. Format is
657
+ * `projects/{project}/snapshots/{snap}`.
640
658
  * @param {object} [options]
641
659
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
642
660
  * @returns {Promise} - The promise which resolves to an array.
@@ -678,12 +696,12 @@ export declare class SubscriberClient {
678
696
  * @param {string} request.project
679
697
  * Required. The name of the project in which to list subscriptions.
680
698
  * Format is `projects/{project-id}`.
681
- * @param {number} request.pageSize
682
- * Maximum number of subscriptions to return.
683
- * @param {string} request.pageToken
684
- * The value returned by the last `ListSubscriptionsResponse`; indicates that
685
- * this is a continuation of a prior `ListSubscriptions` call, and that the
686
- * system should return the next page of data.
699
+ * @param {number} [request.pageSize]
700
+ * Optional. Maximum number of subscriptions to return.
701
+ * @param {string} [request.pageToken]
702
+ * Optional. The value returned by the last `ListSubscriptionsResponse`;
703
+ * indicates that this is a continuation of a prior `ListSubscriptions` call,
704
+ * and that the system should return the next page of data.
687
705
  * @param {object} [options]
688
706
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
689
707
  * @returns {Promise} - The promise which resolves to an array.
@@ -710,12 +728,12 @@ export declare class SubscriberClient {
710
728
  * @param {string} request.project
711
729
  * Required. The name of the project in which to list subscriptions.
712
730
  * Format is `projects/{project-id}`.
713
- * @param {number} request.pageSize
714
- * Maximum number of subscriptions to return.
715
- * @param {string} request.pageToken
716
- * The value returned by the last `ListSubscriptionsResponse`; indicates that
717
- * this is a continuation of a prior `ListSubscriptions` call, and that the
718
- * system should return the next page of data.
731
+ * @param {number} [request.pageSize]
732
+ * Optional. Maximum number of subscriptions to return.
733
+ * @param {string} [request.pageToken]
734
+ * Optional. The value returned by the last `ListSubscriptionsResponse`;
735
+ * indicates that this is a continuation of a prior `ListSubscriptions` call,
736
+ * and that the system should return the next page of data.
719
737
  * @param {object} [options]
720
738
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
721
739
  * @returns {Stream}
@@ -737,12 +755,12 @@ export declare class SubscriberClient {
737
755
  * @param {string} request.project
738
756
  * Required. The name of the project in which to list subscriptions.
739
757
  * Format is `projects/{project-id}`.
740
- * @param {number} request.pageSize
741
- * Maximum number of subscriptions to return.
742
- * @param {string} request.pageToken
743
- * The value returned by the last `ListSubscriptionsResponse`; indicates that
744
- * this is a continuation of a prior `ListSubscriptions` call, and that the
745
- * system should return the next page of data.
758
+ * @param {number} [request.pageSize]
759
+ * Optional. Maximum number of subscriptions to return.
760
+ * @param {string} [request.pageToken]
761
+ * Optional. The value returned by the last `ListSubscriptionsResponse`;
762
+ * indicates that this is a continuation of a prior `ListSubscriptions` call,
763
+ * and that the system should return the next page of data.
746
764
  * @param {object} [options]
747
765
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
748
766
  * @returns {Object}
@@ -766,12 +784,12 @@ export declare class SubscriberClient {
766
784
  * @param {string} request.project
767
785
  * Required. The name of the project in which to list snapshots.
768
786
  * Format is `projects/{project-id}`.
769
- * @param {number} request.pageSize
770
- * Maximum number of snapshots to return.
771
- * @param {string} request.pageToken
772
- * The value returned by the last `ListSnapshotsResponse`; indicates that this
773
- * is a continuation of a prior `ListSnapshots` call, and that the system
774
- * should return the next page of data.
787
+ * @param {number} [request.pageSize]
788
+ * Optional. Maximum number of snapshots to return.
789
+ * @param {string} [request.pageToken]
790
+ * Optional. The value returned by the last `ListSnapshotsResponse`; indicates
791
+ * that this is a continuation of a prior `ListSnapshots` call, and that the
792
+ * system should return the next page of data.
775
793
  * @param {object} [options]
776
794
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
777
795
  * @returns {Promise} - The promise which resolves to an array.
@@ -798,12 +816,12 @@ export declare class SubscriberClient {
798
816
  * @param {string} request.project
799
817
  * Required. The name of the project in which to list snapshots.
800
818
  * Format is `projects/{project-id}`.
801
- * @param {number} request.pageSize
802
- * Maximum number of snapshots to return.
803
- * @param {string} request.pageToken
804
- * The value returned by the last `ListSnapshotsResponse`; indicates that this
805
- * is a continuation of a prior `ListSnapshots` call, and that the system
806
- * should return the next page of data.
819
+ * @param {number} [request.pageSize]
820
+ * Optional. Maximum number of snapshots to return.
821
+ * @param {string} [request.pageToken]
822
+ * Optional. The value returned by the last `ListSnapshotsResponse`; indicates
823
+ * that this is a continuation of a prior `ListSnapshots` call, and that the
824
+ * system should return the next page of data.
807
825
  * @param {object} [options]
808
826
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
809
827
  * @returns {Stream}
@@ -825,12 +843,12 @@ export declare class SubscriberClient {
825
843
  * @param {string} request.project
826
844
  * Required. The name of the project in which to list snapshots.
827
845
  * Format is `projects/{project-id}`.
828
- * @param {number} request.pageSize
829
- * Maximum number of snapshots to return.
830
- * @param {string} request.pageToken
831
- * The value returned by the last `ListSnapshotsResponse`; indicates that this
832
- * is a continuation of a prior `ListSnapshots` call, and that the system
833
- * should return the next page of data.
846
+ * @param {number} [request.pageSize]
847
+ * Optional. Maximum number of snapshots to return.
848
+ * @param {string} [request.pageToken]
849
+ * Optional. The value returned by the last `ListSnapshotsResponse`; indicates
850
+ * that this is a continuation of a prior `ListSnapshots` call, and that the
851
+ * system should return the next page of data.
834
852
  * @param {object} [options]
835
853
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
836
854
  * @returns {Object}
@@ -75,7 +75,7 @@ class SubscriberClient {
75
75
  * ```
76
76
  */
77
77
  constructor(opts, gaxInstance) {
78
- var _a, _b;
78
+ var _a, _b, _c, _d;
79
79
  this._terminated = false;
80
80
  this.descriptors = {
81
81
  page: {},
@@ -85,16 +85,24 @@ class SubscriberClient {
85
85
  };
86
86
  // Ensure that options include all the required fields.
87
87
  const staticMembers = this.constructor;
88
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
88
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
89
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
90
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
91
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
92
+ }
93
+ this._universeDomain =
94
+ (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
95
+ this._servicePath = 'pubsub.' + this._universeDomain;
96
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
89
97
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
90
98
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
91
- const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
92
- const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
99
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
100
+ const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
93
101
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
94
102
  // Request numeric enum values if REST transport is used.
95
103
  opts.numericEnums = true;
96
104
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
97
- if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
105
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
98
106
  opts['scopes'] = staticMembers.scopes;
99
107
  }
100
108
  // Load google-gax module synchronously if needed
@@ -112,9 +120,9 @@ class SubscriberClient {
112
120
  // Set useJWTAccessWithScope on the auth object.
113
121
  this.auth.useJWTAccessWithScope = true;
114
122
  // Set defaultServicePath on the auth object.
115
- this.auth.defaultServicePath = staticMembers.servicePath;
123
+ this.auth.defaultServicePath = this._servicePath;
116
124
  // Set the default scopes in auth client if needed.
117
- if (servicePath === staticMembers.servicePath) {
125
+ if (servicePath === this._servicePath) {
118
126
  this.auth.defaultScopes = staticMembers.scopes;
119
127
  }
120
128
  this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);
@@ -157,7 +165,8 @@ class SubscriberClient {
157
165
  // Some of the methods on this service provide streaming responses.
158
166
  // Provide descriptors for these.
159
167
  this.descriptors.stream = {
160
- streamingPull: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback),
168
+ streamingPull: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback,
169
+ /* gaxStreamingRetries: */ false),
161
170
  };
162
171
  // Put together the default options sent with requests.
163
172
  this._defaults = this._gaxGrpc.constructSettings('google.pubsub.v1.Subscriber', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -237,19 +246,46 @@ class SubscriberClient {
237
246
  }
238
247
  /**
239
248
  * The DNS address for this API service.
249
+ * @deprecated
240
250
  * @returns {string} The DNS address for this service.
241
251
  */
242
252
  static get servicePath() {
253
+ if (typeof process !== undefined &&
254
+ typeof process.emitWarning === 'function') {
255
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
256
+ }
243
257
  return 'pubsub.googleapis.com';
244
258
  }
245
259
  /**
246
- * The DNS address for this API service - same as servicePath(),
260
+ * The DNS address for this API service - same as servicePath,
247
261
  * exists for compatibility reasons.
262
+ * @deprecated
248
263
  * @returns {string} The DNS address for this service.
249
264
  */
250
265
  static get apiEndpoint() {
266
+ if (typeof process !== undefined &&
267
+ typeof process.emitWarning === 'function') {
268
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
269
+ }
251
270
  return 'pubsub.googleapis.com';
252
271
  }
272
+ /**
273
+ * The DNS address for this API service.
274
+ * @returns {string} The DNS address for this service.
275
+ */
276
+ get servicePath() {
277
+ return this._servicePath;
278
+ }
279
+ /**
280
+ * The DNS address for this API service - same as servicePath().
281
+ * @returns {string} The DNS address for this service.
282
+ */
283
+ get apiEndpoint() {
284
+ return this._servicePath;
285
+ }
286
+ get universeDomain() {
287
+ return this._universeDomain;
288
+ }
253
289
  /**
254
290
  * The port for this API service.
255
291
  * @returns {number} The default port for this service.
@@ -602,12 +638,12 @@ class SubscriberClient {
602
638
  * @param {string} request.project
603
639
  * Required. The name of the project in which to list subscriptions.
604
640
  * Format is `projects/{project-id}`.
605
- * @param {number} request.pageSize
606
- * Maximum number of subscriptions to return.
607
- * @param {string} request.pageToken
608
- * The value returned by the last `ListSubscriptionsResponse`; indicates that
609
- * this is a continuation of a prior `ListSubscriptions` call, and that the
610
- * system should return the next page of data.
641
+ * @param {number} [request.pageSize]
642
+ * Optional. Maximum number of subscriptions to return.
643
+ * @param {string} [request.pageToken]
644
+ * Optional. The value returned by the last `ListSubscriptionsResponse`;
645
+ * indicates that this is a continuation of a prior `ListSubscriptions` call,
646
+ * and that the system should return the next page of data.
611
647
  * @param {object} [options]
612
648
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
613
649
  * @returns {Stream}
@@ -643,12 +679,12 @@ class SubscriberClient {
643
679
  * @param {string} request.project
644
680
  * Required. The name of the project in which to list subscriptions.
645
681
  * Format is `projects/{project-id}`.
646
- * @param {number} request.pageSize
647
- * Maximum number of subscriptions to return.
648
- * @param {string} request.pageToken
649
- * The value returned by the last `ListSubscriptionsResponse`; indicates that
650
- * this is a continuation of a prior `ListSubscriptions` call, and that the
651
- * system should return the next page of data.
682
+ * @param {number} [request.pageSize]
683
+ * Optional. Maximum number of subscriptions to return.
684
+ * @param {string} [request.pageToken]
685
+ * Optional. The value returned by the last `ListSubscriptionsResponse`;
686
+ * indicates that this is a continuation of a prior `ListSubscriptions` call,
687
+ * and that the system should return the next page of data.
652
688
  * @param {object} [options]
653
689
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
654
690
  * @returns {Object}
@@ -702,12 +738,12 @@ class SubscriberClient {
702
738
  * @param {string} request.project
703
739
  * Required. The name of the project in which to list snapshots.
704
740
  * Format is `projects/{project-id}`.
705
- * @param {number} request.pageSize
706
- * Maximum number of snapshots to return.
707
- * @param {string} request.pageToken
708
- * The value returned by the last `ListSnapshotsResponse`; indicates that this
709
- * is a continuation of a prior `ListSnapshots` call, and that the system
710
- * should return the next page of data.
741
+ * @param {number} [request.pageSize]
742
+ * Optional. Maximum number of snapshots to return.
743
+ * @param {string} [request.pageToken]
744
+ * Optional. The value returned by the last `ListSnapshotsResponse`; indicates
745
+ * that this is a continuation of a prior `ListSnapshots` call, and that the
746
+ * system should return the next page of data.
711
747
  * @param {object} [options]
712
748
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
713
749
  * @returns {Stream}
@@ -743,12 +779,12 @@ class SubscriberClient {
743
779
  * @param {string} request.project
744
780
  * Required. The name of the project in which to list snapshots.
745
781
  * Format is `projects/{project-id}`.
746
- * @param {number} request.pageSize
747
- * Maximum number of snapshots to return.
748
- * @param {string} request.pageToken
749
- * The value returned by the last `ListSnapshotsResponse`; indicates that this
750
- * is a continuation of a prior `ListSnapshots` call, and that the system
751
- * should return the next page of data.
782
+ * @param {number} [request.pageSize]
783
+ * Optional. Maximum number of snapshots to return.
784
+ * @param {string} [request.pageToken]
785
+ * Optional. The value returned by the last `ListSnapshotsResponse`; indicates
786
+ * that this is a continuation of a prior `ListSnapshots` call, and that the
787
+ * system should return the next page of data.
752
788
  * @param {object} [options]
753
789
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
754
790
  * @returns {Object}