Skip to content

Commit 1a9d00b

Browse files
Google APIscopybara-github
authored andcommitted
docs: Improve documentation of attachment.proto, event_payload.proto and space.proto
feat: Add app authorization support to space APIs feat: Add accessory widget support for private messages PiperOrigin-RevId: 845227338
1 parent 4149dbd commit 1a9d00b

File tree

6 files changed

+107
-48
lines changed

6 files changed

+107
-48
lines changed

google/chat/v1/attachment.proto

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ message Attachment {
4747
UPLOADED_CONTENT = 2;
4848
}
4949

50-
// Optional. Resource name of the attachment, in the form
51-
// `spaces/{space}/messages/{message}/attachments/{attachment}`.
52-
string name = 1 [(google.api.field_behavior) = OPTIONAL];
50+
// Identifier. Resource name of the attachment.
51+
//
52+
// Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
53+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
5354

5455
// Output only. The original file name for the content, not the full path.
5556
string content_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

google/chat/v1/chat_service.proto

Lines changed: 89 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ service ChatService {
5151
"https://www.googleapis.com/auth/chat.admin.spaces.readonly,"
5252
"https://www.googleapis.com/auth/chat.app.delete,"
5353
"https://www.googleapis.com/auth/chat.app.memberships,"
54+
"https://www.googleapis.com/auth/chat.app.messages.readonly,"
5455
"https://www.googleapis.com/auth/chat.app.spaces,"
5556
"https://www.googleapis.com/auth/chat.app.spaces.create,"
5657
"https://www.googleapis.com/auth/chat.bot,"
@@ -127,21 +128,34 @@ service ChatService {
127128
}
128129

129130
// Lists messages in a space that the caller is a member of, including
130-
// messages from blocked members and spaces. If you list messages from a
131+
// messages from blocked members and spaces. System messages, like those
132+
// announcing new space members, aren't included. If you list messages from a
131133
// space with no messages, the response is an empty object. When using a
132134
// REST/HTTP interface, the response contains an empty JSON object, `{}`.
133135
// For an example, see
134136
// [List
135137
// messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list).
136138
//
137-
// Requires [user
138-
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
139-
// with one of the following [authorization
140-
// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
139+
// Supports the following types of
140+
// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
141141
//
142-
// - `https://www.googleapis.com/auth/chat.messages.readonly`
143-
// - `https://www.googleapis.com/auth/chat.messages`
144-
// - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)
142+
// - [App
143+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
144+
// with [administrator
145+
// approval](https://support.google.com/a?p=chat-app-auth) in
146+
// [Developer Preview](https://developers.google.com/workspace/preview)
147+
// with the authorization scope:
148+
// - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When
149+
// using this authentication scope, this method only returns public
150+
// messages in a space. It doesn't include private messages.
151+
//
152+
// - [User
153+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
154+
// with one of the following authorization scopes:
155+
// - `https://www.googleapis.com/auth/chat.messages.readonly`
156+
// - `https://www.googleapis.com/auth/chat.messages`
157+
// - `https://www.googleapis.com/auth/chat.import` (import mode spaces
158+
// only)
145159
rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) {
146160
option (google.api.http) = {
147161
get: "/v1/{parent=spaces/*}/messages"
@@ -231,8 +245,18 @@ service ChatService {
231245
//
232246
// - [App
233247
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
234-
// with the authorization scope:
235-
// - `https://www.googleapis.com/auth/chat.bot`
248+
// with one of the following authorization scopes:
249+
// - `https://www.googleapis.com/auth/chat.bot`: When using this
250+
// authorization scope, this method returns details about a message the
251+
// Chat app has access to, like direct messages and [slash
252+
// commands](https://developers.google.com/workspace/chat/slash-commands)
253+
// that invoke the Chat app.
254+
// - `https://www.googleapis.com/auth/chat.app.messages.readonly`
255+
// with [administrator
256+
// approval](https://support.google.com/a?p=chat-app-auth) (available in
257+
// [Developer Preview](https://developers.google.com/workspace/preview)).
258+
// When using this authentication scope,
259+
// this method returns details about a public message in a space.
236260
//
237261
// - [User
238262
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
@@ -386,7 +410,9 @@ service ChatService {
386410
}
387411

388412
// Returns a list of spaces in a Google Workspace organization based on an
389-
// administrator's search.
413+
// administrator's search. In the request, set `use_admin_access` to `true`.
414+
// For an example, see [Search for and manage
415+
// spaces](https://developers.google.com/workspace/chat/search-manage-admin).
390416
//
391417
// Requires [user
392418
// authentication with administrator
@@ -396,8 +422,6 @@ service ChatService {
396422
//
397423
// - `https://www.googleapis.com/auth/chat.admin.spaces.readonly`
398424
// - `https://www.googleapis.com/auth/chat.admin.spaces`
399-
//
400-
// In the request, set `use_admin_access` to `true`.
401425
rpc SearchSpaces(SearchSpacesRequest) returns (SearchSpacesResponse) {
402426
option (google.api.http) = {
403427
get: "/v1/spaces:search"
@@ -1040,22 +1064,36 @@ service ChatService {
10401064
// Note: The `permissionSettings` field is not returned in the Space
10411065
// object of the Space event data for this request.
10421066
//
1043-
// Requires [user
1044-
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1045-
// with an [authorization
1067+
// Supports the following types of
1068+
// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize)
1069+
// with an
1070+
// [authorization
10461071
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes)
10471072
// appropriate for reading the requested data:
10481073
//
1049-
// - `https://www.googleapis.com/auth/chat.spaces.readonly`
1050-
// - `https://www.googleapis.com/auth/chat.spaces`
1051-
// - `https://www.googleapis.com/auth/chat.messages.readonly`
1052-
// - `https://www.googleapis.com/auth/chat.messages`
1053-
// - `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
1054-
// - `https://www.googleapis.com/auth/chat.messages.reactions`
1055-
// - `https://www.googleapis.com/auth/chat.memberships.readonly`
1056-
// - `https://www.googleapis.com/auth/chat.memberships`
1074+
// - [App
1075+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1076+
// with [administrator
1077+
// approval](https://support.google.com/a?p=chat-app-auth) in
1078+
// [Developer Preview](https://developers.google.com/workspace/preview)
1079+
// with one of the following authorization scopes:
1080+
// - `https://www.googleapis.com/auth/chat.app.spaces`
1081+
// - `https://www.googleapis.com/auth/chat.app.messages.readonly`
1082+
// - `https://www.googleapis.com/auth/chat.app.memberships`
1083+
//
1084+
// - [User
1085+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1086+
// with one of the following authorization scopes:
1087+
// - `https://www.googleapis.com/auth/chat.spaces.readonly`
1088+
// - `https://www.googleapis.com/auth/chat.spaces`
1089+
// - `https://www.googleapis.com/auth/chat.messages.readonly`
1090+
// - `https://www.googleapis.com/auth/chat.messages`
1091+
// - `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
1092+
// - `https://www.googleapis.com/auth/chat.messages.reactions`
1093+
// - `https://www.googleapis.com/auth/chat.memberships.readonly`
1094+
// - `https://www.googleapis.com/auth/chat.memberships`
10571095
//
1058-
// To get an event, the authenticated user must be a member of the space.
1096+
// To get an event, the authenticated caller must be a member of the space.
10591097
//
10601098
// For an example, see [Get details about an
10611099
// event from a Google Chat
@@ -1075,22 +1113,36 @@ service ChatService {
10751113
// removed during the requested period, the event payload contains an empty
10761114
// `Membership` resource.
10771115
//
1078-
// Requires [user
1079-
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1080-
// with an [authorization
1116+
// Supports the following types of
1117+
// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize)
1118+
// with an
1119+
// [authorization
10811120
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes)
10821121
// appropriate for reading the requested data:
10831122
//
1084-
// - `https://www.googleapis.com/auth/chat.spaces.readonly`
1085-
// - `https://www.googleapis.com/auth/chat.spaces`
1086-
// - `https://www.googleapis.com/auth/chat.messages.readonly`
1087-
// - `https://www.googleapis.com/auth/chat.messages`
1088-
// - `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
1089-
// - `https://www.googleapis.com/auth/chat.messages.reactions`
1090-
// - `https://www.googleapis.com/auth/chat.memberships.readonly`
1091-
// - `https://www.googleapis.com/auth/chat.memberships`
1123+
// - [App
1124+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1125+
// with [administrator
1126+
// approval](https://support.google.com/a?p=chat-app-auth) in
1127+
// [Developer Preview](https://developers.google.com/workspace/preview)
1128+
// with one of the following authorization scopes:
1129+
// - `https://www.googleapis.com/auth/chat.app.spaces`
1130+
// - `https://www.googleapis.com/auth/chat.app.messages.readonly`
1131+
// - `https://www.googleapis.com/auth/chat.app.memberships`
1132+
//
1133+
// - [User
1134+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1135+
// with one of the following authorization scopes:
1136+
// - `https://www.googleapis.com/auth/chat.spaces.readonly`
1137+
// - `https://www.googleapis.com/auth/chat.spaces`
1138+
// - `https://www.googleapis.com/auth/chat.messages.readonly`
1139+
// - `https://www.googleapis.com/auth/chat.messages`
1140+
// - `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
1141+
// - `https://www.googleapis.com/auth/chat.messages.reactions`
1142+
// - `https://www.googleapis.com/auth/chat.memberships.readonly`
1143+
// - `https://www.googleapis.com/auth/chat.memberships`
10921144
//
1093-
// To list events, the authenticated user must be a member of the space.
1145+
// To list events, the authenticated caller must be a member of the space.
10941146
//
10951147
// For an example, see [List events from a Google Chat
10961148
// space](https://developers.google.com/workspace/chat/list-space-events).

google/chat/v1/chat_v1.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ authentication:
110110
- selector: google.chat.v1.ChatService.GetMessage
111111
oauth:
112112
canonical_scopes: |-
113+
https://www.googleapis.com/auth/chat.app.messages.readonly,
113114
https://www.googleapis.com/auth/chat.bot,
114115
https://www.googleapis.com/auth/chat.messages,
115116
https://www.googleapis.com/auth/chat.messages.readonly
@@ -126,6 +127,7 @@ authentication:
126127
oauth:
127128
canonical_scopes: |-
128129
https://www.googleapis.com/auth/chat.app.memberships,
130+
https://www.googleapis.com/auth/chat.app.messages.readonly,
129131
https://www.googleapis.com/auth/chat.app.spaces,
130132
https://www.googleapis.com/auth/chat.memberships,
131133
https://www.googleapis.com/auth/chat.memberships.readonly,
@@ -167,6 +169,7 @@ authentication:
167169
- selector: google.chat.v1.ChatService.ListMessages
168170
oauth:
169171
canonical_scopes: |-
172+
https://www.googleapis.com/auth/chat.app.messages.readonly,
170173
https://www.googleapis.com/auth/chat.import,
171174
https://www.googleapis.com/auth/chat.messages,
172175
https://www.googleapis.com/auth/chat.messages.readonly
@@ -181,6 +184,7 @@ authentication:
181184
oauth:
182185
canonical_scopes: |-
183186
https://www.googleapis.com/auth/chat.app.memberships,
187+
https://www.googleapis.com/auth/chat.app.messages.readonly,
184188
https://www.googleapis.com/auth/chat.app.spaces,
185189
https://www.googleapis.com/auth/chat.memberships,
186190
https://www.googleapis.com/auth/chat.memberships.readonly,

google/chat/v1/event_payload.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ message MessageUpdatedEventData {
9999
//
100100
// Event type: `google.workspace.chat.message.v1.deleted`
101101
message MessageDeletedEventData {
102-
// The deleted message. Only the `name`, `createTime`, `deleteTime`, and
102+
// The deleted message. Only the `name`, `createTime`, and
103103
// `deletionMetadata` fields are populated.
104104
Message message = 1;
105105
}

google/chat/v1/message.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ message Message {
127127
// This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning
128128
// face emoji.
129129
//
130+
// * Bullet list items using asterisks (`*`)—for example, `* item`.
131+
//
130132
// For more information, see [View text formatting sent in a
131133
// message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message)
132134
string formatted_text = 43 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -223,8 +225,6 @@ message Message {
223225
// and omit the following:
224226
//
225227
// * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments)
226-
// * [Accessory
227-
// widgets](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message.AccessoryWidget)
228228
//
229229
// For details, see [Send a message
230230
// privately](https://developers.google.com/workspace/chat/create-messages#private).

google/chat/v1/space.proto

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ message Space {
370370
// Private apps can also use the `customers/my_customer` alias to create
371371
// the space in the same Google Workspace organization as the app.
372372
//
373-
// For DMs, this field isn't populated.
373+
// This field isn't populated for direct messages (DMs) or when the space is
374+
// created by non-Google Workspace users.
374375
optional string customer = 24 [
375376
(google.api.field_behavior) = IMMUTABLE,
376377
(google.api.field_behavior) = OPTIONAL
@@ -563,8 +564,10 @@ message UpdateSpaceRequest {
563564
//
564565
// You can update the following fields for a space:
565566
//
566-
// `space_details`: Updates the space's description. Supports up to 150
567-
// characters.
567+
// `space_details`: Updates the space's description and guidelines. You must
568+
// pass both description and guidelines in the update request as
569+
// [`SpaceDetails`][google.chat.v1.Space.SpaceDetails]. If you only want to
570+
// update one of the fields, pass the existing value for the other field.
568571
//
569572
// `display_name`: Only supports updating the display name for spaces where
570573
// `spaceType` field is `SPACE`.
@@ -608,8 +611,7 @@ message UpdateSpaceRequest {
608611
// of a space.
609612
// When updating permission settings, you can only specify
610613
// `permissionSettings` field masks; you cannot update other field masks
611-
// at the same time. `permissionSettings` is not supported with
612-
// `useAdminAccess`.
614+
// at the same time.
613615
// The supported field masks include:
614616
//
615617
// - `permission_settings.manageMembersAndGroups`

0 commit comments

Comments
 (0)