Skip to content

Commit 76fdbf7

Browse files
Google APIscopybara-github
authored andcommitted
feat: Addition of Section and SectionItem APIs
PiperOrigin-RevId: 893488928
1 parent 1568178 commit 76fdbf7

5 files changed

Lines changed: 523 additions & 3 deletions

File tree

google/chat/v1/BUILD.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ proto_library(
3737
"membership.proto",
3838
"message.proto",
3939
"reaction.proto",
40+
"section.proto",
4041
"slash_command.proto",
4142
"space.proto",
4243
"space_event.proto",
@@ -129,7 +130,7 @@ java_gapic_assembly_gradle_pkg(
129130
":chat_java_grpc",
130131
":chat_java_proto",
131132
":chat_proto",
132-
"//google/apps/card/v1:card_java_proto", # Added manually
133+
"//google/apps/card/v1:card_java_proto", # Added manually
133134
],
134135
)
135136

@@ -195,7 +196,7 @@ load(
195196
)
196197

197198
py_import(
198-
name="card",
199+
name = "card",
199200
srcs = [
200201
"//google/apps/card/v1:card_py_gapic",
201202
],

google/chat/v1/chat_grpc_service_config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
{ "service": "google.chat.v1.ChatService", "method": "GetAttachment" },
3535
{ "service": "google.chat.v1.ChatService", "method": "GetSpaceEvent" },
3636
{ "service": "google.chat.v1.ChatService", "method": "ListSpaceEvents" },
37+
{ "service": "google.chat.v1.ChatService", "method": "CreateSection" },
38+
{ "service": "google.chat.v1.ChatService", "method": "DeleteSection" },
39+
{ "service": "google.chat.v1.ChatService", "method": "ListSections" },
40+
{ "service": "google.chat.v1.ChatService", "method": "PositionSection" },
41+
{ "service": "google.chat.v1.ChatService", "method": "UpdateSection" },
42+
{ "service": "google.chat.v1.ChatService", "method": "ListSectionItems" },
43+
{ "service": "google.chat.v1.ChatService", "method": "MoveSectionItem" },
3744
{ "service": "google.chat.v1.ChatService", "method": "GetSpaceNotificationSetting" },
3845
{ "service": "google.chat.v1.ChatService", "method": "UpdateSpaceNotificationSetting" }
3946
],

google/chat/v1/chat_service.proto

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import "google/chat/v1/attachment.proto";
2222
import "google/chat/v1/membership.proto";
2323
import "google/chat/v1/message.proto";
2424
import "google/chat/v1/reaction.proto";
25+
import "google/chat/v1/section.proto";
2526
import "google/chat/v1/space.proto";
2627
import "google/chat/v1/space_event.proto";
2728
import "google/chat/v1/space_notification_setting.proto";
@@ -73,6 +74,8 @@ service ChatService {
7374
"https://www.googleapis.com/auth/chat.spaces.readonly,"
7475
"https://www.googleapis.com/auth/chat.users.readstate,"
7576
"https://www.googleapis.com/auth/chat.users.readstate.readonly,"
77+
"https://www.googleapis.com/auth/chat.users.sections,"
78+
"https://www.googleapis.com/auth/chat.users.sections.readonly,"
7679
"https://www.googleapis.com/auth/chat.users.spacesettings";
7780

7881
// Creates a message in a Google Chat space. For an example, see [Send a
@@ -1191,4 +1194,139 @@ service ChatService {
11911194
option (google.api.method_signature) =
11921195
"space_notification_setting,update_mask";
11931196
}
1197+
1198+
// Creates a section in Google Chat. Sections help users group conversations
1199+
// and customize the list of spaces displayed in Chat navigation panel. Only
1200+
// sections of type `CUSTOM_SECTION` can be created. For details, see [Create
1201+
// and organize sections in Google
1202+
// Chat](https://support.google.com/chat/answer/16059854).
1203+
//
1204+
// Requires [user
1205+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1206+
// with the [authorization
1207+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
1208+
//
1209+
// - `https://www.googleapis.com/auth/chat.users.sections`
1210+
rpc CreateSection(CreateSectionRequest) returns (Section) {
1211+
option (google.api.http) = {
1212+
post: "/v1/{parent=users/*}/sections"
1213+
body: "section"
1214+
};
1215+
option (google.api.method_signature) = "parent,section";
1216+
}
1217+
1218+
// Deletes a section of type `CUSTOM_SECTION`.
1219+
//
1220+
// If the section contains items, such as spaces, the items are moved to
1221+
// Google Chat's default sections and are not deleted.
1222+
//
1223+
// For details, see [Create and organize sections in Google
1224+
// Chat](https://support.google.com/chat/answer/16059854).
1225+
//
1226+
// Requires [user
1227+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1228+
// with the [authorization
1229+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
1230+
//
1231+
// - `https://www.googleapis.com/auth/chat.users.sections`
1232+
rpc DeleteSection(DeleteSectionRequest) returns (google.protobuf.Empty) {
1233+
option (google.api.http) = {
1234+
delete: "/v1/{name=users/*/sections/*}"
1235+
};
1236+
option (google.api.method_signature) = "name";
1237+
}
1238+
1239+
// Updates a section. Only sections of type `CUSTOM_SECTION` can be updated.
1240+
// For details, see [Create and organize sections in Google
1241+
// Chat](https://support.google.com/chat/answer/16059854).
1242+
//
1243+
// Requires [user
1244+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1245+
// with the [authorization
1246+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
1247+
//
1248+
// - `https://www.googleapis.com/auth/chat.users.sections`
1249+
rpc UpdateSection(UpdateSectionRequest) returns (Section) {
1250+
option (google.api.http) = {
1251+
patch: "/v1/{section.name=users/*/sections/*}"
1252+
body: "section"
1253+
};
1254+
option (google.api.method_signature) = "section,update_mask";
1255+
}
1256+
1257+
// Lists sections available to the Chat user. Sections help users group their
1258+
// conversations and customize the list of spaces displayed in Chat
1259+
// navigation panel. For details, see [Create and organize sections in Google
1260+
// Chat](https://support.google.com/chat/answer/16059854).
1261+
//
1262+
// Requires [user
1263+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1264+
// with the [authorization
1265+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
1266+
//
1267+
// - `https://www.googleapis.com/auth/chat.users.sections`
1268+
// - `https://www.googleapis.com/auth/chat.users.sections.readonly`
1269+
rpc ListSections(ListSectionsRequest) returns (ListSectionsResponse) {
1270+
option (google.api.http) = {
1271+
get: "/v1/{parent=users/*}/sections"
1272+
};
1273+
option (google.api.method_signature) = "parent";
1274+
}
1275+
1276+
// Changes the sort order of a section. For details, see [Create and organize
1277+
// sections in Google Chat](https://support.google.com/chat/answer/16059854).
1278+
//
1279+
// Requires [user
1280+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1281+
// with the [authorization
1282+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
1283+
//
1284+
// - `https://www.googleapis.com/auth/chat.users.sections`
1285+
rpc PositionSection(PositionSectionRequest)
1286+
returns (PositionSectionResponse) {
1287+
option (google.api.http) = {
1288+
post: "/v1/{name=users/*/sections/*}:position"
1289+
body: "*"
1290+
};
1291+
}
1292+
1293+
// Lists items in a section.
1294+
//
1295+
// Only spaces can be section items. For details, see [Create and organize
1296+
// sections in Google Chat](https://support.google.com/chat/answer/16059854).
1297+
//
1298+
// Requires [user
1299+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1300+
// with the [authorization
1301+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
1302+
//
1303+
// - `https://www.googleapis.com/auth/chat.users.sections`
1304+
// - `https://www.googleapis.com/auth/chat.users.sections.readonly`
1305+
rpc ListSectionItems(ListSectionItemsRequest)
1306+
returns (ListSectionItemsResponse) {
1307+
option (google.api.http) = {
1308+
get: "/v1/{parent=users/*/sections/*}/items"
1309+
};
1310+
option (google.api.method_signature) = "parent";
1311+
}
1312+
1313+
// Moves an item from one section to another. For example, if a section
1314+
// contains spaces, this method can be used to move a space to a different
1315+
// section. For details, see [Create and organize sections in Google
1316+
// Chat](https://support.google.com/chat/answer/16059854).
1317+
//
1318+
// Requires [user
1319+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1320+
// with the [authorization
1321+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
1322+
//
1323+
// - `https://www.googleapis.com/auth/chat.users.sections`
1324+
rpc MoveSectionItem(MoveSectionItemRequest)
1325+
returns (MoveSectionItemResponse) {
1326+
option (google.api.http) = {
1327+
post: "/v1/{name=users/*/sections/*/items/*}:move"
1328+
body: "*"
1329+
};
1330+
option (google.api.method_signature) = "name,target_section";
1331+
}
11941332
}

google/chat/v1/chat_v1.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ authentication:
4444
https://www.googleapis.com/auth/chat.messages,
4545
https://www.googleapis.com/auth/chat.messages.reactions,
4646
https://www.googleapis.com/auth/chat.messages.reactions.create
47+
- selector: google.chat.v1.ChatService.CreateSection
48+
oauth:
49+
canonical_scopes: |-
50+
https://www.googleapis.com/auth/chat.users.sections
4751
- selector: google.chat.v1.ChatService.CreateSpace
4852
oauth:
4953
canonical_scopes: |-
@@ -76,6 +80,10 @@ authentication:
7680
https://www.googleapis.com/auth/chat.import,
7781
https://www.googleapis.com/auth/chat.messages,
7882
https://www.googleapis.com/auth/chat.messages.reactions
83+
- selector: google.chat.v1.ChatService.DeleteSection
84+
oauth:
85+
canonical_scopes: |-
86+
https://www.googleapis.com/auth/chat.users.sections
7987
- selector: google.chat.v1.ChatService.DeleteSpace
8088
oauth:
8189
canonical_scopes: |-
@@ -180,6 +188,16 @@ authentication:
180188
https://www.googleapis.com/auth/chat.messages.reactions,
181189
https://www.googleapis.com/auth/chat.messages.reactions.readonly,
182190
https://www.googleapis.com/auth/chat.messages.readonly
191+
- selector: google.chat.v1.ChatService.ListSectionItems
192+
oauth:
193+
canonical_scopes: |-
194+
https://www.googleapis.com/auth/chat.users.sections,
195+
https://www.googleapis.com/auth/chat.users.sections.readonly
196+
- selector: google.chat.v1.ChatService.ListSections
197+
oauth:
198+
canonical_scopes: |-
199+
https://www.googleapis.com/auth/chat.users.sections,
200+
https://www.googleapis.com/auth/chat.users.sections.readonly
183201
- selector: google.chat.v1.ChatService.ListSpaceEvents
184202
oauth:
185203
canonical_scopes: |-
@@ -200,6 +218,14 @@ authentication:
200218
https://www.googleapis.com/auth/chat.bot,
201219
https://www.googleapis.com/auth/chat.spaces,
202220
https://www.googleapis.com/auth/chat.spaces.readonly
221+
- selector: google.chat.v1.ChatService.MoveSectionItem
222+
oauth:
223+
canonical_scopes: |-
224+
https://www.googleapis.com/auth/chat.users.sections
225+
- selector: google.chat.v1.ChatService.PositionSection
226+
oauth:
227+
canonical_scopes: |-
228+
https://www.googleapis.com/auth/chat.users.sections
203229
- selector: google.chat.v1.ChatService.SearchSpaces
204230
oauth:
205231
canonical_scopes: |-
@@ -223,6 +249,10 @@ authentication:
223249
https://www.googleapis.com/auth/chat.bot,
224250
https://www.googleapis.com/auth/chat.import,
225251
https://www.googleapis.com/auth/chat.messages
252+
- selector: google.chat.v1.ChatService.UpdateSection
253+
oauth:
254+
canonical_scopes: |-
255+
https://www.googleapis.com/auth/chat.users.sections
226256
- selector: google.chat.v1.ChatService.UpdateSpace
227257
oauth:
228258
canonical_scopes: |-

0 commit comments

Comments
 (0)