@google-apps/chat 0.1.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +202 -0
  3. package/README.md +220 -0
  4. package/build/protos/google/apps/card/v1/card.proto +1918 -0
  5. package/build/protos/google/chat/v1/action_status.proto +38 -0
  6. package/build/protos/google/chat/v1/annotation.proto +137 -0
  7. package/build/protos/google/chat/v1/attachment.proto +122 -0
  8. package/build/protos/google/chat/v1/chat_service.proto +493 -0
  9. package/build/protos/google/chat/v1/contextual_addon.proto +106 -0
  10. package/build/protos/google/chat/v1/deletion_metadata.proto +56 -0
  11. package/build/protos/google/chat/v1/group.proto +37 -0
  12. package/build/protos/google/chat/v1/history_state.proto +41 -0
  13. package/build/protos/google/chat/v1/matched_url.proto +35 -0
  14. package/build/protos/google/chat/v1/membership.proto +292 -0
  15. package/build/protos/google/chat/v1/message.proto +645 -0
  16. package/build/protos/google/chat/v1/reaction.proto +183 -0
  17. package/build/protos/google/chat/v1/slash_command.proto +32 -0
  18. package/build/protos/google/chat/v1/space.proto +360 -0
  19. package/build/protos/google/chat/v1/space_setup.proto +91 -0
  20. package/build/protos/google/chat/v1/user.proto +82 -0
  21. package/build/protos/google/chat/v1/widgets.proto +277 -0
  22. package/build/protos/protos.d.ts +20339 -0
  23. package/build/protos/protos.js +52506 -0
  24. package/build/protos/protos.json +5114 -0
  25. package/build/src/index.d.ts +11 -0
  26. package/build/src/index.js +28 -0
  27. package/build/src/index.js.map +1 -0
  28. package/build/src/v1/chat_service_client.d.ts +2194 -0
  29. package/build/src/v1/chat_service_client.js +1763 -0
  30. package/build/src/v1/chat_service_client.js.map +1 -0
  31. package/build/src/v1/chat_service_client_config.json +148 -0
  32. package/build/src/v1/index.d.ts +1 -0
  33. package/build/src/v1/index.js +23 -0
  34. package/build/src/v1/index.js.map +1 -0
  35. package/package.json +70 -0
@@ -0,0 +1,1763 @@
1
+ "use strict";
2
+ // Copyright 2024 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // ** This file is automatically generated by gapic-generator-typescript. **
17
+ // ** https://github.com/googleapis/gapic-generator-typescript **
18
+ // ** All changes to this file may be overwritten. **
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.ChatServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/chat_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./chat_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Enables developers to build Chat apps and
31
+ * integrations on Google Chat Platform.
32
+ * @class
33
+ * @memberof v1
34
+ */
35
+ class ChatServiceClient {
36
+ /**
37
+ * Construct an instance of ChatServiceClient.
38
+ *
39
+ * @param {object} [options] - The configuration object.
40
+ * The options accepted by the constructor are described in detail
41
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
42
+ * The common options are:
43
+ * @param {object} [options.credentials] - Credentials object.
44
+ * @param {string} [options.credentials.client_email]
45
+ * @param {string} [options.credentials.private_key]
46
+ * @param {string} [options.email] - Account email address. Required when
47
+ * using a .pem or .p12 keyFilename.
48
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
49
+ * .p12 key downloaded from the Google Developers Console. If you provide
50
+ * a path to a JSON file, the projectId option below is not necessary.
51
+ * NOTE: .pem and .p12 require you to specify options.email as well.
52
+ * @param {number} [options.port] - The port on which to connect to
53
+ * the remote host.
54
+ * @param {string} [options.projectId] - The project ID from the Google
55
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
56
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
57
+ * app is running in an environment which supports
58
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
59
+ * your project ID will be detected automatically.
60
+ * @param {string} [options.apiEndpoint] - The domain name of the
61
+ * API remote host.
62
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
63
+ * Follows the structure of {@link gapicConfig}.
64
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
65
+ * For more information, please check the
66
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
68
+ * need to avoid loading the default gRPC version and want to use the fallback
69
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
70
+ * ```
71
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
+ * const client = new ChatServiceClient({fallback: true}, gax);
73
+ * ```
74
+ */
75
+ constructor(opts, gaxInstance) {
76
+ var _a, _b, _c, _d;
77
+ this._terminated = false;
78
+ this.descriptors = {
79
+ page: {},
80
+ stream: {},
81
+ longrunning: {},
82
+ batching: {},
83
+ };
84
+ // Ensure that options include all the required fields.
85
+ const staticMembers = this.constructor;
86
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
88
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
+ }
91
+ this._universeDomain =
92
+ (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
93
+ this._servicePath = 'chat.' + this._universeDomain;
94
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
95
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
96
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
97
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
98
+ const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
99
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
100
+ // Request numeric enum values if REST transport is used.
101
+ opts.numericEnums = true;
102
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
103
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
104
+ opts['scopes'] = staticMembers.scopes;
105
+ }
106
+ // Load google-gax module synchronously if needed
107
+ if (!gaxInstance) {
108
+ gaxInstance = require('google-gax');
109
+ }
110
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
111
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
112
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
113
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
114
+ // Save options to use in initialize() method.
115
+ this._opts = opts;
116
+ // Save the auth object to the client, for use by other methods.
117
+ this.auth = this._gaxGrpc.auth;
118
+ // Set useJWTAccessWithScope on the auth object.
119
+ this.auth.useJWTAccessWithScope = true;
120
+ // Set defaultServicePath on the auth object.
121
+ this.auth.defaultServicePath = this._servicePath;
122
+ // Set the default scopes in auth client if needed.
123
+ if (servicePath === this._servicePath) {
124
+ this.auth.defaultScopes = staticMembers.scopes;
125
+ }
126
+ // Determine the client header string.
127
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
128
+ if (typeof process !== 'undefined' && 'versions' in process) {
129
+ clientHeader.push(`gl-node/${process.versions.node}`);
130
+ }
131
+ else {
132
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
133
+ }
134
+ if (!opts.fallback) {
135
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
136
+ }
137
+ else {
138
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
139
+ }
140
+ if (opts.libName && opts.libVersion) {
141
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
142
+ }
143
+ // Load the applicable protos.
144
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
145
+ // This API contains "path templates"; forward-slash-separated
146
+ // identifiers to uniquely identify resources within the API.
147
+ // Create useful helper objects for these.
148
+ this.pathTemplates = {
149
+ attachmentPathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/messages/{message}/attachments/{attachment}'),
150
+ membershipPathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/members/{member}'),
151
+ messagePathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/messages/{message}'),
152
+ quotedMessageMetadataPathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}'),
153
+ reactionPathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/messages/{message}/reactions/{reaction}'),
154
+ spacePathTemplate: new this._gaxModule.PathTemplate('spaces/{space}'),
155
+ threadPathTemplate: new this._gaxModule.PathTemplate('spaces/{space}/threads/{thread}'),
156
+ };
157
+ // Some of the methods on this service return "paged" results,
158
+ // (e.g. 50 results at a time, with tokens to get subsequent
159
+ // pages). Denote the keys used for pagination and results.
160
+ this.descriptors.page = {
161
+ listMessages: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'messages'),
162
+ listMemberships: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'memberships'),
163
+ listSpaces: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaces'),
164
+ listReactions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'reactions'),
165
+ };
166
+ // Put together the default options sent with requests.
167
+ this._defaults = this._gaxGrpc.constructSettings('google.chat.v1.ChatService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
168
+ // Set up a dictionary of "inner API calls"; the core implementation
169
+ // of calling the API is handled in `google-gax`, with this code
170
+ // merely providing the destination and request information.
171
+ this.innerApiCalls = {};
172
+ // Add a warn function to the client constructor so it can be easily tested.
173
+ this.warn = this._gaxModule.warn;
174
+ }
175
+ /**
176
+ * Initialize the client.
177
+ * Performs asynchronous operations (such as authentication) and prepares the client.
178
+ * This function will be called automatically when any class method is called for the
179
+ * first time, but if you need to initialize it before calling an actual method,
180
+ * feel free to call initialize() directly.
181
+ *
182
+ * You can await on this method if you want to make sure the client is initialized.
183
+ *
184
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
185
+ */
186
+ initialize() {
187
+ // If the client stub promise is already initialized, return immediately.
188
+ if (this.chatServiceStub) {
189
+ return this.chatServiceStub;
190
+ }
191
+ // Put together the "service stub" for
192
+ // google.chat.v1.ChatService.
193
+ this.chatServiceStub = this._gaxGrpc.createStub(this._opts.fallback
194
+ ? this._protos.lookupService('google.chat.v1.ChatService')
195
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
196
+ this._protos.google.chat.v1.ChatService, this._opts, this._providedCustomServicePath);
197
+ // Iterate over each of the methods that the service provides
198
+ // and create an API call method for each.
199
+ const chatServiceStubMethods = [
200
+ 'createMessage',
201
+ 'listMessages',
202
+ 'listMemberships',
203
+ 'getMembership',
204
+ 'getMessage',
205
+ 'updateMessage',
206
+ 'deleteMessage',
207
+ 'getAttachment',
208
+ 'uploadAttachment',
209
+ 'listSpaces',
210
+ 'getSpace',
211
+ 'createSpace',
212
+ 'setUpSpace',
213
+ 'updateSpace',
214
+ 'deleteSpace',
215
+ 'completeImportSpace',
216
+ 'findDirectMessage',
217
+ 'createMembership',
218
+ 'deleteMembership',
219
+ 'createReaction',
220
+ 'listReactions',
221
+ 'deleteReaction',
222
+ ];
223
+ for (const methodName of chatServiceStubMethods) {
224
+ const callPromise = this.chatServiceStub.then(stub => (...args) => {
225
+ if (this._terminated) {
226
+ return Promise.reject('The client has already been closed.');
227
+ }
228
+ const func = stub[methodName];
229
+ return func.apply(stub, args);
230
+ }, (err) => () => {
231
+ throw err;
232
+ });
233
+ const descriptor = this.descriptors.page[methodName] || undefined;
234
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
235
+ this.innerApiCalls[methodName] = apiCall;
236
+ }
237
+ return this.chatServiceStub;
238
+ }
239
+ /**
240
+ * The DNS address for this API service.
241
+ * @deprecated Use the apiEndpoint method of the client instance.
242
+ * @returns {string} The DNS address for this service.
243
+ */
244
+ static get servicePath() {
245
+ if (typeof process !== undefined &&
246
+ typeof process.emitWarning === 'function') {
247
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
248
+ }
249
+ return 'chat.googleapis.com';
250
+ }
251
+ /**
252
+ * The DNS address for this API service - same as servicePath.
253
+ * @deprecated Use the apiEndpoint method of the client instance.
254
+ * @returns {string} The DNS address for this service.
255
+ */
256
+ static get apiEndpoint() {
257
+ if (typeof process !== undefined &&
258
+ typeof process.emitWarning === 'function') {
259
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
260
+ }
261
+ return 'chat.googleapis.com';
262
+ }
263
+ /**
264
+ * The DNS address for this API service.
265
+ * @returns {string} The DNS address for this service.
266
+ */
267
+ get apiEndpoint() {
268
+ return this._servicePath;
269
+ }
270
+ get universeDomain() {
271
+ return this._universeDomain;
272
+ }
273
+ /**
274
+ * The port for this API service.
275
+ * @returns {number} The default port for this service.
276
+ */
277
+ static get port() {
278
+ return 443;
279
+ }
280
+ /**
281
+ * The scopes needed to make gRPC calls for every method defined
282
+ * in this service.
283
+ * @returns {string[]} List of default scopes.
284
+ */
285
+ static get scopes() {
286
+ return [
287
+ 'https://www.googleapis.com/auth/chat.bot',
288
+ 'https://www.googleapis.com/auth/chat.delete',
289
+ 'https://www.googleapis.com/auth/chat.import',
290
+ 'https://www.googleapis.com/auth/chat.memberships',
291
+ 'https://www.googleapis.com/auth/chat.memberships.app',
292
+ 'https://www.googleapis.com/auth/chat.memberships.readonly',
293
+ 'https://www.googleapis.com/auth/chat.messages',
294
+ 'https://www.googleapis.com/auth/chat.messages.create',
295
+ 'https://www.googleapis.com/auth/chat.messages.reactions',
296
+ 'https://www.googleapis.com/auth/chat.messages.reactions.create',
297
+ 'https://www.googleapis.com/auth/chat.messages.reactions.readonly',
298
+ 'https://www.googleapis.com/auth/chat.messages.readonly',
299
+ 'https://www.googleapis.com/auth/chat.spaces',
300
+ 'https://www.googleapis.com/auth/chat.spaces.create',
301
+ 'https://www.googleapis.com/auth/chat.spaces.readonly',
302
+ ];
303
+ }
304
+ /**
305
+ * Return the project ID used by this class.
306
+ * @returns {Promise} A promise that resolves to string containing the project ID.
307
+ */
308
+ getProjectId(callback) {
309
+ if (callback) {
310
+ this.auth.getProjectId(callback);
311
+ return;
312
+ }
313
+ return this.auth.getProjectId();
314
+ }
315
+ createMessage(request, optionsOrCallback, callback) {
316
+ var _a;
317
+ request = request || {};
318
+ let options;
319
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
320
+ callback = optionsOrCallback;
321
+ options = {};
322
+ }
323
+ else {
324
+ options = optionsOrCallback;
325
+ }
326
+ options = options || {};
327
+ options.otherArgs = options.otherArgs || {};
328
+ options.otherArgs.headers = options.otherArgs.headers || {};
329
+ options.otherArgs.headers['x-goog-request-params'] =
330
+ this._gaxModule.routingHeader.fromParams({
331
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
332
+ });
333
+ this.initialize();
334
+ return this.innerApiCalls.createMessage(request, options, callback);
335
+ }
336
+ getMembership(request, optionsOrCallback, callback) {
337
+ var _a;
338
+ request = request || {};
339
+ let options;
340
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
341
+ callback = optionsOrCallback;
342
+ options = {};
343
+ }
344
+ else {
345
+ options = optionsOrCallback;
346
+ }
347
+ options = options || {};
348
+ options.otherArgs = options.otherArgs || {};
349
+ options.otherArgs.headers = options.otherArgs.headers || {};
350
+ options.otherArgs.headers['x-goog-request-params'] =
351
+ this._gaxModule.routingHeader.fromParams({
352
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
353
+ });
354
+ this.initialize();
355
+ return this.innerApiCalls.getMembership(request, options, callback);
356
+ }
357
+ getMessage(request, optionsOrCallback, callback) {
358
+ var _a;
359
+ request = request || {};
360
+ let options;
361
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
362
+ callback = optionsOrCallback;
363
+ options = {};
364
+ }
365
+ else {
366
+ options = optionsOrCallback;
367
+ }
368
+ options = options || {};
369
+ options.otherArgs = options.otherArgs || {};
370
+ options.otherArgs.headers = options.otherArgs.headers || {};
371
+ options.otherArgs.headers['x-goog-request-params'] =
372
+ this._gaxModule.routingHeader.fromParams({
373
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
374
+ });
375
+ this.initialize();
376
+ return this.innerApiCalls.getMessage(request, options, callback);
377
+ }
378
+ updateMessage(request, optionsOrCallback, callback) {
379
+ var _a;
380
+ request = request || {};
381
+ let options;
382
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
383
+ callback = optionsOrCallback;
384
+ options = {};
385
+ }
386
+ else {
387
+ options = optionsOrCallback;
388
+ }
389
+ options = options || {};
390
+ options.otherArgs = options.otherArgs || {};
391
+ options.otherArgs.headers = options.otherArgs.headers || {};
392
+ options.otherArgs.headers['x-goog-request-params'] =
393
+ this._gaxModule.routingHeader.fromParams({
394
+ 'message.name': (_a = request.message.name) !== null && _a !== void 0 ? _a : '',
395
+ });
396
+ this.initialize();
397
+ return this.innerApiCalls.updateMessage(request, options, callback);
398
+ }
399
+ deleteMessage(request, optionsOrCallback, callback) {
400
+ var _a;
401
+ request = request || {};
402
+ let options;
403
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
404
+ callback = optionsOrCallback;
405
+ options = {};
406
+ }
407
+ else {
408
+ options = optionsOrCallback;
409
+ }
410
+ options = options || {};
411
+ options.otherArgs = options.otherArgs || {};
412
+ options.otherArgs.headers = options.otherArgs.headers || {};
413
+ options.otherArgs.headers['x-goog-request-params'] =
414
+ this._gaxModule.routingHeader.fromParams({
415
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
416
+ });
417
+ this.initialize();
418
+ return this.innerApiCalls.deleteMessage(request, options, callback);
419
+ }
420
+ getAttachment(request, optionsOrCallback, callback) {
421
+ var _a;
422
+ request = request || {};
423
+ let options;
424
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
425
+ callback = optionsOrCallback;
426
+ options = {};
427
+ }
428
+ else {
429
+ options = optionsOrCallback;
430
+ }
431
+ options = options || {};
432
+ options.otherArgs = options.otherArgs || {};
433
+ options.otherArgs.headers = options.otherArgs.headers || {};
434
+ options.otherArgs.headers['x-goog-request-params'] =
435
+ this._gaxModule.routingHeader.fromParams({
436
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
437
+ });
438
+ this.initialize();
439
+ return this.innerApiCalls.getAttachment(request, options, callback);
440
+ }
441
+ uploadAttachment(request, optionsOrCallback, callback) {
442
+ var _a;
443
+ request = request || {};
444
+ let options;
445
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
446
+ callback = optionsOrCallback;
447
+ options = {};
448
+ }
449
+ else {
450
+ options = optionsOrCallback;
451
+ }
452
+ options = options || {};
453
+ options.otherArgs = options.otherArgs || {};
454
+ options.otherArgs.headers = options.otherArgs.headers || {};
455
+ options.otherArgs.headers['x-goog-request-params'] =
456
+ this._gaxModule.routingHeader.fromParams({
457
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
458
+ });
459
+ this.initialize();
460
+ return this.innerApiCalls.uploadAttachment(request, options, callback);
461
+ }
462
+ getSpace(request, optionsOrCallback, callback) {
463
+ var _a;
464
+ request = request || {};
465
+ let options;
466
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
467
+ callback = optionsOrCallback;
468
+ options = {};
469
+ }
470
+ else {
471
+ options = optionsOrCallback;
472
+ }
473
+ options = options || {};
474
+ options.otherArgs = options.otherArgs || {};
475
+ options.otherArgs.headers = options.otherArgs.headers || {};
476
+ options.otherArgs.headers['x-goog-request-params'] =
477
+ this._gaxModule.routingHeader.fromParams({
478
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
479
+ });
480
+ this.initialize();
481
+ return this.innerApiCalls.getSpace(request, options, callback);
482
+ }
483
+ createSpace(request, optionsOrCallback, callback) {
484
+ request = request || {};
485
+ let options;
486
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
487
+ callback = optionsOrCallback;
488
+ options = {};
489
+ }
490
+ else {
491
+ options = optionsOrCallback;
492
+ }
493
+ options = options || {};
494
+ options.otherArgs = options.otherArgs || {};
495
+ options.otherArgs.headers = options.otherArgs.headers || {};
496
+ this.initialize();
497
+ return this.innerApiCalls.createSpace(request, options, callback);
498
+ }
499
+ setUpSpace(request, optionsOrCallback, callback) {
500
+ request = request || {};
501
+ let options;
502
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
503
+ callback = optionsOrCallback;
504
+ options = {};
505
+ }
506
+ else {
507
+ options = optionsOrCallback;
508
+ }
509
+ options = options || {};
510
+ options.otherArgs = options.otherArgs || {};
511
+ options.otherArgs.headers = options.otherArgs.headers || {};
512
+ this.initialize();
513
+ return this.innerApiCalls.setUpSpace(request, options, callback);
514
+ }
515
+ updateSpace(request, optionsOrCallback, callback) {
516
+ var _a;
517
+ request = request || {};
518
+ let options;
519
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
520
+ callback = optionsOrCallback;
521
+ options = {};
522
+ }
523
+ else {
524
+ options = optionsOrCallback;
525
+ }
526
+ options = options || {};
527
+ options.otherArgs = options.otherArgs || {};
528
+ options.otherArgs.headers = options.otherArgs.headers || {};
529
+ options.otherArgs.headers['x-goog-request-params'] =
530
+ this._gaxModule.routingHeader.fromParams({
531
+ 'space.name': (_a = request.space.name) !== null && _a !== void 0 ? _a : '',
532
+ });
533
+ this.initialize();
534
+ return this.innerApiCalls.updateSpace(request, options, callback);
535
+ }
536
+ deleteSpace(request, optionsOrCallback, callback) {
537
+ var _a;
538
+ request = request || {};
539
+ let options;
540
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
541
+ callback = optionsOrCallback;
542
+ options = {};
543
+ }
544
+ else {
545
+ options = optionsOrCallback;
546
+ }
547
+ options = options || {};
548
+ options.otherArgs = options.otherArgs || {};
549
+ options.otherArgs.headers = options.otherArgs.headers || {};
550
+ options.otherArgs.headers['x-goog-request-params'] =
551
+ this._gaxModule.routingHeader.fromParams({
552
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
553
+ });
554
+ this.initialize();
555
+ return this.innerApiCalls.deleteSpace(request, options, callback);
556
+ }
557
+ completeImportSpace(request, optionsOrCallback, callback) {
558
+ var _a;
559
+ request = request || {};
560
+ let options;
561
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
562
+ callback = optionsOrCallback;
563
+ options = {};
564
+ }
565
+ else {
566
+ options = optionsOrCallback;
567
+ }
568
+ options = options || {};
569
+ options.otherArgs = options.otherArgs || {};
570
+ options.otherArgs.headers = options.otherArgs.headers || {};
571
+ options.otherArgs.headers['x-goog-request-params'] =
572
+ this._gaxModule.routingHeader.fromParams({
573
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
574
+ });
575
+ this.initialize();
576
+ return this.innerApiCalls.completeImportSpace(request, options, callback);
577
+ }
578
+ findDirectMessage(request, optionsOrCallback, callback) {
579
+ request = request || {};
580
+ let options;
581
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
582
+ callback = optionsOrCallback;
583
+ options = {};
584
+ }
585
+ else {
586
+ options = optionsOrCallback;
587
+ }
588
+ options = options || {};
589
+ options.otherArgs = options.otherArgs || {};
590
+ options.otherArgs.headers = options.otherArgs.headers || {};
591
+ this.initialize();
592
+ return this.innerApiCalls.findDirectMessage(request, options, callback);
593
+ }
594
+ createMembership(request, optionsOrCallback, callback) {
595
+ var _a;
596
+ request = request || {};
597
+ let options;
598
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
599
+ callback = optionsOrCallback;
600
+ options = {};
601
+ }
602
+ else {
603
+ options = optionsOrCallback;
604
+ }
605
+ options = options || {};
606
+ options.otherArgs = options.otherArgs || {};
607
+ options.otherArgs.headers = options.otherArgs.headers || {};
608
+ options.otherArgs.headers['x-goog-request-params'] =
609
+ this._gaxModule.routingHeader.fromParams({
610
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
611
+ });
612
+ this.initialize();
613
+ return this.innerApiCalls.createMembership(request, options, callback);
614
+ }
615
+ deleteMembership(request, optionsOrCallback, callback) {
616
+ var _a;
617
+ request = request || {};
618
+ let options;
619
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
620
+ callback = optionsOrCallback;
621
+ options = {};
622
+ }
623
+ else {
624
+ options = optionsOrCallback;
625
+ }
626
+ options = options || {};
627
+ options.otherArgs = options.otherArgs || {};
628
+ options.otherArgs.headers = options.otherArgs.headers || {};
629
+ options.otherArgs.headers['x-goog-request-params'] =
630
+ this._gaxModule.routingHeader.fromParams({
631
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
632
+ });
633
+ this.initialize();
634
+ return this.innerApiCalls.deleteMembership(request, options, callback);
635
+ }
636
+ createReaction(request, optionsOrCallback, callback) {
637
+ var _a;
638
+ request = request || {};
639
+ let options;
640
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
641
+ callback = optionsOrCallback;
642
+ options = {};
643
+ }
644
+ else {
645
+ options = optionsOrCallback;
646
+ }
647
+ options = options || {};
648
+ options.otherArgs = options.otherArgs || {};
649
+ options.otherArgs.headers = options.otherArgs.headers || {};
650
+ options.otherArgs.headers['x-goog-request-params'] =
651
+ this._gaxModule.routingHeader.fromParams({
652
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
653
+ });
654
+ this.initialize();
655
+ return this.innerApiCalls.createReaction(request, options, callback);
656
+ }
657
+ deleteReaction(request, optionsOrCallback, callback) {
658
+ var _a;
659
+ request = request || {};
660
+ let options;
661
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
662
+ callback = optionsOrCallback;
663
+ options = {};
664
+ }
665
+ else {
666
+ options = optionsOrCallback;
667
+ }
668
+ options = options || {};
669
+ options.otherArgs = options.otherArgs || {};
670
+ options.otherArgs.headers = options.otherArgs.headers || {};
671
+ options.otherArgs.headers['x-goog-request-params'] =
672
+ this._gaxModule.routingHeader.fromParams({
673
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
674
+ });
675
+ this.initialize();
676
+ return this.innerApiCalls.deleteReaction(request, options, callback);
677
+ }
678
+ listMessages(request, optionsOrCallback, callback) {
679
+ var _a;
680
+ request = request || {};
681
+ let options;
682
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
683
+ callback = optionsOrCallback;
684
+ options = {};
685
+ }
686
+ else {
687
+ options = optionsOrCallback;
688
+ }
689
+ options = options || {};
690
+ options.otherArgs = options.otherArgs || {};
691
+ options.otherArgs.headers = options.otherArgs.headers || {};
692
+ options.otherArgs.headers['x-goog-request-params'] =
693
+ this._gaxModule.routingHeader.fromParams({
694
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
695
+ });
696
+ this.initialize();
697
+ return this.innerApiCalls.listMessages(request, options, callback);
698
+ }
699
+ /**
700
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
701
+ * @param {Object} request
702
+ * The request object that will be sent.
703
+ * @param {string} request.parent
704
+ * Required. The resource name of the space to list messages from.
705
+ *
706
+ * Format: `spaces/{space}`
707
+ * @param {number} request.pageSize
708
+ * The maximum number of messages returned. The service might return fewer
709
+ * messages than this value.
710
+ *
711
+ * If unspecified, at most 25 are returned.
712
+ *
713
+ * The maximum value is 1,000. If you use a value more than 1,000, it's
714
+ * automatically changed to 1,000.
715
+ *
716
+ * Negative values return an `INVALID_ARGUMENT` error.
717
+ * @param {string} request.pageToken
718
+ * Optional, if resuming from a previous query.
719
+ *
720
+ * A page token received from a previous list messages call. Provide this
721
+ * parameter to retrieve the subsequent page.
722
+ *
723
+ * When paginating, all other parameters provided should match the call that
724
+ * provided the page token. Passing different values to the other parameters
725
+ * might lead to unexpected results.
726
+ * @param {string} request.filter
727
+ * A query filter.
728
+ *
729
+ * You can filter messages by date (`create_time`) and thread (`thread.name`).
730
+ *
731
+ * To filter messages by the date they were created, specify the `create_time`
732
+ * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339)
733
+ * format and double quotation marks. For example,
734
+ * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to
735
+ * list messages that were created after a timestamp, or the less than
736
+ * operator `<` to list messages that were created before a timestamp. To
737
+ * filter messages within a time interval, use the `AND` operator between two
738
+ * timestamps.
739
+ *
740
+ * To filter by thread, specify the `thread.name`, formatted as
741
+ * `spaces/{space}/threads/{thread}`. You can only specify one
742
+ * `thread.name` per query.
743
+ *
744
+ * To filter by both thread and date, use the `AND` operator in your query.
745
+ *
746
+ * For example, the following queries are valid:
747
+ *
748
+ * ```
749
+ * create_time > "2012-04-21T11:30:00-04:00"
750
+ *
751
+ * create_time > "2012-04-21T11:30:00-04:00" AND
752
+ * thread.name = spaces/AAAAAAAAAAA/threads/123
753
+ *
754
+ * create_time > "2012-04-21T11:30:00+00:00" AND
755
+ *
756
+ * create_time < "2013-01-01T00:00:00+00:00" AND
757
+ * thread.name = spaces/AAAAAAAAAAA/threads/123
758
+ *
759
+ * thread.name = spaces/AAAAAAAAAAA/threads/123
760
+ * ```
761
+ *
762
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
763
+ * error.
764
+ * @param {string} request.orderBy
765
+ * Optional, if resuming from a previous query.
766
+ *
767
+ * How the list of messages is ordered. Specify a value to order by an
768
+ * ordering operation. Valid ordering operation values are as follows:
769
+ *
770
+ * - `ASC` for ascending.
771
+ *
772
+ * - `DESC` for descending.
773
+ *
774
+ * The default ordering is `create_time ASC`.
775
+ * @param {boolean} request.showDeleted
776
+ * Whether to include deleted messages. Deleted messages include deleted time
777
+ * and metadata about their deletion, but message content is unavailable.
778
+ * @param {object} [options]
779
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
780
+ * @returns {Stream}
781
+ * An object stream which emits an object representing {@link protos.google.chat.v1.Message|Message} on 'data' event.
782
+ * The client library will perform auto-pagination by default: it will call the API as many
783
+ * times as needed. Note that it can affect your quota.
784
+ * We recommend using `listMessagesAsync()`
785
+ * method described below for async iteration which you can stop as needed.
786
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
787
+ * for more details and examples.
788
+ */
789
+ listMessagesStream(request, options) {
790
+ var _a;
791
+ request = request || {};
792
+ options = options || {};
793
+ options.otherArgs = options.otherArgs || {};
794
+ options.otherArgs.headers = options.otherArgs.headers || {};
795
+ options.otherArgs.headers['x-goog-request-params'] =
796
+ this._gaxModule.routingHeader.fromParams({
797
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
798
+ });
799
+ const defaultCallSettings = this._defaults['listMessages'];
800
+ const callSettings = defaultCallSettings.merge(options);
801
+ this.initialize();
802
+ return this.descriptors.page.listMessages.createStream(this.innerApiCalls.listMessages, request, callSettings);
803
+ }
804
+ /**
805
+ * Equivalent to `listMessages`, but returns an iterable object.
806
+ *
807
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
808
+ * @param {Object} request
809
+ * The request object that will be sent.
810
+ * @param {string} request.parent
811
+ * Required. The resource name of the space to list messages from.
812
+ *
813
+ * Format: `spaces/{space}`
814
+ * @param {number} request.pageSize
815
+ * The maximum number of messages returned. The service might return fewer
816
+ * messages than this value.
817
+ *
818
+ * If unspecified, at most 25 are returned.
819
+ *
820
+ * The maximum value is 1,000. If you use a value more than 1,000, it's
821
+ * automatically changed to 1,000.
822
+ *
823
+ * Negative values return an `INVALID_ARGUMENT` error.
824
+ * @param {string} request.pageToken
825
+ * Optional, if resuming from a previous query.
826
+ *
827
+ * A page token received from a previous list messages call. Provide this
828
+ * parameter to retrieve the subsequent page.
829
+ *
830
+ * When paginating, all other parameters provided should match the call that
831
+ * provided the page token. Passing different values to the other parameters
832
+ * might lead to unexpected results.
833
+ * @param {string} request.filter
834
+ * A query filter.
835
+ *
836
+ * You can filter messages by date (`create_time`) and thread (`thread.name`).
837
+ *
838
+ * To filter messages by the date they were created, specify the `create_time`
839
+ * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339)
840
+ * format and double quotation marks. For example,
841
+ * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to
842
+ * list messages that were created after a timestamp, or the less than
843
+ * operator `<` to list messages that were created before a timestamp. To
844
+ * filter messages within a time interval, use the `AND` operator between two
845
+ * timestamps.
846
+ *
847
+ * To filter by thread, specify the `thread.name`, formatted as
848
+ * `spaces/{space}/threads/{thread}`. You can only specify one
849
+ * `thread.name` per query.
850
+ *
851
+ * To filter by both thread and date, use the `AND` operator in your query.
852
+ *
853
+ * For example, the following queries are valid:
854
+ *
855
+ * ```
856
+ * create_time > "2012-04-21T11:30:00-04:00"
857
+ *
858
+ * create_time > "2012-04-21T11:30:00-04:00" AND
859
+ * thread.name = spaces/AAAAAAAAAAA/threads/123
860
+ *
861
+ * create_time > "2012-04-21T11:30:00+00:00" AND
862
+ *
863
+ * create_time < "2013-01-01T00:00:00+00:00" AND
864
+ * thread.name = spaces/AAAAAAAAAAA/threads/123
865
+ *
866
+ * thread.name = spaces/AAAAAAAAAAA/threads/123
867
+ * ```
868
+ *
869
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
870
+ * error.
871
+ * @param {string} request.orderBy
872
+ * Optional, if resuming from a previous query.
873
+ *
874
+ * How the list of messages is ordered. Specify a value to order by an
875
+ * ordering operation. Valid ordering operation values are as follows:
876
+ *
877
+ * - `ASC` for ascending.
878
+ *
879
+ * - `DESC` for descending.
880
+ *
881
+ * The default ordering is `create_time ASC`.
882
+ * @param {boolean} request.showDeleted
883
+ * Whether to include deleted messages. Deleted messages include deleted time
884
+ * and metadata about their deletion, but message content is unavailable.
885
+ * @param {object} [options]
886
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
887
+ * @returns {Object}
888
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
889
+ * When you iterate the returned iterable, each element will be an object representing
890
+ * {@link protos.google.chat.v1.Message|Message}. The API will be called under the hood as needed, once per the page,
891
+ * so you can stop the iteration when you don't need more results.
892
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
893
+ * for more details and examples.
894
+ * @example <caption>include:samples/generated/v1/chat_service.list_messages.js</caption>
895
+ * region_tag:chat_v1_generated_ChatService_ListMessages_async
896
+ */
897
+ listMessagesAsync(request, options) {
898
+ var _a;
899
+ request = request || {};
900
+ options = options || {};
901
+ options.otherArgs = options.otherArgs || {};
902
+ options.otherArgs.headers = options.otherArgs.headers || {};
903
+ options.otherArgs.headers['x-goog-request-params'] =
904
+ this._gaxModule.routingHeader.fromParams({
905
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
906
+ });
907
+ const defaultCallSettings = this._defaults['listMessages'];
908
+ const callSettings = defaultCallSettings.merge(options);
909
+ this.initialize();
910
+ return this.descriptors.page.listMessages.asyncIterate(this.innerApiCalls['listMessages'], request, callSettings);
911
+ }
912
+ listMemberships(request, optionsOrCallback, callback) {
913
+ var _a;
914
+ request = request || {};
915
+ let options;
916
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
917
+ callback = optionsOrCallback;
918
+ options = {};
919
+ }
920
+ else {
921
+ options = optionsOrCallback;
922
+ }
923
+ options = options || {};
924
+ options.otherArgs = options.otherArgs || {};
925
+ options.otherArgs.headers = options.otherArgs.headers || {};
926
+ options.otherArgs.headers['x-goog-request-params'] =
927
+ this._gaxModule.routingHeader.fromParams({
928
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
929
+ });
930
+ this.initialize();
931
+ return this.innerApiCalls.listMemberships(request, options, callback);
932
+ }
933
+ /**
934
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
935
+ * @param {Object} request
936
+ * The request object that will be sent.
937
+ * @param {string} request.parent
938
+ * Required. The resource name of the space for which to fetch a membership
939
+ * list.
940
+ *
941
+ * Format: spaces/{space}
942
+ * @param {number} [request.pageSize]
943
+ * Optional. The maximum number of memberships to return. The service might
944
+ * return fewer than this value.
945
+ *
946
+ * If unspecified, at most 100 memberships are returned.
947
+ *
948
+ * The maximum value is 1,000. If you use a value more than 1,000, it's
949
+ * automatically changed to 1,000.
950
+ *
951
+ * Negative values return an `INVALID_ARGUMENT` error.
952
+ * @param {string} [request.pageToken]
953
+ * Optional. A page token, received from a previous call to list memberships.
954
+ * Provide this parameter to retrieve the subsequent page.
955
+ *
956
+ * When paginating, all other parameters provided should match the call that
957
+ * provided the page token. Passing different values to the other parameters
958
+ * might lead to unexpected results.
959
+ * @param {string} [request.filter]
960
+ * Optional. A query filter.
961
+ *
962
+ * You can filter memberships by a member's role
963
+ * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole))
964
+ * and type
965
+ * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)).
966
+ *
967
+ * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.
968
+ *
969
+ * To filter by type, set `member.type` to `HUMAN` or `BOT`.
970
+ *
971
+ * To filter by both role and type, use the `AND` operator. To filter by
972
+ * either role or type, use the `OR` operator.
973
+ *
974
+ * For example, the following queries are valid:
975
+ *
976
+ * ```
977
+ * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
978
+ * member.type = "HUMAN" AND role = "ROLE_MANAGER"
979
+ * ```
980
+ *
981
+ * The following queries are invalid:
982
+ *
983
+ * ```
984
+ * member.type = "HUMAN" AND member.type = "BOT"
985
+ * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
986
+ * ```
987
+ *
988
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
989
+ * error.
990
+ * @param {boolean} [request.showGroups]
991
+ * Optional. When `true`, also returns memberships associated with a
992
+ * {@link protos.google.chat.v1.Membership.group_member|Google Group}, in
993
+ * addition to other types of memberships. If a
994
+ * {@link protos.google.chat.v1.ListMembershipsRequest.filter|filter} is set,
995
+ * {@link protos.google.chat.v1.Membership.group_member|Google Group}
996
+ * memberships that don't match the filter criteria aren't returned.
997
+ * @param {boolean} [request.showInvited]
998
+ * Optional. When `true`, also returns memberships associated with
999
+ * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} members, in
1000
+ * addition to other types of memberships. If a
1001
+ * filter is set,
1002
+ * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} memberships
1003
+ * that don't match the filter criteria aren't returned.
1004
+ *
1005
+ * Currently requires [user
1006
+ * authentication](https://developers.google.com/chat/api/guides/auth/users).
1007
+ * @param {object} [options]
1008
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1009
+ * @returns {Stream}
1010
+ * An object stream which emits an object representing {@link protos.google.chat.v1.Membership|Membership} on 'data' event.
1011
+ * The client library will perform auto-pagination by default: it will call the API as many
1012
+ * times as needed. Note that it can affect your quota.
1013
+ * We recommend using `listMembershipsAsync()`
1014
+ * method described below for async iteration which you can stop as needed.
1015
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1016
+ * for more details and examples.
1017
+ */
1018
+ listMembershipsStream(request, options) {
1019
+ var _a;
1020
+ request = request || {};
1021
+ options = options || {};
1022
+ options.otherArgs = options.otherArgs || {};
1023
+ options.otherArgs.headers = options.otherArgs.headers || {};
1024
+ options.otherArgs.headers['x-goog-request-params'] =
1025
+ this._gaxModule.routingHeader.fromParams({
1026
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1027
+ });
1028
+ const defaultCallSettings = this._defaults['listMemberships'];
1029
+ const callSettings = defaultCallSettings.merge(options);
1030
+ this.initialize();
1031
+ return this.descriptors.page.listMemberships.createStream(this.innerApiCalls.listMemberships, request, callSettings);
1032
+ }
1033
+ /**
1034
+ * Equivalent to `listMemberships`, but returns an iterable object.
1035
+ *
1036
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1037
+ * @param {Object} request
1038
+ * The request object that will be sent.
1039
+ * @param {string} request.parent
1040
+ * Required. The resource name of the space for which to fetch a membership
1041
+ * list.
1042
+ *
1043
+ * Format: spaces/{space}
1044
+ * @param {number} [request.pageSize]
1045
+ * Optional. The maximum number of memberships to return. The service might
1046
+ * return fewer than this value.
1047
+ *
1048
+ * If unspecified, at most 100 memberships are returned.
1049
+ *
1050
+ * The maximum value is 1,000. If you use a value more than 1,000, it's
1051
+ * automatically changed to 1,000.
1052
+ *
1053
+ * Negative values return an `INVALID_ARGUMENT` error.
1054
+ * @param {string} [request.pageToken]
1055
+ * Optional. A page token, received from a previous call to list memberships.
1056
+ * Provide this parameter to retrieve the subsequent page.
1057
+ *
1058
+ * When paginating, all other parameters provided should match the call that
1059
+ * provided the page token. Passing different values to the other parameters
1060
+ * might lead to unexpected results.
1061
+ * @param {string} [request.filter]
1062
+ * Optional. A query filter.
1063
+ *
1064
+ * You can filter memberships by a member's role
1065
+ * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole))
1066
+ * and type
1067
+ * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)).
1068
+ *
1069
+ * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.
1070
+ *
1071
+ * To filter by type, set `member.type` to `HUMAN` or `BOT`.
1072
+ *
1073
+ * To filter by both role and type, use the `AND` operator. To filter by
1074
+ * either role or type, use the `OR` operator.
1075
+ *
1076
+ * For example, the following queries are valid:
1077
+ *
1078
+ * ```
1079
+ * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
1080
+ * member.type = "HUMAN" AND role = "ROLE_MANAGER"
1081
+ * ```
1082
+ *
1083
+ * The following queries are invalid:
1084
+ *
1085
+ * ```
1086
+ * member.type = "HUMAN" AND member.type = "BOT"
1087
+ * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
1088
+ * ```
1089
+ *
1090
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
1091
+ * error.
1092
+ * @param {boolean} [request.showGroups]
1093
+ * Optional. When `true`, also returns memberships associated with a
1094
+ * {@link protos.google.chat.v1.Membership.group_member|Google Group}, in
1095
+ * addition to other types of memberships. If a
1096
+ * {@link protos.google.chat.v1.ListMembershipsRequest.filter|filter} is set,
1097
+ * {@link protos.google.chat.v1.Membership.group_member|Google Group}
1098
+ * memberships that don't match the filter criteria aren't returned.
1099
+ * @param {boolean} [request.showInvited]
1100
+ * Optional. When `true`, also returns memberships associated with
1101
+ * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} members, in
1102
+ * addition to other types of memberships. If a
1103
+ * filter is set,
1104
+ * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} memberships
1105
+ * that don't match the filter criteria aren't returned.
1106
+ *
1107
+ * Currently requires [user
1108
+ * authentication](https://developers.google.com/chat/api/guides/auth/users).
1109
+ * @param {object} [options]
1110
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1111
+ * @returns {Object}
1112
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1113
+ * When you iterate the returned iterable, each element will be an object representing
1114
+ * {@link protos.google.chat.v1.Membership|Membership}. The API will be called under the hood as needed, once per the page,
1115
+ * so you can stop the iteration when you don't need more results.
1116
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1117
+ * for more details and examples.
1118
+ * @example <caption>include:samples/generated/v1/chat_service.list_memberships.js</caption>
1119
+ * region_tag:chat_v1_generated_ChatService_ListMemberships_async
1120
+ */
1121
+ listMembershipsAsync(request, options) {
1122
+ var _a;
1123
+ request = request || {};
1124
+ options = options || {};
1125
+ options.otherArgs = options.otherArgs || {};
1126
+ options.otherArgs.headers = options.otherArgs.headers || {};
1127
+ options.otherArgs.headers['x-goog-request-params'] =
1128
+ this._gaxModule.routingHeader.fromParams({
1129
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1130
+ });
1131
+ const defaultCallSettings = this._defaults['listMemberships'];
1132
+ const callSettings = defaultCallSettings.merge(options);
1133
+ this.initialize();
1134
+ return this.descriptors.page.listMemberships.asyncIterate(this.innerApiCalls['listMemberships'], request, callSettings);
1135
+ }
1136
+ listSpaces(request, optionsOrCallback, callback) {
1137
+ request = request || {};
1138
+ let options;
1139
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1140
+ callback = optionsOrCallback;
1141
+ options = {};
1142
+ }
1143
+ else {
1144
+ options = optionsOrCallback;
1145
+ }
1146
+ options = options || {};
1147
+ options.otherArgs = options.otherArgs || {};
1148
+ options.otherArgs.headers = options.otherArgs.headers || {};
1149
+ this.initialize();
1150
+ return this.innerApiCalls.listSpaces(request, options, callback);
1151
+ }
1152
+ /**
1153
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1154
+ * @param {Object} request
1155
+ * The request object that will be sent.
1156
+ * @param {number} [request.pageSize]
1157
+ * Optional. The maximum number of spaces to return. The service might return
1158
+ * fewer than this value.
1159
+ *
1160
+ * If unspecified, at most 100 spaces are returned.
1161
+ *
1162
+ * The maximum value is 1,000. If you use a value more than 1,000, it's
1163
+ * automatically changed to 1,000.
1164
+ *
1165
+ * Negative values return an `INVALID_ARGUMENT` error.
1166
+ * @param {string} [request.pageToken]
1167
+ * Optional. A page token, received from a previous list spaces call.
1168
+ * Provide this parameter to retrieve the subsequent page.
1169
+ *
1170
+ * When paginating, the filter value should match the call that provided the
1171
+ * page token. Passing a different value may lead to unexpected results.
1172
+ * @param {string} [request.filter]
1173
+ * Optional. A query filter.
1174
+ *
1175
+ * You can filter spaces by the space type
1176
+ * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)).
1177
+ *
1178
+ * To filter by space type, you must specify valid enum value, such as
1179
+ * `SPACE` or `GROUP_CHAT` (the `space_type` can't be
1180
+ * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
1181
+ * operator.
1182
+ *
1183
+ * For example, the following queries are valid:
1184
+ *
1185
+ * ```
1186
+ * space_type = "SPACE"
1187
+ * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"
1188
+ * ```
1189
+ *
1190
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
1191
+ * error.
1192
+ * @param {object} [options]
1193
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1194
+ * @returns {Stream}
1195
+ * An object stream which emits an object representing {@link protos.google.chat.v1.Space|Space} on 'data' event.
1196
+ * The client library will perform auto-pagination by default: it will call the API as many
1197
+ * times as needed. Note that it can affect your quota.
1198
+ * We recommend using `listSpacesAsync()`
1199
+ * method described below for async iteration which you can stop as needed.
1200
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1201
+ * for more details and examples.
1202
+ */
1203
+ listSpacesStream(request, options) {
1204
+ request = request || {};
1205
+ options = options || {};
1206
+ options.otherArgs = options.otherArgs || {};
1207
+ options.otherArgs.headers = options.otherArgs.headers || {};
1208
+ const defaultCallSettings = this._defaults['listSpaces'];
1209
+ const callSettings = defaultCallSettings.merge(options);
1210
+ this.initialize();
1211
+ return this.descriptors.page.listSpaces.createStream(this.innerApiCalls.listSpaces, request, callSettings);
1212
+ }
1213
+ /**
1214
+ * Equivalent to `listSpaces`, but returns an iterable object.
1215
+ *
1216
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1217
+ * @param {Object} request
1218
+ * The request object that will be sent.
1219
+ * @param {number} [request.pageSize]
1220
+ * Optional. The maximum number of spaces to return. The service might return
1221
+ * fewer than this value.
1222
+ *
1223
+ * If unspecified, at most 100 spaces are returned.
1224
+ *
1225
+ * The maximum value is 1,000. If you use a value more than 1,000, it's
1226
+ * automatically changed to 1,000.
1227
+ *
1228
+ * Negative values return an `INVALID_ARGUMENT` error.
1229
+ * @param {string} [request.pageToken]
1230
+ * Optional. A page token, received from a previous list spaces call.
1231
+ * Provide this parameter to retrieve the subsequent page.
1232
+ *
1233
+ * When paginating, the filter value should match the call that provided the
1234
+ * page token. Passing a different value may lead to unexpected results.
1235
+ * @param {string} [request.filter]
1236
+ * Optional. A query filter.
1237
+ *
1238
+ * You can filter spaces by the space type
1239
+ * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)).
1240
+ *
1241
+ * To filter by space type, you must specify valid enum value, such as
1242
+ * `SPACE` or `GROUP_CHAT` (the `space_type` can't be
1243
+ * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
1244
+ * operator.
1245
+ *
1246
+ * For example, the following queries are valid:
1247
+ *
1248
+ * ```
1249
+ * space_type = "SPACE"
1250
+ * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"
1251
+ * ```
1252
+ *
1253
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
1254
+ * error.
1255
+ * @param {object} [options]
1256
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1257
+ * @returns {Object}
1258
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1259
+ * When you iterate the returned iterable, each element will be an object representing
1260
+ * {@link protos.google.chat.v1.Space|Space}. The API will be called under the hood as needed, once per the page,
1261
+ * so you can stop the iteration when you don't need more results.
1262
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1263
+ * for more details and examples.
1264
+ * @example <caption>include:samples/generated/v1/chat_service.list_spaces.js</caption>
1265
+ * region_tag:chat_v1_generated_ChatService_ListSpaces_async
1266
+ */
1267
+ listSpacesAsync(request, options) {
1268
+ request = request || {};
1269
+ options = options || {};
1270
+ options.otherArgs = options.otherArgs || {};
1271
+ options.otherArgs.headers = options.otherArgs.headers || {};
1272
+ const defaultCallSettings = this._defaults['listSpaces'];
1273
+ const callSettings = defaultCallSettings.merge(options);
1274
+ this.initialize();
1275
+ return this.descriptors.page.listSpaces.asyncIterate(this.innerApiCalls['listSpaces'], request, callSettings);
1276
+ }
1277
+ listReactions(request, optionsOrCallback, callback) {
1278
+ var _a;
1279
+ request = request || {};
1280
+ let options;
1281
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1282
+ callback = optionsOrCallback;
1283
+ options = {};
1284
+ }
1285
+ else {
1286
+ options = optionsOrCallback;
1287
+ }
1288
+ options = options || {};
1289
+ options.otherArgs = options.otherArgs || {};
1290
+ options.otherArgs.headers = options.otherArgs.headers || {};
1291
+ options.otherArgs.headers['x-goog-request-params'] =
1292
+ this._gaxModule.routingHeader.fromParams({
1293
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1294
+ });
1295
+ this.initialize();
1296
+ return this.innerApiCalls.listReactions(request, options, callback);
1297
+ }
1298
+ /**
1299
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1300
+ * @param {Object} request
1301
+ * The request object that will be sent.
1302
+ * @param {string} request.parent
1303
+ * Required. The message users reacted to.
1304
+ *
1305
+ * Format: `spaces/{space}/messages/{message}`
1306
+ * @param {number} [request.pageSize]
1307
+ * Optional. The maximum number of reactions returned. The service can return
1308
+ * fewer reactions than this value. If unspecified, the default value is 25.
1309
+ * The maximum value is 200; values above 200 are changed to 200.
1310
+ * @param {string} [request.pageToken]
1311
+ * Optional. (If resuming from a previous query.)
1312
+ *
1313
+ * A page token received from a previous list reactions call. Provide this
1314
+ * to retrieve the subsequent page.
1315
+ *
1316
+ * When paginating, the filter value should match the call that provided the
1317
+ * page token. Passing a different value might lead to unexpected results.
1318
+ * @param {string} [request.filter]
1319
+ * Optional. A query filter.
1320
+ *
1321
+ * You can filter reactions by
1322
+ * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji)
1323
+ * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and
1324
+ * [user](https://developers.google.com/chat/api/reference/rest/v1/User)
1325
+ * (`user.name`).
1326
+ *
1327
+ * To filter reactions for multiple emojis or users, join similar fields
1328
+ * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode =
1329
+ * "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`.
1330
+ *
1331
+ * To filter reactions by emoji and user, use the `AND` operator, such as
1332
+ * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`.
1333
+ *
1334
+ * If your query uses both `AND` and `OR`, group them with parentheses.
1335
+ *
1336
+ * For example, the following queries are valid:
1337
+ *
1338
+ * ```
1339
+ * user.name = "users/{user}"
1340
+ * emoji.unicode = "🙂"
1341
+ * emoji.custom_emoji.uid = "{uid}"
1342
+ * emoji.unicode = "🙂" OR emoji.unicode = "👍"
1343
+ * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
1344
+ * emoji.unicode = "🙂" AND user.name = "users/{user}"
1345
+ * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}")
1346
+ * AND user.name = "users/{user}"
1347
+ * ```
1348
+ *
1349
+ * The following queries are invalid:
1350
+ *
1351
+ * ```
1352
+ * emoji.unicode = "🙂" AND emoji.unicode = "👍"
1353
+ * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}"
1354
+ * emoji.unicode = "🙂" OR user.name = "users/{user}"
1355
+ * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR
1356
+ * user.name = "users/{user}"
1357
+ * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
1358
+ * AND user.name = "users/{user}"
1359
+ * ```
1360
+ *
1361
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
1362
+ * error.
1363
+ * @param {object} [options]
1364
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1365
+ * @returns {Stream}
1366
+ * An object stream which emits an object representing {@link protos.google.chat.v1.Reaction|Reaction} on 'data' event.
1367
+ * The client library will perform auto-pagination by default: it will call the API as many
1368
+ * times as needed. Note that it can affect your quota.
1369
+ * We recommend using `listReactionsAsync()`
1370
+ * method described below for async iteration which you can stop as needed.
1371
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1372
+ * for more details and examples.
1373
+ */
1374
+ listReactionsStream(request, options) {
1375
+ var _a;
1376
+ request = request || {};
1377
+ options = options || {};
1378
+ options.otherArgs = options.otherArgs || {};
1379
+ options.otherArgs.headers = options.otherArgs.headers || {};
1380
+ options.otherArgs.headers['x-goog-request-params'] =
1381
+ this._gaxModule.routingHeader.fromParams({
1382
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1383
+ });
1384
+ const defaultCallSettings = this._defaults['listReactions'];
1385
+ const callSettings = defaultCallSettings.merge(options);
1386
+ this.initialize();
1387
+ return this.descriptors.page.listReactions.createStream(this.innerApiCalls.listReactions, request, callSettings);
1388
+ }
1389
+ /**
1390
+ * Equivalent to `listReactions`, but returns an iterable object.
1391
+ *
1392
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1393
+ * @param {Object} request
1394
+ * The request object that will be sent.
1395
+ * @param {string} request.parent
1396
+ * Required. The message users reacted to.
1397
+ *
1398
+ * Format: `spaces/{space}/messages/{message}`
1399
+ * @param {number} [request.pageSize]
1400
+ * Optional. The maximum number of reactions returned. The service can return
1401
+ * fewer reactions than this value. If unspecified, the default value is 25.
1402
+ * The maximum value is 200; values above 200 are changed to 200.
1403
+ * @param {string} [request.pageToken]
1404
+ * Optional. (If resuming from a previous query.)
1405
+ *
1406
+ * A page token received from a previous list reactions call. Provide this
1407
+ * to retrieve the subsequent page.
1408
+ *
1409
+ * When paginating, the filter value should match the call that provided the
1410
+ * page token. Passing a different value might lead to unexpected results.
1411
+ * @param {string} [request.filter]
1412
+ * Optional. A query filter.
1413
+ *
1414
+ * You can filter reactions by
1415
+ * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji)
1416
+ * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and
1417
+ * [user](https://developers.google.com/chat/api/reference/rest/v1/User)
1418
+ * (`user.name`).
1419
+ *
1420
+ * To filter reactions for multiple emojis or users, join similar fields
1421
+ * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode =
1422
+ * "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`.
1423
+ *
1424
+ * To filter reactions by emoji and user, use the `AND` operator, such as
1425
+ * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`.
1426
+ *
1427
+ * If your query uses both `AND` and `OR`, group them with parentheses.
1428
+ *
1429
+ * For example, the following queries are valid:
1430
+ *
1431
+ * ```
1432
+ * user.name = "users/{user}"
1433
+ * emoji.unicode = "🙂"
1434
+ * emoji.custom_emoji.uid = "{uid}"
1435
+ * emoji.unicode = "🙂" OR emoji.unicode = "👍"
1436
+ * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
1437
+ * emoji.unicode = "🙂" AND user.name = "users/{user}"
1438
+ * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}")
1439
+ * AND user.name = "users/{user}"
1440
+ * ```
1441
+ *
1442
+ * The following queries are invalid:
1443
+ *
1444
+ * ```
1445
+ * emoji.unicode = "🙂" AND emoji.unicode = "👍"
1446
+ * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}"
1447
+ * emoji.unicode = "🙂" OR user.name = "users/{user}"
1448
+ * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR
1449
+ * user.name = "users/{user}"
1450
+ * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
1451
+ * AND user.name = "users/{user}"
1452
+ * ```
1453
+ *
1454
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
1455
+ * error.
1456
+ * @param {object} [options]
1457
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1458
+ * @returns {Object}
1459
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1460
+ * When you iterate the returned iterable, each element will be an object representing
1461
+ * {@link protos.google.chat.v1.Reaction|Reaction}. The API will be called under the hood as needed, once per the page,
1462
+ * so you can stop the iteration when you don't need more results.
1463
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1464
+ * for more details and examples.
1465
+ * @example <caption>include:samples/generated/v1/chat_service.list_reactions.js</caption>
1466
+ * region_tag:chat_v1_generated_ChatService_ListReactions_async
1467
+ */
1468
+ listReactionsAsync(request, options) {
1469
+ var _a;
1470
+ request = request || {};
1471
+ options = options || {};
1472
+ options.otherArgs = options.otherArgs || {};
1473
+ options.otherArgs.headers = options.otherArgs.headers || {};
1474
+ options.otherArgs.headers['x-goog-request-params'] =
1475
+ this._gaxModule.routingHeader.fromParams({
1476
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1477
+ });
1478
+ const defaultCallSettings = this._defaults['listReactions'];
1479
+ const callSettings = defaultCallSettings.merge(options);
1480
+ this.initialize();
1481
+ return this.descriptors.page.listReactions.asyncIterate(this.innerApiCalls['listReactions'], request, callSettings);
1482
+ }
1483
+ // --------------------
1484
+ // -- Path templates --
1485
+ // --------------------
1486
+ /**
1487
+ * Return a fully-qualified attachment resource name string.
1488
+ *
1489
+ * @param {string} space
1490
+ * @param {string} message
1491
+ * @param {string} attachment
1492
+ * @returns {string} Resource name string.
1493
+ */
1494
+ attachmentPath(space, message, attachment) {
1495
+ return this.pathTemplates.attachmentPathTemplate.render({
1496
+ space: space,
1497
+ message: message,
1498
+ attachment: attachment,
1499
+ });
1500
+ }
1501
+ /**
1502
+ * Parse the space from Attachment resource.
1503
+ *
1504
+ * @param {string} attachmentName
1505
+ * A fully-qualified path representing Attachment resource.
1506
+ * @returns {string} A string representing the space.
1507
+ */
1508
+ matchSpaceFromAttachmentName(attachmentName) {
1509
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
1510
+ .space;
1511
+ }
1512
+ /**
1513
+ * Parse the message from Attachment resource.
1514
+ *
1515
+ * @param {string} attachmentName
1516
+ * A fully-qualified path representing Attachment resource.
1517
+ * @returns {string} A string representing the message.
1518
+ */
1519
+ matchMessageFromAttachmentName(attachmentName) {
1520
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
1521
+ .message;
1522
+ }
1523
+ /**
1524
+ * Parse the attachment from Attachment resource.
1525
+ *
1526
+ * @param {string} attachmentName
1527
+ * A fully-qualified path representing Attachment resource.
1528
+ * @returns {string} A string representing the attachment.
1529
+ */
1530
+ matchAttachmentFromAttachmentName(attachmentName) {
1531
+ return this.pathTemplates.attachmentPathTemplate.match(attachmentName)
1532
+ .attachment;
1533
+ }
1534
+ /**
1535
+ * Return a fully-qualified membership resource name string.
1536
+ *
1537
+ * @param {string} space
1538
+ * @param {string} member
1539
+ * @returns {string} Resource name string.
1540
+ */
1541
+ membershipPath(space, member) {
1542
+ return this.pathTemplates.membershipPathTemplate.render({
1543
+ space: space,
1544
+ member: member,
1545
+ });
1546
+ }
1547
+ /**
1548
+ * Parse the space from Membership resource.
1549
+ *
1550
+ * @param {string} membershipName
1551
+ * A fully-qualified path representing Membership resource.
1552
+ * @returns {string} A string representing the space.
1553
+ */
1554
+ matchSpaceFromMembershipName(membershipName) {
1555
+ return this.pathTemplates.membershipPathTemplate.match(membershipName)
1556
+ .space;
1557
+ }
1558
+ /**
1559
+ * Parse the member from Membership resource.
1560
+ *
1561
+ * @param {string} membershipName
1562
+ * A fully-qualified path representing Membership resource.
1563
+ * @returns {string} A string representing the member.
1564
+ */
1565
+ matchMemberFromMembershipName(membershipName) {
1566
+ return this.pathTemplates.membershipPathTemplate.match(membershipName)
1567
+ .member;
1568
+ }
1569
+ /**
1570
+ * Return a fully-qualified message resource name string.
1571
+ *
1572
+ * @param {string} space
1573
+ * @param {string} message
1574
+ * @returns {string} Resource name string.
1575
+ */
1576
+ messagePath(space, message) {
1577
+ return this.pathTemplates.messagePathTemplate.render({
1578
+ space: space,
1579
+ message: message,
1580
+ });
1581
+ }
1582
+ /**
1583
+ * Parse the space from Message resource.
1584
+ *
1585
+ * @param {string} messageName
1586
+ * A fully-qualified path representing Message resource.
1587
+ * @returns {string} A string representing the space.
1588
+ */
1589
+ matchSpaceFromMessageName(messageName) {
1590
+ return this.pathTemplates.messagePathTemplate.match(messageName).space;
1591
+ }
1592
+ /**
1593
+ * Parse the message from Message resource.
1594
+ *
1595
+ * @param {string} messageName
1596
+ * A fully-qualified path representing Message resource.
1597
+ * @returns {string} A string representing the message.
1598
+ */
1599
+ matchMessageFromMessageName(messageName) {
1600
+ return this.pathTemplates.messagePathTemplate.match(messageName).message;
1601
+ }
1602
+ /**
1603
+ * Return a fully-qualified quotedMessageMetadata resource name string.
1604
+ *
1605
+ * @param {string} space
1606
+ * @param {string} message
1607
+ * @param {string} quoted_message_metadata
1608
+ * @returns {string} Resource name string.
1609
+ */
1610
+ quotedMessageMetadataPath(space, message, quotedMessageMetadata) {
1611
+ return this.pathTemplates.quotedMessageMetadataPathTemplate.render({
1612
+ space: space,
1613
+ message: message,
1614
+ quoted_message_metadata: quotedMessageMetadata,
1615
+ });
1616
+ }
1617
+ /**
1618
+ * Parse the space from QuotedMessageMetadata resource.
1619
+ *
1620
+ * @param {string} quotedMessageMetadataName
1621
+ * A fully-qualified path representing QuotedMessageMetadata resource.
1622
+ * @returns {string} A string representing the space.
1623
+ */
1624
+ matchSpaceFromQuotedMessageMetadataName(quotedMessageMetadataName) {
1625
+ return this.pathTemplates.quotedMessageMetadataPathTemplate.match(quotedMessageMetadataName).space;
1626
+ }
1627
+ /**
1628
+ * Parse the message from QuotedMessageMetadata resource.
1629
+ *
1630
+ * @param {string} quotedMessageMetadataName
1631
+ * A fully-qualified path representing QuotedMessageMetadata resource.
1632
+ * @returns {string} A string representing the message.
1633
+ */
1634
+ matchMessageFromQuotedMessageMetadataName(quotedMessageMetadataName) {
1635
+ return this.pathTemplates.quotedMessageMetadataPathTemplate.match(quotedMessageMetadataName).message;
1636
+ }
1637
+ /**
1638
+ * Parse the quoted_message_metadata from QuotedMessageMetadata resource.
1639
+ *
1640
+ * @param {string} quotedMessageMetadataName
1641
+ * A fully-qualified path representing QuotedMessageMetadata resource.
1642
+ * @returns {string} A string representing the quoted_message_metadata.
1643
+ */
1644
+ matchQuotedMessageMetadataFromQuotedMessageMetadataName(quotedMessageMetadataName) {
1645
+ return this.pathTemplates.quotedMessageMetadataPathTemplate.match(quotedMessageMetadataName).quoted_message_metadata;
1646
+ }
1647
+ /**
1648
+ * Return a fully-qualified reaction resource name string.
1649
+ *
1650
+ * @param {string} space
1651
+ * @param {string} message
1652
+ * @param {string} reaction
1653
+ * @returns {string} Resource name string.
1654
+ */
1655
+ reactionPath(space, message, reaction) {
1656
+ return this.pathTemplates.reactionPathTemplate.render({
1657
+ space: space,
1658
+ message: message,
1659
+ reaction: reaction,
1660
+ });
1661
+ }
1662
+ /**
1663
+ * Parse the space from Reaction resource.
1664
+ *
1665
+ * @param {string} reactionName
1666
+ * A fully-qualified path representing Reaction resource.
1667
+ * @returns {string} A string representing the space.
1668
+ */
1669
+ matchSpaceFromReactionName(reactionName) {
1670
+ return this.pathTemplates.reactionPathTemplate.match(reactionName).space;
1671
+ }
1672
+ /**
1673
+ * Parse the message from Reaction resource.
1674
+ *
1675
+ * @param {string} reactionName
1676
+ * A fully-qualified path representing Reaction resource.
1677
+ * @returns {string} A string representing the message.
1678
+ */
1679
+ matchMessageFromReactionName(reactionName) {
1680
+ return this.pathTemplates.reactionPathTemplate.match(reactionName).message;
1681
+ }
1682
+ /**
1683
+ * Parse the reaction from Reaction resource.
1684
+ *
1685
+ * @param {string} reactionName
1686
+ * A fully-qualified path representing Reaction resource.
1687
+ * @returns {string} A string representing the reaction.
1688
+ */
1689
+ matchReactionFromReactionName(reactionName) {
1690
+ return this.pathTemplates.reactionPathTemplate.match(reactionName).reaction;
1691
+ }
1692
+ /**
1693
+ * Return a fully-qualified space resource name string.
1694
+ *
1695
+ * @param {string} space
1696
+ * @returns {string} Resource name string.
1697
+ */
1698
+ spacePath(space) {
1699
+ return this.pathTemplates.spacePathTemplate.render({
1700
+ space: space,
1701
+ });
1702
+ }
1703
+ /**
1704
+ * Parse the space from Space resource.
1705
+ *
1706
+ * @param {string} spaceName
1707
+ * A fully-qualified path representing Space resource.
1708
+ * @returns {string} A string representing the space.
1709
+ */
1710
+ matchSpaceFromSpaceName(spaceName) {
1711
+ return this.pathTemplates.spacePathTemplate.match(spaceName).space;
1712
+ }
1713
+ /**
1714
+ * Return a fully-qualified thread resource name string.
1715
+ *
1716
+ * @param {string} space
1717
+ * @param {string} thread
1718
+ * @returns {string} Resource name string.
1719
+ */
1720
+ threadPath(space, thread) {
1721
+ return this.pathTemplates.threadPathTemplate.render({
1722
+ space: space,
1723
+ thread: thread,
1724
+ });
1725
+ }
1726
+ /**
1727
+ * Parse the space from Thread resource.
1728
+ *
1729
+ * @param {string} threadName
1730
+ * A fully-qualified path representing Thread resource.
1731
+ * @returns {string} A string representing the space.
1732
+ */
1733
+ matchSpaceFromThreadName(threadName) {
1734
+ return this.pathTemplates.threadPathTemplate.match(threadName).space;
1735
+ }
1736
+ /**
1737
+ * Parse the thread from Thread resource.
1738
+ *
1739
+ * @param {string} threadName
1740
+ * A fully-qualified path representing Thread resource.
1741
+ * @returns {string} A string representing the thread.
1742
+ */
1743
+ matchThreadFromThreadName(threadName) {
1744
+ return this.pathTemplates.threadPathTemplate.match(threadName).thread;
1745
+ }
1746
+ /**
1747
+ * Terminate the gRPC channel and close the client.
1748
+ *
1749
+ * The client will no longer be usable and all future behavior is undefined.
1750
+ * @returns {Promise} A promise that resolves when the client is closed.
1751
+ */
1752
+ close() {
1753
+ if (this.chatServiceStub && !this._terminated) {
1754
+ return this.chatServiceStub.then(stub => {
1755
+ this._terminated = true;
1756
+ stub.close();
1757
+ });
1758
+ }
1759
+ return Promise.resolve();
1760
+ }
1761
+ }
1762
+ exports.ChatServiceClient = ChatServiceClient;
1763
+ //# sourceMappingURL=chat_service_client.js.map