@google-apps/chat 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,292 @@
1
+ // Copyright 2024 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.chat.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/chat/v1/event_payload.proto";
22
+ import "google/protobuf/timestamp.proto";
23
+
24
+ option csharp_namespace = "Google.Apps.Chat.V1";
25
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
26
+ option java_multiple_files = true;
27
+ option java_outer_classname = "SpaceEventProto";
28
+ option java_package = "com.google.chat.v1";
29
+ option php_namespace = "Google\\Apps\\Chat\\V1";
30
+ option ruby_package = "Google::Apps::Chat::V1";
31
+
32
+ // An event that represents a change or activity in a Google Chat space. To
33
+ // learn more, see [Work with events from Google
34
+ // Chat](https://developers.google.com/workspace/chat/events-overview).
35
+ message SpaceEvent {
36
+ option (google.api.resource) = {
37
+ type: "chat.googleapis.com/SpaceEvent"
38
+ pattern: "spaces/{space}/spaceEvents/{space_event}"
39
+ };
40
+
41
+ // Resource name of the space event.
42
+ //
43
+ // Format: `spaces/{space}/spaceEvents/{spaceEvent}`
44
+ string name = 1;
45
+
46
+ // Time when the event occurred.
47
+ google.protobuf.Timestamp event_time = 3;
48
+
49
+ // Type of space event. Each event type has a batch version, which
50
+ // represents multiple instances of the event type that occur in a short
51
+ // period of time. For `spaceEvents.list()` requests, omit batch event types
52
+ // in your query filter. By default, the server returns both event type and
53
+ // its batch version.
54
+ //
55
+ // Supported event types for
56
+ // [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages):
57
+ //
58
+ // * New message: `google.workspace.chat.message.v1.created`
59
+ // * Updated message: `google.workspace.chat.message.v1.updated`
60
+ // * Deleted message: `google.workspace.chat.message.v1.deleted`
61
+ // * Multiple new messages: `google.workspace.chat.message.v1.batchCreated`
62
+ // * Multiple updated messages:
63
+ // `google.workspace.chat.message.v1.batchUpdated`
64
+ // * Multiple deleted messages:
65
+ // `google.workspace.chat.message.v1.batchDeleted`
66
+ //
67
+ // Supported event types for
68
+ // [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members):
69
+ //
70
+ // * New membership: `google.workspace.chat.membership.v1.created`
71
+ // * Updated membership: `google.workspace.chat.membership.v1.updated`
72
+ // * Deleted membership: `google.workspace.chat.membership.v1.deleted`
73
+ // * Multiple new memberships:
74
+ // `google.workspace.chat.membership.v1.batchCreated`
75
+ // * Multiple updated memberships:
76
+ // `google.workspace.chat.membership.v1.batchUpdated`
77
+ // * Multiple deleted memberships:
78
+ // `google.workspace.chat.membership.v1.batchDeleted`
79
+ //
80
+ // Supported event types for
81
+ // [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions):
82
+ //
83
+ // * New reaction: `google.workspace.chat.reaction.v1.created`
84
+ // * Deleted reaction: `google.workspace.chat.reaction.v1.deleted`
85
+ // * Multiple new reactions:
86
+ // `google.workspace.chat.reaction.v1.batchCreated`
87
+ // * Multiple deleted reactions:
88
+ // `google.workspace.chat.reaction.v1.batchDeleted`
89
+ //
90
+ // Supported event types about the
91
+ // [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces):
92
+ //
93
+ // * Updated space: `google.workspace.chat.space.v1.updated`
94
+ // * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated`
95
+ string event_type = 6;
96
+
97
+ oneof payload {
98
+ // Event payload for a new message.
99
+ //
100
+ // Event type: `google.workspace.chat.message.v1.created`
101
+ MessageCreatedEventData message_created_event_data = 12;
102
+
103
+ // Event payload for an updated message.
104
+ //
105
+ // Event type: `google.workspace.chat.message.v1.updated`
106
+ MessageUpdatedEventData message_updated_event_data = 13;
107
+
108
+ // Event payload for a deleted message.
109
+ //
110
+ // Event type: `google.workspace.chat.message.v1.deleted`
111
+ MessageDeletedEventData message_deleted_event_data = 14;
112
+
113
+ // Event payload for multiple new messages.
114
+ //
115
+ // Event type: `google.workspace.chat.message.v1.batchCreated`
116
+ MessageBatchCreatedEventData message_batch_created_event_data = 26;
117
+
118
+ // Event payload for multiple updated messages.
119
+ //
120
+ // Event type: `google.workspace.chat.message.v1.batchUpdated`
121
+ MessageBatchUpdatedEventData message_batch_updated_event_data = 27;
122
+
123
+ // Event payload for multiple deleted messages.
124
+ //
125
+ // Event type: `google.workspace.chat.message.v1.batchDeleted`
126
+ MessageBatchDeletedEventData message_batch_deleted_event_data = 28;
127
+
128
+ // Event payload for a space update.
129
+ //
130
+ // Event type: `google.workspace.chat.space.v1.updated`
131
+ SpaceUpdatedEventData space_updated_event_data = 15;
132
+
133
+ // Event payload for multiple updates to a space.
134
+ //
135
+ // Event type: `google.workspace.chat.space.v1.batchUpdated`
136
+ SpaceBatchUpdatedEventData space_batch_updated_event_data = 29;
137
+
138
+ // Event payload for a new membership.
139
+ //
140
+ // Event type: `google.workspace.chat.membership.v1.created`
141
+ MembershipCreatedEventData membership_created_event_data = 17;
142
+
143
+ // Event payload for an updated membership.
144
+ //
145
+ // Event type: `google.workspace.chat.membership.v1.updated`
146
+ MembershipUpdatedEventData membership_updated_event_data = 18;
147
+
148
+ // Event payload for a deleted membership.
149
+ //
150
+ // Event type: `google.workspace.chat.membership.v1.deleted`
151
+ MembershipDeletedEventData membership_deleted_event_data = 219;
152
+
153
+ // Event payload for multiple new memberships.
154
+ //
155
+ // Event type: `google.workspace.chat.membership.v1.batchCreated`
156
+ MembershipBatchCreatedEventData membership_batch_created_event_data = 31;
157
+
158
+ // Event payload for multiple updated memberships.
159
+ //
160
+ // Event type: `google.workspace.chat.membership.v1.batchUpdated`
161
+ MembershipBatchUpdatedEventData membership_batch_updated_event_data = 32;
162
+
163
+ // Event payload for multiple deleted memberships.
164
+ //
165
+ // Event type: `google.workspace.chat.membership.v1.batchDeleted`
166
+ MembershipBatchDeletedEventData membership_batch_deleted_event_data = 33;
167
+
168
+ // Event payload for a new reaction.
169
+ //
170
+ // Event type: `google.workspace.chat.reaction.v1.created`
171
+ ReactionCreatedEventData reaction_created_event_data = 21;
172
+
173
+ // Event payload for a deleted reaction.
174
+ //
175
+ // Event type: `google.workspace.chat.reaction.v1.deleted`
176
+ ReactionDeletedEventData reaction_deleted_event_data = 22;
177
+
178
+ // Event payload for multiple new reactions.
179
+ //
180
+ // Event type: `google.workspace.chat.reaction.v1.batchCreated`
181
+ ReactionBatchCreatedEventData reaction_batch_created_event_data = 34;
182
+
183
+ // Event payload for multiple deleted reactions.
184
+ //
185
+ // Event type: `google.workspace.chat.reaction.v1.batchDeleted`
186
+ ReactionBatchDeletedEventData reaction_batch_deleted_event_data = 35;
187
+ }
188
+ }
189
+
190
+ // Request message for getting a space event.
191
+ message GetSpaceEventRequest {
192
+ // Required. The resource name of the space event.
193
+ //
194
+ // Format: `spaces/{space}/spaceEvents/{spaceEvent}`
195
+ string name = 1 [
196
+ (google.api.field_behavior) = REQUIRED,
197
+ (google.api.resource_reference) = { type: "chat.googleapis.com/SpaceEvent" }
198
+ ];
199
+ }
200
+
201
+ // Request message for listing space events.
202
+ message ListSpaceEventsRequest {
203
+ // Required. Resource name of the [Google Chat
204
+ // space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces)
205
+ // where the events occurred.
206
+ //
207
+ // Format: `spaces/{space}`.
208
+ string parent = 1 [
209
+ (google.api.field_behavior) = REQUIRED,
210
+ (google.api.resource_reference) = {
211
+ child_type: "chat.googleapis.com/SpaceEvent"
212
+ }
213
+ ];
214
+
215
+ // Optional. The maximum number of space events returned. The service might
216
+ // return fewer than this value.
217
+ //
218
+ // Negative values return an `INVALID_ARGUMENT` error.
219
+ int32 page_size = 5;
220
+
221
+ // A page token, received from a previous list space events call. Provide this
222
+ // to retrieve the subsequent page.
223
+ //
224
+ // When paginating, all other parameters provided to list space events must
225
+ // match the call that provided the page token. Passing different values to
226
+ // the other parameters might lead to unexpected results.
227
+ string page_token = 6;
228
+
229
+ // Required. A query filter.
230
+ //
231
+ // You must specify at least one event type (`event_type`)
232
+ // using the has `:` operator. To filter by multiple event types, use the `OR`
233
+ // operator. Omit batch event types in your filter. The request automatically
234
+ // returns any related batch events. For example, if you filter by new
235
+ // reactions
236
+ // (`google.workspace.chat.reaction.v1.created`), the server also returns
237
+ // batch new reactions events
238
+ // (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported
239
+ // event types, see the [`SpaceEvents` reference
240
+ // documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type).
241
+ //
242
+ // Optionally, you can also filter by start time (`start_time`) and
243
+ // end time (`end_time`):
244
+ //
245
+ // * `start_time`: Exclusive timestamp from which to start listing space
246
+ // events.
247
+ // You can list events that occurred up to 28 days ago. If unspecified, lists
248
+ // space events from the past 28 days.
249
+ // * `end_time`: Inclusive timestamp until which space events are listed.
250
+ // If unspecified, lists events up to the time of the request.
251
+ //
252
+ // To specify a start or end time, use the equals `=` operator and format in
253
+ // [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both
254
+ // `start_time` and `end_time`, use the `AND` operator.
255
+ //
256
+ // For example, the following queries are valid:
257
+ //
258
+ // ```
259
+ // start_time="2023-08-23T19:20:33+00:00" AND
260
+ // end_time="2023-08-23T19:21:54+00:00"
261
+ // ```
262
+ // ```
263
+ // start_time="2023-08-23T19:20:33+00:00" AND
264
+ // (event_types:"google.workspace.chat.space.v1.updated" OR
265
+ // event_types:"google.workspace.chat.message.v1.created")
266
+ // ```
267
+ //
268
+ // The following queries are invalid:
269
+ //
270
+ // ```
271
+ // start_time="2023-08-23T19:20:33+00:00" OR
272
+ // end_time="2023-08-23T19:21:54+00:00"
273
+ // ```
274
+ // ```
275
+ // event_types:"google.workspace.chat.space.v1.updated" AND
276
+ // event_types:"google.workspace.chat.message.v1.created"
277
+ // ```
278
+ //
279
+ // Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
280
+ // error.
281
+ string filter = 8 [(google.api.field_behavior) = REQUIRED];
282
+ }
283
+
284
+ // Response message for listing space events.
285
+ message ListSpaceEventsResponse {
286
+ // Results are returned in chronological order (oldest event first).
287
+ repeated SpaceEvent space_events = 1;
288
+
289
+ // Continuation token used to fetch more events.
290
+ // If this field is omitted, there are no subsequent pages.
291
+ string next_page_token = 2;
292
+ }
@@ -64,8 +64,8 @@ message SetUpSpaceRequest {
64
64
  // authenticated user returns an error.
65
65
  string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
66
66
 
67
- // Optional. The Google Chat users to invite to join the space. Omit the
68
- // calling user, as they are added automatically.
67
+ // Optional. The Google Chat users or groups to invite to join the space. Omit
68
+ // the calling user, as they are added automatically.
69
69
  //
70
70
  // The set currently allows up to 20 memberships (in addition to the caller).
71
71
  //
@@ -78,6 +78,10 @@ message SetUpSpaceRequest {
78
78
  // To invite Gmail users or users from external Google Workspace domains,
79
79
  // user's email must be used for `{user}`.
80
80
  //
81
+ // For Google group membership, the `Membership.group_member` field must
82
+ // contain a `group` with `name` populated (format `groups/{group}`). You
83
+ // can only add Google groups when setting `Space.spaceType` to `SPACE`.
84
+ //
81
85
  // Optional when setting `Space.spaceType` to `SPACE`.
82
86
  //
83
87
  // Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at