@google-apps/chat 0.24.0 → 0.25.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.
@@ -97,17 +97,26 @@ class ChatServiceClient {
97
97
  constructor(opts, gaxInstance) {
98
98
  // Ensure that options include all the required fields.
99
99
  const staticMembers = this.constructor;
100
- if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
100
+ if (opts?.universe_domain &&
101
+ opts?.universeDomain &&
102
+ opts?.universe_domain !== opts?.universeDomain) {
101
103
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
102
104
  }
103
- const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
104
- this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
105
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
106
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
107
+ : undefined;
108
+ this._universeDomain =
109
+ opts?.universeDomain ??
110
+ opts?.universe_domain ??
111
+ universeDomainEnvVar ??
112
+ 'googleapis.com';
105
113
  this._servicePath = 'chat.' + this._universeDomain;
106
114
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
107
115
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
108
116
  const port = opts?.port || staticMembers.port;
109
117
  const clientConfig = opts?.clientConfig ?? {};
110
- const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
118
+ const fallback = opts?.fallback ??
119
+ (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
120
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
112
121
  // Request numeric enum values if REST transport is used.
113
122
  opts.numericEnums = true;
@@ -136,10 +145,7 @@ class ChatServiceClient {
136
145
  this.auth.defaultScopes = staticMembers.scopes;
137
146
  }
138
147
  // Determine the client header string.
139
- const clientHeader = [
140
- `gax/${this._gaxModule.version}`,
141
- `gapic/${version}`,
142
- ];
148
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
143
149
  if (typeof process === 'object' && 'versions' in process) {
144
150
  clientHeader.push(`gl-node/${process.versions.node}`);
145
151
  }
@@ -189,7 +195,7 @@ class ChatServiceClient {
189
195
  listCustomEmojis: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customEmojis'),
190
196
  listSpaceEvents: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaceEvents'),
191
197
  listSections: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sections'),
192
- listSectionItems: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sectionItems')
198
+ listSectionItems: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sectionItems'),
193
199
  };
194
200
  // Put together the default options sent with requests.
195
201
  this._defaults = this._gaxGrpc.constructSettings('google.chat.v1.ChatService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -218,15 +224,59 @@ class ChatServiceClient {
218
224
  }
219
225
  // Put together the "service stub" for
220
226
  // google.chat.v1.ChatService.
221
- this.chatServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
222
- this._protos.lookupService('google.chat.v1.ChatService') :
223
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
224
- this._protos.google.chat.v1.ChatService, this._opts, this._providedCustomServicePath);
227
+ this.chatServiceStub = this._gaxGrpc.createStub(this._opts.fallback
228
+ ? this._protos.lookupService('google.chat.v1.ChatService')
229
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
230
+ this._protos.google.chat.v1.ChatService, this._opts, this._providedCustomServicePath);
225
231
  // Iterate over each of the methods that the service provides
226
232
  // and create an API call method for each.
227
- const chatServiceStubMethods = ['createMessage', 'listMessages', 'listMemberships', 'getMembership', 'getMessage', 'updateMessage', 'deleteMessage', 'getAttachment', 'uploadAttachment', 'listSpaces', 'searchSpaces', 'getSpace', 'createSpace', 'setUpSpace', 'updateSpace', 'deleteSpace', 'completeImportSpace', 'findDirectMessage', 'findGroupChats', 'createMembership', 'updateMembership', 'deleteMembership', 'createReaction', 'listReactions', 'deleteReaction', 'createCustomEmoji', 'getCustomEmoji', 'listCustomEmojis', 'deleteCustomEmoji', 'getSpaceReadState', 'updateSpaceReadState', 'getThreadReadState', 'getSpaceEvent', 'listSpaceEvents', 'getSpaceNotificationSetting', 'updateSpaceNotificationSetting', 'createSection', 'deleteSection', 'updateSection', 'listSections', 'positionSection', 'listSectionItems', 'moveSectionItem'];
233
+ const chatServiceStubMethods = [
234
+ 'createMessage',
235
+ 'listMessages',
236
+ 'listMemberships',
237
+ 'getMembership',
238
+ 'getMessage',
239
+ 'updateMessage',
240
+ 'deleteMessage',
241
+ 'getAttachment',
242
+ 'uploadAttachment',
243
+ 'listSpaces',
244
+ 'searchSpaces',
245
+ 'getSpace',
246
+ 'createSpace',
247
+ 'setUpSpace',
248
+ 'updateSpace',
249
+ 'deleteSpace',
250
+ 'completeImportSpace',
251
+ 'findDirectMessage',
252
+ 'findGroupChats',
253
+ 'createMembership',
254
+ 'updateMembership',
255
+ 'deleteMembership',
256
+ 'createReaction',
257
+ 'listReactions',
258
+ 'deleteReaction',
259
+ 'createCustomEmoji',
260
+ 'getCustomEmoji',
261
+ 'listCustomEmojis',
262
+ 'deleteCustomEmoji',
263
+ 'getSpaceReadState',
264
+ 'updateSpaceReadState',
265
+ 'getThreadReadState',
266
+ 'getSpaceEvent',
267
+ 'listSpaceEvents',
268
+ 'getSpaceNotificationSetting',
269
+ 'updateSpaceNotificationSetting',
270
+ 'createSection',
271
+ 'deleteSection',
272
+ 'updateSection',
273
+ 'listSections',
274
+ 'positionSection',
275
+ 'listSectionItems',
276
+ 'moveSectionItem',
277
+ ];
228
278
  for (const methodName of chatServiceStubMethods) {
229
- const callPromise = this.chatServiceStub.then(stub => (...args) => {
279
+ const callPromise = this.chatServiceStub.then((stub) => (...args) => {
230
280
  if (this._terminated) {
231
281
  return Promise.reject('The client has already been closed.');
232
282
  }
@@ -235,8 +285,7 @@ class ChatServiceClient {
235
285
  }, (err) => () => {
236
286
  throw err;
237
287
  });
238
- const descriptor = this.descriptors.page[methodName] ||
239
- undefined;
288
+ const descriptor = this.descriptors.page[methodName] || undefined;
240
289
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
241
290
  this.innerApiCalls[methodName] = apiCall;
242
291
  }
@@ -248,7 +297,8 @@ class ChatServiceClient {
248
297
  * @returns {string} The DNS address for this service.
249
298
  */
250
299
  static get servicePath() {
251
- if (typeof process === 'object' && typeof process.emitWarning === 'function') {
300
+ if (typeof process === 'object' &&
301
+ typeof process.emitWarning === 'function') {
252
302
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
253
303
  }
254
304
  return 'chat.googleapis.com';
@@ -259,7 +309,8 @@ class ChatServiceClient {
259
309
  * @returns {string} The DNS address for this service.
260
310
  */
261
311
  static get apiEndpoint() {
262
- if (typeof process === 'object' && typeof process.emitWarning === 'function') {
312
+ if (typeof process === 'object' &&
313
+ typeof process.emitWarning === 'function') {
263
314
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
264
315
  }
265
316
  return 'chat.googleapis.com';
@@ -321,7 +372,7 @@ class ChatServiceClient {
321
372
  'https://www.googleapis.com/auth/chat.users.readstate.readonly',
322
373
  'https://www.googleapis.com/auth/chat.users.sections',
323
374
  'https://www.googleapis.com/auth/chat.users.sections.readonly',
324
- 'https://www.googleapis.com/auth/chat.users.spacesettings'
375
+ 'https://www.googleapis.com/auth/chat.users.spacesettings',
325
376
  ];
326
377
  }
327
378
  /**
@@ -348,10 +399,13 @@ class ChatServiceClient {
348
399
  options = options || {};
349
400
  options.otherArgs = options.otherArgs || {};
350
401
  options.otherArgs.headers = options.otherArgs.headers || {};
351
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
352
- 'parent': request.parent ?? '',
402
+ options.otherArgs.headers['x-goog-request-params'] =
403
+ this._gaxModule.routingHeader.fromParams({
404
+ parent: request.parent ?? '',
405
+ });
406
+ this.initialize().catch((err) => {
407
+ throw err;
353
408
  });
354
- this.initialize().catch(err => { throw err; });
355
409
  this._log.info('createMessage request %j', request);
356
410
  const wrappedCallback = callback
357
411
  ? (error, response, options, rawResponse) => {
@@ -359,12 +413,16 @@ class ChatServiceClient {
359
413
  callback(error, response, options, rawResponse); // We verified callback above.
360
414
  }
361
415
  : undefined;
362
- return this.innerApiCalls.createMessage(request, options, wrappedCallback)
416
+ return this.innerApiCalls
417
+ .createMessage(request, options, wrappedCallback)
363
418
  ?.then(([response, options, rawResponse]) => {
364
419
  this._log.info('createMessage response %j', response);
365
420
  return [response, options, rawResponse];
366
- }).catch((error) => {
367
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
421
+ })
422
+ .catch((error) => {
423
+ if (error &&
424
+ 'statusDetails' in error &&
425
+ error.statusDetails instanceof Array) {
368
426
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
369
427
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
370
428
  }
@@ -384,10 +442,13 @@ class ChatServiceClient {
384
442
  options = options || {};
385
443
  options.otherArgs = options.otherArgs || {};
386
444
  options.otherArgs.headers = options.otherArgs.headers || {};
387
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
388
- 'name': request.name ?? '',
445
+ options.otherArgs.headers['x-goog-request-params'] =
446
+ this._gaxModule.routingHeader.fromParams({
447
+ name: request.name ?? '',
448
+ });
449
+ this.initialize().catch((err) => {
450
+ throw err;
389
451
  });
390
- this.initialize().catch(err => { throw err; });
391
452
  this._log.info('getMembership request %j', request);
392
453
  const wrappedCallback = callback
393
454
  ? (error, response, options, rawResponse) => {
@@ -395,12 +456,16 @@ class ChatServiceClient {
395
456
  callback(error, response, options, rawResponse); // We verified callback above.
396
457
  }
397
458
  : undefined;
398
- return this.innerApiCalls.getMembership(request, options, wrappedCallback)
459
+ return this.innerApiCalls
460
+ .getMembership(request, options, wrappedCallback)
399
461
  ?.then(([response, options, rawResponse]) => {
400
462
  this._log.info('getMembership response %j', response);
401
463
  return [response, options, rawResponse];
402
- }).catch((error) => {
403
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
464
+ })
465
+ .catch((error) => {
466
+ if (error &&
467
+ 'statusDetails' in error &&
468
+ error.statusDetails instanceof Array) {
404
469
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
405
470
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
406
471
  }
@@ -420,10 +485,13 @@ class ChatServiceClient {
420
485
  options = options || {};
421
486
  options.otherArgs = options.otherArgs || {};
422
487
  options.otherArgs.headers = options.otherArgs.headers || {};
423
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
424
- 'name': request.name ?? '',
488
+ options.otherArgs.headers['x-goog-request-params'] =
489
+ this._gaxModule.routingHeader.fromParams({
490
+ name: request.name ?? '',
491
+ });
492
+ this.initialize().catch((err) => {
493
+ throw err;
425
494
  });
426
- this.initialize().catch(err => { throw err; });
427
495
  this._log.info('getMessage request %j', request);
428
496
  const wrappedCallback = callback
429
497
  ? (error, response, options, rawResponse) => {
@@ -431,12 +499,16 @@ class ChatServiceClient {
431
499
  callback(error, response, options, rawResponse); // We verified callback above.
432
500
  }
433
501
  : undefined;
434
- return this.innerApiCalls.getMessage(request, options, wrappedCallback)
502
+ return this.innerApiCalls
503
+ .getMessage(request, options, wrappedCallback)
435
504
  ?.then(([response, options, rawResponse]) => {
436
505
  this._log.info('getMessage response %j', response);
437
506
  return [response, options, rawResponse];
438
- }).catch((error) => {
439
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
507
+ })
508
+ .catch((error) => {
509
+ if (error &&
510
+ 'statusDetails' in error &&
511
+ error.statusDetails instanceof Array) {
440
512
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
441
513
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
442
514
  }
@@ -456,10 +528,13 @@ class ChatServiceClient {
456
528
  options = options || {};
457
529
  options.otherArgs = options.otherArgs || {};
458
530
  options.otherArgs.headers = options.otherArgs.headers || {};
459
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
460
- 'message.name': request.message.name ?? '',
531
+ options.otherArgs.headers['x-goog-request-params'] =
532
+ this._gaxModule.routingHeader.fromParams({
533
+ 'message.name': request.message.name ?? '',
534
+ });
535
+ this.initialize().catch((err) => {
536
+ throw err;
461
537
  });
462
- this.initialize().catch(err => { throw err; });
463
538
  this._log.info('updateMessage request %j', request);
464
539
  const wrappedCallback = callback
465
540
  ? (error, response, options, rawResponse) => {
@@ -467,12 +542,16 @@ class ChatServiceClient {
467
542
  callback(error, response, options, rawResponse); // We verified callback above.
468
543
  }
469
544
  : undefined;
470
- return this.innerApiCalls.updateMessage(request, options, wrappedCallback)
545
+ return this.innerApiCalls
546
+ .updateMessage(request, options, wrappedCallback)
471
547
  ?.then(([response, options, rawResponse]) => {
472
548
  this._log.info('updateMessage response %j', response);
473
549
  return [response, options, rawResponse];
474
- }).catch((error) => {
475
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
550
+ })
551
+ .catch((error) => {
552
+ if (error &&
553
+ 'statusDetails' in error &&
554
+ error.statusDetails instanceof Array) {
476
555
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
477
556
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
478
557
  }
@@ -492,10 +571,13 @@ class ChatServiceClient {
492
571
  options = options || {};
493
572
  options.otherArgs = options.otherArgs || {};
494
573
  options.otherArgs.headers = options.otherArgs.headers || {};
495
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
496
- 'name': request.name ?? '',
574
+ options.otherArgs.headers['x-goog-request-params'] =
575
+ this._gaxModule.routingHeader.fromParams({
576
+ name: request.name ?? '',
577
+ });
578
+ this.initialize().catch((err) => {
579
+ throw err;
497
580
  });
498
- this.initialize().catch(err => { throw err; });
499
581
  this._log.info('deleteMessage request %j', request);
500
582
  const wrappedCallback = callback
501
583
  ? (error, response, options, rawResponse) => {
@@ -503,12 +585,16 @@ class ChatServiceClient {
503
585
  callback(error, response, options, rawResponse); // We verified callback above.
504
586
  }
505
587
  : undefined;
506
- return this.innerApiCalls.deleteMessage(request, options, wrappedCallback)
588
+ return this.innerApiCalls
589
+ .deleteMessage(request, options, wrappedCallback)
507
590
  ?.then(([response, options, rawResponse]) => {
508
591
  this._log.info('deleteMessage response %j', response);
509
592
  return [response, options, rawResponse];
510
- }).catch((error) => {
511
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
593
+ })
594
+ .catch((error) => {
595
+ if (error &&
596
+ 'statusDetails' in error &&
597
+ error.statusDetails instanceof Array) {
512
598
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
513
599
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
514
600
  }
@@ -528,10 +614,13 @@ class ChatServiceClient {
528
614
  options = options || {};
529
615
  options.otherArgs = options.otherArgs || {};
530
616
  options.otherArgs.headers = options.otherArgs.headers || {};
531
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
532
- 'name': request.name ?? '',
617
+ options.otherArgs.headers['x-goog-request-params'] =
618
+ this._gaxModule.routingHeader.fromParams({
619
+ name: request.name ?? '',
620
+ });
621
+ this.initialize().catch((err) => {
622
+ throw err;
533
623
  });
534
- this.initialize().catch(err => { throw err; });
535
624
  this._log.info('getAttachment request %j', request);
536
625
  const wrappedCallback = callback
537
626
  ? (error, response, options, rawResponse) => {
@@ -539,12 +628,16 @@ class ChatServiceClient {
539
628
  callback(error, response, options, rawResponse); // We verified callback above.
540
629
  }
541
630
  : undefined;
542
- return this.innerApiCalls.getAttachment(request, options, wrappedCallback)
631
+ return this.innerApiCalls
632
+ .getAttachment(request, options, wrappedCallback)
543
633
  ?.then(([response, options, rawResponse]) => {
544
634
  this._log.info('getAttachment response %j', response);
545
635
  return [response, options, rawResponse];
546
- }).catch((error) => {
547
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
636
+ })
637
+ .catch((error) => {
638
+ if (error &&
639
+ 'statusDetails' in error &&
640
+ error.statusDetails instanceof Array) {
548
641
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
549
642
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
550
643
  }
@@ -564,10 +657,13 @@ class ChatServiceClient {
564
657
  options = options || {};
565
658
  options.otherArgs = options.otherArgs || {};
566
659
  options.otherArgs.headers = options.otherArgs.headers || {};
567
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
568
- 'parent': request.parent ?? '',
660
+ options.otherArgs.headers['x-goog-request-params'] =
661
+ this._gaxModule.routingHeader.fromParams({
662
+ parent: request.parent ?? '',
663
+ });
664
+ this.initialize().catch((err) => {
665
+ throw err;
569
666
  });
570
- this.initialize().catch(err => { throw err; });
571
667
  this._log.info('uploadAttachment request %j', request);
572
668
  const wrappedCallback = callback
573
669
  ? (error, response, options, rawResponse) => {
@@ -575,12 +671,16 @@ class ChatServiceClient {
575
671
  callback(error, response, options, rawResponse); // We verified callback above.
576
672
  }
577
673
  : undefined;
578
- return this.innerApiCalls.uploadAttachment(request, options, wrappedCallback)
674
+ return this.innerApiCalls
675
+ .uploadAttachment(request, options, wrappedCallback)
579
676
  ?.then(([response, options, rawResponse]) => {
580
677
  this._log.info('uploadAttachment response %j', response);
581
678
  return [response, options, rawResponse];
582
- }).catch((error) => {
583
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
679
+ })
680
+ .catch((error) => {
681
+ if (error &&
682
+ 'statusDetails' in error &&
683
+ error.statusDetails instanceof Array) {
584
684
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
585
685
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
586
686
  }
@@ -600,10 +700,13 @@ class ChatServiceClient {
600
700
  options = options || {};
601
701
  options.otherArgs = options.otherArgs || {};
602
702
  options.otherArgs.headers = options.otherArgs.headers || {};
603
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
604
- 'name': request.name ?? '',
703
+ options.otherArgs.headers['x-goog-request-params'] =
704
+ this._gaxModule.routingHeader.fromParams({
705
+ name: request.name ?? '',
706
+ });
707
+ this.initialize().catch((err) => {
708
+ throw err;
605
709
  });
606
- this.initialize().catch(err => { throw err; });
607
710
  this._log.info('getSpace request %j', request);
608
711
  const wrappedCallback = callback
609
712
  ? (error, response, options, rawResponse) => {
@@ -611,12 +714,16 @@ class ChatServiceClient {
611
714
  callback(error, response, options, rawResponse); // We verified callback above.
612
715
  }
613
716
  : undefined;
614
- return this.innerApiCalls.getSpace(request, options, wrappedCallback)
717
+ return this.innerApiCalls
718
+ .getSpace(request, options, wrappedCallback)
615
719
  ?.then(([response, options, rawResponse]) => {
616
720
  this._log.info('getSpace response %j', response);
617
721
  return [response, options, rawResponse];
618
- }).catch((error) => {
619
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
722
+ })
723
+ .catch((error) => {
724
+ if (error &&
725
+ 'statusDetails' in error &&
726
+ error.statusDetails instanceof Array) {
620
727
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
621
728
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
622
729
  }
@@ -636,7 +743,9 @@ class ChatServiceClient {
636
743
  options = options || {};
637
744
  options.otherArgs = options.otherArgs || {};
638
745
  options.otherArgs.headers = options.otherArgs.headers || {};
639
- this.initialize().catch(err => { throw err; });
746
+ this.initialize().catch((err) => {
747
+ throw err;
748
+ });
640
749
  this._log.info('createSpace request %j', request);
641
750
  const wrappedCallback = callback
642
751
  ? (error, response, options, rawResponse) => {
@@ -644,12 +753,16 @@ class ChatServiceClient {
644
753
  callback(error, response, options, rawResponse); // We verified callback above.
645
754
  }
646
755
  : undefined;
647
- return this.innerApiCalls.createSpace(request, options, wrappedCallback)
756
+ return this.innerApiCalls
757
+ .createSpace(request, options, wrappedCallback)
648
758
  ?.then(([response, options, rawResponse]) => {
649
759
  this._log.info('createSpace response %j', response);
650
760
  return [response, options, rawResponse];
651
- }).catch((error) => {
652
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
761
+ })
762
+ .catch((error) => {
763
+ if (error &&
764
+ 'statusDetails' in error &&
765
+ error.statusDetails instanceof Array) {
653
766
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
654
767
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
655
768
  }
@@ -669,7 +782,9 @@ class ChatServiceClient {
669
782
  options = options || {};
670
783
  options.otherArgs = options.otherArgs || {};
671
784
  options.otherArgs.headers = options.otherArgs.headers || {};
672
- this.initialize().catch(err => { throw err; });
785
+ this.initialize().catch((err) => {
786
+ throw err;
787
+ });
673
788
  this._log.info('setUpSpace request %j', request);
674
789
  const wrappedCallback = callback
675
790
  ? (error, response, options, rawResponse) => {
@@ -677,12 +792,16 @@ class ChatServiceClient {
677
792
  callback(error, response, options, rawResponse); // We verified callback above.
678
793
  }
679
794
  : undefined;
680
- return this.innerApiCalls.setUpSpace(request, options, wrappedCallback)
795
+ return this.innerApiCalls
796
+ .setUpSpace(request, options, wrappedCallback)
681
797
  ?.then(([response, options, rawResponse]) => {
682
798
  this._log.info('setUpSpace response %j', response);
683
799
  return [response, options, rawResponse];
684
- }).catch((error) => {
685
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
800
+ })
801
+ .catch((error) => {
802
+ if (error &&
803
+ 'statusDetails' in error &&
804
+ error.statusDetails instanceof Array) {
686
805
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
687
806
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
688
807
  }
@@ -702,10 +821,13 @@ class ChatServiceClient {
702
821
  options = options || {};
703
822
  options.otherArgs = options.otherArgs || {};
704
823
  options.otherArgs.headers = options.otherArgs.headers || {};
705
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
706
- 'space.name': request.space.name ?? '',
824
+ options.otherArgs.headers['x-goog-request-params'] =
825
+ this._gaxModule.routingHeader.fromParams({
826
+ 'space.name': request.space.name ?? '',
827
+ });
828
+ this.initialize().catch((err) => {
829
+ throw err;
707
830
  });
708
- this.initialize().catch(err => { throw err; });
709
831
  this._log.info('updateSpace request %j', request);
710
832
  const wrappedCallback = callback
711
833
  ? (error, response, options, rawResponse) => {
@@ -713,12 +835,16 @@ class ChatServiceClient {
713
835
  callback(error, response, options, rawResponse); // We verified callback above.
714
836
  }
715
837
  : undefined;
716
- return this.innerApiCalls.updateSpace(request, options, wrappedCallback)
838
+ return this.innerApiCalls
839
+ .updateSpace(request, options, wrappedCallback)
717
840
  ?.then(([response, options, rawResponse]) => {
718
841
  this._log.info('updateSpace response %j', response);
719
842
  return [response, options, rawResponse];
720
- }).catch((error) => {
721
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
843
+ })
844
+ .catch((error) => {
845
+ if (error &&
846
+ 'statusDetails' in error &&
847
+ error.statusDetails instanceof Array) {
722
848
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
723
849
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
724
850
  }
@@ -738,10 +864,13 @@ class ChatServiceClient {
738
864
  options = options || {};
739
865
  options.otherArgs = options.otherArgs || {};
740
866
  options.otherArgs.headers = options.otherArgs.headers || {};
741
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
742
- 'name': request.name ?? '',
867
+ options.otherArgs.headers['x-goog-request-params'] =
868
+ this._gaxModule.routingHeader.fromParams({
869
+ name: request.name ?? '',
870
+ });
871
+ this.initialize().catch((err) => {
872
+ throw err;
743
873
  });
744
- this.initialize().catch(err => { throw err; });
745
874
  this._log.info('deleteSpace request %j', request);
746
875
  const wrappedCallback = callback
747
876
  ? (error, response, options, rawResponse) => {
@@ -749,12 +878,16 @@ class ChatServiceClient {
749
878
  callback(error, response, options, rawResponse); // We verified callback above.
750
879
  }
751
880
  : undefined;
752
- return this.innerApiCalls.deleteSpace(request, options, wrappedCallback)
881
+ return this.innerApiCalls
882
+ .deleteSpace(request, options, wrappedCallback)
753
883
  ?.then(([response, options, rawResponse]) => {
754
884
  this._log.info('deleteSpace response %j', response);
755
885
  return [response, options, rawResponse];
756
- }).catch((error) => {
757
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
886
+ })
887
+ .catch((error) => {
888
+ if (error &&
889
+ 'statusDetails' in error &&
890
+ error.statusDetails instanceof Array) {
758
891
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
759
892
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
760
893
  }
@@ -774,10 +907,13 @@ class ChatServiceClient {
774
907
  options = options || {};
775
908
  options.otherArgs = options.otherArgs || {};
776
909
  options.otherArgs.headers = options.otherArgs.headers || {};
777
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
778
- 'name': request.name ?? '',
910
+ options.otherArgs.headers['x-goog-request-params'] =
911
+ this._gaxModule.routingHeader.fromParams({
912
+ name: request.name ?? '',
913
+ });
914
+ this.initialize().catch((err) => {
915
+ throw err;
779
916
  });
780
- this.initialize().catch(err => { throw err; });
781
917
  this._log.info('completeImportSpace request %j', request);
782
918
  const wrappedCallback = callback
783
919
  ? (error, response, options, rawResponse) => {
@@ -785,12 +921,16 @@ class ChatServiceClient {
785
921
  callback(error, response, options, rawResponse); // We verified callback above.
786
922
  }
787
923
  : undefined;
788
- return this.innerApiCalls.completeImportSpace(request, options, wrappedCallback)
924
+ return this.innerApiCalls
925
+ .completeImportSpace(request, options, wrappedCallback)
789
926
  ?.then(([response, options, rawResponse]) => {
790
927
  this._log.info('completeImportSpace response %j', response);
791
928
  return [response, options, rawResponse];
792
- }).catch((error) => {
793
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
929
+ })
930
+ .catch((error) => {
931
+ if (error &&
932
+ 'statusDetails' in error &&
933
+ error.statusDetails instanceof Array) {
794
934
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
795
935
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
796
936
  }
@@ -810,7 +950,9 @@ class ChatServiceClient {
810
950
  options = options || {};
811
951
  options.otherArgs = options.otherArgs || {};
812
952
  options.otherArgs.headers = options.otherArgs.headers || {};
813
- this.initialize().catch(err => { throw err; });
953
+ this.initialize().catch((err) => {
954
+ throw err;
955
+ });
814
956
  this._log.info('findDirectMessage request %j', request);
815
957
  const wrappedCallback = callback
816
958
  ? (error, response, options, rawResponse) => {
@@ -818,12 +960,16 @@ class ChatServiceClient {
818
960
  callback(error, response, options, rawResponse); // We verified callback above.
819
961
  }
820
962
  : undefined;
821
- return this.innerApiCalls.findDirectMessage(request, options, wrappedCallback)
963
+ return this.innerApiCalls
964
+ .findDirectMessage(request, options, wrappedCallback)
822
965
  ?.then(([response, options, rawResponse]) => {
823
966
  this._log.info('findDirectMessage response %j', response);
824
967
  return [response, options, rawResponse];
825
- }).catch((error) => {
826
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
968
+ })
969
+ .catch((error) => {
970
+ if (error &&
971
+ 'statusDetails' in error &&
972
+ error.statusDetails instanceof Array) {
827
973
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
828
974
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
829
975
  }
@@ -843,10 +989,13 @@ class ChatServiceClient {
843
989
  options = options || {};
844
990
  options.otherArgs = options.otherArgs || {};
845
991
  options.otherArgs.headers = options.otherArgs.headers || {};
846
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
847
- 'parent': request.parent ?? '',
992
+ options.otherArgs.headers['x-goog-request-params'] =
993
+ this._gaxModule.routingHeader.fromParams({
994
+ parent: request.parent ?? '',
995
+ });
996
+ this.initialize().catch((err) => {
997
+ throw err;
848
998
  });
849
- this.initialize().catch(err => { throw err; });
850
999
  this._log.info('createMembership request %j', request);
851
1000
  const wrappedCallback = callback
852
1001
  ? (error, response, options, rawResponse) => {
@@ -854,12 +1003,16 @@ class ChatServiceClient {
854
1003
  callback(error, response, options, rawResponse); // We verified callback above.
855
1004
  }
856
1005
  : undefined;
857
- return this.innerApiCalls.createMembership(request, options, wrappedCallback)
1006
+ return this.innerApiCalls
1007
+ .createMembership(request, options, wrappedCallback)
858
1008
  ?.then(([response, options, rawResponse]) => {
859
1009
  this._log.info('createMembership response %j', response);
860
1010
  return [response, options, rawResponse];
861
- }).catch((error) => {
862
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1011
+ })
1012
+ .catch((error) => {
1013
+ if (error &&
1014
+ 'statusDetails' in error &&
1015
+ error.statusDetails instanceof Array) {
863
1016
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
864
1017
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
865
1018
  }
@@ -879,10 +1032,13 @@ class ChatServiceClient {
879
1032
  options = options || {};
880
1033
  options.otherArgs = options.otherArgs || {};
881
1034
  options.otherArgs.headers = options.otherArgs.headers || {};
882
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
883
- 'membership.name': request.membership.name ?? '',
1035
+ options.otherArgs.headers['x-goog-request-params'] =
1036
+ this._gaxModule.routingHeader.fromParams({
1037
+ 'membership.name': request.membership.name ?? '',
1038
+ });
1039
+ this.initialize().catch((err) => {
1040
+ throw err;
884
1041
  });
885
- this.initialize().catch(err => { throw err; });
886
1042
  this._log.info('updateMembership request %j', request);
887
1043
  const wrappedCallback = callback
888
1044
  ? (error, response, options, rawResponse) => {
@@ -890,12 +1046,16 @@ class ChatServiceClient {
890
1046
  callback(error, response, options, rawResponse); // We verified callback above.
891
1047
  }
892
1048
  : undefined;
893
- return this.innerApiCalls.updateMembership(request, options, wrappedCallback)
1049
+ return this.innerApiCalls
1050
+ .updateMembership(request, options, wrappedCallback)
894
1051
  ?.then(([response, options, rawResponse]) => {
895
1052
  this._log.info('updateMembership response %j', response);
896
1053
  return [response, options, rawResponse];
897
- }).catch((error) => {
898
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1054
+ })
1055
+ .catch((error) => {
1056
+ if (error &&
1057
+ 'statusDetails' in error &&
1058
+ error.statusDetails instanceof Array) {
899
1059
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
900
1060
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
901
1061
  }
@@ -915,10 +1075,13 @@ class ChatServiceClient {
915
1075
  options = options || {};
916
1076
  options.otherArgs = options.otherArgs || {};
917
1077
  options.otherArgs.headers = options.otherArgs.headers || {};
918
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
919
- 'name': request.name ?? '',
1078
+ options.otherArgs.headers['x-goog-request-params'] =
1079
+ this._gaxModule.routingHeader.fromParams({
1080
+ name: request.name ?? '',
1081
+ });
1082
+ this.initialize().catch((err) => {
1083
+ throw err;
920
1084
  });
921
- this.initialize().catch(err => { throw err; });
922
1085
  this._log.info('deleteMembership request %j', request);
923
1086
  const wrappedCallback = callback
924
1087
  ? (error, response, options, rawResponse) => {
@@ -926,12 +1089,16 @@ class ChatServiceClient {
926
1089
  callback(error, response, options, rawResponse); // We verified callback above.
927
1090
  }
928
1091
  : undefined;
929
- return this.innerApiCalls.deleteMembership(request, options, wrappedCallback)
1092
+ return this.innerApiCalls
1093
+ .deleteMembership(request, options, wrappedCallback)
930
1094
  ?.then(([response, options, rawResponse]) => {
931
1095
  this._log.info('deleteMembership response %j', response);
932
1096
  return [response, options, rawResponse];
933
- }).catch((error) => {
934
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1097
+ })
1098
+ .catch((error) => {
1099
+ if (error &&
1100
+ 'statusDetails' in error &&
1101
+ error.statusDetails instanceof Array) {
935
1102
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
936
1103
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
937
1104
  }
@@ -951,10 +1118,13 @@ class ChatServiceClient {
951
1118
  options = options || {};
952
1119
  options.otherArgs = options.otherArgs || {};
953
1120
  options.otherArgs.headers = options.otherArgs.headers || {};
954
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
955
- 'parent': request.parent ?? '',
1121
+ options.otherArgs.headers['x-goog-request-params'] =
1122
+ this._gaxModule.routingHeader.fromParams({
1123
+ parent: request.parent ?? '',
1124
+ });
1125
+ this.initialize().catch((err) => {
1126
+ throw err;
956
1127
  });
957
- this.initialize().catch(err => { throw err; });
958
1128
  this._log.info('createReaction request %j', request);
959
1129
  const wrappedCallback = callback
960
1130
  ? (error, response, options, rawResponse) => {
@@ -962,12 +1132,16 @@ class ChatServiceClient {
962
1132
  callback(error, response, options, rawResponse); // We verified callback above.
963
1133
  }
964
1134
  : undefined;
965
- return this.innerApiCalls.createReaction(request, options, wrappedCallback)
1135
+ return this.innerApiCalls
1136
+ .createReaction(request, options, wrappedCallback)
966
1137
  ?.then(([response, options, rawResponse]) => {
967
1138
  this._log.info('createReaction response %j', response);
968
1139
  return [response, options, rawResponse];
969
- }).catch((error) => {
970
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1140
+ })
1141
+ .catch((error) => {
1142
+ if (error &&
1143
+ 'statusDetails' in error &&
1144
+ error.statusDetails instanceof Array) {
971
1145
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
972
1146
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
973
1147
  }
@@ -987,10 +1161,13 @@ class ChatServiceClient {
987
1161
  options = options || {};
988
1162
  options.otherArgs = options.otherArgs || {};
989
1163
  options.otherArgs.headers = options.otherArgs.headers || {};
990
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
991
- 'name': request.name ?? '',
1164
+ options.otherArgs.headers['x-goog-request-params'] =
1165
+ this._gaxModule.routingHeader.fromParams({
1166
+ name: request.name ?? '',
1167
+ });
1168
+ this.initialize().catch((err) => {
1169
+ throw err;
992
1170
  });
993
- this.initialize().catch(err => { throw err; });
994
1171
  this._log.info('deleteReaction request %j', request);
995
1172
  const wrappedCallback = callback
996
1173
  ? (error, response, options, rawResponse) => {
@@ -998,12 +1175,16 @@ class ChatServiceClient {
998
1175
  callback(error, response, options, rawResponse); // We verified callback above.
999
1176
  }
1000
1177
  : undefined;
1001
- return this.innerApiCalls.deleteReaction(request, options, wrappedCallback)
1178
+ return this.innerApiCalls
1179
+ .deleteReaction(request, options, wrappedCallback)
1002
1180
  ?.then(([response, options, rawResponse]) => {
1003
1181
  this._log.info('deleteReaction response %j', response);
1004
1182
  return [response, options, rawResponse];
1005
- }).catch((error) => {
1006
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1183
+ })
1184
+ .catch((error) => {
1185
+ if (error &&
1186
+ 'statusDetails' in error &&
1187
+ error.statusDetails instanceof Array) {
1007
1188
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1008
1189
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1009
1190
  }
@@ -1023,7 +1204,9 @@ class ChatServiceClient {
1023
1204
  options = options || {};
1024
1205
  options.otherArgs = options.otherArgs || {};
1025
1206
  options.otherArgs.headers = options.otherArgs.headers || {};
1026
- this.initialize().catch(err => { throw err; });
1207
+ this.initialize().catch((err) => {
1208
+ throw err;
1209
+ });
1027
1210
  this._log.info('createCustomEmoji request %j', request);
1028
1211
  const wrappedCallback = callback
1029
1212
  ? (error, response, options, rawResponse) => {
@@ -1031,12 +1214,16 @@ class ChatServiceClient {
1031
1214
  callback(error, response, options, rawResponse); // We verified callback above.
1032
1215
  }
1033
1216
  : undefined;
1034
- return this.innerApiCalls.createCustomEmoji(request, options, wrappedCallback)
1217
+ return this.innerApiCalls
1218
+ .createCustomEmoji(request, options, wrappedCallback)
1035
1219
  ?.then(([response, options, rawResponse]) => {
1036
1220
  this._log.info('createCustomEmoji response %j', response);
1037
1221
  return [response, options, rawResponse];
1038
- }).catch((error) => {
1039
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1222
+ })
1223
+ .catch((error) => {
1224
+ if (error &&
1225
+ 'statusDetails' in error &&
1226
+ error.statusDetails instanceof Array) {
1040
1227
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1041
1228
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1042
1229
  }
@@ -1056,10 +1243,13 @@ class ChatServiceClient {
1056
1243
  options = options || {};
1057
1244
  options.otherArgs = options.otherArgs || {};
1058
1245
  options.otherArgs.headers = options.otherArgs.headers || {};
1059
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1060
- 'name': request.name ?? '',
1246
+ options.otherArgs.headers['x-goog-request-params'] =
1247
+ this._gaxModule.routingHeader.fromParams({
1248
+ name: request.name ?? '',
1249
+ });
1250
+ this.initialize().catch((err) => {
1251
+ throw err;
1061
1252
  });
1062
- this.initialize().catch(err => { throw err; });
1063
1253
  this._log.info('getCustomEmoji request %j', request);
1064
1254
  const wrappedCallback = callback
1065
1255
  ? (error, response, options, rawResponse) => {
@@ -1067,12 +1257,16 @@ class ChatServiceClient {
1067
1257
  callback(error, response, options, rawResponse); // We verified callback above.
1068
1258
  }
1069
1259
  : undefined;
1070
- return this.innerApiCalls.getCustomEmoji(request, options, wrappedCallback)
1260
+ return this.innerApiCalls
1261
+ .getCustomEmoji(request, options, wrappedCallback)
1071
1262
  ?.then(([response, options, rawResponse]) => {
1072
1263
  this._log.info('getCustomEmoji response %j', response);
1073
1264
  return [response, options, rawResponse];
1074
- }).catch((error) => {
1075
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1265
+ })
1266
+ .catch((error) => {
1267
+ if (error &&
1268
+ 'statusDetails' in error &&
1269
+ error.statusDetails instanceof Array) {
1076
1270
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1077
1271
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1078
1272
  }
@@ -1092,10 +1286,13 @@ class ChatServiceClient {
1092
1286
  options = options || {};
1093
1287
  options.otherArgs = options.otherArgs || {};
1094
1288
  options.otherArgs.headers = options.otherArgs.headers || {};
1095
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1096
- 'name': request.name ?? '',
1289
+ options.otherArgs.headers['x-goog-request-params'] =
1290
+ this._gaxModule.routingHeader.fromParams({
1291
+ name: request.name ?? '',
1292
+ });
1293
+ this.initialize().catch((err) => {
1294
+ throw err;
1097
1295
  });
1098
- this.initialize().catch(err => { throw err; });
1099
1296
  this._log.info('deleteCustomEmoji request %j', request);
1100
1297
  const wrappedCallback = callback
1101
1298
  ? (error, response, options, rawResponse) => {
@@ -1103,12 +1300,16 @@ class ChatServiceClient {
1103
1300
  callback(error, response, options, rawResponse); // We verified callback above.
1104
1301
  }
1105
1302
  : undefined;
1106
- return this.innerApiCalls.deleteCustomEmoji(request, options, wrappedCallback)
1303
+ return this.innerApiCalls
1304
+ .deleteCustomEmoji(request, options, wrappedCallback)
1107
1305
  ?.then(([response, options, rawResponse]) => {
1108
1306
  this._log.info('deleteCustomEmoji response %j', response);
1109
1307
  return [response, options, rawResponse];
1110
- }).catch((error) => {
1111
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1308
+ })
1309
+ .catch((error) => {
1310
+ if (error &&
1311
+ 'statusDetails' in error &&
1312
+ error.statusDetails instanceof Array) {
1112
1313
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1113
1314
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1114
1315
  }
@@ -1128,10 +1329,13 @@ class ChatServiceClient {
1128
1329
  options = options || {};
1129
1330
  options.otherArgs = options.otherArgs || {};
1130
1331
  options.otherArgs.headers = options.otherArgs.headers || {};
1131
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1132
- 'name': request.name ?? '',
1332
+ options.otherArgs.headers['x-goog-request-params'] =
1333
+ this._gaxModule.routingHeader.fromParams({
1334
+ name: request.name ?? '',
1335
+ });
1336
+ this.initialize().catch((err) => {
1337
+ throw err;
1133
1338
  });
1134
- this.initialize().catch(err => { throw err; });
1135
1339
  this._log.info('getSpaceReadState request %j', request);
1136
1340
  const wrappedCallback = callback
1137
1341
  ? (error, response, options, rawResponse) => {
@@ -1139,12 +1343,16 @@ class ChatServiceClient {
1139
1343
  callback(error, response, options, rawResponse); // We verified callback above.
1140
1344
  }
1141
1345
  : undefined;
1142
- return this.innerApiCalls.getSpaceReadState(request, options, wrappedCallback)
1346
+ return this.innerApiCalls
1347
+ .getSpaceReadState(request, options, wrappedCallback)
1143
1348
  ?.then(([response, options, rawResponse]) => {
1144
1349
  this._log.info('getSpaceReadState response %j', response);
1145
1350
  return [response, options, rawResponse];
1146
- }).catch((error) => {
1147
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1351
+ })
1352
+ .catch((error) => {
1353
+ if (error &&
1354
+ 'statusDetails' in error &&
1355
+ error.statusDetails instanceof Array) {
1148
1356
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1149
1357
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1150
1358
  }
@@ -1164,10 +1372,13 @@ class ChatServiceClient {
1164
1372
  options = options || {};
1165
1373
  options.otherArgs = options.otherArgs || {};
1166
1374
  options.otherArgs.headers = options.otherArgs.headers || {};
1167
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1168
- 'space_read_state.name': request.spaceReadState.name ?? '',
1375
+ options.otherArgs.headers['x-goog-request-params'] =
1376
+ this._gaxModule.routingHeader.fromParams({
1377
+ 'space_read_state.name': request.spaceReadState.name ?? '',
1378
+ });
1379
+ this.initialize().catch((err) => {
1380
+ throw err;
1169
1381
  });
1170
- this.initialize().catch(err => { throw err; });
1171
1382
  this._log.info('updateSpaceReadState request %j', request);
1172
1383
  const wrappedCallback = callback
1173
1384
  ? (error, response, options, rawResponse) => {
@@ -1175,12 +1386,16 @@ class ChatServiceClient {
1175
1386
  callback(error, response, options, rawResponse); // We verified callback above.
1176
1387
  }
1177
1388
  : undefined;
1178
- return this.innerApiCalls.updateSpaceReadState(request, options, wrappedCallback)
1389
+ return this.innerApiCalls
1390
+ .updateSpaceReadState(request, options, wrappedCallback)
1179
1391
  ?.then(([response, options, rawResponse]) => {
1180
1392
  this._log.info('updateSpaceReadState response %j', response);
1181
1393
  return [response, options, rawResponse];
1182
- }).catch((error) => {
1183
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1394
+ })
1395
+ .catch((error) => {
1396
+ if (error &&
1397
+ 'statusDetails' in error &&
1398
+ error.statusDetails instanceof Array) {
1184
1399
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1185
1400
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1186
1401
  }
@@ -1200,10 +1415,13 @@ class ChatServiceClient {
1200
1415
  options = options || {};
1201
1416
  options.otherArgs = options.otherArgs || {};
1202
1417
  options.otherArgs.headers = options.otherArgs.headers || {};
1203
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1204
- 'name': request.name ?? '',
1418
+ options.otherArgs.headers['x-goog-request-params'] =
1419
+ this._gaxModule.routingHeader.fromParams({
1420
+ name: request.name ?? '',
1421
+ });
1422
+ this.initialize().catch((err) => {
1423
+ throw err;
1205
1424
  });
1206
- this.initialize().catch(err => { throw err; });
1207
1425
  this._log.info('getThreadReadState request %j', request);
1208
1426
  const wrappedCallback = callback
1209
1427
  ? (error, response, options, rawResponse) => {
@@ -1211,12 +1429,16 @@ class ChatServiceClient {
1211
1429
  callback(error, response, options, rawResponse); // We verified callback above.
1212
1430
  }
1213
1431
  : undefined;
1214
- return this.innerApiCalls.getThreadReadState(request, options, wrappedCallback)
1432
+ return this.innerApiCalls
1433
+ .getThreadReadState(request, options, wrappedCallback)
1215
1434
  ?.then(([response, options, rawResponse]) => {
1216
1435
  this._log.info('getThreadReadState response %j', response);
1217
1436
  return [response, options, rawResponse];
1218
- }).catch((error) => {
1219
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1437
+ })
1438
+ .catch((error) => {
1439
+ if (error &&
1440
+ 'statusDetails' in error &&
1441
+ error.statusDetails instanceof Array) {
1220
1442
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1221
1443
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1222
1444
  }
@@ -1236,10 +1458,13 @@ class ChatServiceClient {
1236
1458
  options = options || {};
1237
1459
  options.otherArgs = options.otherArgs || {};
1238
1460
  options.otherArgs.headers = options.otherArgs.headers || {};
1239
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1240
- 'name': request.name ?? '',
1461
+ options.otherArgs.headers['x-goog-request-params'] =
1462
+ this._gaxModule.routingHeader.fromParams({
1463
+ name: request.name ?? '',
1464
+ });
1465
+ this.initialize().catch((err) => {
1466
+ throw err;
1241
1467
  });
1242
- this.initialize().catch(err => { throw err; });
1243
1468
  this._log.info('getSpaceEvent request %j', request);
1244
1469
  const wrappedCallback = callback
1245
1470
  ? (error, response, options, rawResponse) => {
@@ -1247,12 +1472,16 @@ class ChatServiceClient {
1247
1472
  callback(error, response, options, rawResponse); // We verified callback above.
1248
1473
  }
1249
1474
  : undefined;
1250
- return this.innerApiCalls.getSpaceEvent(request, options, wrappedCallback)
1475
+ return this.innerApiCalls
1476
+ .getSpaceEvent(request, options, wrappedCallback)
1251
1477
  ?.then(([response, options, rawResponse]) => {
1252
1478
  this._log.info('getSpaceEvent response %j', response);
1253
1479
  return [response, options, rawResponse];
1254
- }).catch((error) => {
1255
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1480
+ })
1481
+ .catch((error) => {
1482
+ if (error &&
1483
+ 'statusDetails' in error &&
1484
+ error.statusDetails instanceof Array) {
1256
1485
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1257
1486
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1258
1487
  }
@@ -1272,10 +1501,13 @@ class ChatServiceClient {
1272
1501
  options = options || {};
1273
1502
  options.otherArgs = options.otherArgs || {};
1274
1503
  options.otherArgs.headers = options.otherArgs.headers || {};
1275
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1276
- 'name': request.name ?? '',
1504
+ options.otherArgs.headers['x-goog-request-params'] =
1505
+ this._gaxModule.routingHeader.fromParams({
1506
+ name: request.name ?? '',
1507
+ });
1508
+ this.initialize().catch((err) => {
1509
+ throw err;
1277
1510
  });
1278
- this.initialize().catch(err => { throw err; });
1279
1511
  this._log.info('getSpaceNotificationSetting request %j', request);
1280
1512
  const wrappedCallback = callback
1281
1513
  ? (error, response, options, rawResponse) => {
@@ -1283,12 +1515,16 @@ class ChatServiceClient {
1283
1515
  callback(error, response, options, rawResponse); // We verified callback above.
1284
1516
  }
1285
1517
  : undefined;
1286
- return this.innerApiCalls.getSpaceNotificationSetting(request, options, wrappedCallback)
1518
+ return this.innerApiCalls
1519
+ .getSpaceNotificationSetting(request, options, wrappedCallback)
1287
1520
  ?.then(([response, options, rawResponse]) => {
1288
1521
  this._log.info('getSpaceNotificationSetting response %j', response);
1289
1522
  return [response, options, rawResponse];
1290
- }).catch((error) => {
1291
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1523
+ })
1524
+ .catch((error) => {
1525
+ if (error &&
1526
+ 'statusDetails' in error &&
1527
+ error.statusDetails instanceof Array) {
1292
1528
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1293
1529
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1294
1530
  }
@@ -1308,10 +1544,13 @@ class ChatServiceClient {
1308
1544
  options = options || {};
1309
1545
  options.otherArgs = options.otherArgs || {};
1310
1546
  options.otherArgs.headers = options.otherArgs.headers || {};
1311
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1312
- 'space_notification_setting.name': request.spaceNotificationSetting.name ?? '',
1547
+ options.otherArgs.headers['x-goog-request-params'] =
1548
+ this._gaxModule.routingHeader.fromParams({
1549
+ 'space_notification_setting.name': request.spaceNotificationSetting.name ?? '',
1550
+ });
1551
+ this.initialize().catch((err) => {
1552
+ throw err;
1313
1553
  });
1314
- this.initialize().catch(err => { throw err; });
1315
1554
  this._log.info('updateSpaceNotificationSetting request %j', request);
1316
1555
  const wrappedCallback = callback
1317
1556
  ? (error, response, options, rawResponse) => {
@@ -1319,12 +1558,16 @@ class ChatServiceClient {
1319
1558
  callback(error, response, options, rawResponse); // We verified callback above.
1320
1559
  }
1321
1560
  : undefined;
1322
- return this.innerApiCalls.updateSpaceNotificationSetting(request, options, wrappedCallback)
1561
+ return this.innerApiCalls
1562
+ .updateSpaceNotificationSetting(request, options, wrappedCallback)
1323
1563
  ?.then(([response, options, rawResponse]) => {
1324
1564
  this._log.info('updateSpaceNotificationSetting response %j', response);
1325
1565
  return [response, options, rawResponse];
1326
- }).catch((error) => {
1327
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1566
+ })
1567
+ .catch((error) => {
1568
+ if (error &&
1569
+ 'statusDetails' in error &&
1570
+ error.statusDetails instanceof Array) {
1328
1571
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1329
1572
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1330
1573
  }
@@ -1344,10 +1587,13 @@ class ChatServiceClient {
1344
1587
  options = options || {};
1345
1588
  options.otherArgs = options.otherArgs || {};
1346
1589
  options.otherArgs.headers = options.otherArgs.headers || {};
1347
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1348
- 'parent': request.parent ?? '',
1590
+ options.otherArgs.headers['x-goog-request-params'] =
1591
+ this._gaxModule.routingHeader.fromParams({
1592
+ parent: request.parent ?? '',
1593
+ });
1594
+ this.initialize().catch((err) => {
1595
+ throw err;
1349
1596
  });
1350
- this.initialize().catch(err => { throw err; });
1351
1597
  this._log.info('createSection request %j', request);
1352
1598
  const wrappedCallback = callback
1353
1599
  ? (error, response, options, rawResponse) => {
@@ -1355,12 +1601,16 @@ class ChatServiceClient {
1355
1601
  callback(error, response, options, rawResponse); // We verified callback above.
1356
1602
  }
1357
1603
  : undefined;
1358
- return this.innerApiCalls.createSection(request, options, wrappedCallback)
1604
+ return this.innerApiCalls
1605
+ .createSection(request, options, wrappedCallback)
1359
1606
  ?.then(([response, options, rawResponse]) => {
1360
1607
  this._log.info('createSection response %j', response);
1361
1608
  return [response, options, rawResponse];
1362
- }).catch((error) => {
1363
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1609
+ })
1610
+ .catch((error) => {
1611
+ if (error &&
1612
+ 'statusDetails' in error &&
1613
+ error.statusDetails instanceof Array) {
1364
1614
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1365
1615
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1366
1616
  }
@@ -1380,10 +1630,13 @@ class ChatServiceClient {
1380
1630
  options = options || {};
1381
1631
  options.otherArgs = options.otherArgs || {};
1382
1632
  options.otherArgs.headers = options.otherArgs.headers || {};
1383
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1384
- 'name': request.name ?? '',
1633
+ options.otherArgs.headers['x-goog-request-params'] =
1634
+ this._gaxModule.routingHeader.fromParams({
1635
+ name: request.name ?? '',
1636
+ });
1637
+ this.initialize().catch((err) => {
1638
+ throw err;
1385
1639
  });
1386
- this.initialize().catch(err => { throw err; });
1387
1640
  this._log.info('deleteSection request %j', request);
1388
1641
  const wrappedCallback = callback
1389
1642
  ? (error, response, options, rawResponse) => {
@@ -1391,12 +1644,16 @@ class ChatServiceClient {
1391
1644
  callback(error, response, options, rawResponse); // We verified callback above.
1392
1645
  }
1393
1646
  : undefined;
1394
- return this.innerApiCalls.deleteSection(request, options, wrappedCallback)
1647
+ return this.innerApiCalls
1648
+ .deleteSection(request, options, wrappedCallback)
1395
1649
  ?.then(([response, options, rawResponse]) => {
1396
1650
  this._log.info('deleteSection response %j', response);
1397
1651
  return [response, options, rawResponse];
1398
- }).catch((error) => {
1399
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1652
+ })
1653
+ .catch((error) => {
1654
+ if (error &&
1655
+ 'statusDetails' in error &&
1656
+ error.statusDetails instanceof Array) {
1400
1657
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1401
1658
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1402
1659
  }
@@ -1416,10 +1673,13 @@ class ChatServiceClient {
1416
1673
  options = options || {};
1417
1674
  options.otherArgs = options.otherArgs || {};
1418
1675
  options.otherArgs.headers = options.otherArgs.headers || {};
1419
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1420
- 'section.name': request.section.name ?? '',
1676
+ options.otherArgs.headers['x-goog-request-params'] =
1677
+ this._gaxModule.routingHeader.fromParams({
1678
+ 'section.name': request.section.name ?? '',
1679
+ });
1680
+ this.initialize().catch((err) => {
1681
+ throw err;
1421
1682
  });
1422
- this.initialize().catch(err => { throw err; });
1423
1683
  this._log.info('updateSection request %j', request);
1424
1684
  const wrappedCallback = callback
1425
1685
  ? (error, response, options, rawResponse) => {
@@ -1427,12 +1687,16 @@ class ChatServiceClient {
1427
1687
  callback(error, response, options, rawResponse); // We verified callback above.
1428
1688
  }
1429
1689
  : undefined;
1430
- return this.innerApiCalls.updateSection(request, options, wrappedCallback)
1690
+ return this.innerApiCalls
1691
+ .updateSection(request, options, wrappedCallback)
1431
1692
  ?.then(([response, options, rawResponse]) => {
1432
1693
  this._log.info('updateSection response %j', response);
1433
1694
  return [response, options, rawResponse];
1434
- }).catch((error) => {
1435
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1695
+ })
1696
+ .catch((error) => {
1697
+ if (error &&
1698
+ 'statusDetails' in error &&
1699
+ error.statusDetails instanceof Array) {
1436
1700
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1437
1701
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1438
1702
  }
@@ -1452,10 +1716,13 @@ class ChatServiceClient {
1452
1716
  options = options || {};
1453
1717
  options.otherArgs = options.otherArgs || {};
1454
1718
  options.otherArgs.headers = options.otherArgs.headers || {};
1455
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1456
- 'name': request.name ?? '',
1719
+ options.otherArgs.headers['x-goog-request-params'] =
1720
+ this._gaxModule.routingHeader.fromParams({
1721
+ name: request.name ?? '',
1722
+ });
1723
+ this.initialize().catch((err) => {
1724
+ throw err;
1457
1725
  });
1458
- this.initialize().catch(err => { throw err; });
1459
1726
  this._log.info('positionSection request %j', request);
1460
1727
  const wrappedCallback = callback
1461
1728
  ? (error, response, options, rawResponse) => {
@@ -1463,12 +1730,16 @@ class ChatServiceClient {
1463
1730
  callback(error, response, options, rawResponse); // We verified callback above.
1464
1731
  }
1465
1732
  : undefined;
1466
- return this.innerApiCalls.positionSection(request, options, wrappedCallback)
1733
+ return this.innerApiCalls
1734
+ .positionSection(request, options, wrappedCallback)
1467
1735
  ?.then(([response, options, rawResponse]) => {
1468
1736
  this._log.info('positionSection response %j', response);
1469
1737
  return [response, options, rawResponse];
1470
- }).catch((error) => {
1471
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1738
+ })
1739
+ .catch((error) => {
1740
+ if (error &&
1741
+ 'statusDetails' in error &&
1742
+ error.statusDetails instanceof Array) {
1472
1743
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1473
1744
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1474
1745
  }
@@ -1488,10 +1759,13 @@ class ChatServiceClient {
1488
1759
  options = options || {};
1489
1760
  options.otherArgs = options.otherArgs || {};
1490
1761
  options.otherArgs.headers = options.otherArgs.headers || {};
1491
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1492
- 'name': request.name ?? '',
1762
+ options.otherArgs.headers['x-goog-request-params'] =
1763
+ this._gaxModule.routingHeader.fromParams({
1764
+ name: request.name ?? '',
1765
+ });
1766
+ this.initialize().catch((err) => {
1767
+ throw err;
1493
1768
  });
1494
- this.initialize().catch(err => { throw err; });
1495
1769
  this._log.info('moveSectionItem request %j', request);
1496
1770
  const wrappedCallback = callback
1497
1771
  ? (error, response, options, rawResponse) => {
@@ -1499,12 +1773,16 @@ class ChatServiceClient {
1499
1773
  callback(error, response, options, rawResponse); // We verified callback above.
1500
1774
  }
1501
1775
  : undefined;
1502
- return this.innerApiCalls.moveSectionItem(request, options, wrappedCallback)
1776
+ return this.innerApiCalls
1777
+ .moveSectionItem(request, options, wrappedCallback)
1503
1778
  ?.then(([response, options, rawResponse]) => {
1504
1779
  this._log.info('moveSectionItem response %j', response);
1505
1780
  return [response, options, rawResponse];
1506
- }).catch((error) => {
1507
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1781
+ })
1782
+ .catch((error) => {
1783
+ if (error &&
1784
+ 'statusDetails' in error &&
1785
+ error.statusDetails instanceof Array) {
1508
1786
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1509
1787
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1510
1788
  }
@@ -1524,10 +1802,13 @@ class ChatServiceClient {
1524
1802
  options = options || {};
1525
1803
  options.otherArgs = options.otherArgs || {};
1526
1804
  options.otherArgs.headers = options.otherArgs.headers || {};
1527
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1528
- 'parent': request.parent ?? '',
1805
+ options.otherArgs.headers['x-goog-request-params'] =
1806
+ this._gaxModule.routingHeader.fromParams({
1807
+ parent: request.parent ?? '',
1808
+ });
1809
+ this.initialize().catch((err) => {
1810
+ throw err;
1529
1811
  });
1530
- this.initialize().catch(err => { throw err; });
1531
1812
  const wrappedCallback = callback
1532
1813
  ? (error, values, nextPageRequest, rawResponse) => {
1533
1814
  this._log.info('listMessages values %j', values);
@@ -1634,12 +1915,15 @@ class ChatServiceClient {
1634
1915
  options = options || {};
1635
1916
  options.otherArgs = options.otherArgs || {};
1636
1917
  options.otherArgs.headers = options.otherArgs.headers || {};
1637
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1638
- 'parent': request.parent ?? '',
1639
- });
1918
+ options.otherArgs.headers['x-goog-request-params'] =
1919
+ this._gaxModule.routingHeader.fromParams({
1920
+ parent: request.parent ?? '',
1921
+ });
1640
1922
  const defaultCallSettings = this._defaults['listMessages'];
1641
1923
  const callSettings = defaultCallSettings.merge(options);
1642
- this.initialize().catch(err => { throw err; });
1924
+ this.initialize().catch((err) => {
1925
+ throw err;
1926
+ });
1643
1927
  this._log.info('listMessages stream %j', request);
1644
1928
  return this.descriptors.page.listMessages.createStream(this.innerApiCalls.listMessages, request, callSettings);
1645
1929
  }
@@ -1738,12 +2022,15 @@ class ChatServiceClient {
1738
2022
  options = options || {};
1739
2023
  options.otherArgs = options.otherArgs || {};
1740
2024
  options.otherArgs.headers = options.otherArgs.headers || {};
1741
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1742
- 'parent': request.parent ?? '',
1743
- });
2025
+ options.otherArgs.headers['x-goog-request-params'] =
2026
+ this._gaxModule.routingHeader.fromParams({
2027
+ parent: request.parent ?? '',
2028
+ });
1744
2029
  const defaultCallSettings = this._defaults['listMessages'];
1745
2030
  const callSettings = defaultCallSettings.merge(options);
1746
- this.initialize().catch(err => { throw err; });
2031
+ this.initialize().catch((err) => {
2032
+ throw err;
2033
+ });
1747
2034
  this._log.info('listMessages iterate %j', request);
1748
2035
  return this.descriptors.page.listMessages.asyncIterate(this.innerApiCalls['listMessages'], request, callSettings);
1749
2036
  }
@@ -1760,10 +2047,13 @@ class ChatServiceClient {
1760
2047
  options = options || {};
1761
2048
  options.otherArgs = options.otherArgs || {};
1762
2049
  options.otherArgs.headers = options.otherArgs.headers || {};
1763
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1764
- 'parent': request.parent ?? '',
2050
+ options.otherArgs.headers['x-goog-request-params'] =
2051
+ this._gaxModule.routingHeader.fromParams({
2052
+ parent: request.parent ?? '',
2053
+ });
2054
+ this.initialize().catch((err) => {
2055
+ throw err;
1765
2056
  });
1766
- this.initialize().catch(err => { throw err; });
1767
2057
  const wrappedCallback = callback
1768
2058
  ? (error, values, nextPageRequest, rawResponse) => {
1769
2059
  this._log.info('listMemberships values %j', values);
@@ -1888,12 +2178,15 @@ class ChatServiceClient {
1888
2178
  options = options || {};
1889
2179
  options.otherArgs = options.otherArgs || {};
1890
2180
  options.otherArgs.headers = options.otherArgs.headers || {};
1891
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1892
- 'parent': request.parent ?? '',
1893
- });
2181
+ options.otherArgs.headers['x-goog-request-params'] =
2182
+ this._gaxModule.routingHeader.fromParams({
2183
+ parent: request.parent ?? '',
2184
+ });
1894
2185
  const defaultCallSettings = this._defaults['listMemberships'];
1895
2186
  const callSettings = defaultCallSettings.merge(options);
1896
- this.initialize().catch(err => { throw err; });
2187
+ this.initialize().catch((err) => {
2188
+ throw err;
2189
+ });
1897
2190
  this._log.info('listMemberships stream %j', request);
1898
2191
  return this.descriptors.page.listMemberships.createStream(this.innerApiCalls.listMemberships, request, callSettings);
1899
2192
  }
@@ -2010,12 +2303,15 @@ class ChatServiceClient {
2010
2303
  options = options || {};
2011
2304
  options.otherArgs = options.otherArgs || {};
2012
2305
  options.otherArgs.headers = options.otherArgs.headers || {};
2013
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2014
- 'parent': request.parent ?? '',
2015
- });
2306
+ options.otherArgs.headers['x-goog-request-params'] =
2307
+ this._gaxModule.routingHeader.fromParams({
2308
+ parent: request.parent ?? '',
2309
+ });
2016
2310
  const defaultCallSettings = this._defaults['listMemberships'];
2017
2311
  const callSettings = defaultCallSettings.merge(options);
2018
- this.initialize().catch(err => { throw err; });
2312
+ this.initialize().catch((err) => {
2313
+ throw err;
2314
+ });
2019
2315
  this._log.info('listMemberships iterate %j', request);
2020
2316
  return this.descriptors.page.listMemberships.asyncIterate(this.innerApiCalls['listMemberships'], request, callSettings);
2021
2317
  }
@@ -2032,7 +2328,9 @@ class ChatServiceClient {
2032
2328
  options = options || {};
2033
2329
  options.otherArgs = options.otherArgs || {};
2034
2330
  options.otherArgs.headers = options.otherArgs.headers || {};
2035
- this.initialize().catch(err => { throw err; });
2331
+ this.initialize().catch((err) => {
2332
+ throw err;
2333
+ });
2036
2334
  const wrappedCallback = callback
2037
2335
  ? (error, values, nextPageRequest, rawResponse) => {
2038
2336
  this._log.info('listSpaces values %j', values);
@@ -2105,7 +2403,9 @@ class ChatServiceClient {
2105
2403
  options.otherArgs.headers = options.otherArgs.headers || {};
2106
2404
  const defaultCallSettings = this._defaults['listSpaces'];
2107
2405
  const callSettings = defaultCallSettings.merge(options);
2108
- this.initialize().catch(err => { throw err; });
2406
+ this.initialize().catch((err) => {
2407
+ throw err;
2408
+ });
2109
2409
  this._log.info('listSpaces stream %j', request);
2110
2410
  return this.descriptors.page.listSpaces.createStream(this.innerApiCalls.listSpaces, request, callSettings);
2111
2411
  }
@@ -2170,7 +2470,9 @@ class ChatServiceClient {
2170
2470
  options.otherArgs.headers = options.otherArgs.headers || {};
2171
2471
  const defaultCallSettings = this._defaults['listSpaces'];
2172
2472
  const callSettings = defaultCallSettings.merge(options);
2173
- this.initialize().catch(err => { throw err; });
2473
+ this.initialize().catch((err) => {
2474
+ throw err;
2475
+ });
2174
2476
  this._log.info('listSpaces iterate %j', request);
2175
2477
  return this.descriptors.page.listSpaces.asyncIterate(this.innerApiCalls['listSpaces'], request, callSettings);
2176
2478
  }
@@ -2187,7 +2489,9 @@ class ChatServiceClient {
2187
2489
  options = options || {};
2188
2490
  options.otherArgs = options.otherArgs || {};
2189
2491
  options.otherArgs.headers = options.otherArgs.headers || {};
2190
- this.initialize().catch(err => { throw err; });
2492
+ this.initialize().catch((err) => {
2493
+ throw err;
2494
+ });
2191
2495
  const wrappedCallback = callback
2192
2496
  ? (error, values, nextPageRequest, rawResponse) => {
2193
2497
  this._log.info('searchSpaces values %j', values);
@@ -2347,7 +2651,9 @@ class ChatServiceClient {
2347
2651
  options.otherArgs.headers = options.otherArgs.headers || {};
2348
2652
  const defaultCallSettings = this._defaults['searchSpaces'];
2349
2653
  const callSettings = defaultCallSettings.merge(options);
2350
- this.initialize().catch(err => { throw err; });
2654
+ this.initialize().catch((err) => {
2655
+ throw err;
2656
+ });
2351
2657
  this._log.info('searchSpaces stream %j', request);
2352
2658
  return this.descriptors.page.searchSpaces.createStream(this.innerApiCalls.searchSpaces, request, callSettings);
2353
2659
  }
@@ -2499,7 +2805,9 @@ class ChatServiceClient {
2499
2805
  options.otherArgs.headers = options.otherArgs.headers || {};
2500
2806
  const defaultCallSettings = this._defaults['searchSpaces'];
2501
2807
  const callSettings = defaultCallSettings.merge(options);
2502
- this.initialize().catch(err => { throw err; });
2808
+ this.initialize().catch((err) => {
2809
+ throw err;
2810
+ });
2503
2811
  this._log.info('searchSpaces iterate %j', request);
2504
2812
  return this.descriptors.page.searchSpaces.asyncIterate(this.innerApiCalls['searchSpaces'], request, callSettings);
2505
2813
  }
@@ -2516,7 +2824,9 @@ class ChatServiceClient {
2516
2824
  options = options || {};
2517
2825
  options.otherArgs = options.otherArgs || {};
2518
2826
  options.otherArgs.headers = options.otherArgs.headers || {};
2519
- this.initialize().catch(err => { throw err; });
2827
+ this.initialize().catch((err) => {
2828
+ throw err;
2829
+ });
2520
2830
  const wrappedCallback = callback
2521
2831
  ? (error, values, nextPageRequest, rawResponse) => {
2522
2832
  this._log.info('findGroupChats values %j', values);
@@ -2594,7 +2904,9 @@ class ChatServiceClient {
2594
2904
  options.otherArgs.headers = options.otherArgs.headers || {};
2595
2905
  const defaultCallSettings = this._defaults['findGroupChats'];
2596
2906
  const callSettings = defaultCallSettings.merge(options);
2597
- this.initialize().catch(err => { throw err; });
2907
+ this.initialize().catch((err) => {
2908
+ throw err;
2909
+ });
2598
2910
  this._log.info('findGroupChats stream %j', request);
2599
2911
  return this.descriptors.page.findGroupChats.createStream(this.innerApiCalls.findGroupChats, request, callSettings);
2600
2912
  }
@@ -2664,7 +2976,9 @@ class ChatServiceClient {
2664
2976
  options.otherArgs.headers = options.otherArgs.headers || {};
2665
2977
  const defaultCallSettings = this._defaults['findGroupChats'];
2666
2978
  const callSettings = defaultCallSettings.merge(options);
2667
- this.initialize().catch(err => { throw err; });
2979
+ this.initialize().catch((err) => {
2980
+ throw err;
2981
+ });
2668
2982
  this._log.info('findGroupChats iterate %j', request);
2669
2983
  return this.descriptors.page.findGroupChats.asyncIterate(this.innerApiCalls['findGroupChats'], request, callSettings);
2670
2984
  }
@@ -2681,10 +2995,13 @@ class ChatServiceClient {
2681
2995
  options = options || {};
2682
2996
  options.otherArgs = options.otherArgs || {};
2683
2997
  options.otherArgs.headers = options.otherArgs.headers || {};
2684
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2685
- 'parent': request.parent ?? '',
2998
+ options.otherArgs.headers['x-goog-request-params'] =
2999
+ this._gaxModule.routingHeader.fromParams({
3000
+ parent: request.parent ?? '',
3001
+ });
3002
+ this.initialize().catch((err) => {
3003
+ throw err;
2686
3004
  });
2687
- this.initialize().catch(err => { throw err; });
2688
3005
  const wrappedCallback = callback
2689
3006
  ? (error, values, nextPageRequest, rawResponse) => {
2690
3007
  this._log.info('listReactions values %j', values);
@@ -2779,12 +3096,15 @@ class ChatServiceClient {
2779
3096
  options = options || {};
2780
3097
  options.otherArgs = options.otherArgs || {};
2781
3098
  options.otherArgs.headers = options.otherArgs.headers || {};
2782
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2783
- 'parent': request.parent ?? '',
2784
- });
3099
+ options.otherArgs.headers['x-goog-request-params'] =
3100
+ this._gaxModule.routingHeader.fromParams({
3101
+ parent: request.parent ?? '',
3102
+ });
2785
3103
  const defaultCallSettings = this._defaults['listReactions'];
2786
3104
  const callSettings = defaultCallSettings.merge(options);
2787
- this.initialize().catch(err => { throw err; });
3105
+ this.initialize().catch((err) => {
3106
+ throw err;
3107
+ });
2788
3108
  this._log.info('listReactions stream %j', request);
2789
3109
  return this.descriptors.page.listReactions.createStream(this.innerApiCalls.listReactions, request, callSettings);
2790
3110
  }
@@ -2871,12 +3191,15 @@ class ChatServiceClient {
2871
3191
  options = options || {};
2872
3192
  options.otherArgs = options.otherArgs || {};
2873
3193
  options.otherArgs.headers = options.otherArgs.headers || {};
2874
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2875
- 'parent': request.parent ?? '',
2876
- });
3194
+ options.otherArgs.headers['x-goog-request-params'] =
3195
+ this._gaxModule.routingHeader.fromParams({
3196
+ parent: request.parent ?? '',
3197
+ });
2877
3198
  const defaultCallSettings = this._defaults['listReactions'];
2878
3199
  const callSettings = defaultCallSettings.merge(options);
2879
- this.initialize().catch(err => { throw err; });
3200
+ this.initialize().catch((err) => {
3201
+ throw err;
3202
+ });
2880
3203
  this._log.info('listReactions iterate %j', request);
2881
3204
  return this.descriptors.page.listReactions.asyncIterate(this.innerApiCalls['listReactions'], request, callSettings);
2882
3205
  }
@@ -2893,7 +3216,9 @@ class ChatServiceClient {
2893
3216
  options = options || {};
2894
3217
  options.otherArgs = options.otherArgs || {};
2895
3218
  options.otherArgs.headers = options.otherArgs.headers || {};
2896
- this.initialize().catch(err => { throw err; });
3219
+ this.initialize().catch((err) => {
3220
+ throw err;
3221
+ });
2897
3222
  const wrappedCallback = callback
2898
3223
  ? (error, values, nextPageRequest, rawResponse) => {
2899
3224
  this._log.info('listCustomEmojis values %j', values);
@@ -2958,7 +3283,9 @@ class ChatServiceClient {
2958
3283
  options.otherArgs.headers = options.otherArgs.headers || {};
2959
3284
  const defaultCallSettings = this._defaults['listCustomEmojis'];
2960
3285
  const callSettings = defaultCallSettings.merge(options);
2961
- this.initialize().catch(err => { throw err; });
3286
+ this.initialize().catch((err) => {
3287
+ throw err;
3288
+ });
2962
3289
  this._log.info('listCustomEmojis stream %j', request);
2963
3290
  return this.descriptors.page.listCustomEmojis.createStream(this.innerApiCalls.listCustomEmojis, request, callSettings);
2964
3291
  }
@@ -3015,7 +3342,9 @@ class ChatServiceClient {
3015
3342
  options.otherArgs.headers = options.otherArgs.headers || {};
3016
3343
  const defaultCallSettings = this._defaults['listCustomEmojis'];
3017
3344
  const callSettings = defaultCallSettings.merge(options);
3018
- this.initialize().catch(err => { throw err; });
3345
+ this.initialize().catch((err) => {
3346
+ throw err;
3347
+ });
3019
3348
  this._log.info('listCustomEmojis iterate %j', request);
3020
3349
  return this.descriptors.page.listCustomEmojis.asyncIterate(this.innerApiCalls['listCustomEmojis'], request, callSettings);
3021
3350
  }
@@ -3032,10 +3361,13 @@ class ChatServiceClient {
3032
3361
  options = options || {};
3033
3362
  options.otherArgs = options.otherArgs || {};
3034
3363
  options.otherArgs.headers = options.otherArgs.headers || {};
3035
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3036
- 'parent': request.parent ?? '',
3364
+ options.otherArgs.headers['x-goog-request-params'] =
3365
+ this._gaxModule.routingHeader.fromParams({
3366
+ parent: request.parent ?? '',
3367
+ });
3368
+ this.initialize().catch((err) => {
3369
+ throw err;
3037
3370
  });
3038
- this.initialize().catch(err => { throw err; });
3039
3371
  const wrappedCallback = callback
3040
3372
  ? (error, values, nextPageRequest, rawResponse) => {
3041
3373
  this._log.info('listSpaceEvents values %j', values);
@@ -3141,12 +3473,15 @@ class ChatServiceClient {
3141
3473
  options = options || {};
3142
3474
  options.otherArgs = options.otherArgs || {};
3143
3475
  options.otherArgs.headers = options.otherArgs.headers || {};
3144
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3145
- 'parent': request.parent ?? '',
3146
- });
3476
+ options.otherArgs.headers['x-goog-request-params'] =
3477
+ this._gaxModule.routingHeader.fromParams({
3478
+ parent: request.parent ?? '',
3479
+ });
3147
3480
  const defaultCallSettings = this._defaults['listSpaceEvents'];
3148
3481
  const callSettings = defaultCallSettings.merge(options);
3149
- this.initialize().catch(err => { throw err; });
3482
+ this.initialize().catch((err) => {
3483
+ throw err;
3484
+ });
3150
3485
  this._log.info('listSpaceEvents stream %j', request);
3151
3486
  return this.descriptors.page.listSpaceEvents.createStream(this.innerApiCalls.listSpaceEvents, request, callSettings);
3152
3487
  }
@@ -3244,12 +3579,15 @@ class ChatServiceClient {
3244
3579
  options = options || {};
3245
3580
  options.otherArgs = options.otherArgs || {};
3246
3581
  options.otherArgs.headers = options.otherArgs.headers || {};
3247
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3248
- 'parent': request.parent ?? '',
3249
- });
3582
+ options.otherArgs.headers['x-goog-request-params'] =
3583
+ this._gaxModule.routingHeader.fromParams({
3584
+ parent: request.parent ?? '',
3585
+ });
3250
3586
  const defaultCallSettings = this._defaults['listSpaceEvents'];
3251
3587
  const callSettings = defaultCallSettings.merge(options);
3252
- this.initialize().catch(err => { throw err; });
3588
+ this.initialize().catch((err) => {
3589
+ throw err;
3590
+ });
3253
3591
  this._log.info('listSpaceEvents iterate %j', request);
3254
3592
  return this.descriptors.page.listSpaceEvents.asyncIterate(this.innerApiCalls['listSpaceEvents'], request, callSettings);
3255
3593
  }
@@ -3266,10 +3604,13 @@ class ChatServiceClient {
3266
3604
  options = options || {};
3267
3605
  options.otherArgs = options.otherArgs || {};
3268
3606
  options.otherArgs.headers = options.otherArgs.headers || {};
3269
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3270
- 'parent': request.parent ?? '',
3607
+ options.otherArgs.headers['x-goog-request-params'] =
3608
+ this._gaxModule.routingHeader.fromParams({
3609
+ parent: request.parent ?? '',
3610
+ });
3611
+ this.initialize().catch((err) => {
3612
+ throw err;
3271
3613
  });
3272
- this.initialize().catch(err => { throw err; });
3273
3614
  const wrappedCallback = callback
3274
3615
  ? (error, values, nextPageRequest, rawResponse) => {
3275
3616
  this._log.info('listSections values %j', values);
@@ -3333,12 +3674,15 @@ class ChatServiceClient {
3333
3674
  options = options || {};
3334
3675
  options.otherArgs = options.otherArgs || {};
3335
3676
  options.otherArgs.headers = options.otherArgs.headers || {};
3336
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3337
- 'parent': request.parent ?? '',
3338
- });
3677
+ options.otherArgs.headers['x-goog-request-params'] =
3678
+ this._gaxModule.routingHeader.fromParams({
3679
+ parent: request.parent ?? '',
3680
+ });
3339
3681
  const defaultCallSettings = this._defaults['listSections'];
3340
3682
  const callSettings = defaultCallSettings.merge(options);
3341
- this.initialize().catch(err => { throw err; });
3683
+ this.initialize().catch((err) => {
3684
+ throw err;
3685
+ });
3342
3686
  this._log.info('listSections stream %j', request);
3343
3687
  return this.descriptors.page.listSections.createStream(this.innerApiCalls.listSections, request, callSettings);
3344
3688
  }
@@ -3394,12 +3738,15 @@ class ChatServiceClient {
3394
3738
  options = options || {};
3395
3739
  options.otherArgs = options.otherArgs || {};
3396
3740
  options.otherArgs.headers = options.otherArgs.headers || {};
3397
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3398
- 'parent': request.parent ?? '',
3399
- });
3741
+ options.otherArgs.headers['x-goog-request-params'] =
3742
+ this._gaxModule.routingHeader.fromParams({
3743
+ parent: request.parent ?? '',
3744
+ });
3400
3745
  const defaultCallSettings = this._defaults['listSections'];
3401
3746
  const callSettings = defaultCallSettings.merge(options);
3402
- this.initialize().catch(err => { throw err; });
3747
+ this.initialize().catch((err) => {
3748
+ throw err;
3749
+ });
3403
3750
  this._log.info('listSections iterate %j', request);
3404
3751
  return this.descriptors.page.listSections.asyncIterate(this.innerApiCalls['listSections'], request, callSettings);
3405
3752
  }
@@ -3416,10 +3763,13 @@ class ChatServiceClient {
3416
3763
  options = options || {};
3417
3764
  options.otherArgs = options.otherArgs || {};
3418
3765
  options.otherArgs.headers = options.otherArgs.headers || {};
3419
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3420
- 'parent': request.parent ?? '',
3766
+ options.otherArgs.headers['x-goog-request-params'] =
3767
+ this._gaxModule.routingHeader.fromParams({
3768
+ parent: request.parent ?? '',
3769
+ });
3770
+ this.initialize().catch((err) => {
3771
+ throw err;
3421
3772
  });
3422
- this.initialize().catch(err => { throw err; });
3423
3773
  const wrappedCallback = callback
3424
3774
  ? (error, values, nextPageRequest, rawResponse) => {
3425
3775
  this._log.info('listSectionItems values %j', values);
@@ -3488,12 +3838,15 @@ class ChatServiceClient {
3488
3838
  options = options || {};
3489
3839
  options.otherArgs = options.otherArgs || {};
3490
3840
  options.otherArgs.headers = options.otherArgs.headers || {};
3491
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3492
- 'parent': request.parent ?? '',
3493
- });
3841
+ options.otherArgs.headers['x-goog-request-params'] =
3842
+ this._gaxModule.routingHeader.fromParams({
3843
+ parent: request.parent ?? '',
3844
+ });
3494
3845
  const defaultCallSettings = this._defaults['listSectionItems'];
3495
3846
  const callSettings = defaultCallSettings.merge(options);
3496
- this.initialize().catch(err => { throw err; });
3847
+ this.initialize().catch((err) => {
3848
+ throw err;
3849
+ });
3497
3850
  this._log.info('listSectionItems stream %j', request);
3498
3851
  return this.descriptors.page.listSectionItems.createStream(this.innerApiCalls.listSectionItems, request, callSettings);
3499
3852
  }
@@ -3554,12 +3907,15 @@ class ChatServiceClient {
3554
3907
  options = options || {};
3555
3908
  options.otherArgs = options.otherArgs || {};
3556
3909
  options.otherArgs.headers = options.otherArgs.headers || {};
3557
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3558
- 'parent': request.parent ?? '',
3559
- });
3910
+ options.otherArgs.headers['x-goog-request-params'] =
3911
+ this._gaxModule.routingHeader.fromParams({
3912
+ parent: request.parent ?? '',
3913
+ });
3560
3914
  const defaultCallSettings = this._defaults['listSectionItems'];
3561
3915
  const callSettings = defaultCallSettings.merge(options);
3562
- this.initialize().catch(err => { throw err; });
3916
+ this.initialize().catch((err) => {
3917
+ throw err;
3918
+ });
3563
3919
  this._log.info('listSectionItems iterate %j', request);
3564
3920
  return this.descriptors.page.listSectionItems.asyncIterate(this.innerApiCalls['listSectionItems'], request, callSettings);
3565
3921
  }
@@ -3589,7 +3945,8 @@ class ChatServiceClient {
3589
3945
  * @returns {string} A string representing the space.
3590
3946
  */
3591
3947
  matchSpaceFromAttachmentName(attachmentName) {
3592
- return this.pathTemplates.attachmentPathTemplate.match(attachmentName).space;
3948
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
3949
+ .space;
3593
3950
  }
3594
3951
  /**
3595
3952
  * Parse the message from Attachment resource.
@@ -3599,7 +3956,8 @@ class ChatServiceClient {
3599
3956
  * @returns {string} A string representing the message.
3600
3957
  */
3601
3958
  matchMessageFromAttachmentName(attachmentName) {
3602
- return this.pathTemplates.attachmentPathTemplate.match(attachmentName).message;
3959
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
3960
+ .message;
3603
3961
  }
3604
3962
  /**
3605
3963
  * Parse the attachment from Attachment resource.
@@ -3609,7 +3967,8 @@ class ChatServiceClient {
3609
3967
  * @returns {string} A string representing the attachment.
3610
3968
  */
3611
3969
  matchAttachmentFromAttachmentName(attachmentName) {
3612
- return this.pathTemplates.attachmentPathTemplate.match(attachmentName).attachment;
3970
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
3971
+ .attachment;
3613
3972
  }
3614
3973
  /**
3615
3974
  * Return a fully-qualified customEmoji resource name string.
@@ -3630,7 +3989,8 @@ class ChatServiceClient {
3630
3989
  * @returns {string} A string representing the custom_emoji.
3631
3990
  */
3632
3991
  matchCustomEmojiFromCustomEmojiName(customEmojiName) {
3633
- return this.pathTemplates.customEmojiPathTemplate.match(customEmojiName).custom_emoji;
3992
+ return this.pathTemplates.customEmojiPathTemplate.match(customEmojiName)
3993
+ .custom_emoji;
3634
3994
  }
3635
3995
  /**
3636
3996
  * Return a fully-qualified membership resource name string.
@@ -3653,7 +4013,8 @@ class ChatServiceClient {
3653
4013
  * @returns {string} A string representing the space.
3654
4014
  */
3655
4015
  matchSpaceFromMembershipName(membershipName) {
3656
- return this.pathTemplates.membershipPathTemplate.match(membershipName).space;
4016
+ return this.pathTemplates.membershipPathTemplate.match(membershipName)
4017
+ .space;
3657
4018
  }
3658
4019
  /**
3659
4020
  * Parse the member from Membership resource.
@@ -3663,7 +4024,8 @@ class ChatServiceClient {
3663
4024
  * @returns {string} A string representing the member.
3664
4025
  */
3665
4026
  matchMemberFromMembershipName(membershipName) {
3666
- return this.pathTemplates.membershipPathTemplate.match(membershipName).member;
4027
+ return this.pathTemplates.membershipPathTemplate.match(membershipName)
4028
+ .member;
3667
4029
  }
3668
4030
  /**
3669
4031
  * Return a fully-qualified message resource name string.
@@ -3844,7 +4206,8 @@ class ChatServiceClient {
3844
4206
  * @returns {string} A string representing the user.
3845
4207
  */
3846
4208
  matchUserFromSectionItemName(sectionItemName) {
3847
- return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName).user;
4209
+ return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName)
4210
+ .user;
3848
4211
  }
3849
4212
  /**
3850
4213
  * Parse the section from SectionItem resource.
@@ -3854,7 +4217,8 @@ class ChatServiceClient {
3854
4217
  * @returns {string} A string representing the section.
3855
4218
  */
3856
4219
  matchSectionFromSectionItemName(sectionItemName) {
3857
- return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName).section;
4220
+ return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName)
4221
+ .section;
3858
4222
  }
3859
4223
  /**
3860
4224
  * Parse the item from SectionItem resource.
@@ -3864,7 +4228,8 @@ class ChatServiceClient {
3864
4228
  * @returns {string} A string representing the item.
3865
4229
  */
3866
4230
  matchItemFromSectionItemName(sectionItemName) {
3867
- return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName).item;
4231
+ return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName)
4232
+ .item;
3868
4233
  }
3869
4234
  /**
3870
4235
  * Return a fully-qualified space resource name string.
@@ -3908,7 +4273,8 @@ class ChatServiceClient {
3908
4273
  * @returns {string} A string representing the space.
3909
4274
  */
3910
4275
  matchSpaceFromSpaceEventName(spaceEventName) {
3911
- return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName).space;
4276
+ return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName)
4277
+ .space;
3912
4278
  }
3913
4279
  /**
3914
4280
  * Parse the space_event from SpaceEvent resource.
@@ -3918,7 +4284,8 @@ class ChatServiceClient {
3918
4284
  * @returns {string} A string representing the space_event.
3919
4285
  */
3920
4286
  matchSpaceEventFromSpaceEventName(spaceEventName) {
3921
- return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName).space_event;
4287
+ return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName)
4288
+ .space_event;
3922
4289
  }
3923
4290
  /**
3924
4291
  * Return a fully-qualified spaceNotificationSetting resource name string.
@@ -4072,7 +4439,7 @@ class ChatServiceClient {
4072
4439
  */
4073
4440
  close() {
4074
4441
  if (this.chatServiceStub && !this._terminated) {
4075
- return this.chatServiceStub.then(stub => {
4442
+ return this.chatServiceStub.then((stub) => {
4076
4443
  this._log.info('ending gRPC channel');
4077
4444
  this._terminated = true;
4078
4445
  stub.close();