@google-apps/chat 0.6.0 → 0.8.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.
@@ -1220,6 +1220,44 @@ export declare class ChatServiceClient {
1220
1220
  ]>;
1221
1221
  getThreadReadState(request: protos.google.chat.v1.IGetThreadReadStateRequest, options: CallOptions, callback: Callback<protos.google.chat.v1.IThreadReadState, protos.google.chat.v1.IGetThreadReadStateRequest | null | undefined, {} | null | undefined>): void;
1222
1222
  getThreadReadState(request: protos.google.chat.v1.IGetThreadReadStateRequest, callback: Callback<protos.google.chat.v1.IThreadReadState, protos.google.chat.v1.IGetThreadReadStateRequest | null | undefined, {} | null | undefined>): void;
1223
+ /**
1224
+ * Returns an event from a Google Chat space. The [event
1225
+ * payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
1226
+ * contains the most recent version of the resource that changed. For example,
1227
+ * if you request an event about a new message but the message was later
1228
+ * updated, the server returns the updated `Message` resource in the event
1229
+ * payload.
1230
+ *
1231
+ * Requires [user
1232
+ * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1233
+ * To get an event, the authenticated user must be a member of the space.
1234
+ *
1235
+ * For an example, see [Get details about an
1236
+ * event from a Google Chat
1237
+ * space](https://developers.google.com/workspace/chat/get-space-event).
1238
+ *
1239
+ * @param {Object} request
1240
+ * The request object that will be sent.
1241
+ * @param {string} request.name
1242
+ * Required. The resource name of the space event.
1243
+ *
1244
+ * Format: `spaces/{space}/spaceEvents/{spaceEvent}`
1245
+ * @param {object} [options]
1246
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1247
+ * @returns {Promise} - The promise which resolves to an array.
1248
+ * The first element of the array is an object representing {@link protos.google.chat.v1.SpaceEvent|SpaceEvent}.
1249
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
1250
+ * for more details and examples.
1251
+ * @example <caption>include:samples/generated/v1/chat_service.get_space_event.js</caption>
1252
+ * region_tag:chat_v1_generated_ChatService_GetSpaceEvent_async
1253
+ */
1254
+ getSpaceEvent(request?: protos.google.chat.v1.IGetSpaceEventRequest, options?: CallOptions): Promise<[
1255
+ protos.google.chat.v1.ISpaceEvent,
1256
+ protos.google.chat.v1.IGetSpaceEventRequest | undefined,
1257
+ {} | undefined
1258
+ ]>;
1259
+ getSpaceEvent(request: protos.google.chat.v1.IGetSpaceEventRequest, options: CallOptions, callback: Callback<protos.google.chat.v1.ISpaceEvent, protos.google.chat.v1.IGetSpaceEventRequest | null | undefined, {} | null | undefined>): void;
1260
+ getSpaceEvent(request: protos.google.chat.v1.IGetSpaceEventRequest, callback: Callback<protos.google.chat.v1.ISpaceEvent, protos.google.chat.v1.IGetSpaceEventRequest | null | undefined, {} | null | undefined>): void;
1223
1261
  /**
1224
1262
  * Lists messages in a space that the caller is a member of, including
1225
1263
  * messages from blocked members and spaces. For an example, see
@@ -2247,6 +2285,291 @@ export declare class ChatServiceClient {
2247
2285
  * region_tag:chat_v1_generated_ChatService_ListReactions_async
2248
2286
  */
2249
2287
  listReactionsAsync(request?: protos.google.chat.v1.IListReactionsRequest, options?: CallOptions): AsyncIterable<protos.google.chat.v1.IReaction>;
2288
+ /**
2289
+ * Lists events from a Google Chat space. For each event, the
2290
+ * [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
2291
+ * contains the most recent version of the Chat resource. For example, if you
2292
+ * list events about new space members, the server returns `Membership`
2293
+ * resources that contain the latest membership details. If new members were
2294
+ * removed during the requested period, the event payload contains an empty
2295
+ * `Membership` resource.
2296
+ *
2297
+ * Requires [user
2298
+ * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2299
+ * To list events, the authenticated user must be a member of the space.
2300
+ *
2301
+ * For an example, see [List events from a Google Chat
2302
+ * space](https://developers.google.com/workspace/chat/list-space-events).
2303
+ *
2304
+ * @param {Object} request
2305
+ * The request object that will be sent.
2306
+ * @param {string} request.parent
2307
+ * Required. Resource name of the [Google Chat
2308
+ * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces)
2309
+ * where the events occurred.
2310
+ *
2311
+ * Format: `spaces/{space}`.
2312
+ * @param {number} request.pageSize
2313
+ * Optional. The maximum number of space events returned. The service might
2314
+ * return fewer than this value.
2315
+ *
2316
+ * Negative values return an `INVALID_ARGUMENT` error.
2317
+ * @param {string} request.pageToken
2318
+ * A page token, received from a previous list space events call. Provide this
2319
+ * to retrieve the subsequent page.
2320
+ *
2321
+ * When paginating, all other parameters provided to list space events must
2322
+ * match the call that provided the page token. Passing different values to
2323
+ * the other parameters might lead to unexpected results.
2324
+ * @param {string} request.filter
2325
+ * Required. A query filter.
2326
+ *
2327
+ * You must specify at least one event type (`event_type`)
2328
+ * using the has `:` operator. To filter by multiple event types, use the `OR`
2329
+ * operator. Omit batch event types in your filter. The request automatically
2330
+ * returns any related batch events. For example, if you filter by new
2331
+ * reactions
2332
+ * (`google.workspace.chat.reaction.v1.created`), the server also returns
2333
+ * batch new reactions events
2334
+ * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported
2335
+ * event types, see the [`SpaceEvents` reference
2336
+ * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type).
2337
+ *
2338
+ * Optionally, you can also filter by start time (`start_time`) and
2339
+ * end time (`end_time`):
2340
+ *
2341
+ * * `start_time`: Exclusive timestamp from which to start listing space
2342
+ * events.
2343
+ * You can list events that occurred up to 28 days ago. If unspecified, lists
2344
+ * space events from the past 28 days.
2345
+ * * `end_time`: Inclusive timestamp until which space events are listed.
2346
+ * If unspecified, lists events up to the time of the request.
2347
+ *
2348
+ * To specify a start or end time, use the equals `=` operator and format in
2349
+ * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both
2350
+ * `start_time` and `end_time`, use the `AND` operator.
2351
+ *
2352
+ * For example, the following queries are valid:
2353
+ *
2354
+ * ```
2355
+ * start_time="2023-08-23T19:20:33+00:00" AND
2356
+ * end_time="2023-08-23T19:21:54+00:00"
2357
+ * ```
2358
+ * ```
2359
+ * start_time="2023-08-23T19:20:33+00:00" AND
2360
+ * (event_types:"google.workspace.chat.space.v1.updated" OR
2361
+ * event_types:"google.workspace.chat.message.v1.created")
2362
+ * ```
2363
+ *
2364
+ * The following queries are invalid:
2365
+ *
2366
+ * ```
2367
+ * start_time="2023-08-23T19:20:33+00:00" OR
2368
+ * end_time="2023-08-23T19:21:54+00:00"
2369
+ * ```
2370
+ * ```
2371
+ * event_types:"google.workspace.chat.space.v1.updated" AND
2372
+ * event_types:"google.workspace.chat.message.v1.created"
2373
+ * ```
2374
+ *
2375
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
2376
+ * error.
2377
+ * @param {object} [options]
2378
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2379
+ * @returns {Promise} - The promise which resolves to an array.
2380
+ * The first element of the array is Array of {@link protos.google.chat.v1.SpaceEvent|SpaceEvent}.
2381
+ * The client library will perform auto-pagination by default: it will call the API as many
2382
+ * times as needed and will merge results from all the pages into this array.
2383
+ * Note that it can affect your quota.
2384
+ * We recommend using `listSpaceEventsAsync()`
2385
+ * method described below for async iteration which you can stop as needed.
2386
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
2387
+ * for more details and examples.
2388
+ */
2389
+ listSpaceEvents(request?: protos.google.chat.v1.IListSpaceEventsRequest, options?: CallOptions): Promise<[
2390
+ protos.google.chat.v1.ISpaceEvent[],
2391
+ protos.google.chat.v1.IListSpaceEventsRequest | null,
2392
+ protos.google.chat.v1.IListSpaceEventsResponse
2393
+ ]>;
2394
+ listSpaceEvents(request: protos.google.chat.v1.IListSpaceEventsRequest, options: CallOptions, callback: PaginationCallback<protos.google.chat.v1.IListSpaceEventsRequest, protos.google.chat.v1.IListSpaceEventsResponse | null | undefined, protos.google.chat.v1.ISpaceEvent>): void;
2395
+ listSpaceEvents(request: protos.google.chat.v1.IListSpaceEventsRequest, callback: PaginationCallback<protos.google.chat.v1.IListSpaceEventsRequest, protos.google.chat.v1.IListSpaceEventsResponse | null | undefined, protos.google.chat.v1.ISpaceEvent>): void;
2396
+ /**
2397
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
2398
+ * @param {Object} request
2399
+ * The request object that will be sent.
2400
+ * @param {string} request.parent
2401
+ * Required. Resource name of the [Google Chat
2402
+ * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces)
2403
+ * where the events occurred.
2404
+ *
2405
+ * Format: `spaces/{space}`.
2406
+ * @param {number} request.pageSize
2407
+ * Optional. The maximum number of space events returned. The service might
2408
+ * return fewer than this value.
2409
+ *
2410
+ * Negative values return an `INVALID_ARGUMENT` error.
2411
+ * @param {string} request.pageToken
2412
+ * A page token, received from a previous list space events call. Provide this
2413
+ * to retrieve the subsequent page.
2414
+ *
2415
+ * When paginating, all other parameters provided to list space events must
2416
+ * match the call that provided the page token. Passing different values to
2417
+ * the other parameters might lead to unexpected results.
2418
+ * @param {string} request.filter
2419
+ * Required. A query filter.
2420
+ *
2421
+ * You must specify at least one event type (`event_type`)
2422
+ * using the has `:` operator. To filter by multiple event types, use the `OR`
2423
+ * operator. Omit batch event types in your filter. The request automatically
2424
+ * returns any related batch events. For example, if you filter by new
2425
+ * reactions
2426
+ * (`google.workspace.chat.reaction.v1.created`), the server also returns
2427
+ * batch new reactions events
2428
+ * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported
2429
+ * event types, see the [`SpaceEvents` reference
2430
+ * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type).
2431
+ *
2432
+ * Optionally, you can also filter by start time (`start_time`) and
2433
+ * end time (`end_time`):
2434
+ *
2435
+ * * `start_time`: Exclusive timestamp from which to start listing space
2436
+ * events.
2437
+ * You can list events that occurred up to 28 days ago. If unspecified, lists
2438
+ * space events from the past 28 days.
2439
+ * * `end_time`: Inclusive timestamp until which space events are listed.
2440
+ * If unspecified, lists events up to the time of the request.
2441
+ *
2442
+ * To specify a start or end time, use the equals `=` operator and format in
2443
+ * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both
2444
+ * `start_time` and `end_time`, use the `AND` operator.
2445
+ *
2446
+ * For example, the following queries are valid:
2447
+ *
2448
+ * ```
2449
+ * start_time="2023-08-23T19:20:33+00:00" AND
2450
+ * end_time="2023-08-23T19:21:54+00:00"
2451
+ * ```
2452
+ * ```
2453
+ * start_time="2023-08-23T19:20:33+00:00" AND
2454
+ * (event_types:"google.workspace.chat.space.v1.updated" OR
2455
+ * event_types:"google.workspace.chat.message.v1.created")
2456
+ * ```
2457
+ *
2458
+ * The following queries are invalid:
2459
+ *
2460
+ * ```
2461
+ * start_time="2023-08-23T19:20:33+00:00" OR
2462
+ * end_time="2023-08-23T19:21:54+00:00"
2463
+ * ```
2464
+ * ```
2465
+ * event_types:"google.workspace.chat.space.v1.updated" AND
2466
+ * event_types:"google.workspace.chat.message.v1.created"
2467
+ * ```
2468
+ *
2469
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
2470
+ * error.
2471
+ * @param {object} [options]
2472
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2473
+ * @returns {Stream}
2474
+ * An object stream which emits an object representing {@link protos.google.chat.v1.SpaceEvent|SpaceEvent} on 'data' event.
2475
+ * The client library will perform auto-pagination by default: it will call the API as many
2476
+ * times as needed. Note that it can affect your quota.
2477
+ * We recommend using `listSpaceEventsAsync()`
2478
+ * method described below for async iteration which you can stop as needed.
2479
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
2480
+ * for more details and examples.
2481
+ */
2482
+ listSpaceEventsStream(request?: protos.google.chat.v1.IListSpaceEventsRequest, options?: CallOptions): Transform;
2483
+ /**
2484
+ * Equivalent to `listSpaceEvents`, but returns an iterable object.
2485
+ *
2486
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
2487
+ * @param {Object} request
2488
+ * The request object that will be sent.
2489
+ * @param {string} request.parent
2490
+ * Required. Resource name of the [Google Chat
2491
+ * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces)
2492
+ * where the events occurred.
2493
+ *
2494
+ * Format: `spaces/{space}`.
2495
+ * @param {number} request.pageSize
2496
+ * Optional. The maximum number of space events returned. The service might
2497
+ * return fewer than this value.
2498
+ *
2499
+ * Negative values return an `INVALID_ARGUMENT` error.
2500
+ * @param {string} request.pageToken
2501
+ * A page token, received from a previous list space events call. Provide this
2502
+ * to retrieve the subsequent page.
2503
+ *
2504
+ * When paginating, all other parameters provided to list space events must
2505
+ * match the call that provided the page token. Passing different values to
2506
+ * the other parameters might lead to unexpected results.
2507
+ * @param {string} request.filter
2508
+ * Required. A query filter.
2509
+ *
2510
+ * You must specify at least one event type (`event_type`)
2511
+ * using the has `:` operator. To filter by multiple event types, use the `OR`
2512
+ * operator. Omit batch event types in your filter. The request automatically
2513
+ * returns any related batch events. For example, if you filter by new
2514
+ * reactions
2515
+ * (`google.workspace.chat.reaction.v1.created`), the server also returns
2516
+ * batch new reactions events
2517
+ * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported
2518
+ * event types, see the [`SpaceEvents` reference
2519
+ * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type).
2520
+ *
2521
+ * Optionally, you can also filter by start time (`start_time`) and
2522
+ * end time (`end_time`):
2523
+ *
2524
+ * * `start_time`: Exclusive timestamp from which to start listing space
2525
+ * events.
2526
+ * You can list events that occurred up to 28 days ago. If unspecified, lists
2527
+ * space events from the past 28 days.
2528
+ * * `end_time`: Inclusive timestamp until which space events are listed.
2529
+ * If unspecified, lists events up to the time of the request.
2530
+ *
2531
+ * To specify a start or end time, use the equals `=` operator and format in
2532
+ * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both
2533
+ * `start_time` and `end_time`, use the `AND` operator.
2534
+ *
2535
+ * For example, the following queries are valid:
2536
+ *
2537
+ * ```
2538
+ * start_time="2023-08-23T19:20:33+00:00" AND
2539
+ * end_time="2023-08-23T19:21:54+00:00"
2540
+ * ```
2541
+ * ```
2542
+ * start_time="2023-08-23T19:20:33+00:00" AND
2543
+ * (event_types:"google.workspace.chat.space.v1.updated" OR
2544
+ * event_types:"google.workspace.chat.message.v1.created")
2545
+ * ```
2546
+ *
2547
+ * The following queries are invalid:
2548
+ *
2549
+ * ```
2550
+ * start_time="2023-08-23T19:20:33+00:00" OR
2551
+ * end_time="2023-08-23T19:21:54+00:00"
2552
+ * ```
2553
+ * ```
2554
+ * event_types:"google.workspace.chat.space.v1.updated" AND
2555
+ * event_types:"google.workspace.chat.message.v1.created"
2556
+ * ```
2557
+ *
2558
+ * Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
2559
+ * error.
2560
+ * @param {object} [options]
2561
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2562
+ * @returns {Object}
2563
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
2564
+ * When you iterate the returned iterable, each element will be an object representing
2565
+ * {@link protos.google.chat.v1.SpaceEvent|SpaceEvent}. The API will be called under the hood as needed, once per the page,
2566
+ * so you can stop the iteration when you don't need more results.
2567
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
2568
+ * for more details and examples.
2569
+ * @example <caption>include:samples/generated/v1/chat_service.list_space_events.js</caption>
2570
+ * region_tag:chat_v1_generated_ChatService_ListSpaceEvents_async
2571
+ */
2572
+ listSpaceEventsAsync(request?: protos.google.chat.v1.IListSpaceEventsRequest, options?: CallOptions): AsyncIterable<protos.google.chat.v1.ISpaceEvent>;
2250
2573
  /**
2251
2574
  * Return a fully-qualified attachment resource name string.
2252
2575
  *
@@ -2409,6 +2732,30 @@ export declare class ChatServiceClient {
2409
2732
  * @returns {string} A string representing the space.
2410
2733
  */
2411
2734
  matchSpaceFromSpaceName(spaceName: string): string | number;
2735
+ /**
2736
+ * Return a fully-qualified spaceEvent resource name string.
2737
+ *
2738
+ * @param {string} space
2739
+ * @param {string} space_event
2740
+ * @returns {string} Resource name string.
2741
+ */
2742
+ spaceEventPath(space: string, spaceEvent: string): string;
2743
+ /**
2744
+ * Parse the space from SpaceEvent resource.
2745
+ *
2746
+ * @param {string} spaceEventName
2747
+ * A fully-qualified path representing SpaceEvent resource.
2748
+ * @returns {string} A string representing the space.
2749
+ */
2750
+ matchSpaceFromSpaceEventName(spaceEventName: string): string | number;
2751
+ /**
2752
+ * Parse the space_event from SpaceEvent resource.
2753
+ *
2754
+ * @param {string} spaceEventName
2755
+ * A fully-qualified path representing SpaceEvent resource.
2756
+ * @returns {string} A string representing the space_event.
2757
+ */
2758
+ matchSpaceEventFromSpaceEventName(spaceEventName: string): string | number;
2412
2759
  /**
2413
2760
  * Return a fully-qualified spaceReadState resource name string.
2414
2761
  *