@google-apps/chat 0.23.1 → 0.24.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.
- package/LICENSE +202 -0
- package/README.md +1 -0
- package/build/protos/google/chat/v1/action_status.proto +1 -1
- package/build/protos/google/chat/v1/annotation.proto +1 -1
- package/build/protos/google/chat/v1/attachment.proto +1 -1
- package/build/protos/google/chat/v1/chat_service.proto +26 -0
- package/build/protos/google/chat/v1/contextual_addon.proto +1 -1
- package/build/protos/google/chat/v1/deletion_metadata.proto +1 -1
- package/build/protos/google/chat/v1/event_payload.proto +1 -1
- package/build/protos/google/chat/v1/group.proto +1 -1
- package/build/protos/google/chat/v1/history_state.proto +1 -1
- package/build/protos/google/chat/v1/matched_url.proto +1 -1
- package/build/protos/google/chat/v1/membership.proto +1 -1
- package/build/protos/google/chat/v1/message.proto +41 -0
- package/build/protos/google/chat/v1/reaction.proto +1 -1
- package/build/protos/google/chat/v1/slash_command.proto +1 -1
- package/build/protos/google/chat/v1/space.proto +81 -1
- package/build/protos/google/chat/v1/space_event.proto +1 -1
- package/build/protos/google/chat/v1/space_notification_setting.proto +1 -1
- package/build/protos/google/chat/v1/space_read_state.proto +1 -1
- package/build/protos/google/chat/v1/space_setup.proto +1 -1
- package/build/protos/google/chat/v1/thread_read_state.proto +1 -1
- package/build/protos/google/chat/v1/user.proto +1 -1
- package/build/protos/google/chat/v1/widgets.proto +1 -1
- package/build/protos/protos.d.ts +365 -0
- package/build/protos/protos.js +959 -48
- package/build/protos/protos.json +95 -0
- package/build/src/index.js +1 -1
- package/build/src/v1/chat_service_client.d.ts +205 -0
- package/build/src/v1/chat_service_client.js +167 -1
- package/build/src/v1/chat_service_client.js.map +1 -1
- package/build/src/v1/chat_service_client_config.json +5 -0
- package/build/src/v1/gapic_metadata.json +14 -0
- package/package.json +1 -1
package/build/protos/protos.json
CHANGED
|
@@ -3830,6 +3830,20 @@
|
|
|
3830
3830
|
}
|
|
3831
3831
|
]
|
|
3832
3832
|
},
|
|
3833
|
+
"FindGroupChats": {
|
|
3834
|
+
"requestType": "FindGroupChatsRequest",
|
|
3835
|
+
"responseType": "FindGroupChatsResponse",
|
|
3836
|
+
"options": {
|
|
3837
|
+
"(google.api.http).get": "/v1/spaces:findGroupChats"
|
|
3838
|
+
},
|
|
3839
|
+
"parsedOptions": [
|
|
3840
|
+
{
|
|
3841
|
+
"(google.api.http)": {
|
|
3842
|
+
"get": "/v1/spaces:findGroupChats"
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
]
|
|
3846
|
+
},
|
|
3833
3847
|
"CreateMembership": {
|
|
3834
3848
|
"requestType": "CreateMembershipRequest",
|
|
3835
3849
|
"responseType": "Membership",
|
|
@@ -4670,6 +4684,13 @@
|
|
|
4670
4684
|
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
4671
4685
|
}
|
|
4672
4686
|
},
|
|
4687
|
+
"silent": {
|
|
4688
|
+
"type": "bool",
|
|
4689
|
+
"id": 46,
|
|
4690
|
+
"options": {
|
|
4691
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
4692
|
+
}
|
|
4693
|
+
},
|
|
4673
4694
|
"clientAssignedMessageId": {
|
|
4674
4695
|
"type": "string",
|
|
4675
4696
|
"id": 32,
|
|
@@ -5058,6 +5079,13 @@
|
|
|
5058
5079
|
"options": {
|
|
5059
5080
|
"(google.api.field_behavior)": "OPTIONAL"
|
|
5060
5081
|
}
|
|
5082
|
+
},
|
|
5083
|
+
"createMessageNotificationOptions": {
|
|
5084
|
+
"type": "CreateMessageNotificationOptions",
|
|
5085
|
+
"id": 10,
|
|
5086
|
+
"options": {
|
|
5087
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
5088
|
+
}
|
|
5061
5089
|
}
|
|
5062
5090
|
},
|
|
5063
5091
|
"nested": {
|
|
@@ -5070,6 +5098,23 @@
|
|
|
5070
5098
|
}
|
|
5071
5099
|
}
|
|
5072
5100
|
},
|
|
5101
|
+
"CreateMessageNotificationOptions": {
|
|
5102
|
+
"fields": {
|
|
5103
|
+
"notificationType": {
|
|
5104
|
+
"type": "NotificationType",
|
|
5105
|
+
"id": 1
|
|
5106
|
+
}
|
|
5107
|
+
},
|
|
5108
|
+
"nested": {
|
|
5109
|
+
"NotificationType": {
|
|
5110
|
+
"values": {
|
|
5111
|
+
"NOTIFICATION_TYPE_NONE": 0,
|
|
5112
|
+
"NOTIFICATION_TYPE_FORCE_NOTIFY": 2,
|
|
5113
|
+
"NOTIFICATION_TYPE_SILENT": 3
|
|
5114
|
+
}
|
|
5115
|
+
}
|
|
5116
|
+
}
|
|
5117
|
+
},
|
|
5073
5118
|
"ListMessagesRequest": {
|
|
5074
5119
|
"fields": {
|
|
5075
5120
|
"parent": {
|
|
@@ -6052,6 +6097,49 @@
|
|
|
6052
6097
|
}
|
|
6053
6098
|
}
|
|
6054
6099
|
},
|
|
6100
|
+
"FindGroupChatsRequest": {
|
|
6101
|
+
"fields": {
|
|
6102
|
+
"users": {
|
|
6103
|
+
"rule": "repeated",
|
|
6104
|
+
"type": "string",
|
|
6105
|
+
"id": 5,
|
|
6106
|
+
"options": {
|
|
6107
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
6108
|
+
}
|
|
6109
|
+
},
|
|
6110
|
+
"pageSize": {
|
|
6111
|
+
"type": "int32",
|
|
6112
|
+
"id": 2,
|
|
6113
|
+
"options": {
|
|
6114
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
6115
|
+
}
|
|
6116
|
+
},
|
|
6117
|
+
"pageToken": {
|
|
6118
|
+
"type": "string",
|
|
6119
|
+
"id": 3,
|
|
6120
|
+
"options": {
|
|
6121
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
6122
|
+
}
|
|
6123
|
+
},
|
|
6124
|
+
"spaceView": {
|
|
6125
|
+
"type": "SpaceView",
|
|
6126
|
+
"id": 4
|
|
6127
|
+
}
|
|
6128
|
+
}
|
|
6129
|
+
},
|
|
6130
|
+
"FindGroupChatsResponse": {
|
|
6131
|
+
"fields": {
|
|
6132
|
+
"spaces": {
|
|
6133
|
+
"rule": "repeated",
|
|
6134
|
+
"type": "Space",
|
|
6135
|
+
"id": 1
|
|
6136
|
+
},
|
|
6137
|
+
"nextPageToken": {
|
|
6138
|
+
"type": "string",
|
|
6139
|
+
"id": 2
|
|
6140
|
+
}
|
|
6141
|
+
}
|
|
6142
|
+
},
|
|
6055
6143
|
"UpdateSpaceRequest": {
|
|
6056
6144
|
"fields": {
|
|
6057
6145
|
"space": {
|
|
@@ -6163,6 +6251,13 @@
|
|
|
6163
6251
|
}
|
|
6164
6252
|
}
|
|
6165
6253
|
},
|
|
6254
|
+
"SpaceView": {
|
|
6255
|
+
"values": {
|
|
6256
|
+
"SPACE_VIEW_UNSPECIFIED": 0,
|
|
6257
|
+
"SPACE_VIEW_RESOURCE_NAME_ONLY": 3,
|
|
6258
|
+
"SPACE_VIEW_EXPANDED": 4
|
|
6259
|
+
}
|
|
6260
|
+
},
|
|
6166
6261
|
"HistoryState": {
|
|
6167
6262
|
"values": {
|
|
6168
6263
|
"HISTORY_STATE_UNSPECIFIED": 0,
|
package/build/src/index.js
CHANGED
|
@@ -207,6 +207,10 @@ export declare class ChatServiceClient {
|
|
|
207
207
|
*
|
|
208
208
|
* For details, see [Name a
|
|
209
209
|
* message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).
|
|
210
|
+
* @param {google.chat.v1.CreateMessageNotificationOptions} [request.createMessageNotificationOptions]
|
|
211
|
+
* Optional. Controls the notification behavior when the message is posted.
|
|
212
|
+
* To learn more, see [Force notifications or send silent
|
|
213
|
+
* messages](https://developer.google.com/workspace/chat/create-messages#force-notify-silent).
|
|
210
214
|
* @param {object} [options]
|
|
211
215
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
212
216
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -3399,6 +3403,207 @@ export declare class ChatServiceClient {
|
|
|
3399
3403
|
*/
|
|
3400
3404
|
searchSpacesAsync(request?: protos.google.chat.v1.ISearchSpacesRequest, options?: CallOptions): AsyncIterable<protos.google.chat.v1.ISpace>;
|
|
3401
3405
|
/**
|
|
3406
|
+
* Returns all spaces with `spaceType == GROUP_CHAT`, whose
|
|
3407
|
+
* human memberships contain exactly the calling user, and the users specified
|
|
3408
|
+
* in `FindGroupChatsRequest.users`. Only members that have joined the
|
|
3409
|
+
* conversation are supported. For an example, see [Find group
|
|
3410
|
+
* chats](https://developers.google.com/workspace/chat/find-group-chats).
|
|
3411
|
+
*
|
|
3412
|
+
* If the calling user blocks, or is blocked by, some users, and no spaces
|
|
3413
|
+
* with the entire specified set of users are found, this method returns
|
|
3414
|
+
* spaces that don't include the blocked or blocking users.
|
|
3415
|
+
*
|
|
3416
|
+
* The specified set of users must contain only human (non-app) memberships.
|
|
3417
|
+
* A request that contains non-human users doesn't return any spaces.
|
|
3418
|
+
*
|
|
3419
|
+
* Requires [user
|
|
3420
|
+
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
3421
|
+
* with one of the following [authorization
|
|
3422
|
+
* scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
3423
|
+
*
|
|
3424
|
+
* - `https://www.googleapis.com/auth/chat.memberships.readonly`
|
|
3425
|
+
* - `https://www.googleapis.com/auth/chat.memberships`
|
|
3426
|
+
*
|
|
3427
|
+
* @param {Object} request
|
|
3428
|
+
* The request object that will be sent.
|
|
3429
|
+
* @param {string[]} [request.users]
|
|
3430
|
+
* Optional. Resource names of all human users in group chat with the calling
|
|
3431
|
+
* user. Chat apps can't be included in the request.
|
|
3432
|
+
*
|
|
3433
|
+
* The maximum number of users that can be specified in a single request is
|
|
3434
|
+
* `49`.
|
|
3435
|
+
*
|
|
3436
|
+
* Format: `users/{user}`, where `{user}` is either the `id` for the
|
|
3437
|
+
* [person](https://developers.google.com/people/api/rest/v1/people) from the
|
|
3438
|
+
* People API, or the `id` for the
|
|
3439
|
+
* [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
|
|
3440
|
+
* in the Directory API. For example, to find all group chats with the calling
|
|
3441
|
+
* user and two other users, with People API profile IDs `123456789` and
|
|
3442
|
+
* `987654321`, you can use `users/123456789` and `users/987654321`.
|
|
3443
|
+
* You can also use the email as an alias for `{user}`. For example,
|
|
3444
|
+
* `users/example@gmail.com` where `example@gmail.com` is the email of the
|
|
3445
|
+
* Google Chat user.
|
|
3446
|
+
* @param {number} [request.pageSize]
|
|
3447
|
+
* Optional. The maximum number of spaces to return. The service might return
|
|
3448
|
+
* fewer than this value.
|
|
3449
|
+
*
|
|
3450
|
+
* If unspecified, at most 10 spaces are returned.
|
|
3451
|
+
*
|
|
3452
|
+
* The maximum value is 30. If you use a value more than 30, it's
|
|
3453
|
+
* automatically changed to 30.
|
|
3454
|
+
*
|
|
3455
|
+
* Negative values return an `INVALID_ARGUMENT` error.
|
|
3456
|
+
* @param {string} [request.pageToken]
|
|
3457
|
+
* Optional. A page token, received from a previous call to find group chats.
|
|
3458
|
+
* Provide this parameter to retrieve the subsequent page.
|
|
3459
|
+
*
|
|
3460
|
+
* When paginating, all other parameters provided should match the call that
|
|
3461
|
+
* provided the token. Passing different values may lead to unexpected
|
|
3462
|
+
* results.
|
|
3463
|
+
* @param {google.chat.v1.SpaceView} request.spaceView
|
|
3464
|
+
* Requested space view type. If unset, defaults to
|
|
3465
|
+
* `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify
|
|
3466
|
+
* `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data,
|
|
3467
|
+
* for example,
|
|
3468
|
+
* https://www.googleapis.com/auth/chat.spaces or
|
|
3469
|
+
* https://www.googleapis.com/auth/chat.spaces.readonly.
|
|
3470
|
+
* @param {object} [options]
|
|
3471
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
3472
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
3473
|
+
* The first element of the array is Array of {@link protos.google.chat.v1.Space|Space}.
|
|
3474
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
3475
|
+
* times as needed and will merge results from all the pages into this array.
|
|
3476
|
+
* Note that it can affect your quota.
|
|
3477
|
+
* We recommend using `findGroupChatsAsync()`
|
|
3478
|
+
* method described below for async iteration which you can stop as needed.
|
|
3479
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
3480
|
+
* for more details and examples.
|
|
3481
|
+
*/
|
|
3482
|
+
findGroupChats(request?: protos.google.chat.v1.IFindGroupChatsRequest, options?: CallOptions): Promise<[
|
|
3483
|
+
protos.google.chat.v1.ISpace[],
|
|
3484
|
+
protos.google.chat.v1.IFindGroupChatsRequest | null,
|
|
3485
|
+
protos.google.chat.v1.IFindGroupChatsResponse
|
|
3486
|
+
]>;
|
|
3487
|
+
findGroupChats(request: protos.google.chat.v1.IFindGroupChatsRequest, options: CallOptions, callback: PaginationCallback<protos.google.chat.v1.IFindGroupChatsRequest, protos.google.chat.v1.IFindGroupChatsResponse | null | undefined, protos.google.chat.v1.ISpace>): void;
|
|
3488
|
+
findGroupChats(request: protos.google.chat.v1.IFindGroupChatsRequest, callback: PaginationCallback<protos.google.chat.v1.IFindGroupChatsRequest, protos.google.chat.v1.IFindGroupChatsResponse | null | undefined, protos.google.chat.v1.ISpace>): void;
|
|
3489
|
+
/**
|
|
3490
|
+
* Equivalent to `findGroupChats`, but returns a NodeJS Stream object.
|
|
3491
|
+
* @param {Object} request
|
|
3492
|
+
* The request object that will be sent.
|
|
3493
|
+
* @param {string[]} [request.users]
|
|
3494
|
+
* Optional. Resource names of all human users in group chat with the calling
|
|
3495
|
+
* user. Chat apps can't be included in the request.
|
|
3496
|
+
*
|
|
3497
|
+
* The maximum number of users that can be specified in a single request is
|
|
3498
|
+
* `49`.
|
|
3499
|
+
*
|
|
3500
|
+
* Format: `users/{user}`, where `{user}` is either the `id` for the
|
|
3501
|
+
* [person](https://developers.google.com/people/api/rest/v1/people) from the
|
|
3502
|
+
* People API, or the `id` for the
|
|
3503
|
+
* [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
|
|
3504
|
+
* in the Directory API. For example, to find all group chats with the calling
|
|
3505
|
+
* user and two other users, with People API profile IDs `123456789` and
|
|
3506
|
+
* `987654321`, you can use `users/123456789` and `users/987654321`.
|
|
3507
|
+
* You can also use the email as an alias for `{user}`. For example,
|
|
3508
|
+
* `users/example@gmail.com` where `example@gmail.com` is the email of the
|
|
3509
|
+
* Google Chat user.
|
|
3510
|
+
* @param {number} [request.pageSize]
|
|
3511
|
+
* Optional. The maximum number of spaces to return. The service might return
|
|
3512
|
+
* fewer than this value.
|
|
3513
|
+
*
|
|
3514
|
+
* If unspecified, at most 10 spaces are returned.
|
|
3515
|
+
*
|
|
3516
|
+
* The maximum value is 30. If you use a value more than 30, it's
|
|
3517
|
+
* automatically changed to 30.
|
|
3518
|
+
*
|
|
3519
|
+
* Negative values return an `INVALID_ARGUMENT` error.
|
|
3520
|
+
* @param {string} [request.pageToken]
|
|
3521
|
+
* Optional. A page token, received from a previous call to find group chats.
|
|
3522
|
+
* Provide this parameter to retrieve the subsequent page.
|
|
3523
|
+
*
|
|
3524
|
+
* When paginating, all other parameters provided should match the call that
|
|
3525
|
+
* provided the token. Passing different values may lead to unexpected
|
|
3526
|
+
* results.
|
|
3527
|
+
* @param {google.chat.v1.SpaceView} request.spaceView
|
|
3528
|
+
* Requested space view type. If unset, defaults to
|
|
3529
|
+
* `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify
|
|
3530
|
+
* `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data,
|
|
3531
|
+
* for example,
|
|
3532
|
+
* https://www.googleapis.com/auth/chat.spaces or
|
|
3533
|
+
* https://www.googleapis.com/auth/chat.spaces.readonly.
|
|
3534
|
+
* @param {object} [options]
|
|
3535
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
3536
|
+
* @returns {Stream}
|
|
3537
|
+
* An object stream which emits an object representing {@link protos.google.chat.v1.Space|Space} on 'data' event.
|
|
3538
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
3539
|
+
* times as needed. Note that it can affect your quota.
|
|
3540
|
+
* We recommend using `findGroupChatsAsync()`
|
|
3541
|
+
* method described below for async iteration which you can stop as needed.
|
|
3542
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
3543
|
+
* for more details and examples.
|
|
3544
|
+
*/
|
|
3545
|
+
findGroupChatsStream(request?: protos.google.chat.v1.IFindGroupChatsRequest, options?: CallOptions): Transform;
|
|
3546
|
+
/**
|
|
3547
|
+
* Equivalent to `findGroupChats`, but returns an iterable object.
|
|
3548
|
+
*
|
|
3549
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
3550
|
+
* @param {Object} request
|
|
3551
|
+
* The request object that will be sent.
|
|
3552
|
+
* @param {string[]} [request.users]
|
|
3553
|
+
* Optional. Resource names of all human users in group chat with the calling
|
|
3554
|
+
* user. Chat apps can't be included in the request.
|
|
3555
|
+
*
|
|
3556
|
+
* The maximum number of users that can be specified in a single request is
|
|
3557
|
+
* `49`.
|
|
3558
|
+
*
|
|
3559
|
+
* Format: `users/{user}`, where `{user}` is either the `id` for the
|
|
3560
|
+
* [person](https://developers.google.com/people/api/rest/v1/people) from the
|
|
3561
|
+
* People API, or the `id` for the
|
|
3562
|
+
* [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
|
|
3563
|
+
* in the Directory API. For example, to find all group chats with the calling
|
|
3564
|
+
* user and two other users, with People API profile IDs `123456789` and
|
|
3565
|
+
* `987654321`, you can use `users/123456789` and `users/987654321`.
|
|
3566
|
+
* You can also use the email as an alias for `{user}`. For example,
|
|
3567
|
+
* `users/example@gmail.com` where `example@gmail.com` is the email of the
|
|
3568
|
+
* Google Chat user.
|
|
3569
|
+
* @param {number} [request.pageSize]
|
|
3570
|
+
* Optional. The maximum number of spaces to return. The service might return
|
|
3571
|
+
* fewer than this value.
|
|
3572
|
+
*
|
|
3573
|
+
* If unspecified, at most 10 spaces are returned.
|
|
3574
|
+
*
|
|
3575
|
+
* The maximum value is 30. If you use a value more than 30, it's
|
|
3576
|
+
* automatically changed to 30.
|
|
3577
|
+
*
|
|
3578
|
+
* Negative values return an `INVALID_ARGUMENT` error.
|
|
3579
|
+
* @param {string} [request.pageToken]
|
|
3580
|
+
* Optional. A page token, received from a previous call to find group chats.
|
|
3581
|
+
* Provide this parameter to retrieve the subsequent page.
|
|
3582
|
+
*
|
|
3583
|
+
* When paginating, all other parameters provided should match the call that
|
|
3584
|
+
* provided the token. Passing different values may lead to unexpected
|
|
3585
|
+
* results.
|
|
3586
|
+
* @param {google.chat.v1.SpaceView} request.spaceView
|
|
3587
|
+
* Requested space view type. If unset, defaults to
|
|
3588
|
+
* `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify
|
|
3589
|
+
* `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data,
|
|
3590
|
+
* for example,
|
|
3591
|
+
* https://www.googleapis.com/auth/chat.spaces or
|
|
3592
|
+
* https://www.googleapis.com/auth/chat.spaces.readonly.
|
|
3593
|
+
* @param {object} [options]
|
|
3594
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
3595
|
+
* @returns {Object}
|
|
3596
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
3597
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
3598
|
+
* {@link protos.google.chat.v1.Space|Space}. The API will be called under the hood as needed, once per the page,
|
|
3599
|
+
* so you can stop the iteration when you don't need more results.
|
|
3600
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
3601
|
+
* for more details and examples.
|
|
3602
|
+
* @example <caption>include:samples/generated/v1/chat_service.find_group_chats.js</caption>
|
|
3603
|
+
* region_tag:chat_v1_generated_ChatService_FindGroupChats_async
|
|
3604
|
+
*/
|
|
3605
|
+
findGroupChatsAsync(request?: protos.google.chat.v1.IFindGroupChatsRequest, options?: CallOptions): AsyncIterable<protos.google.chat.v1.ISpace>;
|
|
3606
|
+
/**
|
|
3402
3607
|
* Lists reactions to a message. For an example, see
|
|
3403
3608
|
* [List reactions for a
|
|
3404
3609
|
* message](https://developers.google.com/workspace/chat/list-reactions).
|
|
@@ -184,6 +184,7 @@ class ChatServiceClient {
|
|
|
184
184
|
listMemberships: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'memberships'),
|
|
185
185
|
listSpaces: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaces'),
|
|
186
186
|
searchSpaces: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaces'),
|
|
187
|
+
findGroupChats: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaces'),
|
|
187
188
|
listReactions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'reactions'),
|
|
188
189
|
listCustomEmojis: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customEmojis'),
|
|
189
190
|
listSpaceEvents: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaceEvents'),
|
|
@@ -223,7 +224,7 @@ class ChatServiceClient {
|
|
|
223
224
|
this._protos.google.chat.v1.ChatService, this._opts, this._providedCustomServicePath);
|
|
224
225
|
// Iterate over each of the methods that the service provides
|
|
225
226
|
// and create an API call method for each.
|
|
226
|
-
const chatServiceStubMethods = ['createMessage', 'listMessages', 'listMemberships', 'getMembership', 'getMessage', 'updateMessage', 'deleteMessage', 'getAttachment', 'uploadAttachment', 'listSpaces', 'searchSpaces', 'getSpace', 'createSpace', 'setUpSpace', 'updateSpace', 'deleteSpace', 'completeImportSpace', 'findDirectMessage', 'createMembership', 'updateMembership', 'deleteMembership', 'createReaction', 'listReactions', 'deleteReaction', 'createCustomEmoji', 'getCustomEmoji', 'listCustomEmojis', 'deleteCustomEmoji', 'getSpaceReadState', 'updateSpaceReadState', 'getThreadReadState', 'getSpaceEvent', 'listSpaceEvents', 'getSpaceNotificationSetting', 'updateSpaceNotificationSetting', 'createSection', 'deleteSection', 'updateSection', 'listSections', 'positionSection', 'listSectionItems', 'moveSectionItem'];
|
|
227
|
+
const chatServiceStubMethods = ['createMessage', 'listMessages', 'listMemberships', 'getMembership', 'getMessage', 'updateMessage', 'deleteMessage', 'getAttachment', 'uploadAttachment', 'listSpaces', 'searchSpaces', 'getSpace', 'createSpace', 'setUpSpace', 'updateSpace', 'deleteSpace', 'completeImportSpace', 'findDirectMessage', 'findGroupChats', 'createMembership', 'updateMembership', 'deleteMembership', 'createReaction', 'listReactions', 'deleteReaction', 'createCustomEmoji', 'getCustomEmoji', 'listCustomEmojis', 'deleteCustomEmoji', 'getSpaceReadState', 'updateSpaceReadState', 'getThreadReadState', 'getSpaceEvent', 'listSpaceEvents', 'getSpaceNotificationSetting', 'updateSpaceNotificationSetting', 'createSection', 'deleteSection', 'updateSection', 'listSections', 'positionSection', 'listSectionItems', 'moveSectionItem'];
|
|
227
228
|
for (const methodName of chatServiceStubMethods) {
|
|
228
229
|
const callPromise = this.chatServiceStub.then(stub => (...args) => {
|
|
229
230
|
if (this._terminated) {
|
|
@@ -2502,6 +2503,171 @@ class ChatServiceClient {
|
|
|
2502
2503
|
this._log.info('searchSpaces iterate %j', request);
|
|
2503
2504
|
return this.descriptors.page.searchSpaces.asyncIterate(this.innerApiCalls['searchSpaces'], request, callSettings);
|
|
2504
2505
|
}
|
|
2506
|
+
findGroupChats(request, optionsOrCallback, callback) {
|
|
2507
|
+
request = request || {};
|
|
2508
|
+
let options;
|
|
2509
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
2510
|
+
callback = optionsOrCallback;
|
|
2511
|
+
options = {};
|
|
2512
|
+
}
|
|
2513
|
+
else {
|
|
2514
|
+
options = optionsOrCallback;
|
|
2515
|
+
}
|
|
2516
|
+
options = options || {};
|
|
2517
|
+
options.otherArgs = options.otherArgs || {};
|
|
2518
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
2519
|
+
this.initialize().catch(err => { throw err; });
|
|
2520
|
+
const wrappedCallback = callback
|
|
2521
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
2522
|
+
this._log.info('findGroupChats values %j', values);
|
|
2523
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
2524
|
+
}
|
|
2525
|
+
: undefined;
|
|
2526
|
+
this._log.info('findGroupChats request %j', request);
|
|
2527
|
+
return this.innerApiCalls
|
|
2528
|
+
.findGroupChats(request, options, wrappedCallback)
|
|
2529
|
+
?.then(([response, input, output]) => {
|
|
2530
|
+
this._log.info('findGroupChats values %j', response);
|
|
2531
|
+
return [response, input, output];
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
2534
|
+
/**
|
|
2535
|
+
* Equivalent to `findGroupChats`, but returns a NodeJS Stream object.
|
|
2536
|
+
* @param {Object} request
|
|
2537
|
+
* The request object that will be sent.
|
|
2538
|
+
* @param {string[]} [request.users]
|
|
2539
|
+
* Optional. Resource names of all human users in group chat with the calling
|
|
2540
|
+
* user. Chat apps can't be included in the request.
|
|
2541
|
+
*
|
|
2542
|
+
* The maximum number of users that can be specified in a single request is
|
|
2543
|
+
* `49`.
|
|
2544
|
+
*
|
|
2545
|
+
* Format: `users/{user}`, where `{user}` is either the `id` for the
|
|
2546
|
+
* [person](https://developers.google.com/people/api/rest/v1/people) from the
|
|
2547
|
+
* People API, or the `id` for the
|
|
2548
|
+
* [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
|
|
2549
|
+
* in the Directory API. For example, to find all group chats with the calling
|
|
2550
|
+
* user and two other users, with People API profile IDs `123456789` and
|
|
2551
|
+
* `987654321`, you can use `users/123456789` and `users/987654321`.
|
|
2552
|
+
* You can also use the email as an alias for `{user}`. For example,
|
|
2553
|
+
* `users/example@gmail.com` where `example@gmail.com` is the email of the
|
|
2554
|
+
* Google Chat user.
|
|
2555
|
+
* @param {number} [request.pageSize]
|
|
2556
|
+
* Optional. The maximum number of spaces to return. The service might return
|
|
2557
|
+
* fewer than this value.
|
|
2558
|
+
*
|
|
2559
|
+
* If unspecified, at most 10 spaces are returned.
|
|
2560
|
+
*
|
|
2561
|
+
* The maximum value is 30. If you use a value more than 30, it's
|
|
2562
|
+
* automatically changed to 30.
|
|
2563
|
+
*
|
|
2564
|
+
* Negative values return an `INVALID_ARGUMENT` error.
|
|
2565
|
+
* @param {string} [request.pageToken]
|
|
2566
|
+
* Optional. A page token, received from a previous call to find group chats.
|
|
2567
|
+
* Provide this parameter to retrieve the subsequent page.
|
|
2568
|
+
*
|
|
2569
|
+
* When paginating, all other parameters provided should match the call that
|
|
2570
|
+
* provided the token. Passing different values may lead to unexpected
|
|
2571
|
+
* results.
|
|
2572
|
+
* @param {google.chat.v1.SpaceView} request.spaceView
|
|
2573
|
+
* Requested space view type. If unset, defaults to
|
|
2574
|
+
* `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify
|
|
2575
|
+
* `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data,
|
|
2576
|
+
* for example,
|
|
2577
|
+
* https://www.googleapis.com/auth/chat.spaces or
|
|
2578
|
+
* https://www.googleapis.com/auth/chat.spaces.readonly.
|
|
2579
|
+
* @param {object} [options]
|
|
2580
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
2581
|
+
* @returns {Stream}
|
|
2582
|
+
* An object stream which emits an object representing {@link protos.google.chat.v1.Space|Space} on 'data' event.
|
|
2583
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
2584
|
+
* times as needed. Note that it can affect your quota.
|
|
2585
|
+
* We recommend using `findGroupChatsAsync()`
|
|
2586
|
+
* method described below for async iteration which you can stop as needed.
|
|
2587
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
2588
|
+
* for more details and examples.
|
|
2589
|
+
*/
|
|
2590
|
+
findGroupChatsStream(request, options) {
|
|
2591
|
+
request = request || {};
|
|
2592
|
+
options = options || {};
|
|
2593
|
+
options.otherArgs = options.otherArgs || {};
|
|
2594
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
2595
|
+
const defaultCallSettings = this._defaults['findGroupChats'];
|
|
2596
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
2597
|
+
this.initialize().catch(err => { throw err; });
|
|
2598
|
+
this._log.info('findGroupChats stream %j', request);
|
|
2599
|
+
return this.descriptors.page.findGroupChats.createStream(this.innerApiCalls.findGroupChats, request, callSettings);
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* Equivalent to `findGroupChats`, but returns an iterable object.
|
|
2603
|
+
*
|
|
2604
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
2605
|
+
* @param {Object} request
|
|
2606
|
+
* The request object that will be sent.
|
|
2607
|
+
* @param {string[]} [request.users]
|
|
2608
|
+
* Optional. Resource names of all human users in group chat with the calling
|
|
2609
|
+
* user. Chat apps can't be included in the request.
|
|
2610
|
+
*
|
|
2611
|
+
* The maximum number of users that can be specified in a single request is
|
|
2612
|
+
* `49`.
|
|
2613
|
+
*
|
|
2614
|
+
* Format: `users/{user}`, where `{user}` is either the `id` for the
|
|
2615
|
+
* [person](https://developers.google.com/people/api/rest/v1/people) from the
|
|
2616
|
+
* People API, or the `id` for the
|
|
2617
|
+
* [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
|
|
2618
|
+
* in the Directory API. For example, to find all group chats with the calling
|
|
2619
|
+
* user and two other users, with People API profile IDs `123456789` and
|
|
2620
|
+
* `987654321`, you can use `users/123456789` and `users/987654321`.
|
|
2621
|
+
* You can also use the email as an alias for `{user}`. For example,
|
|
2622
|
+
* `users/example@gmail.com` where `example@gmail.com` is the email of the
|
|
2623
|
+
* Google Chat user.
|
|
2624
|
+
* @param {number} [request.pageSize]
|
|
2625
|
+
* Optional. The maximum number of spaces to return. The service might return
|
|
2626
|
+
* fewer than this value.
|
|
2627
|
+
*
|
|
2628
|
+
* If unspecified, at most 10 spaces are returned.
|
|
2629
|
+
*
|
|
2630
|
+
* The maximum value is 30. If you use a value more than 30, it's
|
|
2631
|
+
* automatically changed to 30.
|
|
2632
|
+
*
|
|
2633
|
+
* Negative values return an `INVALID_ARGUMENT` error.
|
|
2634
|
+
* @param {string} [request.pageToken]
|
|
2635
|
+
* Optional. A page token, received from a previous call to find group chats.
|
|
2636
|
+
* Provide this parameter to retrieve the subsequent page.
|
|
2637
|
+
*
|
|
2638
|
+
* When paginating, all other parameters provided should match the call that
|
|
2639
|
+
* provided the token. Passing different values may lead to unexpected
|
|
2640
|
+
* results.
|
|
2641
|
+
* @param {google.chat.v1.SpaceView} request.spaceView
|
|
2642
|
+
* Requested space view type. If unset, defaults to
|
|
2643
|
+
* `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify
|
|
2644
|
+
* `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data,
|
|
2645
|
+
* for example,
|
|
2646
|
+
* https://www.googleapis.com/auth/chat.spaces or
|
|
2647
|
+
* https://www.googleapis.com/auth/chat.spaces.readonly.
|
|
2648
|
+
* @param {object} [options]
|
|
2649
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
2650
|
+
* @returns {Object}
|
|
2651
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
2652
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
2653
|
+
* {@link protos.google.chat.v1.Space|Space}. The API will be called under the hood as needed, once per the page,
|
|
2654
|
+
* so you can stop the iteration when you don't need more results.
|
|
2655
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
2656
|
+
* for more details and examples.
|
|
2657
|
+
* @example <caption>include:samples/generated/v1/chat_service.find_group_chats.js</caption>
|
|
2658
|
+
* region_tag:chat_v1_generated_ChatService_FindGroupChats_async
|
|
2659
|
+
*/
|
|
2660
|
+
findGroupChatsAsync(request, options) {
|
|
2661
|
+
request = request || {};
|
|
2662
|
+
options = options || {};
|
|
2663
|
+
options.otherArgs = options.otherArgs || {};
|
|
2664
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
2665
|
+
const defaultCallSettings = this._defaults['findGroupChats'];
|
|
2666
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
2667
|
+
this.initialize().catch(err => { throw err; });
|
|
2668
|
+
this._log.info('findGroupChats iterate %j', request);
|
|
2669
|
+
return this.descriptors.page.findGroupChats.asyncIterate(this.innerApiCalls['findGroupChats'], request, callSettings);
|
|
2670
|
+
}
|
|
2505
2671
|
listReactions(request, optionsOrCallback, callback) {
|
|
2506
2672
|
request = request || {};
|
|
2507
2673
|
let options;
|