|
20 | 20 | use Google\Service\HangoutsChat\ChatEmpty; |
21 | 21 | use Google\Service\HangoutsChat\CompleteImportSpaceRequest; |
22 | 22 | use Google\Service\HangoutsChat\CompleteImportSpaceResponse; |
| 23 | +use Google\Service\HangoutsChat\FindGroupChatsResponse; |
23 | 24 | use Google\Service\HangoutsChat\ListSpacesResponse; |
24 | 25 | use Google\Service\HangoutsChat\SearchSpacesResponse; |
25 | 26 | use Google\Service\HangoutsChat\SetUpSpaceRequest; |
@@ -196,6 +197,63 @@ public function findDirectMessage($optParams = []) |
196 | 197 | $params = array_merge($params, $optParams); |
197 | 198 | return $this->call('findDirectMessage', [$params], Space::class); |
198 | 199 | } |
| 200 | + /** |
| 201 | + * [Developer Preview](https://developers.google.com/workspace/preview): Returns |
| 202 | + * all spaces with `spaceType == GROUP_CHAT`, whose human memberships contain |
| 203 | + * exactly the calling user, and the users specified in |
| 204 | + * `FindGroupChatsRequest.users`. Only members that have joined the conversation |
| 205 | + * are supported. For an example, see [Find group |
| 206 | + * chats](https://developers.google.com/workspace/chat/find-group-chats). If the |
| 207 | + * calling user blocks, or is blocked by, some users, and no spaces with the |
| 208 | + * entire specified set of users are found, this method returns spaces that |
| 209 | + * don't include the blocked or blocking users. The specified set of users must |
| 210 | + * contain only human (non-app) memberships. A request that contains non-human |
| 211 | + * users doesn't return any spaces. Requires [user |
| 212 | + * authentication](https://developers.google.com/workspace/chat/authenticate- |
| 213 | + * authorize-chat-user) with one of the following [authorization |
| 214 | + * scopes](https://developers.google.com/workspace/chat/authenticate- |
| 215 | + * authorize#chat-api-scopes): - |
| 216 | + * `https://www.googleapis.com/auth/chat.memberships.readonly` - |
| 217 | + * `https://www.googleapis.com/auth/chat.memberships` (spaces.findGroupChats) |
| 218 | + * |
| 219 | + * @param array $optParams Optional parameters. |
| 220 | + * |
| 221 | + * @opt_param int pageSize Optional. The maximum number of spaces to return. The |
| 222 | + * service might return fewer than this value. If unspecified, at most 10 spaces |
| 223 | + * are returned. The maximum value is 30. If you use a value more than 30, it's |
| 224 | + * automatically changed to 30. Negative values return an `INVALID_ARGUMENT` |
| 225 | + * error. |
| 226 | + * @opt_param string pageToken Optional. A page token, received from a previous |
| 227 | + * call to find group chats. Provide this parameter to retrieve the subsequent |
| 228 | + * page. When paginating, all other parameters provided should match the call |
| 229 | + * that provided the token. Passing different values may lead to unexpected |
| 230 | + * results. |
| 231 | + * @opt_param string spaceView Requested space view type. If unset, defaults to |
| 232 | + * `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify `SPACE_VIEW_EXPANDED` |
| 233 | + * must include scopes that allow reading space data, for example, |
| 234 | + * https://www.googleapis.com/auth/chat.spaces or |
| 235 | + * https://www.googleapis.com/auth/chat.spaces.readonly. |
| 236 | + * @opt_param string users Optional. Resource names of all human users in group |
| 237 | + * chat with the calling user. Chat apps can't be included in the request. The |
| 238 | + * maximum number of users that can be specified in a single request is `49`. |
| 239 | + * Format: `users/{user}`, where `{user}` is either the `id` for the |
| 240 | + * [person](https://developers.google.com/people/api/rest/v1/people) from the |
| 241 | + * People API, or the `id` for the [user](https://developers.google.com/admin- |
| 242 | + * sdk/directory/reference/rest/v1/users) in the Directory API. For example, to |
| 243 | + * find all group chats with the calling user and two other users, with People |
| 244 | + * API profile IDs `123456789` and `987654321`, you can use `users/123456789` |
| 245 | + * and `users/987654321`. You can also use the email as an alias for `{user}`. |
| 246 | + * For example, `users/example@gmail.com` where `example@gmail.com` is the email |
| 247 | + * of the Google Chat user. |
| 248 | + * @return FindGroupChatsResponse |
| 249 | + * @throws \Google\Service\Exception |
| 250 | + */ |
| 251 | + public function findGroupChats($optParams = []) |
| 252 | + { |
| 253 | + $params = []; |
| 254 | + $params = array_merge($params, $optParams); |
| 255 | + return $this->call('findGroupChats', [$params], FindGroupChatsResponse::class); |
| 256 | + } |
199 | 257 | /** |
200 | 258 | * Returns details about a space. For an example, see [Get details about a |
201 | 259 | * space](https://developers.google.com/workspace/chat/get-spaces). Supports the |
|
0 commit comments