@google-apps/chat 0.24.0 → 0.26.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
  }
@@ -162,6 +168,7 @@ class ChatServiceClient {
162
168
  // Create useful helper objects for these.
163
169
  this.pathTemplates = {
164
170
  attachmentPathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/messages/{message}/attachments/{attachment}'),
171
+ availabilityPathTemplate: new this._gaxModule.PathTemplate('users/{user}/availability'),
165
172
  customEmojiPathTemplate: new this._gaxModule.PathTemplate('customEmojis/{custom_emoji}'),
166
173
  membershipPathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/members/{member}'),
167
174
  messagePathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/messages/{message}'),
@@ -189,7 +196,7 @@ class ChatServiceClient {
189
196
  listCustomEmojis: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customEmojis'),
190
197
  listSpaceEvents: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaceEvents'),
191
198
  listSections: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sections'),
192
- listSectionItems: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sectionItems')
199
+ listSectionItems: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sectionItems'),
193
200
  };
194
201
  // Put together the default options sent with requests.
195
202
  this._defaults = this._gaxGrpc.constructSettings('google.chat.v1.ChatService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -218,15 +225,64 @@ class ChatServiceClient {
218
225
  }
219
226
  // Put together the "service stub" for
220
227
  // 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);
228
+ this.chatServiceStub = this._gaxGrpc.createStub(this._opts.fallback
229
+ ? this._protos.lookupService('google.chat.v1.ChatService')
230
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
231
+ this._protos.google.chat.v1.ChatService, this._opts, this._providedCustomServicePath);
225
232
  // Iterate over each of the methods that the service provides
226
233
  // 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'];
234
+ const chatServiceStubMethods = [
235
+ 'createMessage',
236
+ 'listMessages',
237
+ 'listMemberships',
238
+ 'getMembership',
239
+ 'getMessage',
240
+ 'updateMessage',
241
+ 'deleteMessage',
242
+ 'getAttachment',
243
+ 'uploadAttachment',
244
+ 'listSpaces',
245
+ 'searchSpaces',
246
+ 'getSpace',
247
+ 'createSpace',
248
+ 'setUpSpace',
249
+ 'updateSpace',
250
+ 'deleteSpace',
251
+ 'completeImportSpace',
252
+ 'findDirectMessage',
253
+ 'findGroupChats',
254
+ 'createMembership',
255
+ 'updateMembership',
256
+ 'deleteMembership',
257
+ 'createReaction',
258
+ 'listReactions',
259
+ 'deleteReaction',
260
+ 'createCustomEmoji',
261
+ 'getCustomEmoji',
262
+ 'listCustomEmojis',
263
+ 'deleteCustomEmoji',
264
+ 'getSpaceReadState',
265
+ 'updateSpaceReadState',
266
+ 'getThreadReadState',
267
+ 'getAvailability',
268
+ 'markAsActive',
269
+ 'markAsAway',
270
+ 'markAsDoNotDisturb',
271
+ 'updateAvailability',
272
+ 'getSpaceEvent',
273
+ 'listSpaceEvents',
274
+ 'getSpaceNotificationSetting',
275
+ 'updateSpaceNotificationSetting',
276
+ 'createSection',
277
+ 'deleteSection',
278
+ 'updateSection',
279
+ 'listSections',
280
+ 'positionSection',
281
+ 'listSectionItems',
282
+ 'moveSectionItem',
283
+ ];
228
284
  for (const methodName of chatServiceStubMethods) {
229
- const callPromise = this.chatServiceStub.then(stub => (...args) => {
285
+ const callPromise = this.chatServiceStub.then((stub) => (...args) => {
230
286
  if (this._terminated) {
231
287
  return Promise.reject('The client has already been closed.');
232
288
  }
@@ -235,8 +291,7 @@ class ChatServiceClient {
235
291
  }, (err) => () => {
236
292
  throw err;
237
293
  });
238
- const descriptor = this.descriptors.page[methodName] ||
239
- undefined;
294
+ const descriptor = this.descriptors.page[methodName] || undefined;
240
295
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
241
296
  this.innerApiCalls[methodName] = apiCall;
242
297
  }
@@ -248,7 +303,8 @@ class ChatServiceClient {
248
303
  * @returns {string} The DNS address for this service.
249
304
  */
250
305
  static get servicePath() {
251
- if (typeof process === 'object' && typeof process.emitWarning === 'function') {
306
+ if (typeof process === 'object' &&
307
+ typeof process.emitWarning === 'function') {
252
308
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
253
309
  }
254
310
  return 'chat.googleapis.com';
@@ -259,7 +315,8 @@ class ChatServiceClient {
259
315
  * @returns {string} The DNS address for this service.
260
316
  */
261
317
  static get apiEndpoint() {
262
- if (typeof process === 'object' && typeof process.emitWarning === 'function') {
318
+ if (typeof process === 'object' &&
319
+ typeof process.emitWarning === 'function') {
263
320
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
264
321
  }
265
322
  return 'chat.googleapis.com';
@@ -317,11 +374,13 @@ class ChatServiceClient {
317
374
  'https://www.googleapis.com/auth/chat.spaces',
318
375
  'https://www.googleapis.com/auth/chat.spaces.create',
319
376
  'https://www.googleapis.com/auth/chat.spaces.readonly',
377
+ 'https://www.googleapis.com/auth/chat.users.availability',
378
+ 'https://www.googleapis.com/auth/chat.users.availability.readonly',
320
379
  'https://www.googleapis.com/auth/chat.users.readstate',
321
380
  'https://www.googleapis.com/auth/chat.users.readstate.readonly',
322
381
  'https://www.googleapis.com/auth/chat.users.sections',
323
382
  'https://www.googleapis.com/auth/chat.users.sections.readonly',
324
- 'https://www.googleapis.com/auth/chat.users.spacesettings'
383
+ 'https://www.googleapis.com/auth/chat.users.spacesettings',
325
384
  ];
326
385
  }
327
386
  /**
@@ -348,10 +407,13 @@ class ChatServiceClient {
348
407
  options = options || {};
349
408
  options.otherArgs = options.otherArgs || {};
350
409
  options.otherArgs.headers = options.otherArgs.headers || {};
351
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
352
- 'parent': request.parent ?? '',
410
+ options.otherArgs.headers['x-goog-request-params'] =
411
+ this._gaxModule.routingHeader.fromParams({
412
+ parent: request.parent ?? '',
413
+ });
414
+ this.initialize().catch((err) => {
415
+ throw err;
353
416
  });
354
- this.initialize().catch(err => { throw err; });
355
417
  this._log.info('createMessage request %j', request);
356
418
  const wrappedCallback = callback
357
419
  ? (error, response, options, rawResponse) => {
@@ -359,12 +421,16 @@ class ChatServiceClient {
359
421
  callback(error, response, options, rawResponse); // We verified callback above.
360
422
  }
361
423
  : undefined;
362
- return this.innerApiCalls.createMessage(request, options, wrappedCallback)
424
+ return this.innerApiCalls
425
+ .createMessage(request, options, wrappedCallback)
363
426
  ?.then(([response, options, rawResponse]) => {
364
427
  this._log.info('createMessage response %j', response);
365
428
  return [response, options, rawResponse];
366
- }).catch((error) => {
367
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
429
+ })
430
+ .catch((error) => {
431
+ if (error &&
432
+ 'statusDetails' in error &&
433
+ error.statusDetails instanceof Array) {
368
434
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
369
435
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
370
436
  }
@@ -384,10 +450,13 @@ class ChatServiceClient {
384
450
  options = options || {};
385
451
  options.otherArgs = options.otherArgs || {};
386
452
  options.otherArgs.headers = options.otherArgs.headers || {};
387
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
388
- 'name': request.name ?? '',
453
+ options.otherArgs.headers['x-goog-request-params'] =
454
+ this._gaxModule.routingHeader.fromParams({
455
+ name: request.name ?? '',
456
+ });
457
+ this.initialize().catch((err) => {
458
+ throw err;
389
459
  });
390
- this.initialize().catch(err => { throw err; });
391
460
  this._log.info('getMembership request %j', request);
392
461
  const wrappedCallback = callback
393
462
  ? (error, response, options, rawResponse) => {
@@ -395,12 +464,16 @@ class ChatServiceClient {
395
464
  callback(error, response, options, rawResponse); // We verified callback above.
396
465
  }
397
466
  : undefined;
398
- return this.innerApiCalls.getMembership(request, options, wrappedCallback)
467
+ return this.innerApiCalls
468
+ .getMembership(request, options, wrappedCallback)
399
469
  ?.then(([response, options, rawResponse]) => {
400
470
  this._log.info('getMembership response %j', response);
401
471
  return [response, options, rawResponse];
402
- }).catch((error) => {
403
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
472
+ })
473
+ .catch((error) => {
474
+ if (error &&
475
+ 'statusDetails' in error &&
476
+ error.statusDetails instanceof Array) {
404
477
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
405
478
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
406
479
  }
@@ -420,10 +493,13 @@ class ChatServiceClient {
420
493
  options = options || {};
421
494
  options.otherArgs = options.otherArgs || {};
422
495
  options.otherArgs.headers = options.otherArgs.headers || {};
423
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
424
- 'name': request.name ?? '',
496
+ options.otherArgs.headers['x-goog-request-params'] =
497
+ this._gaxModule.routingHeader.fromParams({
498
+ name: request.name ?? '',
499
+ });
500
+ this.initialize().catch((err) => {
501
+ throw err;
425
502
  });
426
- this.initialize().catch(err => { throw err; });
427
503
  this._log.info('getMessage request %j', request);
428
504
  const wrappedCallback = callback
429
505
  ? (error, response, options, rawResponse) => {
@@ -431,12 +507,16 @@ class ChatServiceClient {
431
507
  callback(error, response, options, rawResponse); // We verified callback above.
432
508
  }
433
509
  : undefined;
434
- return this.innerApiCalls.getMessage(request, options, wrappedCallback)
510
+ return this.innerApiCalls
511
+ .getMessage(request, options, wrappedCallback)
435
512
  ?.then(([response, options, rawResponse]) => {
436
513
  this._log.info('getMessage response %j', response);
437
514
  return [response, options, rawResponse];
438
- }).catch((error) => {
439
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
515
+ })
516
+ .catch((error) => {
517
+ if (error &&
518
+ 'statusDetails' in error &&
519
+ error.statusDetails instanceof Array) {
440
520
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
441
521
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
442
522
  }
@@ -456,10 +536,13 @@ class ChatServiceClient {
456
536
  options = options || {};
457
537
  options.otherArgs = options.otherArgs || {};
458
538
  options.otherArgs.headers = options.otherArgs.headers || {};
459
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
460
- 'message.name': request.message.name ?? '',
539
+ options.otherArgs.headers['x-goog-request-params'] =
540
+ this._gaxModule.routingHeader.fromParams({
541
+ 'message.name': request.message.name ?? '',
542
+ });
543
+ this.initialize().catch((err) => {
544
+ throw err;
461
545
  });
462
- this.initialize().catch(err => { throw err; });
463
546
  this._log.info('updateMessage request %j', request);
464
547
  const wrappedCallback = callback
465
548
  ? (error, response, options, rawResponse) => {
@@ -467,12 +550,16 @@ class ChatServiceClient {
467
550
  callback(error, response, options, rawResponse); // We verified callback above.
468
551
  }
469
552
  : undefined;
470
- return this.innerApiCalls.updateMessage(request, options, wrappedCallback)
553
+ return this.innerApiCalls
554
+ .updateMessage(request, options, wrappedCallback)
471
555
  ?.then(([response, options, rawResponse]) => {
472
556
  this._log.info('updateMessage response %j', response);
473
557
  return [response, options, rawResponse];
474
- }).catch((error) => {
475
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
558
+ })
559
+ .catch((error) => {
560
+ if (error &&
561
+ 'statusDetails' in error &&
562
+ error.statusDetails instanceof Array) {
476
563
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
477
564
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
478
565
  }
@@ -492,10 +579,13 @@ class ChatServiceClient {
492
579
  options = options || {};
493
580
  options.otherArgs = options.otherArgs || {};
494
581
  options.otherArgs.headers = options.otherArgs.headers || {};
495
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
496
- 'name': request.name ?? '',
582
+ options.otherArgs.headers['x-goog-request-params'] =
583
+ this._gaxModule.routingHeader.fromParams({
584
+ name: request.name ?? '',
585
+ });
586
+ this.initialize().catch((err) => {
587
+ throw err;
497
588
  });
498
- this.initialize().catch(err => { throw err; });
499
589
  this._log.info('deleteMessage request %j', request);
500
590
  const wrappedCallback = callback
501
591
  ? (error, response, options, rawResponse) => {
@@ -503,12 +593,16 @@ class ChatServiceClient {
503
593
  callback(error, response, options, rawResponse); // We verified callback above.
504
594
  }
505
595
  : undefined;
506
- return this.innerApiCalls.deleteMessage(request, options, wrappedCallback)
596
+ return this.innerApiCalls
597
+ .deleteMessage(request, options, wrappedCallback)
507
598
  ?.then(([response, options, rawResponse]) => {
508
599
  this._log.info('deleteMessage response %j', response);
509
600
  return [response, options, rawResponse];
510
- }).catch((error) => {
511
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
601
+ })
602
+ .catch((error) => {
603
+ if (error &&
604
+ 'statusDetails' in error &&
605
+ error.statusDetails instanceof Array) {
512
606
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
513
607
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
514
608
  }
@@ -528,10 +622,13 @@ class ChatServiceClient {
528
622
  options = options || {};
529
623
  options.otherArgs = options.otherArgs || {};
530
624
  options.otherArgs.headers = options.otherArgs.headers || {};
531
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
532
- 'name': request.name ?? '',
625
+ options.otherArgs.headers['x-goog-request-params'] =
626
+ this._gaxModule.routingHeader.fromParams({
627
+ name: request.name ?? '',
628
+ });
629
+ this.initialize().catch((err) => {
630
+ throw err;
533
631
  });
534
- this.initialize().catch(err => { throw err; });
535
632
  this._log.info('getAttachment request %j', request);
536
633
  const wrappedCallback = callback
537
634
  ? (error, response, options, rawResponse) => {
@@ -539,12 +636,16 @@ class ChatServiceClient {
539
636
  callback(error, response, options, rawResponse); // We verified callback above.
540
637
  }
541
638
  : undefined;
542
- return this.innerApiCalls.getAttachment(request, options, wrappedCallback)
639
+ return this.innerApiCalls
640
+ .getAttachment(request, options, wrappedCallback)
543
641
  ?.then(([response, options, rawResponse]) => {
544
642
  this._log.info('getAttachment response %j', response);
545
643
  return [response, options, rawResponse];
546
- }).catch((error) => {
547
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
644
+ })
645
+ .catch((error) => {
646
+ if (error &&
647
+ 'statusDetails' in error &&
648
+ error.statusDetails instanceof Array) {
548
649
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
549
650
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
550
651
  }
@@ -564,10 +665,13 @@ class ChatServiceClient {
564
665
  options = options || {};
565
666
  options.otherArgs = options.otherArgs || {};
566
667
  options.otherArgs.headers = options.otherArgs.headers || {};
567
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
568
- 'parent': request.parent ?? '',
668
+ options.otherArgs.headers['x-goog-request-params'] =
669
+ this._gaxModule.routingHeader.fromParams({
670
+ parent: request.parent ?? '',
671
+ });
672
+ this.initialize().catch((err) => {
673
+ throw err;
569
674
  });
570
- this.initialize().catch(err => { throw err; });
571
675
  this._log.info('uploadAttachment request %j', request);
572
676
  const wrappedCallback = callback
573
677
  ? (error, response, options, rawResponse) => {
@@ -575,12 +679,16 @@ class ChatServiceClient {
575
679
  callback(error, response, options, rawResponse); // We verified callback above.
576
680
  }
577
681
  : undefined;
578
- return this.innerApiCalls.uploadAttachment(request, options, wrappedCallback)
682
+ return this.innerApiCalls
683
+ .uploadAttachment(request, options, wrappedCallback)
579
684
  ?.then(([response, options, rawResponse]) => {
580
685
  this._log.info('uploadAttachment response %j', response);
581
686
  return [response, options, rawResponse];
582
- }).catch((error) => {
583
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
687
+ })
688
+ .catch((error) => {
689
+ if (error &&
690
+ 'statusDetails' in error &&
691
+ error.statusDetails instanceof Array) {
584
692
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
585
693
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
586
694
  }
@@ -600,10 +708,13 @@ class ChatServiceClient {
600
708
  options = options || {};
601
709
  options.otherArgs = options.otherArgs || {};
602
710
  options.otherArgs.headers = options.otherArgs.headers || {};
603
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
604
- 'name': request.name ?? '',
711
+ options.otherArgs.headers['x-goog-request-params'] =
712
+ this._gaxModule.routingHeader.fromParams({
713
+ name: request.name ?? '',
714
+ });
715
+ this.initialize().catch((err) => {
716
+ throw err;
605
717
  });
606
- this.initialize().catch(err => { throw err; });
607
718
  this._log.info('getSpace request %j', request);
608
719
  const wrappedCallback = callback
609
720
  ? (error, response, options, rawResponse) => {
@@ -611,12 +722,16 @@ class ChatServiceClient {
611
722
  callback(error, response, options, rawResponse); // We verified callback above.
612
723
  }
613
724
  : undefined;
614
- return this.innerApiCalls.getSpace(request, options, wrappedCallback)
725
+ return this.innerApiCalls
726
+ .getSpace(request, options, wrappedCallback)
615
727
  ?.then(([response, options, rawResponse]) => {
616
728
  this._log.info('getSpace response %j', response);
617
729
  return [response, options, rawResponse];
618
- }).catch((error) => {
619
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
730
+ })
731
+ .catch((error) => {
732
+ if (error &&
733
+ 'statusDetails' in error &&
734
+ error.statusDetails instanceof Array) {
620
735
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
621
736
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
622
737
  }
@@ -636,7 +751,9 @@ class ChatServiceClient {
636
751
  options = options || {};
637
752
  options.otherArgs = options.otherArgs || {};
638
753
  options.otherArgs.headers = options.otherArgs.headers || {};
639
- this.initialize().catch(err => { throw err; });
754
+ this.initialize().catch((err) => {
755
+ throw err;
756
+ });
640
757
  this._log.info('createSpace request %j', request);
641
758
  const wrappedCallback = callback
642
759
  ? (error, response, options, rawResponse) => {
@@ -644,12 +761,16 @@ class ChatServiceClient {
644
761
  callback(error, response, options, rawResponse); // We verified callback above.
645
762
  }
646
763
  : undefined;
647
- return this.innerApiCalls.createSpace(request, options, wrappedCallback)
764
+ return this.innerApiCalls
765
+ .createSpace(request, options, wrappedCallback)
648
766
  ?.then(([response, options, rawResponse]) => {
649
767
  this._log.info('createSpace response %j', response);
650
768
  return [response, options, rawResponse];
651
- }).catch((error) => {
652
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
769
+ })
770
+ .catch((error) => {
771
+ if (error &&
772
+ 'statusDetails' in error &&
773
+ error.statusDetails instanceof Array) {
653
774
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
654
775
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
655
776
  }
@@ -669,7 +790,9 @@ class ChatServiceClient {
669
790
  options = options || {};
670
791
  options.otherArgs = options.otherArgs || {};
671
792
  options.otherArgs.headers = options.otherArgs.headers || {};
672
- this.initialize().catch(err => { throw err; });
793
+ this.initialize().catch((err) => {
794
+ throw err;
795
+ });
673
796
  this._log.info('setUpSpace request %j', request);
674
797
  const wrappedCallback = callback
675
798
  ? (error, response, options, rawResponse) => {
@@ -677,12 +800,16 @@ class ChatServiceClient {
677
800
  callback(error, response, options, rawResponse); // We verified callback above.
678
801
  }
679
802
  : undefined;
680
- return this.innerApiCalls.setUpSpace(request, options, wrappedCallback)
803
+ return this.innerApiCalls
804
+ .setUpSpace(request, options, wrappedCallback)
681
805
  ?.then(([response, options, rawResponse]) => {
682
806
  this._log.info('setUpSpace response %j', response);
683
807
  return [response, options, rawResponse];
684
- }).catch((error) => {
685
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
808
+ })
809
+ .catch((error) => {
810
+ if (error &&
811
+ 'statusDetails' in error &&
812
+ error.statusDetails instanceof Array) {
686
813
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
687
814
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
688
815
  }
@@ -702,10 +829,13 @@ class ChatServiceClient {
702
829
  options = options || {};
703
830
  options.otherArgs = options.otherArgs || {};
704
831
  options.otherArgs.headers = options.otherArgs.headers || {};
705
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
706
- 'space.name': request.space.name ?? '',
832
+ options.otherArgs.headers['x-goog-request-params'] =
833
+ this._gaxModule.routingHeader.fromParams({
834
+ 'space.name': request.space.name ?? '',
835
+ });
836
+ this.initialize().catch((err) => {
837
+ throw err;
707
838
  });
708
- this.initialize().catch(err => { throw err; });
709
839
  this._log.info('updateSpace request %j', request);
710
840
  const wrappedCallback = callback
711
841
  ? (error, response, options, rawResponse) => {
@@ -713,12 +843,16 @@ class ChatServiceClient {
713
843
  callback(error, response, options, rawResponse); // We verified callback above.
714
844
  }
715
845
  : undefined;
716
- return this.innerApiCalls.updateSpace(request, options, wrappedCallback)
846
+ return this.innerApiCalls
847
+ .updateSpace(request, options, wrappedCallback)
717
848
  ?.then(([response, options, rawResponse]) => {
718
849
  this._log.info('updateSpace response %j', response);
719
850
  return [response, options, rawResponse];
720
- }).catch((error) => {
721
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
851
+ })
852
+ .catch((error) => {
853
+ if (error &&
854
+ 'statusDetails' in error &&
855
+ error.statusDetails instanceof Array) {
722
856
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
723
857
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
724
858
  }
@@ -738,10 +872,13 @@ class ChatServiceClient {
738
872
  options = options || {};
739
873
  options.otherArgs = options.otherArgs || {};
740
874
  options.otherArgs.headers = options.otherArgs.headers || {};
741
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
742
- 'name': request.name ?? '',
875
+ options.otherArgs.headers['x-goog-request-params'] =
876
+ this._gaxModule.routingHeader.fromParams({
877
+ name: request.name ?? '',
878
+ });
879
+ this.initialize().catch((err) => {
880
+ throw err;
743
881
  });
744
- this.initialize().catch(err => { throw err; });
745
882
  this._log.info('deleteSpace request %j', request);
746
883
  const wrappedCallback = callback
747
884
  ? (error, response, options, rawResponse) => {
@@ -749,12 +886,16 @@ class ChatServiceClient {
749
886
  callback(error, response, options, rawResponse); // We verified callback above.
750
887
  }
751
888
  : undefined;
752
- return this.innerApiCalls.deleteSpace(request, options, wrappedCallback)
889
+ return this.innerApiCalls
890
+ .deleteSpace(request, options, wrappedCallback)
753
891
  ?.then(([response, options, rawResponse]) => {
754
892
  this._log.info('deleteSpace response %j', response);
755
893
  return [response, options, rawResponse];
756
- }).catch((error) => {
757
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
894
+ })
895
+ .catch((error) => {
896
+ if (error &&
897
+ 'statusDetails' in error &&
898
+ error.statusDetails instanceof Array) {
758
899
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
759
900
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
760
901
  }
@@ -774,10 +915,13 @@ class ChatServiceClient {
774
915
  options = options || {};
775
916
  options.otherArgs = options.otherArgs || {};
776
917
  options.otherArgs.headers = options.otherArgs.headers || {};
777
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
778
- 'name': request.name ?? '',
918
+ options.otherArgs.headers['x-goog-request-params'] =
919
+ this._gaxModule.routingHeader.fromParams({
920
+ name: request.name ?? '',
921
+ });
922
+ this.initialize().catch((err) => {
923
+ throw err;
779
924
  });
780
- this.initialize().catch(err => { throw err; });
781
925
  this._log.info('completeImportSpace request %j', request);
782
926
  const wrappedCallback = callback
783
927
  ? (error, response, options, rawResponse) => {
@@ -785,12 +929,16 @@ class ChatServiceClient {
785
929
  callback(error, response, options, rawResponse); // We verified callback above.
786
930
  }
787
931
  : undefined;
788
- return this.innerApiCalls.completeImportSpace(request, options, wrappedCallback)
932
+ return this.innerApiCalls
933
+ .completeImportSpace(request, options, wrappedCallback)
789
934
  ?.then(([response, options, rawResponse]) => {
790
935
  this._log.info('completeImportSpace response %j', response);
791
936
  return [response, options, rawResponse];
792
- }).catch((error) => {
793
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
937
+ })
938
+ .catch((error) => {
939
+ if (error &&
940
+ 'statusDetails' in error &&
941
+ error.statusDetails instanceof Array) {
794
942
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
795
943
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
796
944
  }
@@ -810,7 +958,9 @@ class ChatServiceClient {
810
958
  options = options || {};
811
959
  options.otherArgs = options.otherArgs || {};
812
960
  options.otherArgs.headers = options.otherArgs.headers || {};
813
- this.initialize().catch(err => { throw err; });
961
+ this.initialize().catch((err) => {
962
+ throw err;
963
+ });
814
964
  this._log.info('findDirectMessage request %j', request);
815
965
  const wrappedCallback = callback
816
966
  ? (error, response, options, rawResponse) => {
@@ -818,12 +968,16 @@ class ChatServiceClient {
818
968
  callback(error, response, options, rawResponse); // We verified callback above.
819
969
  }
820
970
  : undefined;
821
- return this.innerApiCalls.findDirectMessage(request, options, wrappedCallback)
971
+ return this.innerApiCalls
972
+ .findDirectMessage(request, options, wrappedCallback)
822
973
  ?.then(([response, options, rawResponse]) => {
823
974
  this._log.info('findDirectMessage response %j', response);
824
975
  return [response, options, rawResponse];
825
- }).catch((error) => {
826
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
976
+ })
977
+ .catch((error) => {
978
+ if (error &&
979
+ 'statusDetails' in error &&
980
+ error.statusDetails instanceof Array) {
827
981
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
828
982
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
829
983
  }
@@ -843,10 +997,13 @@ class ChatServiceClient {
843
997
  options = options || {};
844
998
  options.otherArgs = options.otherArgs || {};
845
999
  options.otherArgs.headers = options.otherArgs.headers || {};
846
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
847
- 'parent': request.parent ?? '',
1000
+ options.otherArgs.headers['x-goog-request-params'] =
1001
+ this._gaxModule.routingHeader.fromParams({
1002
+ parent: request.parent ?? '',
1003
+ });
1004
+ this.initialize().catch((err) => {
1005
+ throw err;
848
1006
  });
849
- this.initialize().catch(err => { throw err; });
850
1007
  this._log.info('createMembership request %j', request);
851
1008
  const wrappedCallback = callback
852
1009
  ? (error, response, options, rawResponse) => {
@@ -854,12 +1011,16 @@ class ChatServiceClient {
854
1011
  callback(error, response, options, rawResponse); // We verified callback above.
855
1012
  }
856
1013
  : undefined;
857
- return this.innerApiCalls.createMembership(request, options, wrappedCallback)
1014
+ return this.innerApiCalls
1015
+ .createMembership(request, options, wrappedCallback)
858
1016
  ?.then(([response, options, rawResponse]) => {
859
1017
  this._log.info('createMembership response %j', response);
860
1018
  return [response, options, rawResponse];
861
- }).catch((error) => {
862
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1019
+ })
1020
+ .catch((error) => {
1021
+ if (error &&
1022
+ 'statusDetails' in error &&
1023
+ error.statusDetails instanceof Array) {
863
1024
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
864
1025
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
865
1026
  }
@@ -879,10 +1040,13 @@ class ChatServiceClient {
879
1040
  options = options || {};
880
1041
  options.otherArgs = options.otherArgs || {};
881
1042
  options.otherArgs.headers = options.otherArgs.headers || {};
882
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
883
- 'membership.name': request.membership.name ?? '',
1043
+ options.otherArgs.headers['x-goog-request-params'] =
1044
+ this._gaxModule.routingHeader.fromParams({
1045
+ 'membership.name': request.membership.name ?? '',
1046
+ });
1047
+ this.initialize().catch((err) => {
1048
+ throw err;
884
1049
  });
885
- this.initialize().catch(err => { throw err; });
886
1050
  this._log.info('updateMembership request %j', request);
887
1051
  const wrappedCallback = callback
888
1052
  ? (error, response, options, rawResponse) => {
@@ -890,12 +1054,16 @@ class ChatServiceClient {
890
1054
  callback(error, response, options, rawResponse); // We verified callback above.
891
1055
  }
892
1056
  : undefined;
893
- return this.innerApiCalls.updateMembership(request, options, wrappedCallback)
1057
+ return this.innerApiCalls
1058
+ .updateMembership(request, options, wrappedCallback)
894
1059
  ?.then(([response, options, rawResponse]) => {
895
1060
  this._log.info('updateMembership response %j', response);
896
1061
  return [response, options, rawResponse];
897
- }).catch((error) => {
898
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1062
+ })
1063
+ .catch((error) => {
1064
+ if (error &&
1065
+ 'statusDetails' in error &&
1066
+ error.statusDetails instanceof Array) {
899
1067
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
900
1068
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
901
1069
  }
@@ -915,10 +1083,13 @@ class ChatServiceClient {
915
1083
  options = options || {};
916
1084
  options.otherArgs = options.otherArgs || {};
917
1085
  options.otherArgs.headers = options.otherArgs.headers || {};
918
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
919
- 'name': request.name ?? '',
1086
+ options.otherArgs.headers['x-goog-request-params'] =
1087
+ this._gaxModule.routingHeader.fromParams({
1088
+ name: request.name ?? '',
1089
+ });
1090
+ this.initialize().catch((err) => {
1091
+ throw err;
920
1092
  });
921
- this.initialize().catch(err => { throw err; });
922
1093
  this._log.info('deleteMembership request %j', request);
923
1094
  const wrappedCallback = callback
924
1095
  ? (error, response, options, rawResponse) => {
@@ -926,12 +1097,16 @@ class ChatServiceClient {
926
1097
  callback(error, response, options, rawResponse); // We verified callback above.
927
1098
  }
928
1099
  : undefined;
929
- return this.innerApiCalls.deleteMembership(request, options, wrappedCallback)
1100
+ return this.innerApiCalls
1101
+ .deleteMembership(request, options, wrappedCallback)
930
1102
  ?.then(([response, options, rawResponse]) => {
931
1103
  this._log.info('deleteMembership response %j', response);
932
1104
  return [response, options, rawResponse];
933
- }).catch((error) => {
934
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1105
+ })
1106
+ .catch((error) => {
1107
+ if (error &&
1108
+ 'statusDetails' in error &&
1109
+ error.statusDetails instanceof Array) {
935
1110
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
936
1111
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
937
1112
  }
@@ -951,10 +1126,13 @@ class ChatServiceClient {
951
1126
  options = options || {};
952
1127
  options.otherArgs = options.otherArgs || {};
953
1128
  options.otherArgs.headers = options.otherArgs.headers || {};
954
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
955
- 'parent': request.parent ?? '',
1129
+ options.otherArgs.headers['x-goog-request-params'] =
1130
+ this._gaxModule.routingHeader.fromParams({
1131
+ parent: request.parent ?? '',
1132
+ });
1133
+ this.initialize().catch((err) => {
1134
+ throw err;
956
1135
  });
957
- this.initialize().catch(err => { throw err; });
958
1136
  this._log.info('createReaction request %j', request);
959
1137
  const wrappedCallback = callback
960
1138
  ? (error, response, options, rawResponse) => {
@@ -962,12 +1140,16 @@ class ChatServiceClient {
962
1140
  callback(error, response, options, rawResponse); // We verified callback above.
963
1141
  }
964
1142
  : undefined;
965
- return this.innerApiCalls.createReaction(request, options, wrappedCallback)
1143
+ return this.innerApiCalls
1144
+ .createReaction(request, options, wrappedCallback)
966
1145
  ?.then(([response, options, rawResponse]) => {
967
1146
  this._log.info('createReaction response %j', response);
968
1147
  return [response, options, rawResponse];
969
- }).catch((error) => {
970
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1148
+ })
1149
+ .catch((error) => {
1150
+ if (error &&
1151
+ 'statusDetails' in error &&
1152
+ error.statusDetails instanceof Array) {
971
1153
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
972
1154
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
973
1155
  }
@@ -987,10 +1169,13 @@ class ChatServiceClient {
987
1169
  options = options || {};
988
1170
  options.otherArgs = options.otherArgs || {};
989
1171
  options.otherArgs.headers = options.otherArgs.headers || {};
990
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
991
- 'name': request.name ?? '',
1172
+ options.otherArgs.headers['x-goog-request-params'] =
1173
+ this._gaxModule.routingHeader.fromParams({
1174
+ name: request.name ?? '',
1175
+ });
1176
+ this.initialize().catch((err) => {
1177
+ throw err;
992
1178
  });
993
- this.initialize().catch(err => { throw err; });
994
1179
  this._log.info('deleteReaction request %j', request);
995
1180
  const wrappedCallback = callback
996
1181
  ? (error, response, options, rawResponse) => {
@@ -998,12 +1183,16 @@ class ChatServiceClient {
998
1183
  callback(error, response, options, rawResponse); // We verified callback above.
999
1184
  }
1000
1185
  : undefined;
1001
- return this.innerApiCalls.deleteReaction(request, options, wrappedCallback)
1186
+ return this.innerApiCalls
1187
+ .deleteReaction(request, options, wrappedCallback)
1002
1188
  ?.then(([response, options, rawResponse]) => {
1003
1189
  this._log.info('deleteReaction response %j', response);
1004
1190
  return [response, options, rawResponse];
1005
- }).catch((error) => {
1006
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1191
+ })
1192
+ .catch((error) => {
1193
+ if (error &&
1194
+ 'statusDetails' in error &&
1195
+ error.statusDetails instanceof Array) {
1007
1196
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1008
1197
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1009
1198
  }
@@ -1023,7 +1212,9 @@ class ChatServiceClient {
1023
1212
  options = options || {};
1024
1213
  options.otherArgs = options.otherArgs || {};
1025
1214
  options.otherArgs.headers = options.otherArgs.headers || {};
1026
- this.initialize().catch(err => { throw err; });
1215
+ this.initialize().catch((err) => {
1216
+ throw err;
1217
+ });
1027
1218
  this._log.info('createCustomEmoji request %j', request);
1028
1219
  const wrappedCallback = callback
1029
1220
  ? (error, response, options, rawResponse) => {
@@ -1031,12 +1222,16 @@ class ChatServiceClient {
1031
1222
  callback(error, response, options, rawResponse); // We verified callback above.
1032
1223
  }
1033
1224
  : undefined;
1034
- return this.innerApiCalls.createCustomEmoji(request, options, wrappedCallback)
1225
+ return this.innerApiCalls
1226
+ .createCustomEmoji(request, options, wrappedCallback)
1035
1227
  ?.then(([response, options, rawResponse]) => {
1036
1228
  this._log.info('createCustomEmoji response %j', response);
1037
1229
  return [response, options, rawResponse];
1038
- }).catch((error) => {
1039
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1230
+ })
1231
+ .catch((error) => {
1232
+ if (error &&
1233
+ 'statusDetails' in error &&
1234
+ error.statusDetails instanceof Array) {
1040
1235
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1041
1236
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1042
1237
  }
@@ -1056,10 +1251,13 @@ class ChatServiceClient {
1056
1251
  options = options || {};
1057
1252
  options.otherArgs = options.otherArgs || {};
1058
1253
  options.otherArgs.headers = options.otherArgs.headers || {};
1059
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1060
- 'name': request.name ?? '',
1254
+ options.otherArgs.headers['x-goog-request-params'] =
1255
+ this._gaxModule.routingHeader.fromParams({
1256
+ name: request.name ?? '',
1257
+ });
1258
+ this.initialize().catch((err) => {
1259
+ throw err;
1061
1260
  });
1062
- this.initialize().catch(err => { throw err; });
1063
1261
  this._log.info('getCustomEmoji request %j', request);
1064
1262
  const wrappedCallback = callback
1065
1263
  ? (error, response, options, rawResponse) => {
@@ -1067,12 +1265,16 @@ class ChatServiceClient {
1067
1265
  callback(error, response, options, rawResponse); // We verified callback above.
1068
1266
  }
1069
1267
  : undefined;
1070
- return this.innerApiCalls.getCustomEmoji(request, options, wrappedCallback)
1268
+ return this.innerApiCalls
1269
+ .getCustomEmoji(request, options, wrappedCallback)
1071
1270
  ?.then(([response, options, rawResponse]) => {
1072
1271
  this._log.info('getCustomEmoji response %j', response);
1073
1272
  return [response, options, rawResponse];
1074
- }).catch((error) => {
1075
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1273
+ })
1274
+ .catch((error) => {
1275
+ if (error &&
1276
+ 'statusDetails' in error &&
1277
+ error.statusDetails instanceof Array) {
1076
1278
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1077
1279
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1078
1280
  }
@@ -1092,10 +1294,13 @@ class ChatServiceClient {
1092
1294
  options = options || {};
1093
1295
  options.otherArgs = options.otherArgs || {};
1094
1296
  options.otherArgs.headers = options.otherArgs.headers || {};
1095
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1096
- 'name': request.name ?? '',
1297
+ options.otherArgs.headers['x-goog-request-params'] =
1298
+ this._gaxModule.routingHeader.fromParams({
1299
+ name: request.name ?? '',
1300
+ });
1301
+ this.initialize().catch((err) => {
1302
+ throw err;
1097
1303
  });
1098
- this.initialize().catch(err => { throw err; });
1099
1304
  this._log.info('deleteCustomEmoji request %j', request);
1100
1305
  const wrappedCallback = callback
1101
1306
  ? (error, response, options, rawResponse) => {
@@ -1103,12 +1308,16 @@ class ChatServiceClient {
1103
1308
  callback(error, response, options, rawResponse); // We verified callback above.
1104
1309
  }
1105
1310
  : undefined;
1106
- return this.innerApiCalls.deleteCustomEmoji(request, options, wrappedCallback)
1311
+ return this.innerApiCalls
1312
+ .deleteCustomEmoji(request, options, wrappedCallback)
1107
1313
  ?.then(([response, options, rawResponse]) => {
1108
1314
  this._log.info('deleteCustomEmoji response %j', response);
1109
1315
  return [response, options, rawResponse];
1110
- }).catch((error) => {
1111
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1316
+ })
1317
+ .catch((error) => {
1318
+ if (error &&
1319
+ 'statusDetails' in error &&
1320
+ error.statusDetails instanceof Array) {
1112
1321
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1113
1322
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1114
1323
  }
@@ -1128,10 +1337,13 @@ class ChatServiceClient {
1128
1337
  options = options || {};
1129
1338
  options.otherArgs = options.otherArgs || {};
1130
1339
  options.otherArgs.headers = options.otherArgs.headers || {};
1131
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1132
- 'name': request.name ?? '',
1340
+ options.otherArgs.headers['x-goog-request-params'] =
1341
+ this._gaxModule.routingHeader.fromParams({
1342
+ name: request.name ?? '',
1343
+ });
1344
+ this.initialize().catch((err) => {
1345
+ throw err;
1133
1346
  });
1134
- this.initialize().catch(err => { throw err; });
1135
1347
  this._log.info('getSpaceReadState request %j', request);
1136
1348
  const wrappedCallback = callback
1137
1349
  ? (error, response, options, rawResponse) => {
@@ -1139,12 +1351,16 @@ class ChatServiceClient {
1139
1351
  callback(error, response, options, rawResponse); // We verified callback above.
1140
1352
  }
1141
1353
  : undefined;
1142
- return this.innerApiCalls.getSpaceReadState(request, options, wrappedCallback)
1354
+ return this.innerApiCalls
1355
+ .getSpaceReadState(request, options, wrappedCallback)
1143
1356
  ?.then(([response, options, rawResponse]) => {
1144
1357
  this._log.info('getSpaceReadState response %j', response);
1145
1358
  return [response, options, rawResponse];
1146
- }).catch((error) => {
1147
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1359
+ })
1360
+ .catch((error) => {
1361
+ if (error &&
1362
+ 'statusDetails' in error &&
1363
+ error.statusDetails instanceof Array) {
1148
1364
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1149
1365
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1150
1366
  }
@@ -1164,10 +1380,13 @@ class ChatServiceClient {
1164
1380
  options = options || {};
1165
1381
  options.otherArgs = options.otherArgs || {};
1166
1382
  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 ?? '',
1383
+ options.otherArgs.headers['x-goog-request-params'] =
1384
+ this._gaxModule.routingHeader.fromParams({
1385
+ 'space_read_state.name': request.spaceReadState.name ?? '',
1386
+ });
1387
+ this.initialize().catch((err) => {
1388
+ throw err;
1169
1389
  });
1170
- this.initialize().catch(err => { throw err; });
1171
1390
  this._log.info('updateSpaceReadState request %j', request);
1172
1391
  const wrappedCallback = callback
1173
1392
  ? (error, response, options, rawResponse) => {
@@ -1175,12 +1394,16 @@ class ChatServiceClient {
1175
1394
  callback(error, response, options, rawResponse); // We verified callback above.
1176
1395
  }
1177
1396
  : undefined;
1178
- return this.innerApiCalls.updateSpaceReadState(request, options, wrappedCallback)
1397
+ return this.innerApiCalls
1398
+ .updateSpaceReadState(request, options, wrappedCallback)
1179
1399
  ?.then(([response, options, rawResponse]) => {
1180
1400
  this._log.info('updateSpaceReadState response %j', response);
1181
1401
  return [response, options, rawResponse];
1182
- }).catch((error) => {
1183
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1402
+ })
1403
+ .catch((error) => {
1404
+ if (error &&
1405
+ 'statusDetails' in error &&
1406
+ error.statusDetails instanceof Array) {
1184
1407
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1185
1408
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1186
1409
  }
@@ -1200,10 +1423,13 @@ class ChatServiceClient {
1200
1423
  options = options || {};
1201
1424
  options.otherArgs = options.otherArgs || {};
1202
1425
  options.otherArgs.headers = options.otherArgs.headers || {};
1203
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1204
- 'name': request.name ?? '',
1426
+ options.otherArgs.headers['x-goog-request-params'] =
1427
+ this._gaxModule.routingHeader.fromParams({
1428
+ name: request.name ?? '',
1429
+ });
1430
+ this.initialize().catch((err) => {
1431
+ throw err;
1205
1432
  });
1206
- this.initialize().catch(err => { throw err; });
1207
1433
  this._log.info('getThreadReadState request %j', request);
1208
1434
  const wrappedCallback = callback
1209
1435
  ? (error, response, options, rawResponse) => {
@@ -1211,12 +1437,231 @@ class ChatServiceClient {
1211
1437
  callback(error, response, options, rawResponse); // We verified callback above.
1212
1438
  }
1213
1439
  : undefined;
1214
- return this.innerApiCalls.getThreadReadState(request, options, wrappedCallback)
1440
+ return this.innerApiCalls
1441
+ .getThreadReadState(request, options, wrappedCallback)
1215
1442
  ?.then(([response, options, rawResponse]) => {
1216
1443
  this._log.info('getThreadReadState response %j', response);
1217
1444
  return [response, options, rawResponse];
1218
- }).catch((error) => {
1219
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1445
+ })
1446
+ .catch((error) => {
1447
+ if (error &&
1448
+ 'statusDetails' in error &&
1449
+ error.statusDetails instanceof Array) {
1450
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1451
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1452
+ }
1453
+ throw error;
1454
+ });
1455
+ }
1456
+ getAvailability(request, optionsOrCallback, callback) {
1457
+ request = request || {};
1458
+ let options;
1459
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1460
+ callback = optionsOrCallback;
1461
+ options = {};
1462
+ }
1463
+ else {
1464
+ options = optionsOrCallback;
1465
+ }
1466
+ options = options || {};
1467
+ options.otherArgs = options.otherArgs || {};
1468
+ options.otherArgs.headers = options.otherArgs.headers || {};
1469
+ options.otherArgs.headers['x-goog-request-params'] =
1470
+ this._gaxModule.routingHeader.fromParams({
1471
+ name: request.name ?? '',
1472
+ });
1473
+ this.initialize().catch((err) => {
1474
+ throw err;
1475
+ });
1476
+ this._log.info('getAvailability request %j', request);
1477
+ const wrappedCallback = callback
1478
+ ? (error, response, options, rawResponse) => {
1479
+ this._log.info('getAvailability response %j', response);
1480
+ callback(error, response, options, rawResponse); // We verified callback above.
1481
+ }
1482
+ : undefined;
1483
+ return this.innerApiCalls
1484
+ .getAvailability(request, options, wrappedCallback)
1485
+ ?.then(([response, options, rawResponse]) => {
1486
+ this._log.info('getAvailability response %j', response);
1487
+ return [response, options, rawResponse];
1488
+ })
1489
+ .catch((error) => {
1490
+ if (error &&
1491
+ 'statusDetails' in error &&
1492
+ error.statusDetails instanceof Array) {
1493
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1494
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1495
+ }
1496
+ throw error;
1497
+ });
1498
+ }
1499
+ markAsActive(request, optionsOrCallback, callback) {
1500
+ request = request || {};
1501
+ let options;
1502
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1503
+ callback = optionsOrCallback;
1504
+ options = {};
1505
+ }
1506
+ else {
1507
+ options = optionsOrCallback;
1508
+ }
1509
+ options = options || {};
1510
+ options.otherArgs = options.otherArgs || {};
1511
+ options.otherArgs.headers = options.otherArgs.headers || {};
1512
+ options.otherArgs.headers['x-goog-request-params'] =
1513
+ this._gaxModule.routingHeader.fromParams({
1514
+ name: request.name ?? '',
1515
+ });
1516
+ this.initialize().catch((err) => {
1517
+ throw err;
1518
+ });
1519
+ this._log.info('markAsActive request %j', request);
1520
+ const wrappedCallback = callback
1521
+ ? (error, response, options, rawResponse) => {
1522
+ this._log.info('markAsActive response %j', response);
1523
+ callback(error, response, options, rawResponse); // We verified callback above.
1524
+ }
1525
+ : undefined;
1526
+ return this.innerApiCalls
1527
+ .markAsActive(request, options, wrappedCallback)
1528
+ ?.then(([response, options, rawResponse]) => {
1529
+ this._log.info('markAsActive response %j', response);
1530
+ return [response, options, rawResponse];
1531
+ })
1532
+ .catch((error) => {
1533
+ if (error &&
1534
+ 'statusDetails' in error &&
1535
+ error.statusDetails instanceof Array) {
1536
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1537
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1538
+ }
1539
+ throw error;
1540
+ });
1541
+ }
1542
+ markAsAway(request, optionsOrCallback, callback) {
1543
+ request = request || {};
1544
+ let options;
1545
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1546
+ callback = optionsOrCallback;
1547
+ options = {};
1548
+ }
1549
+ else {
1550
+ options = optionsOrCallback;
1551
+ }
1552
+ options = options || {};
1553
+ options.otherArgs = options.otherArgs || {};
1554
+ options.otherArgs.headers = options.otherArgs.headers || {};
1555
+ options.otherArgs.headers['x-goog-request-params'] =
1556
+ this._gaxModule.routingHeader.fromParams({
1557
+ name: request.name ?? '',
1558
+ });
1559
+ this.initialize().catch((err) => {
1560
+ throw err;
1561
+ });
1562
+ this._log.info('markAsAway request %j', request);
1563
+ const wrappedCallback = callback
1564
+ ? (error, response, options, rawResponse) => {
1565
+ this._log.info('markAsAway response %j', response);
1566
+ callback(error, response, options, rawResponse); // We verified callback above.
1567
+ }
1568
+ : undefined;
1569
+ return this.innerApiCalls
1570
+ .markAsAway(request, options, wrappedCallback)
1571
+ ?.then(([response, options, rawResponse]) => {
1572
+ this._log.info('markAsAway response %j', response);
1573
+ return [response, options, rawResponse];
1574
+ })
1575
+ .catch((error) => {
1576
+ if (error &&
1577
+ 'statusDetails' in error &&
1578
+ error.statusDetails instanceof Array) {
1579
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1580
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1581
+ }
1582
+ throw error;
1583
+ });
1584
+ }
1585
+ markAsDoNotDisturb(request, optionsOrCallback, callback) {
1586
+ request = request || {};
1587
+ let options;
1588
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1589
+ callback = optionsOrCallback;
1590
+ options = {};
1591
+ }
1592
+ else {
1593
+ options = optionsOrCallback;
1594
+ }
1595
+ options = options || {};
1596
+ options.otherArgs = options.otherArgs || {};
1597
+ options.otherArgs.headers = options.otherArgs.headers || {};
1598
+ options.otherArgs.headers['x-goog-request-params'] =
1599
+ this._gaxModule.routingHeader.fromParams({
1600
+ name: request.name ?? '',
1601
+ });
1602
+ this.initialize().catch((err) => {
1603
+ throw err;
1604
+ });
1605
+ this._log.info('markAsDoNotDisturb request %j', request);
1606
+ const wrappedCallback = callback
1607
+ ? (error, response, options, rawResponse) => {
1608
+ this._log.info('markAsDoNotDisturb response %j', response);
1609
+ callback(error, response, options, rawResponse); // We verified callback above.
1610
+ }
1611
+ : undefined;
1612
+ return this.innerApiCalls
1613
+ .markAsDoNotDisturb(request, options, wrappedCallback)
1614
+ ?.then(([response, options, rawResponse]) => {
1615
+ this._log.info('markAsDoNotDisturb response %j', response);
1616
+ return [response, options, rawResponse];
1617
+ })
1618
+ .catch((error) => {
1619
+ if (error &&
1620
+ 'statusDetails' in error &&
1621
+ error.statusDetails instanceof Array) {
1622
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1623
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1624
+ }
1625
+ throw error;
1626
+ });
1627
+ }
1628
+ updateAvailability(request, optionsOrCallback, callback) {
1629
+ request = request || {};
1630
+ let options;
1631
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1632
+ callback = optionsOrCallback;
1633
+ options = {};
1634
+ }
1635
+ else {
1636
+ options = optionsOrCallback;
1637
+ }
1638
+ options = options || {};
1639
+ options.otherArgs = options.otherArgs || {};
1640
+ options.otherArgs.headers = options.otherArgs.headers || {};
1641
+ options.otherArgs.headers['x-goog-request-params'] =
1642
+ this._gaxModule.routingHeader.fromParams({
1643
+ 'availability.name': request.availability.name ?? '',
1644
+ });
1645
+ this.initialize().catch((err) => {
1646
+ throw err;
1647
+ });
1648
+ this._log.info('updateAvailability request %j', request);
1649
+ const wrappedCallback = callback
1650
+ ? (error, response, options, rawResponse) => {
1651
+ this._log.info('updateAvailability response %j', response);
1652
+ callback(error, response, options, rawResponse); // We verified callback above.
1653
+ }
1654
+ : undefined;
1655
+ return this.innerApiCalls
1656
+ .updateAvailability(request, options, wrappedCallback)
1657
+ ?.then(([response, options, rawResponse]) => {
1658
+ this._log.info('updateAvailability response %j', response);
1659
+ return [response, options, rawResponse];
1660
+ })
1661
+ .catch((error) => {
1662
+ if (error &&
1663
+ 'statusDetails' in error &&
1664
+ error.statusDetails instanceof Array) {
1220
1665
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1221
1666
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1222
1667
  }
@@ -1236,10 +1681,13 @@ class ChatServiceClient {
1236
1681
  options = options || {};
1237
1682
  options.otherArgs = options.otherArgs || {};
1238
1683
  options.otherArgs.headers = options.otherArgs.headers || {};
1239
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1240
- 'name': request.name ?? '',
1684
+ options.otherArgs.headers['x-goog-request-params'] =
1685
+ this._gaxModule.routingHeader.fromParams({
1686
+ name: request.name ?? '',
1687
+ });
1688
+ this.initialize().catch((err) => {
1689
+ throw err;
1241
1690
  });
1242
- this.initialize().catch(err => { throw err; });
1243
1691
  this._log.info('getSpaceEvent request %j', request);
1244
1692
  const wrappedCallback = callback
1245
1693
  ? (error, response, options, rawResponse) => {
@@ -1247,12 +1695,16 @@ class ChatServiceClient {
1247
1695
  callback(error, response, options, rawResponse); // We verified callback above.
1248
1696
  }
1249
1697
  : undefined;
1250
- return this.innerApiCalls.getSpaceEvent(request, options, wrappedCallback)
1698
+ return this.innerApiCalls
1699
+ .getSpaceEvent(request, options, wrappedCallback)
1251
1700
  ?.then(([response, options, rawResponse]) => {
1252
1701
  this._log.info('getSpaceEvent response %j', response);
1253
1702
  return [response, options, rawResponse];
1254
- }).catch((error) => {
1255
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1703
+ })
1704
+ .catch((error) => {
1705
+ if (error &&
1706
+ 'statusDetails' in error &&
1707
+ error.statusDetails instanceof Array) {
1256
1708
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1257
1709
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1258
1710
  }
@@ -1272,10 +1724,13 @@ class ChatServiceClient {
1272
1724
  options = options || {};
1273
1725
  options.otherArgs = options.otherArgs || {};
1274
1726
  options.otherArgs.headers = options.otherArgs.headers || {};
1275
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1276
- 'name': request.name ?? '',
1727
+ options.otherArgs.headers['x-goog-request-params'] =
1728
+ this._gaxModule.routingHeader.fromParams({
1729
+ name: request.name ?? '',
1730
+ });
1731
+ this.initialize().catch((err) => {
1732
+ throw err;
1277
1733
  });
1278
- this.initialize().catch(err => { throw err; });
1279
1734
  this._log.info('getSpaceNotificationSetting request %j', request);
1280
1735
  const wrappedCallback = callback
1281
1736
  ? (error, response, options, rawResponse) => {
@@ -1283,12 +1738,16 @@ class ChatServiceClient {
1283
1738
  callback(error, response, options, rawResponse); // We verified callback above.
1284
1739
  }
1285
1740
  : undefined;
1286
- return this.innerApiCalls.getSpaceNotificationSetting(request, options, wrappedCallback)
1741
+ return this.innerApiCalls
1742
+ .getSpaceNotificationSetting(request, options, wrappedCallback)
1287
1743
  ?.then(([response, options, rawResponse]) => {
1288
1744
  this._log.info('getSpaceNotificationSetting response %j', response);
1289
1745
  return [response, options, rawResponse];
1290
- }).catch((error) => {
1291
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1746
+ })
1747
+ .catch((error) => {
1748
+ if (error &&
1749
+ 'statusDetails' in error &&
1750
+ error.statusDetails instanceof Array) {
1292
1751
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1293
1752
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1294
1753
  }
@@ -1308,10 +1767,13 @@ class ChatServiceClient {
1308
1767
  options = options || {};
1309
1768
  options.otherArgs = options.otherArgs || {};
1310
1769
  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 ?? '',
1770
+ options.otherArgs.headers['x-goog-request-params'] =
1771
+ this._gaxModule.routingHeader.fromParams({
1772
+ 'space_notification_setting.name': request.spaceNotificationSetting.name ?? '',
1773
+ });
1774
+ this.initialize().catch((err) => {
1775
+ throw err;
1313
1776
  });
1314
- this.initialize().catch(err => { throw err; });
1315
1777
  this._log.info('updateSpaceNotificationSetting request %j', request);
1316
1778
  const wrappedCallback = callback
1317
1779
  ? (error, response, options, rawResponse) => {
@@ -1319,12 +1781,16 @@ class ChatServiceClient {
1319
1781
  callback(error, response, options, rawResponse); // We verified callback above.
1320
1782
  }
1321
1783
  : undefined;
1322
- return this.innerApiCalls.updateSpaceNotificationSetting(request, options, wrappedCallback)
1784
+ return this.innerApiCalls
1785
+ .updateSpaceNotificationSetting(request, options, wrappedCallback)
1323
1786
  ?.then(([response, options, rawResponse]) => {
1324
1787
  this._log.info('updateSpaceNotificationSetting response %j', response);
1325
1788
  return [response, options, rawResponse];
1326
- }).catch((error) => {
1327
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1789
+ })
1790
+ .catch((error) => {
1791
+ if (error &&
1792
+ 'statusDetails' in error &&
1793
+ error.statusDetails instanceof Array) {
1328
1794
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1329
1795
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1330
1796
  }
@@ -1344,10 +1810,13 @@ class ChatServiceClient {
1344
1810
  options = options || {};
1345
1811
  options.otherArgs = options.otherArgs || {};
1346
1812
  options.otherArgs.headers = options.otherArgs.headers || {};
1347
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1348
- 'parent': request.parent ?? '',
1813
+ options.otherArgs.headers['x-goog-request-params'] =
1814
+ this._gaxModule.routingHeader.fromParams({
1815
+ parent: request.parent ?? '',
1816
+ });
1817
+ this.initialize().catch((err) => {
1818
+ throw err;
1349
1819
  });
1350
- this.initialize().catch(err => { throw err; });
1351
1820
  this._log.info('createSection request %j', request);
1352
1821
  const wrappedCallback = callback
1353
1822
  ? (error, response, options, rawResponse) => {
@@ -1355,12 +1824,16 @@ class ChatServiceClient {
1355
1824
  callback(error, response, options, rawResponse); // We verified callback above.
1356
1825
  }
1357
1826
  : undefined;
1358
- return this.innerApiCalls.createSection(request, options, wrappedCallback)
1827
+ return this.innerApiCalls
1828
+ .createSection(request, options, wrappedCallback)
1359
1829
  ?.then(([response, options, rawResponse]) => {
1360
1830
  this._log.info('createSection response %j', response);
1361
1831
  return [response, options, rawResponse];
1362
- }).catch((error) => {
1363
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1832
+ })
1833
+ .catch((error) => {
1834
+ if (error &&
1835
+ 'statusDetails' in error &&
1836
+ error.statusDetails instanceof Array) {
1364
1837
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1365
1838
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1366
1839
  }
@@ -1380,10 +1853,13 @@ class ChatServiceClient {
1380
1853
  options = options || {};
1381
1854
  options.otherArgs = options.otherArgs || {};
1382
1855
  options.otherArgs.headers = options.otherArgs.headers || {};
1383
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1384
- 'name': request.name ?? '',
1856
+ options.otherArgs.headers['x-goog-request-params'] =
1857
+ this._gaxModule.routingHeader.fromParams({
1858
+ name: request.name ?? '',
1859
+ });
1860
+ this.initialize().catch((err) => {
1861
+ throw err;
1385
1862
  });
1386
- this.initialize().catch(err => { throw err; });
1387
1863
  this._log.info('deleteSection request %j', request);
1388
1864
  const wrappedCallback = callback
1389
1865
  ? (error, response, options, rawResponse) => {
@@ -1391,12 +1867,16 @@ class ChatServiceClient {
1391
1867
  callback(error, response, options, rawResponse); // We verified callback above.
1392
1868
  }
1393
1869
  : undefined;
1394
- return this.innerApiCalls.deleteSection(request, options, wrappedCallback)
1870
+ return this.innerApiCalls
1871
+ .deleteSection(request, options, wrappedCallback)
1395
1872
  ?.then(([response, options, rawResponse]) => {
1396
1873
  this._log.info('deleteSection response %j', response);
1397
1874
  return [response, options, rawResponse];
1398
- }).catch((error) => {
1399
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1875
+ })
1876
+ .catch((error) => {
1877
+ if (error &&
1878
+ 'statusDetails' in error &&
1879
+ error.statusDetails instanceof Array) {
1400
1880
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1401
1881
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1402
1882
  }
@@ -1416,10 +1896,13 @@ class ChatServiceClient {
1416
1896
  options = options || {};
1417
1897
  options.otherArgs = options.otherArgs || {};
1418
1898
  options.otherArgs.headers = options.otherArgs.headers || {};
1419
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1420
- 'section.name': request.section.name ?? '',
1899
+ options.otherArgs.headers['x-goog-request-params'] =
1900
+ this._gaxModule.routingHeader.fromParams({
1901
+ 'section.name': request.section.name ?? '',
1902
+ });
1903
+ this.initialize().catch((err) => {
1904
+ throw err;
1421
1905
  });
1422
- this.initialize().catch(err => { throw err; });
1423
1906
  this._log.info('updateSection request %j', request);
1424
1907
  const wrappedCallback = callback
1425
1908
  ? (error, response, options, rawResponse) => {
@@ -1427,12 +1910,16 @@ class ChatServiceClient {
1427
1910
  callback(error, response, options, rawResponse); // We verified callback above.
1428
1911
  }
1429
1912
  : undefined;
1430
- return this.innerApiCalls.updateSection(request, options, wrappedCallback)
1913
+ return this.innerApiCalls
1914
+ .updateSection(request, options, wrappedCallback)
1431
1915
  ?.then(([response, options, rawResponse]) => {
1432
1916
  this._log.info('updateSection response %j', response);
1433
1917
  return [response, options, rawResponse];
1434
- }).catch((error) => {
1435
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1918
+ })
1919
+ .catch((error) => {
1920
+ if (error &&
1921
+ 'statusDetails' in error &&
1922
+ error.statusDetails instanceof Array) {
1436
1923
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1437
1924
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1438
1925
  }
@@ -1452,10 +1939,13 @@ class ChatServiceClient {
1452
1939
  options = options || {};
1453
1940
  options.otherArgs = options.otherArgs || {};
1454
1941
  options.otherArgs.headers = options.otherArgs.headers || {};
1455
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1456
- 'name': request.name ?? '',
1942
+ options.otherArgs.headers['x-goog-request-params'] =
1943
+ this._gaxModule.routingHeader.fromParams({
1944
+ name: request.name ?? '',
1945
+ });
1946
+ this.initialize().catch((err) => {
1947
+ throw err;
1457
1948
  });
1458
- this.initialize().catch(err => { throw err; });
1459
1949
  this._log.info('positionSection request %j', request);
1460
1950
  const wrappedCallback = callback
1461
1951
  ? (error, response, options, rawResponse) => {
@@ -1463,12 +1953,16 @@ class ChatServiceClient {
1463
1953
  callback(error, response, options, rawResponse); // We verified callback above.
1464
1954
  }
1465
1955
  : undefined;
1466
- return this.innerApiCalls.positionSection(request, options, wrappedCallback)
1956
+ return this.innerApiCalls
1957
+ .positionSection(request, options, wrappedCallback)
1467
1958
  ?.then(([response, options, rawResponse]) => {
1468
1959
  this._log.info('positionSection response %j', response);
1469
1960
  return [response, options, rawResponse];
1470
- }).catch((error) => {
1471
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
1961
+ })
1962
+ .catch((error) => {
1963
+ if (error &&
1964
+ 'statusDetails' in error &&
1965
+ error.statusDetails instanceof Array) {
1472
1966
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1473
1967
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1474
1968
  }
@@ -1488,10 +1982,13 @@ class ChatServiceClient {
1488
1982
  options = options || {};
1489
1983
  options.otherArgs = options.otherArgs || {};
1490
1984
  options.otherArgs.headers = options.otherArgs.headers || {};
1491
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1492
- 'name': request.name ?? '',
1985
+ options.otherArgs.headers['x-goog-request-params'] =
1986
+ this._gaxModule.routingHeader.fromParams({
1987
+ name: request.name ?? '',
1988
+ });
1989
+ this.initialize().catch((err) => {
1990
+ throw err;
1493
1991
  });
1494
- this.initialize().catch(err => { throw err; });
1495
1992
  this._log.info('moveSectionItem request %j', request);
1496
1993
  const wrappedCallback = callback
1497
1994
  ? (error, response, options, rawResponse) => {
@@ -1499,12 +1996,16 @@ class ChatServiceClient {
1499
1996
  callback(error, response, options, rawResponse); // We verified callback above.
1500
1997
  }
1501
1998
  : undefined;
1502
- return this.innerApiCalls.moveSectionItem(request, options, wrappedCallback)
1999
+ return this.innerApiCalls
2000
+ .moveSectionItem(request, options, wrappedCallback)
1503
2001
  ?.then(([response, options, rawResponse]) => {
1504
2002
  this._log.info('moveSectionItem response %j', response);
1505
2003
  return [response, options, rawResponse];
1506
- }).catch((error) => {
1507
- if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
2004
+ })
2005
+ .catch((error) => {
2006
+ if (error &&
2007
+ 'statusDetails' in error &&
2008
+ error.statusDetails instanceof Array) {
1508
2009
  const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
1509
2010
  error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
1510
2011
  }
@@ -1524,10 +2025,13 @@ class ChatServiceClient {
1524
2025
  options = options || {};
1525
2026
  options.otherArgs = options.otherArgs || {};
1526
2027
  options.otherArgs.headers = options.otherArgs.headers || {};
1527
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1528
- 'parent': request.parent ?? '',
2028
+ options.otherArgs.headers['x-goog-request-params'] =
2029
+ this._gaxModule.routingHeader.fromParams({
2030
+ parent: request.parent ?? '',
2031
+ });
2032
+ this.initialize().catch((err) => {
2033
+ throw err;
1529
2034
  });
1530
- this.initialize().catch(err => { throw err; });
1531
2035
  const wrappedCallback = callback
1532
2036
  ? (error, values, nextPageRequest, rawResponse) => {
1533
2037
  this._log.info('listMessages values %j', values);
@@ -1634,12 +2138,15 @@ class ChatServiceClient {
1634
2138
  options = options || {};
1635
2139
  options.otherArgs = options.otherArgs || {};
1636
2140
  options.otherArgs.headers = options.otherArgs.headers || {};
1637
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1638
- 'parent': request.parent ?? '',
1639
- });
2141
+ options.otherArgs.headers['x-goog-request-params'] =
2142
+ this._gaxModule.routingHeader.fromParams({
2143
+ parent: request.parent ?? '',
2144
+ });
1640
2145
  const defaultCallSettings = this._defaults['listMessages'];
1641
2146
  const callSettings = defaultCallSettings.merge(options);
1642
- this.initialize().catch(err => { throw err; });
2147
+ this.initialize().catch((err) => {
2148
+ throw err;
2149
+ });
1643
2150
  this._log.info('listMessages stream %j', request);
1644
2151
  return this.descriptors.page.listMessages.createStream(this.innerApiCalls.listMessages, request, callSettings);
1645
2152
  }
@@ -1738,12 +2245,15 @@ class ChatServiceClient {
1738
2245
  options = options || {};
1739
2246
  options.otherArgs = options.otherArgs || {};
1740
2247
  options.otherArgs.headers = options.otherArgs.headers || {};
1741
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1742
- 'parent': request.parent ?? '',
1743
- });
2248
+ options.otherArgs.headers['x-goog-request-params'] =
2249
+ this._gaxModule.routingHeader.fromParams({
2250
+ parent: request.parent ?? '',
2251
+ });
1744
2252
  const defaultCallSettings = this._defaults['listMessages'];
1745
2253
  const callSettings = defaultCallSettings.merge(options);
1746
- this.initialize().catch(err => { throw err; });
2254
+ this.initialize().catch((err) => {
2255
+ throw err;
2256
+ });
1747
2257
  this._log.info('listMessages iterate %j', request);
1748
2258
  return this.descriptors.page.listMessages.asyncIterate(this.innerApiCalls['listMessages'], request, callSettings);
1749
2259
  }
@@ -1760,10 +2270,13 @@ class ChatServiceClient {
1760
2270
  options = options || {};
1761
2271
  options.otherArgs = options.otherArgs || {};
1762
2272
  options.otherArgs.headers = options.otherArgs.headers || {};
1763
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1764
- 'parent': request.parent ?? '',
2273
+ options.otherArgs.headers['x-goog-request-params'] =
2274
+ this._gaxModule.routingHeader.fromParams({
2275
+ parent: request.parent ?? '',
2276
+ });
2277
+ this.initialize().catch((err) => {
2278
+ throw err;
1765
2279
  });
1766
- this.initialize().catch(err => { throw err; });
1767
2280
  const wrappedCallback = callback
1768
2281
  ? (error, values, nextPageRequest, rawResponse) => {
1769
2282
  this._log.info('listMemberships values %j', values);
@@ -1888,12 +2401,15 @@ class ChatServiceClient {
1888
2401
  options = options || {};
1889
2402
  options.otherArgs = options.otherArgs || {};
1890
2403
  options.otherArgs.headers = options.otherArgs.headers || {};
1891
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1892
- 'parent': request.parent ?? '',
1893
- });
2404
+ options.otherArgs.headers['x-goog-request-params'] =
2405
+ this._gaxModule.routingHeader.fromParams({
2406
+ parent: request.parent ?? '',
2407
+ });
1894
2408
  const defaultCallSettings = this._defaults['listMemberships'];
1895
2409
  const callSettings = defaultCallSettings.merge(options);
1896
- this.initialize().catch(err => { throw err; });
2410
+ this.initialize().catch((err) => {
2411
+ throw err;
2412
+ });
1897
2413
  this._log.info('listMemberships stream %j', request);
1898
2414
  return this.descriptors.page.listMemberships.createStream(this.innerApiCalls.listMemberships, request, callSettings);
1899
2415
  }
@@ -2010,12 +2526,15 @@ class ChatServiceClient {
2010
2526
  options = options || {};
2011
2527
  options.otherArgs = options.otherArgs || {};
2012
2528
  options.otherArgs.headers = options.otherArgs.headers || {};
2013
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2014
- 'parent': request.parent ?? '',
2015
- });
2529
+ options.otherArgs.headers['x-goog-request-params'] =
2530
+ this._gaxModule.routingHeader.fromParams({
2531
+ parent: request.parent ?? '',
2532
+ });
2016
2533
  const defaultCallSettings = this._defaults['listMemberships'];
2017
2534
  const callSettings = defaultCallSettings.merge(options);
2018
- this.initialize().catch(err => { throw err; });
2535
+ this.initialize().catch((err) => {
2536
+ throw err;
2537
+ });
2019
2538
  this._log.info('listMemberships iterate %j', request);
2020
2539
  return this.descriptors.page.listMemberships.asyncIterate(this.innerApiCalls['listMemberships'], request, callSettings);
2021
2540
  }
@@ -2032,7 +2551,9 @@ class ChatServiceClient {
2032
2551
  options = options || {};
2033
2552
  options.otherArgs = options.otherArgs || {};
2034
2553
  options.otherArgs.headers = options.otherArgs.headers || {};
2035
- this.initialize().catch(err => { throw err; });
2554
+ this.initialize().catch((err) => {
2555
+ throw err;
2556
+ });
2036
2557
  const wrappedCallback = callback
2037
2558
  ? (error, values, nextPageRequest, rawResponse) => {
2038
2559
  this._log.info('listSpaces values %j', values);
@@ -2105,7 +2626,9 @@ class ChatServiceClient {
2105
2626
  options.otherArgs.headers = options.otherArgs.headers || {};
2106
2627
  const defaultCallSettings = this._defaults['listSpaces'];
2107
2628
  const callSettings = defaultCallSettings.merge(options);
2108
- this.initialize().catch(err => { throw err; });
2629
+ this.initialize().catch((err) => {
2630
+ throw err;
2631
+ });
2109
2632
  this._log.info('listSpaces stream %j', request);
2110
2633
  return this.descriptors.page.listSpaces.createStream(this.innerApiCalls.listSpaces, request, callSettings);
2111
2634
  }
@@ -2170,7 +2693,9 @@ class ChatServiceClient {
2170
2693
  options.otherArgs.headers = options.otherArgs.headers || {};
2171
2694
  const defaultCallSettings = this._defaults['listSpaces'];
2172
2695
  const callSettings = defaultCallSettings.merge(options);
2173
- this.initialize().catch(err => { throw err; });
2696
+ this.initialize().catch((err) => {
2697
+ throw err;
2698
+ });
2174
2699
  this._log.info('listSpaces iterate %j', request);
2175
2700
  return this.descriptors.page.listSpaces.asyncIterate(this.innerApiCalls['listSpaces'], request, callSettings);
2176
2701
  }
@@ -2187,7 +2712,9 @@ class ChatServiceClient {
2187
2712
  options = options || {};
2188
2713
  options.otherArgs = options.otherArgs || {};
2189
2714
  options.otherArgs.headers = options.otherArgs.headers || {};
2190
- this.initialize().catch(err => { throw err; });
2715
+ this.initialize().catch((err) => {
2716
+ throw err;
2717
+ });
2191
2718
  const wrappedCallback = callback
2192
2719
  ? (error, values, nextPageRequest, rawResponse) => {
2193
2720
  this._log.info('searchSpaces values %j', values);
@@ -2347,7 +2874,9 @@ class ChatServiceClient {
2347
2874
  options.otherArgs.headers = options.otherArgs.headers || {};
2348
2875
  const defaultCallSettings = this._defaults['searchSpaces'];
2349
2876
  const callSettings = defaultCallSettings.merge(options);
2350
- this.initialize().catch(err => { throw err; });
2877
+ this.initialize().catch((err) => {
2878
+ throw err;
2879
+ });
2351
2880
  this._log.info('searchSpaces stream %j', request);
2352
2881
  return this.descriptors.page.searchSpaces.createStream(this.innerApiCalls.searchSpaces, request, callSettings);
2353
2882
  }
@@ -2499,7 +3028,9 @@ class ChatServiceClient {
2499
3028
  options.otherArgs.headers = options.otherArgs.headers || {};
2500
3029
  const defaultCallSettings = this._defaults['searchSpaces'];
2501
3030
  const callSettings = defaultCallSettings.merge(options);
2502
- this.initialize().catch(err => { throw err; });
3031
+ this.initialize().catch((err) => {
3032
+ throw err;
3033
+ });
2503
3034
  this._log.info('searchSpaces iterate %j', request);
2504
3035
  return this.descriptors.page.searchSpaces.asyncIterate(this.innerApiCalls['searchSpaces'], request, callSettings);
2505
3036
  }
@@ -2516,7 +3047,9 @@ class ChatServiceClient {
2516
3047
  options = options || {};
2517
3048
  options.otherArgs = options.otherArgs || {};
2518
3049
  options.otherArgs.headers = options.otherArgs.headers || {};
2519
- this.initialize().catch(err => { throw err; });
3050
+ this.initialize().catch((err) => {
3051
+ throw err;
3052
+ });
2520
3053
  const wrappedCallback = callback
2521
3054
  ? (error, values, nextPageRequest, rawResponse) => {
2522
3055
  this._log.info('findGroupChats values %j', values);
@@ -2594,7 +3127,9 @@ class ChatServiceClient {
2594
3127
  options.otherArgs.headers = options.otherArgs.headers || {};
2595
3128
  const defaultCallSettings = this._defaults['findGroupChats'];
2596
3129
  const callSettings = defaultCallSettings.merge(options);
2597
- this.initialize().catch(err => { throw err; });
3130
+ this.initialize().catch((err) => {
3131
+ throw err;
3132
+ });
2598
3133
  this._log.info('findGroupChats stream %j', request);
2599
3134
  return this.descriptors.page.findGroupChats.createStream(this.innerApiCalls.findGroupChats, request, callSettings);
2600
3135
  }
@@ -2664,7 +3199,9 @@ class ChatServiceClient {
2664
3199
  options.otherArgs.headers = options.otherArgs.headers || {};
2665
3200
  const defaultCallSettings = this._defaults['findGroupChats'];
2666
3201
  const callSettings = defaultCallSettings.merge(options);
2667
- this.initialize().catch(err => { throw err; });
3202
+ this.initialize().catch((err) => {
3203
+ throw err;
3204
+ });
2668
3205
  this._log.info('findGroupChats iterate %j', request);
2669
3206
  return this.descriptors.page.findGroupChats.asyncIterate(this.innerApiCalls['findGroupChats'], request, callSettings);
2670
3207
  }
@@ -2681,10 +3218,13 @@ class ChatServiceClient {
2681
3218
  options = options || {};
2682
3219
  options.otherArgs = options.otherArgs || {};
2683
3220
  options.otherArgs.headers = options.otherArgs.headers || {};
2684
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2685
- 'parent': request.parent ?? '',
3221
+ options.otherArgs.headers['x-goog-request-params'] =
3222
+ this._gaxModule.routingHeader.fromParams({
3223
+ parent: request.parent ?? '',
3224
+ });
3225
+ this.initialize().catch((err) => {
3226
+ throw err;
2686
3227
  });
2687
- this.initialize().catch(err => { throw err; });
2688
3228
  const wrappedCallback = callback
2689
3229
  ? (error, values, nextPageRequest, rawResponse) => {
2690
3230
  this._log.info('listReactions values %j', values);
@@ -2779,12 +3319,15 @@ class ChatServiceClient {
2779
3319
  options = options || {};
2780
3320
  options.otherArgs = options.otherArgs || {};
2781
3321
  options.otherArgs.headers = options.otherArgs.headers || {};
2782
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2783
- 'parent': request.parent ?? '',
2784
- });
3322
+ options.otherArgs.headers['x-goog-request-params'] =
3323
+ this._gaxModule.routingHeader.fromParams({
3324
+ parent: request.parent ?? '',
3325
+ });
2785
3326
  const defaultCallSettings = this._defaults['listReactions'];
2786
3327
  const callSettings = defaultCallSettings.merge(options);
2787
- this.initialize().catch(err => { throw err; });
3328
+ this.initialize().catch((err) => {
3329
+ throw err;
3330
+ });
2788
3331
  this._log.info('listReactions stream %j', request);
2789
3332
  return this.descriptors.page.listReactions.createStream(this.innerApiCalls.listReactions, request, callSettings);
2790
3333
  }
@@ -2871,12 +3414,15 @@ class ChatServiceClient {
2871
3414
  options = options || {};
2872
3415
  options.otherArgs = options.otherArgs || {};
2873
3416
  options.otherArgs.headers = options.otherArgs.headers || {};
2874
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
2875
- 'parent': request.parent ?? '',
2876
- });
3417
+ options.otherArgs.headers['x-goog-request-params'] =
3418
+ this._gaxModule.routingHeader.fromParams({
3419
+ parent: request.parent ?? '',
3420
+ });
2877
3421
  const defaultCallSettings = this._defaults['listReactions'];
2878
3422
  const callSettings = defaultCallSettings.merge(options);
2879
- this.initialize().catch(err => { throw err; });
3423
+ this.initialize().catch((err) => {
3424
+ throw err;
3425
+ });
2880
3426
  this._log.info('listReactions iterate %j', request);
2881
3427
  return this.descriptors.page.listReactions.asyncIterate(this.innerApiCalls['listReactions'], request, callSettings);
2882
3428
  }
@@ -2893,7 +3439,9 @@ class ChatServiceClient {
2893
3439
  options = options || {};
2894
3440
  options.otherArgs = options.otherArgs || {};
2895
3441
  options.otherArgs.headers = options.otherArgs.headers || {};
2896
- this.initialize().catch(err => { throw err; });
3442
+ this.initialize().catch((err) => {
3443
+ throw err;
3444
+ });
2897
3445
  const wrappedCallback = callback
2898
3446
  ? (error, values, nextPageRequest, rawResponse) => {
2899
3447
  this._log.info('listCustomEmojis values %j', values);
@@ -2958,7 +3506,9 @@ class ChatServiceClient {
2958
3506
  options.otherArgs.headers = options.otherArgs.headers || {};
2959
3507
  const defaultCallSettings = this._defaults['listCustomEmojis'];
2960
3508
  const callSettings = defaultCallSettings.merge(options);
2961
- this.initialize().catch(err => { throw err; });
3509
+ this.initialize().catch((err) => {
3510
+ throw err;
3511
+ });
2962
3512
  this._log.info('listCustomEmojis stream %j', request);
2963
3513
  return this.descriptors.page.listCustomEmojis.createStream(this.innerApiCalls.listCustomEmojis, request, callSettings);
2964
3514
  }
@@ -3015,7 +3565,9 @@ class ChatServiceClient {
3015
3565
  options.otherArgs.headers = options.otherArgs.headers || {};
3016
3566
  const defaultCallSettings = this._defaults['listCustomEmojis'];
3017
3567
  const callSettings = defaultCallSettings.merge(options);
3018
- this.initialize().catch(err => { throw err; });
3568
+ this.initialize().catch((err) => {
3569
+ throw err;
3570
+ });
3019
3571
  this._log.info('listCustomEmojis iterate %j', request);
3020
3572
  return this.descriptors.page.listCustomEmojis.asyncIterate(this.innerApiCalls['listCustomEmojis'], request, callSettings);
3021
3573
  }
@@ -3032,10 +3584,13 @@ class ChatServiceClient {
3032
3584
  options = options || {};
3033
3585
  options.otherArgs = options.otherArgs || {};
3034
3586
  options.otherArgs.headers = options.otherArgs.headers || {};
3035
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3036
- 'parent': request.parent ?? '',
3587
+ options.otherArgs.headers['x-goog-request-params'] =
3588
+ this._gaxModule.routingHeader.fromParams({
3589
+ parent: request.parent ?? '',
3590
+ });
3591
+ this.initialize().catch((err) => {
3592
+ throw err;
3037
3593
  });
3038
- this.initialize().catch(err => { throw err; });
3039
3594
  const wrappedCallback = callback
3040
3595
  ? (error, values, nextPageRequest, rawResponse) => {
3041
3596
  this._log.info('listSpaceEvents values %j', values);
@@ -3141,12 +3696,15 @@ class ChatServiceClient {
3141
3696
  options = options || {};
3142
3697
  options.otherArgs = options.otherArgs || {};
3143
3698
  options.otherArgs.headers = options.otherArgs.headers || {};
3144
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3145
- 'parent': request.parent ?? '',
3146
- });
3699
+ options.otherArgs.headers['x-goog-request-params'] =
3700
+ this._gaxModule.routingHeader.fromParams({
3701
+ parent: request.parent ?? '',
3702
+ });
3147
3703
  const defaultCallSettings = this._defaults['listSpaceEvents'];
3148
3704
  const callSettings = defaultCallSettings.merge(options);
3149
- this.initialize().catch(err => { throw err; });
3705
+ this.initialize().catch((err) => {
3706
+ throw err;
3707
+ });
3150
3708
  this._log.info('listSpaceEvents stream %j', request);
3151
3709
  return this.descriptors.page.listSpaceEvents.createStream(this.innerApiCalls.listSpaceEvents, request, callSettings);
3152
3710
  }
@@ -3244,12 +3802,15 @@ class ChatServiceClient {
3244
3802
  options = options || {};
3245
3803
  options.otherArgs = options.otherArgs || {};
3246
3804
  options.otherArgs.headers = options.otherArgs.headers || {};
3247
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3248
- 'parent': request.parent ?? '',
3249
- });
3805
+ options.otherArgs.headers['x-goog-request-params'] =
3806
+ this._gaxModule.routingHeader.fromParams({
3807
+ parent: request.parent ?? '',
3808
+ });
3250
3809
  const defaultCallSettings = this._defaults['listSpaceEvents'];
3251
3810
  const callSettings = defaultCallSettings.merge(options);
3252
- this.initialize().catch(err => { throw err; });
3811
+ this.initialize().catch((err) => {
3812
+ throw err;
3813
+ });
3253
3814
  this._log.info('listSpaceEvents iterate %j', request);
3254
3815
  return this.descriptors.page.listSpaceEvents.asyncIterate(this.innerApiCalls['listSpaceEvents'], request, callSettings);
3255
3816
  }
@@ -3266,10 +3827,13 @@ class ChatServiceClient {
3266
3827
  options = options || {};
3267
3828
  options.otherArgs = options.otherArgs || {};
3268
3829
  options.otherArgs.headers = options.otherArgs.headers || {};
3269
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3270
- 'parent': request.parent ?? '',
3830
+ options.otherArgs.headers['x-goog-request-params'] =
3831
+ this._gaxModule.routingHeader.fromParams({
3832
+ parent: request.parent ?? '',
3833
+ });
3834
+ this.initialize().catch((err) => {
3835
+ throw err;
3271
3836
  });
3272
- this.initialize().catch(err => { throw err; });
3273
3837
  const wrappedCallback = callback
3274
3838
  ? (error, values, nextPageRequest, rawResponse) => {
3275
3839
  this._log.info('listSections values %j', values);
@@ -3333,12 +3897,15 @@ class ChatServiceClient {
3333
3897
  options = options || {};
3334
3898
  options.otherArgs = options.otherArgs || {};
3335
3899
  options.otherArgs.headers = options.otherArgs.headers || {};
3336
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3337
- 'parent': request.parent ?? '',
3338
- });
3900
+ options.otherArgs.headers['x-goog-request-params'] =
3901
+ this._gaxModule.routingHeader.fromParams({
3902
+ parent: request.parent ?? '',
3903
+ });
3339
3904
  const defaultCallSettings = this._defaults['listSections'];
3340
3905
  const callSettings = defaultCallSettings.merge(options);
3341
- this.initialize().catch(err => { throw err; });
3906
+ this.initialize().catch((err) => {
3907
+ throw err;
3908
+ });
3342
3909
  this._log.info('listSections stream %j', request);
3343
3910
  return this.descriptors.page.listSections.createStream(this.innerApiCalls.listSections, request, callSettings);
3344
3911
  }
@@ -3394,12 +3961,15 @@ class ChatServiceClient {
3394
3961
  options = options || {};
3395
3962
  options.otherArgs = options.otherArgs || {};
3396
3963
  options.otherArgs.headers = options.otherArgs.headers || {};
3397
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3398
- 'parent': request.parent ?? '',
3399
- });
3964
+ options.otherArgs.headers['x-goog-request-params'] =
3965
+ this._gaxModule.routingHeader.fromParams({
3966
+ parent: request.parent ?? '',
3967
+ });
3400
3968
  const defaultCallSettings = this._defaults['listSections'];
3401
3969
  const callSettings = defaultCallSettings.merge(options);
3402
- this.initialize().catch(err => { throw err; });
3970
+ this.initialize().catch((err) => {
3971
+ throw err;
3972
+ });
3403
3973
  this._log.info('listSections iterate %j', request);
3404
3974
  return this.descriptors.page.listSections.asyncIterate(this.innerApiCalls['listSections'], request, callSettings);
3405
3975
  }
@@ -3416,10 +3986,13 @@ class ChatServiceClient {
3416
3986
  options = options || {};
3417
3987
  options.otherArgs = options.otherArgs || {};
3418
3988
  options.otherArgs.headers = options.otherArgs.headers || {};
3419
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3420
- 'parent': request.parent ?? '',
3989
+ options.otherArgs.headers['x-goog-request-params'] =
3990
+ this._gaxModule.routingHeader.fromParams({
3991
+ parent: request.parent ?? '',
3992
+ });
3993
+ this.initialize().catch((err) => {
3994
+ throw err;
3421
3995
  });
3422
- this.initialize().catch(err => { throw err; });
3423
3996
  const wrappedCallback = callback
3424
3997
  ? (error, values, nextPageRequest, rawResponse) => {
3425
3998
  this._log.info('listSectionItems values %j', values);
@@ -3488,12 +4061,15 @@ class ChatServiceClient {
3488
4061
  options = options || {};
3489
4062
  options.otherArgs = options.otherArgs || {};
3490
4063
  options.otherArgs.headers = options.otherArgs.headers || {};
3491
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3492
- 'parent': request.parent ?? '',
3493
- });
4064
+ options.otherArgs.headers['x-goog-request-params'] =
4065
+ this._gaxModule.routingHeader.fromParams({
4066
+ parent: request.parent ?? '',
4067
+ });
3494
4068
  const defaultCallSettings = this._defaults['listSectionItems'];
3495
4069
  const callSettings = defaultCallSettings.merge(options);
3496
- this.initialize().catch(err => { throw err; });
4070
+ this.initialize().catch((err) => {
4071
+ throw err;
4072
+ });
3497
4073
  this._log.info('listSectionItems stream %j', request);
3498
4074
  return this.descriptors.page.listSectionItems.createStream(this.innerApiCalls.listSectionItems, request, callSettings);
3499
4075
  }
@@ -3554,12 +4130,15 @@ class ChatServiceClient {
3554
4130
  options = options || {};
3555
4131
  options.otherArgs = options.otherArgs || {};
3556
4132
  options.otherArgs.headers = options.otherArgs.headers || {};
3557
- options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
3558
- 'parent': request.parent ?? '',
3559
- });
4133
+ options.otherArgs.headers['x-goog-request-params'] =
4134
+ this._gaxModule.routingHeader.fromParams({
4135
+ parent: request.parent ?? '',
4136
+ });
3560
4137
  const defaultCallSettings = this._defaults['listSectionItems'];
3561
4138
  const callSettings = defaultCallSettings.merge(options);
3562
- this.initialize().catch(err => { throw err; });
4139
+ this.initialize().catch((err) => {
4140
+ throw err;
4141
+ });
3563
4142
  this._log.info('listSectionItems iterate %j', request);
3564
4143
  return this.descriptors.page.listSectionItems.asyncIterate(this.innerApiCalls['listSectionItems'], request, callSettings);
3565
4144
  }
@@ -3589,7 +4168,8 @@ class ChatServiceClient {
3589
4168
  * @returns {string} A string representing the space.
3590
4169
  */
3591
4170
  matchSpaceFromAttachmentName(attachmentName) {
3592
- return this.pathTemplates.attachmentPathTemplate.match(attachmentName).space;
4171
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
4172
+ .space;
3593
4173
  }
3594
4174
  /**
3595
4175
  * Parse the message from Attachment resource.
@@ -3599,7 +4179,8 @@ class ChatServiceClient {
3599
4179
  * @returns {string} A string representing the message.
3600
4180
  */
3601
4181
  matchMessageFromAttachmentName(attachmentName) {
3602
- return this.pathTemplates.attachmentPathTemplate.match(attachmentName).message;
4182
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
4183
+ .message;
3603
4184
  }
3604
4185
  /**
3605
4186
  * Parse the attachment from Attachment resource.
@@ -3609,7 +4190,30 @@ class ChatServiceClient {
3609
4190
  * @returns {string} A string representing the attachment.
3610
4191
  */
3611
4192
  matchAttachmentFromAttachmentName(attachmentName) {
3612
- return this.pathTemplates.attachmentPathTemplate.match(attachmentName).attachment;
4193
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
4194
+ .attachment;
4195
+ }
4196
+ /**
4197
+ * Return a fully-qualified availability resource name string.
4198
+ *
4199
+ * @param {string} user
4200
+ * @returns {string} Resource name string.
4201
+ */
4202
+ availabilityPath(user) {
4203
+ return this.pathTemplates.availabilityPathTemplate.render({
4204
+ user: user,
4205
+ });
4206
+ }
4207
+ /**
4208
+ * Parse the user from Availability resource.
4209
+ *
4210
+ * @param {string} availabilityName
4211
+ * A fully-qualified path representing Availability resource.
4212
+ * @returns {string} A string representing the user.
4213
+ */
4214
+ matchUserFromAvailabilityName(availabilityName) {
4215
+ return this.pathTemplates.availabilityPathTemplate.match(availabilityName)
4216
+ .user;
3613
4217
  }
3614
4218
  /**
3615
4219
  * Return a fully-qualified customEmoji resource name string.
@@ -3630,7 +4234,8 @@ class ChatServiceClient {
3630
4234
  * @returns {string} A string representing the custom_emoji.
3631
4235
  */
3632
4236
  matchCustomEmojiFromCustomEmojiName(customEmojiName) {
3633
- return this.pathTemplates.customEmojiPathTemplate.match(customEmojiName).custom_emoji;
4237
+ return this.pathTemplates.customEmojiPathTemplate.match(customEmojiName)
4238
+ .custom_emoji;
3634
4239
  }
3635
4240
  /**
3636
4241
  * Return a fully-qualified membership resource name string.
@@ -3653,7 +4258,8 @@ class ChatServiceClient {
3653
4258
  * @returns {string} A string representing the space.
3654
4259
  */
3655
4260
  matchSpaceFromMembershipName(membershipName) {
3656
- return this.pathTemplates.membershipPathTemplate.match(membershipName).space;
4261
+ return this.pathTemplates.membershipPathTemplate.match(membershipName)
4262
+ .space;
3657
4263
  }
3658
4264
  /**
3659
4265
  * Parse the member from Membership resource.
@@ -3663,7 +4269,8 @@ class ChatServiceClient {
3663
4269
  * @returns {string} A string representing the member.
3664
4270
  */
3665
4271
  matchMemberFromMembershipName(membershipName) {
3666
- return this.pathTemplates.membershipPathTemplate.match(membershipName).member;
4272
+ return this.pathTemplates.membershipPathTemplate.match(membershipName)
4273
+ .member;
3667
4274
  }
3668
4275
  /**
3669
4276
  * Return a fully-qualified message resource name string.
@@ -3844,7 +4451,8 @@ class ChatServiceClient {
3844
4451
  * @returns {string} A string representing the user.
3845
4452
  */
3846
4453
  matchUserFromSectionItemName(sectionItemName) {
3847
- return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName).user;
4454
+ return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName)
4455
+ .user;
3848
4456
  }
3849
4457
  /**
3850
4458
  * Parse the section from SectionItem resource.
@@ -3854,7 +4462,8 @@ class ChatServiceClient {
3854
4462
  * @returns {string} A string representing the section.
3855
4463
  */
3856
4464
  matchSectionFromSectionItemName(sectionItemName) {
3857
- return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName).section;
4465
+ return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName)
4466
+ .section;
3858
4467
  }
3859
4468
  /**
3860
4469
  * Parse the item from SectionItem resource.
@@ -3864,7 +4473,8 @@ class ChatServiceClient {
3864
4473
  * @returns {string} A string representing the item.
3865
4474
  */
3866
4475
  matchItemFromSectionItemName(sectionItemName) {
3867
- return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName).item;
4476
+ return this.pathTemplates.sectionItemPathTemplate.match(sectionItemName)
4477
+ .item;
3868
4478
  }
3869
4479
  /**
3870
4480
  * Return a fully-qualified space resource name string.
@@ -3908,7 +4518,8 @@ class ChatServiceClient {
3908
4518
  * @returns {string} A string representing the space.
3909
4519
  */
3910
4520
  matchSpaceFromSpaceEventName(spaceEventName) {
3911
- return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName).space;
4521
+ return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName)
4522
+ .space;
3912
4523
  }
3913
4524
  /**
3914
4525
  * Parse the space_event from SpaceEvent resource.
@@ -3918,7 +4529,8 @@ class ChatServiceClient {
3918
4529
  * @returns {string} A string representing the space_event.
3919
4530
  */
3920
4531
  matchSpaceEventFromSpaceEventName(spaceEventName) {
3921
- return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName).space_event;
4532
+ return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName)
4533
+ .space_event;
3922
4534
  }
3923
4535
  /**
3924
4536
  * Return a fully-qualified spaceNotificationSetting resource name string.
@@ -4072,7 +4684,7 @@ class ChatServiceClient {
4072
4684
  */
4073
4685
  close() {
4074
4686
  if (this.chatServiceStub && !this._terminated) {
4075
- return this.chatServiceStub.then(stub => {
4687
+ return this.chatServiceStub.then((stub) => {
4076
4688
  this._log.info('ending gRPC channel');
4077
4689
  this._terminated = true;
4078
4690
  stub.close();