Skip to content

Commit cf9e46b

Browse files
1 parent 9e2be87 commit cf9e46b

7 files changed

Lines changed: 172 additions & 31 deletions

File tree

src/HangoutsChat.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,28 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
299299
'type' => 'string',
300300
],
301301
],
302+
],'findGroupChats' => [
303+
'path' => 'v1/spaces:findGroupChats',
304+
'httpMethod' => 'GET',
305+
'parameters' => [
306+
'pageSize' => [
307+
'location' => 'query',
308+
'type' => 'integer',
309+
],
310+
'pageToken' => [
311+
'location' => 'query',
312+
'type' => 'string',
313+
],
314+
'spaceView' => [
315+
'location' => 'query',
316+
'type' => 'string',
317+
],
318+
'users' => [
319+
'location' => 'query',
320+
'type' => 'string',
321+
'repeated' => true,
322+
],
323+
],
302324
],'get' => [
303325
'path' => 'v1/{+name}',
304326
'httpMethod' => 'GET',
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\HangoutsChat;
19+
20+
class FindGroupChatsResponse extends \Google\Collection
21+
{
22+
protected $collection_key = 'spaces';
23+
/**
24+
* A token that you can send as `pageToken` to retrieve the next page of
25+
* results. If empty, there are no subsequent pages.
26+
*
27+
* @var string
28+
*/
29+
public $nextPageToken;
30+
protected $spacesType = Space::class;
31+
protected $spacesDataType = 'array';
32+
33+
/**
34+
* A token that you can send as `pageToken` to retrieve the next page of
35+
* results. If empty, there are no subsequent pages.
36+
*
37+
* @param string $nextPageToken
38+
*/
39+
public function setNextPageToken($nextPageToken)
40+
{
41+
$this->nextPageToken = $nextPageToken;
42+
}
43+
/**
44+
* @return string
45+
*/
46+
public function getNextPageToken()
47+
{
48+
return $this->nextPageToken;
49+
}
50+
/**
51+
* List of spaces in the requested (or first) page.
52+
*
53+
* @param Space[] $spaces
54+
*/
55+
public function setSpaces($spaces)
56+
{
57+
$this->spaces = $spaces;
58+
}
59+
/**
60+
* @return Space[]
61+
*/
62+
public function getSpaces()
63+
{
64+
return $this->spaces;
65+
}
66+
}
67+
68+
// Adding a class alias for backwards compatibility with the previous class name.
69+
class_alias(FindGroupChatsResponse::class, 'Google_Service_HangoutsChat_FindGroupChatsResponse');

src/HangoutsChat/Resource/Spaces.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Google\Service\HangoutsChat\ChatEmpty;
2121
use Google\Service\HangoutsChat\CompleteImportSpaceRequest;
2222
use Google\Service\HangoutsChat\CompleteImportSpaceResponse;
23+
use Google\Service\HangoutsChat\FindGroupChatsResponse;
2324
use Google\Service\HangoutsChat\ListSpacesResponse;
2425
use Google\Service\HangoutsChat\SearchSpacesResponse;
2526
use Google\Service\HangoutsChat\SetUpSpaceRequest;
@@ -196,6 +197,63 @@ public function findDirectMessage($optParams = [])
196197
$params = array_merge($params, $optParams);
197198
return $this->call('findDirectMessage', [$params], Space::class);
198199
}
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+
}
199257
/**
200258
* Returns details about a space. For an example, see [Get details about a
201259
* space](https://developers.google.com/workspace/chat/get-spaces). Supports the

src/HangoutsChat/Resource/SpacesMessages.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,9 @@ public function delete($name, $optParams = [])
158158
* commands](https://developers.google.com/workspace/chat/slash-commands) that
159159
* invoke the Chat app. -
160160
* `https://www.googleapis.com/auth/chat.app.messages.readonly` with
161-
* [administrator approval](https://support.google.com/a?p=chat-app-auth)
162-
* (available in [Developer
163-
* Preview](https://developers.google.com/workspace/preview)). When using this
164-
* authentication scope, this method returns details about a public message in a
165-
* space. - [User
161+
* [administrator approval](https://support.google.com/a?p=chat-app-auth). When
162+
* using this authentication scope, this method returns details about a public
163+
* message in a space. - [User
166164
* authentication](https://developers.google.com/workspace/chat/authenticate-
167165
* authorize-chat-user) with one of the following authorization scopes: -
168166
* `https://www.googleapis.com/auth/chat.messages.readonly` -
@@ -197,8 +195,7 @@ public function get($name, $optParams = [])
197195
* authorize): - [App
198196
* authentication](https://developers.google.com/workspace/chat/authenticate-
199197
* authorize-chat-app) with [administrator
200-
* approval](https://support.google.com/a?p=chat-app-auth) in [Developer
201-
* Preview](https://developers.google.com/workspace/preview) with the
198+
* approval](https://support.google.com/a?p=chat-app-auth) with the
202199
* authorization scope: -
203200
* `https://www.googleapis.com/auth/chat.app.messages.readonly`. When using this
204201
* authentication scope, this method only returns public messages in a space. It

src/HangoutsChat/Resource/SpacesSpaceEvents.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ class SpacesSpaceEvents extends \Google\Service\Resource
4545
* authorize#chat-api-scopes) appropriate for reading the requested data: - [App
4646
* authentication](https://developers.google.com/workspace/chat/authenticate-
4747
* authorize-chat-app) with [administrator
48-
* approval](https://support.google.com/a?p=chat-app-auth) in [Developer
49-
* Preview](https://developers.google.com/workspace/preview) with one of the
48+
* approval](https://support.google.com/a?p=chat-app-auth) with one of the
5049
* following authorization scopes: -
5150
* `https://www.googleapis.com/auth/chat.app.spaces` -
51+
* `https://www.googleapis.com/auth/chat.app.spaces.readonly` -
5252
* `https://www.googleapis.com/auth/chat.app.messages.readonly` -
53-
* `https://www.googleapis.com/auth/chat.app.memberships` - [User
53+
* `https://www.googleapis.com/auth/chat.app.memberships` -
54+
* `https://www.googleapis.com/auth/chat.app.memberships.readonly` - [User
5455
* authentication](https://developers.google.com/workspace/chat/authenticate-
5556
* authorize-chat-user) with one of the following authorization scopes: -
5657
* `https://www.googleapis.com/auth/chat.spaces.readonly` -
@@ -93,12 +94,13 @@ public function get($name, $optParams = [])
9394
* authorize#chat-api-scopes) appropriate for reading the requested data: - [App
9495
* authentication](https://developers.google.com/workspace/chat/authenticate-
9596
* authorize-chat-app) with [administrator
96-
* approval](https://support.google.com/a?p=chat-app-auth) in [Developer
97-
* Preview](https://developers.google.com/workspace/preview) with one of the
97+
* approval](https://support.google.com/a?p=chat-app-auth) with one of the
9898
* following authorization scopes: -
9999
* `https://www.googleapis.com/auth/chat.app.spaces` -
100+
* `https://www.googleapis.com/auth/chat.app.spaces.readonly` -
100101
* `https://www.googleapis.com/auth/chat.app.messages.readonly` -
101-
* `https://www.googleapis.com/auth/chat.app.memberships` - [User
102+
* `https://www.googleapis.com/auth/chat.app.memberships` -
103+
* `https://www.googleapis.com/auth/chat.app.memberships.readonly` - [User
102104
* authentication](https://developers.google.com/workspace/chat/authenticate-
103105
* authorize-chat-user) with one of the following authorization scopes: -
104106
* `https://www.googleapis.com/auth/chat.spaces.readonly` -

src/HangoutsChat/Resource/UsersSections.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
class UsersSections extends \Google\Service\Resource
3535
{
3636
/**
37-
* [Developer Preview](https://developers.google.com/workspace/preview): Creates
38-
* a section in Google Chat. Sections help users group conversations and
37+
* Creates a section in Google Chat. Sections help users group conversations and
3938
* customize the list of spaces displayed in Chat navigation panel. Only
4039
* sections of type `CUSTOM_SECTION` can be created. For details, see [Create
4140
* and organize sections in Google
@@ -60,10 +59,9 @@ public function create($parent, GoogleChatV1Section $postBody, $optParams = [])
6059
return $this->call('create', [$params], GoogleChatV1Section::class);
6160
}
6261
/**
63-
* [Developer Preview](https://developers.google.com/workspace/preview): Deletes
64-
* a section of type `CUSTOM_SECTION`. If the section contains items, such as
65-
* spaces, the items are moved to Google Chat's default sections and are not
66-
* deleted. For details, see [Create and organize sections in Google
62+
* Deletes a section of type `CUSTOM_SECTION`. If the section contains items,
63+
* such as spaces, the items are moved to Google Chat's default sections and are
64+
* not deleted. For details, see [Create and organize sections in Google
6765
* Chat](https://support.google.com/chat/answer/16059854). Requires [user
6866
* authentication](https://developers.google.com/workspace/chat/authenticate-
6967
* authorize-chat-user) with the [authorization
@@ -84,8 +82,7 @@ public function delete($name, $optParams = [])
8482
return $this->call('delete', [$params], ChatEmpty::class);
8583
}
8684
/**
87-
* [Developer Preview](https://developers.google.com/workspace/preview): Lists
88-
* sections available to the Chat user. Sections help users group their
85+
* Lists sections available to the Chat user. Sections help users group their
8986
* conversations and customize the list of spaces displayed in Chat navigation
9087
* panel. For details, see [Create and organize sections in Google
9188
* Chat](https://support.google.com/chat/answer/16059854). Requires [user
@@ -125,8 +122,7 @@ public function listUsersSections($parent, $optParams = [])
125122
return $this->call('list', [$params], ListSectionsResponse::class);
126123
}
127124
/**
128-
* [Developer Preview](https://developers.google.com/workspace/preview): Updates
129-
* a section. Only sections of type `CUSTOM_SECTION` can be updated. For
125+
* Updates a section. Only sections of type `CUSTOM_SECTION` can be updated. For
130126
* details, see [Create and organize sections in Google
131127
* Chat](https://support.google.com/chat/answer/16059854). Requires [user
132128
* authentication](https://developers.google.com/workspace/chat/authenticate-
@@ -156,10 +152,9 @@ public function patch($name, GoogleChatV1Section $postBody, $optParams = [])
156152
return $this->call('patch', [$params], GoogleChatV1Section::class);
157153
}
158154
/**
159-
* [Developer Preview](https://developers.google.com/workspace/preview): Changes
160-
* the sort order of a section. For details, see [Create and organize sections
161-
* in Google Chat](https://support.google.com/chat/answer/16059854). Requires
162-
* [user
155+
* Changes the sort order of a section. For details, see [Create and organize
156+
* sections in Google Chat](https://support.google.com/chat/answer/16059854).
157+
* Requires [user
163158
* authentication](https://developers.google.com/workspace/chat/authenticate-
164159
* authorize-chat-user) with the [authorization
165160
* scope](https://developers.google.com/workspace/chat/authenticate-

src/HangoutsChat/Resource/UsersSectionsItems.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
class UsersSectionsItems extends \Google\Service\Resource
3333
{
3434
/**
35-
* [Developer Preview](https://developers.google.com/workspace/preview): Lists
36-
* items in a section. Only spaces can be section items. For details, see
35+
* Lists items in a section. Only spaces can be section items. For details, see
3736
* [Create and organize sections in Google
3837
* Chat](https://support.google.com/chat/answer/16059854). Requires [user
3938
* authentication](https://developers.google.com/workspace/chat/authenticate-
@@ -74,8 +73,7 @@ public function listUsersSectionsItems($parent, $optParams = [])
7473
return $this->call('list', [$params], ListSectionItemsResponse::class);
7574
}
7675
/**
77-
* [Developer Preview](https://developers.google.com/workspace/preview): Moves
78-
* an item from one section to another. For example, if a section contains
76+
* Moves an item from one section to another. For example, if a section contains
7977
* spaces, this method can be used to move a space to a different section. For
8078
* details, see [Create and organize sections in Google
8179
* Chat](https://support.google.com/chat/answer/16059854). Requires [user

0 commit comments

Comments
 (0)