Skip to content

Commit 34342c6

Browse files
1 parent 089c171 commit 34342c6

12 files changed

Lines changed: 1016 additions & 4 deletions

src/HangoutsChat.php

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ class HangoutsChat extends \Google\Service
122122
/** View last read time for Google Chat conversations. */
123123
const CHAT_USERS_READSTATE_READONLY =
124124
"https://www.googleapis.com/auth/chat.users.readstate.readonly";
125+
/** View, create, update, and delete your sections in Google Chat; move and list your section items in Google Chat. */
126+
const CHAT_USERS_SECTIONS =
127+
"https://www.googleapis.com/auth/chat.users.sections";
128+
/** View your sections and their section items in Google Chat. */
129+
const CHAT_USERS_SECTIONS_READONLY =
130+
"https://www.googleapis.com/auth/chat.users.sections.readonly";
125131
/** Read and update your space settings. */
126132
const CHAT_USERS_SPACESETTINGS =
127133
"https://www.googleapis.com/auth/chat.users.spacesettings";
@@ -134,6 +140,8 @@ class HangoutsChat extends \Google\Service
134140
public $spaces_messages_attachments;
135141
public $spaces_messages_reactions;
136142
public $spaces_spaceEvents;
143+
public $users_sections;
144+
public $users_sections_items;
137145
public $users_spaces;
138146
public $users_spaces_spaceNotificationSetting;
139147
public $users_spaces_threads;
@@ -711,6 +719,120 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
711719
]
712720
]
713721
);
722+
$this->users_sections = new HangoutsChat\Resource\UsersSections(
723+
$this,
724+
$this->serviceName,
725+
'sections',
726+
[
727+
'methods' => [
728+
'create' => [
729+
'path' => 'v1/{+parent}/sections',
730+
'httpMethod' => 'POST',
731+
'parameters' => [
732+
'parent' => [
733+
'location' => 'path',
734+
'type' => 'string',
735+
'required' => true,
736+
],
737+
],
738+
],'delete' => [
739+
'path' => 'v1/{+name}',
740+
'httpMethod' => 'DELETE',
741+
'parameters' => [
742+
'name' => [
743+
'location' => 'path',
744+
'type' => 'string',
745+
'required' => true,
746+
],
747+
],
748+
],'list' => [
749+
'path' => 'v1/{+parent}/sections',
750+
'httpMethod' => 'GET',
751+
'parameters' => [
752+
'parent' => [
753+
'location' => 'path',
754+
'type' => 'string',
755+
'required' => true,
756+
],
757+
'pageSize' => [
758+
'location' => 'query',
759+
'type' => 'integer',
760+
],
761+
'pageToken' => [
762+
'location' => 'query',
763+
'type' => 'string',
764+
],
765+
],
766+
],'patch' => [
767+
'path' => 'v1/{+name}',
768+
'httpMethod' => 'PATCH',
769+
'parameters' => [
770+
'name' => [
771+
'location' => 'path',
772+
'type' => 'string',
773+
'required' => true,
774+
],
775+
'updateMask' => [
776+
'location' => 'query',
777+
'type' => 'string',
778+
],
779+
],
780+
],'position' => [
781+
'path' => 'v1/{+name}:position',
782+
'httpMethod' => 'POST',
783+
'parameters' => [
784+
'name' => [
785+
'location' => 'path',
786+
'type' => 'string',
787+
'required' => true,
788+
],
789+
],
790+
],
791+
]
792+
]
793+
);
794+
$this->users_sections_items = new HangoutsChat\Resource\UsersSectionsItems(
795+
$this,
796+
$this->serviceName,
797+
'items',
798+
[
799+
'methods' => [
800+
'list' => [
801+
'path' => 'v1/{+parent}/items',
802+
'httpMethod' => 'GET',
803+
'parameters' => [
804+
'parent' => [
805+
'location' => 'path',
806+
'type' => 'string',
807+
'required' => true,
808+
],
809+
'filter' => [
810+
'location' => 'query',
811+
'type' => 'string',
812+
],
813+
'pageSize' => [
814+
'location' => 'query',
815+
'type' => 'integer',
816+
],
817+
'pageToken' => [
818+
'location' => 'query',
819+
'type' => 'string',
820+
],
821+
],
822+
],'move' => [
823+
'path' => 'v1/{+name}:move',
824+
'httpMethod' => 'POST',
825+
'parameters' => [
826+
'name' => [
827+
'location' => 'path',
828+
'type' => 'string',
829+
'required' => true,
830+
],
831+
],
832+
],
833+
]
834+
]
835+
);
714836
$this->users_spaces = new HangoutsChat\Resource\UsersSpaces(
715837
$this,
716838
$this->serviceName,
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
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 GoogleChatV1Section extends \Google\Model
21+
{
22+
/**
23+
* Unspecified section type.
24+
*/
25+
public const TYPE_SECTION_TYPE_UNSPECIFIED = 'SECTION_TYPE_UNSPECIFIED';
26+
/**
27+
* Custom section.
28+
*/
29+
public const TYPE_CUSTOM_SECTION = 'CUSTOM_SECTION';
30+
/**
31+
* Default section containing [DIRECT_MESSAGE](https://developers.google.com/w
32+
* orkspace/chat/api/reference/rest/v1/spaces#spacetype) between two human
33+
* users or [GROUP_CHAT](https://developers.google.com/workspace/chat/api/refe
34+
* rence/rest/v1/spaces#spacetype) spaces that don't belong to any custom
35+
* section.
36+
*/
37+
public const TYPE_DEFAULT_DIRECT_MESSAGES = 'DEFAULT_DIRECT_MESSAGES';
38+
/**
39+
* Default spaces that don't belong to any custom section.
40+
*/
41+
public const TYPE_DEFAULT_SPACES = 'DEFAULT_SPACES';
42+
/**
43+
* Default section containing a user's installed apps.
44+
*/
45+
public const TYPE_DEFAULT_APPS = 'DEFAULT_APPS';
46+
/**
47+
* Optional. The section's display name. Only populated for sections of type
48+
* `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a
49+
* `CUSTOM_SECTION`.
50+
*
51+
* @var string
52+
*/
53+
public $displayName;
54+
/**
55+
* Identifier. Resource name of the section. For system sections, the section
56+
* ID is a constant string: - DEFAULT_DIRECT_MESSAGES:
57+
* `users/{user}/sections/default-direct-messages` - DEFAULT_SPACES:
58+
* `users/{user}/sections/default-spaces` - DEFAULT_APPS:
59+
* `users/{user}/sections/default-apps` Format:
60+
* `users/{user}/sections/{section}`
61+
*
62+
* @var string
63+
*/
64+
public $name;
65+
/**
66+
* Output only. The order of the section in relation to other sections.
67+
* Sections with a lower `sort_order` value appear before sections with a
68+
* higher value.
69+
*
70+
* @var int
71+
*/
72+
public $sortOrder;
73+
/**
74+
* Required. The type of the section.
75+
*
76+
* @var string
77+
*/
78+
public $type;
79+
80+
/**
81+
* Optional. The section's display name. Only populated for sections of type
82+
* `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a
83+
* `CUSTOM_SECTION`.
84+
*
85+
* @param string $displayName
86+
*/
87+
public function setDisplayName($displayName)
88+
{
89+
$this->displayName = $displayName;
90+
}
91+
/**
92+
* @return string
93+
*/
94+
public function getDisplayName()
95+
{
96+
return $this->displayName;
97+
}
98+
/**
99+
* Identifier. Resource name of the section. For system sections, the section
100+
* ID is a constant string: - DEFAULT_DIRECT_MESSAGES:
101+
* `users/{user}/sections/default-direct-messages` - DEFAULT_SPACES:
102+
* `users/{user}/sections/default-spaces` - DEFAULT_APPS:
103+
* `users/{user}/sections/default-apps` Format:
104+
* `users/{user}/sections/{section}`
105+
*
106+
* @param string $name
107+
*/
108+
public function setName($name)
109+
{
110+
$this->name = $name;
111+
}
112+
/**
113+
* @return string
114+
*/
115+
public function getName()
116+
{
117+
return $this->name;
118+
}
119+
/**
120+
* Output only. The order of the section in relation to other sections.
121+
* Sections with a lower `sort_order` value appear before sections with a
122+
* higher value.
123+
*
124+
* @param int $sortOrder
125+
*/
126+
public function setSortOrder($sortOrder)
127+
{
128+
$this->sortOrder = $sortOrder;
129+
}
130+
/**
131+
* @return int
132+
*/
133+
public function getSortOrder()
134+
{
135+
return $this->sortOrder;
136+
}
137+
/**
138+
* Required. The type of the section.
139+
*
140+
* Accepted values: SECTION_TYPE_UNSPECIFIED, CUSTOM_SECTION,
141+
* DEFAULT_DIRECT_MESSAGES, DEFAULT_SPACES, DEFAULT_APPS
142+
*
143+
* @param self::TYPE_* $type
144+
*/
145+
public function setType($type)
146+
{
147+
$this->type = $type;
148+
}
149+
/**
150+
* @return self::TYPE_*
151+
*/
152+
public function getType()
153+
{
154+
return $this->type;
155+
}
156+
}
157+
158+
// Adding a class alias for backwards compatibility with the previous class name.
159+
class_alias(GoogleChatV1Section::class, 'Google_Service_HangoutsChat_GoogleChatV1Section');
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 ListSectionItemsResponse extends \Google\Collection
21+
{
22+
protected $collection_key = 'sectionItems';
23+
/**
24+
* A token, which can be sent as `page_token` to retrieve the next page. If
25+
* this field is omitted, there are no subsequent pages.
26+
*
27+
* @var string
28+
*/
29+
public $nextPageToken;
30+
protected $sectionItemsType = SectionItem::class;
31+
protected $sectionItemsDataType = 'array';
32+
33+
/**
34+
* A token, which can be sent as `page_token` to retrieve the next page. If
35+
* this field is omitted, 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+
* The section items from the specified section.
52+
*
53+
* @param SectionItem[] $sectionItems
54+
*/
55+
public function setSectionItems($sectionItems)
56+
{
57+
$this->sectionItems = $sectionItems;
58+
}
59+
/**
60+
* @return SectionItem[]
61+
*/
62+
public function getSectionItems()
63+
{
64+
return $this->sectionItems;
65+
}
66+
}
67+
68+
// Adding a class alias for backwards compatibility with the previous class name.
69+
class_alias(ListSectionItemsResponse::class, 'Google_Service_HangoutsChat_ListSectionItemsResponse');

0 commit comments

Comments
 (0)