Skip to content

Commit f6801ce

Browse files
Google APIscopybara-github
authored andcommitted
feat: Addition of app auth support for chat api
docs: Update reference documentation for createSpace,updateSpace,deleteSpace,createMembership,updateMembership,deleteMembership and the newly added field -customer- in space.proto PiperOrigin-RevId: 788882030
1 parent 472278b commit f6801ce

File tree

8 files changed

+422
-78
lines changed

8 files changed

+422
-78
lines changed

google/chat/v1/chat_service.proto

Lines changed: 344 additions & 57 deletions
Large diffs are not rendered by default.

google/chat/v1/chat_v1.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ authentication:
2626
oauth:
2727
canonical_scopes: |-
2828
https://www.googleapis.com/auth/chat.admin.memberships,
29+
https://www.googleapis.com/auth/chat.app.memberships,
2930
https://www.googleapis.com/auth/chat.import,
3031
https://www.googleapis.com/auth/chat.memberships,
3132
https://www.googleapis.com/auth/chat.memberships.app
@@ -46,6 +47,8 @@ authentication:
4647
- selector: google.chat.v1.ChatService.CreateSpace
4748
oauth:
4849
canonical_scopes: |-
50+
https://www.googleapis.com/auth/chat.app.spaces,
51+
https://www.googleapis.com/auth/chat.app.spaces.create,
4952
https://www.googleapis.com/auth/chat.import,
5053
https://www.googleapis.com/auth/chat.spaces,
5154
https://www.googleapis.com/auth/chat.spaces.create
@@ -57,6 +60,7 @@ authentication:
5760
oauth:
5861
canonical_scopes: |-
5962
https://www.googleapis.com/auth/chat.admin.memberships,
63+
https://www.googleapis.com/auth/chat.app.memberships,
6064
https://www.googleapis.com/auth/chat.import,
6165
https://www.googleapis.com/auth/chat.memberships,
6266
https://www.googleapis.com/auth/chat.memberships.app
@@ -76,6 +80,7 @@ authentication:
7680
oauth:
7781
canonical_scopes: |-
7882
https://www.googleapis.com/auth/chat.admin.delete,
83+
https://www.googleapis.com/auth/chat.app.delete,
7984
https://www.googleapis.com/auth/chat.delete,
8085
https://www.googleapis.com/auth/chat.import
8186
- selector: google.chat.v1.ChatService.FindDirectMessage
@@ -98,6 +103,7 @@ authentication:
98103
canonical_scopes: |-
99104
https://www.googleapis.com/auth/chat.admin.memberships,
100105
https://www.googleapis.com/auth/chat.admin.memberships.readonly,
106+
https://www.googleapis.com/auth/chat.app.memberships,
101107
https://www.googleapis.com/auth/chat.bot,
102108
https://www.googleapis.com/auth/chat.memberships,
103109
https://www.googleapis.com/auth/chat.memberships.readonly
@@ -112,12 +118,15 @@ authentication:
112118
canonical_scopes: |-
113119
https://www.googleapis.com/auth/chat.admin.spaces,
114120
https://www.googleapis.com/auth/chat.admin.spaces.readonly,
121+
https://www.googleapis.com/auth/chat.app.spaces,
115122
https://www.googleapis.com/auth/chat.bot,
116123
https://www.googleapis.com/auth/chat.spaces,
117124
https://www.googleapis.com/auth/chat.spaces.readonly
118125
- selector: google.chat.v1.ChatService.GetSpaceEvent
119126
oauth:
120127
canonical_scopes: |-
128+
https://www.googleapis.com/auth/chat.app.memberships,
129+
https://www.googleapis.com/auth/chat.app.spaces,
121130
https://www.googleapis.com/auth/chat.memberships,
122131
https://www.googleapis.com/auth/chat.memberships.readonly,
123132
https://www.googleapis.com/auth/chat.messages,
@@ -150,6 +159,7 @@ authentication:
150159
canonical_scopes: |-
151160
https://www.googleapis.com/auth/chat.admin.memberships,
152161
https://www.googleapis.com/auth/chat.admin.memberships.readonly,
162+
https://www.googleapis.com/auth/chat.app.memberships,
153163
https://www.googleapis.com/auth/chat.bot,
154164
https://www.googleapis.com/auth/chat.import,
155165
https://www.googleapis.com/auth/chat.memberships,
@@ -170,6 +180,8 @@ authentication:
170180
- selector: google.chat.v1.ChatService.ListSpaceEvents
171181
oauth:
172182
canonical_scopes: |-
183+
https://www.googleapis.com/auth/chat.app.memberships,
184+
https://www.googleapis.com/auth/chat.app.spaces,
173185
https://www.googleapis.com/auth/chat.memberships,
174186
https://www.googleapis.com/auth/chat.memberships.readonly,
175187
https://www.googleapis.com/auth/chat.messages,
@@ -198,6 +210,7 @@ authentication:
198210
oauth:
199211
canonical_scopes: |-
200212
https://www.googleapis.com/auth/chat.admin.memberships,
213+
https://www.googleapis.com/auth/chat.app.memberships,
201214
https://www.googleapis.com/auth/chat.import,
202215
https://www.googleapis.com/auth/chat.memberships
203216
- selector: google.chat.v1.ChatService.UpdateMessage
@@ -210,6 +223,7 @@ authentication:
210223
oauth:
211224
canonical_scopes: |-
212225
https://www.googleapis.com/auth/chat.admin.spaces,
226+
https://www.googleapis.com/auth/chat.app.spaces,
213227
https://www.googleapis.com/auth/chat.import,
214228
https://www.googleapis.com/auth/chat.spaces
215229
- selector: google.chat.v1.ChatService.UpdateSpaceNotificationSetting

google/chat/v1/deletion_metadata.proto

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,37 @@ option ruby_package = "Google::Apps::Chat::V1";
2929
// is set.
3030
message DeletionMetadata {
3131
// Who deleted the message and how it was deleted. More values may be added in
32-
// the future.
32+
// the future. See [Edit or delete a message in Google
33+
// Chat](https://support.google.com/chat/answer/7653281) for details on when
34+
// messages can be deleted.
3335
enum DeletionType {
3436
// This value is unused.
3537
DELETION_TYPE_UNSPECIFIED = 0;
3638

3739
// User deleted their own message.
3840
CREATOR = 1;
3941

40-
// The space owner deleted the message.
42+
// A space manager deleted the message.
4143
SPACE_OWNER = 2;
4244

43-
// A Google Workspace admin deleted the message.
45+
// A Google Workspace administrator deleted the message. Administrators can
46+
// delete any message in the space, including messages sent by any space
47+
// member or Chat app.
4448
ADMIN = 3;
4549

4650
// A Chat app deleted its own message when it expired.
4751
APP_MESSAGE_EXPIRY = 4;
4852

49-
// A Chat app deleted the message on behalf of the user.
53+
// A Chat app deleted the message on behalf of the creator (using user
54+
// authentication).
5055
CREATOR_VIA_APP = 5;
5156

52-
// A Chat app deleted the message on behalf of the space owner.
57+
// A Chat app deleted the message on behalf of a space manager (using user
58+
// authentication).
5359
SPACE_OWNER_VIA_APP = 6;
5460

55-
// A member of the space deleted the message. Human users can delete
56-
// messages sent by apps.
61+
// A member of the space deleted the message. Users can delete messages sent
62+
// by apps.
5763
SPACE_MEMBER = 7;
5864
}
5965

google/chat/v1/membership.proto

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ message CreateMembershipRequest {
156156
// - When [authenticating as an
157157
// app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
158158
// the `chat.app.memberships` authorization scope is required.
159-
// Authenticating as an app is available in [Developer
160-
// Preview](https://developers.google.com/workspace/preview).
161159
//
162160
// - Set `user.type` to `HUMAN`, and set `user.name` with format
163161
// `users/{user}`, where `{user}` can be the email address for the user. For
@@ -377,9 +375,13 @@ message DeleteMembershipRequest {
377375
// human users' or their own memberships. Chat apps can't delete other apps'
378376
// memberships.
379377
//
380-
// When deleting a human membership, requires the `chat.memberships` scope and
381-
// `spaces/{space}/members/{member}` format. You can use the email as an
382-
// alias for `{member}`. For example,
378+
// When deleting a human membership, requires the `chat.memberships` scope
379+
// with [user
380+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
381+
// or the `chat.memberships.app` scope with [app
382+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
383+
// and the `spaces/{space}/members/{member}` format.
384+
// You can use the email as an alias for `{member}`. For example,
383385
// `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
384386
// email of the Google Chat user.
385387
//

google/chat/v1/slash_command.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ option objc_class_prefix = "DYNAPIProto";
2525
option php_namespace = "Google\\Apps\\Chat\\V1";
2626
option ruby_package = "Google::Apps::Chat::V1";
2727

28-
// A [slash
28+
// Metadata about a [slash
2929
// command](https://developers.google.com/workspace/chat/commands) in
3030
// Google Chat.
3131
message SlashCommand {
32-
// The ID of the slash command invoked.
32+
// The ID of the slash command.
3333
int64 command_id = 1;
3434
}

google/chat/v1/space.proto

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ message Space {
163163
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
164164
// with [administrator
165165
// approval](https://support.google.com/a?p=chat-app-auth)
166-
// with the `chat.app.spaces` scope in [Developer
167-
// Preview](https://developers.google.com/workspace/preview).
166+
// with the `chat.app.spaces` scope.
168167
//
169168
// This field is not populated when using the `chat.bot` scope with [app
170169
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
@@ -350,20 +349,45 @@ message Space {
350349
// Only populated when the `space_type` is `SPACE`.
351350
AccessSettings access_settings = 23 [(google.api.field_behavior) = OPTIONAL];
352351

352+
// Optional. Immutable. The customer id of the domain of the space.
353+
// Required only when creating a space with [app
354+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
355+
// and `SpaceType` is `SPACE`, otherwise should not be set.
356+
//
357+
// In the format `customers/{customer}`, where `customer` is the `id` from the
358+
// [Admin SDK customer resource](
359+
// https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers).
360+
// Private apps can also use the `customers/my_customer` alias to create
361+
// the space in the same Google Workspace organization as the app.
362+
//
363+
// For DMs, this field isn't populated.
364+
optional string customer = 24 [
365+
(google.api.field_behavior) = IMMUTABLE,
366+
(google.api.field_behavior) = OPTIONAL
367+
];
368+
353369
// Output only. The URI for a user to access the space.
354370
string space_uri = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
355371

356372
// Represents the [permission settings]
357373
// (https://support.google.com/chat/answer/13340792) of a space. Only
358374
// populated when the `space_type` is `SPACE`.
359-
//
360-
// Requires [user
361-
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
362375
oneof space_permission_settings {
363376
// Optional. Input only. Predefined space permission settings, input only
364377
// when creating a space. If the field is not set, a collaboration space is
365378
// created. After you create the space, settings are populated in the
366379
// `PermissionSettings` field.
380+
//
381+
// Setting predefined permission settings supports:
382+
//
383+
// - [App
384+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
385+
// with [administrator
386+
// approval](https://support.google.com/a?p=chat-app-auth) with the
387+
// `chat.app.spaces` or `chat.app.spaces.create` scopes.
388+
//
389+
// - [User
390+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
367391
PredefinedPermissionSettings predefined_permission_settings = 26 [
368392
(google.api.field_behavior) = INPUT_ONLY,
369393
(google.api.field_behavior) = OPTIONAL
@@ -372,6 +396,18 @@ message Space {
372396
// Optional. Space permission settings for existing spaces. Input for
373397
// updating exact space permission settings, where existing permission
374398
// settings are replaced. Output lists current permission settings.
399+
//
400+
// Reading and updating permission settings supports:
401+
//
402+
// - [App
403+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
404+
// with [administrator
405+
// approval](https://support.google.com/a?p=chat-app-auth) with the
406+
// `chat.app.spaces` scope. Only populated and settable when the Chat app
407+
// created the space.
408+
//
409+
// - [User
410+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
375411
PermissionSettings permission_settings = 27
376412
[(google.api.field_behavior) = OPTIONAL];
377413
}

google/chat/v1/space_setup.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ message SetUpSpaceRequest {
6767
// Optional. The Google Chat users or groups to invite to join the space. Omit
6868
// the calling user, as they are added automatically.
6969
//
70-
// The set currently allows up to 20 memberships (in addition to the caller).
70+
// The set currently allows up to 49 memberships (in addition to the caller).
7171
//
7272
// For human membership, the `Membership.member` field must contain a `user`
7373
// with `name` populated (format: `users/{user}`) and `type` set to

google/chat/v1/user.proto

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ syntax = "proto3";
1717
package google.chat.v1;
1818

1919
import "google/api/field_behavior.proto";
20-
import "google/api/resource.proto";
2120

2221
option csharp_namespace = "Google.Apps.Chat.V1";
2322
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";

0 commit comments

Comments
 (0)