@google-apps/chat 0.1.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +202 -0
  3. package/README.md +220 -0
  4. package/build/protos/google/apps/card/v1/card.proto +1918 -0
  5. package/build/protos/google/chat/v1/action_status.proto +38 -0
  6. package/build/protos/google/chat/v1/annotation.proto +137 -0
  7. package/build/protos/google/chat/v1/attachment.proto +122 -0
  8. package/build/protos/google/chat/v1/chat_service.proto +493 -0
  9. package/build/protos/google/chat/v1/contextual_addon.proto +106 -0
  10. package/build/protos/google/chat/v1/deletion_metadata.proto +56 -0
  11. package/build/protos/google/chat/v1/group.proto +37 -0
  12. package/build/protos/google/chat/v1/history_state.proto +41 -0
  13. package/build/protos/google/chat/v1/matched_url.proto +35 -0
  14. package/build/protos/google/chat/v1/membership.proto +292 -0
  15. package/build/protos/google/chat/v1/message.proto +645 -0
  16. package/build/protos/google/chat/v1/reaction.proto +183 -0
  17. package/build/protos/google/chat/v1/slash_command.proto +32 -0
  18. package/build/protos/google/chat/v1/space.proto +360 -0
  19. package/build/protos/google/chat/v1/space_setup.proto +91 -0
  20. package/build/protos/google/chat/v1/user.proto +82 -0
  21. package/build/protos/google/chat/v1/widgets.proto +277 -0
  22. package/build/protos/protos.d.ts +20339 -0
  23. package/build/protos/protos.js +52506 -0
  24. package/build/protos/protos.json +5114 -0
  25. package/build/src/index.d.ts +11 -0
  26. package/build/src/index.js +28 -0
  27. package/build/src/index.js.map +1 -0
  28. package/build/src/v1/chat_service_client.d.ts +2194 -0
  29. package/build/src/v1/chat_service_client.js +1763 -0
  30. package/build/src/v1/chat_service_client.js.map +1 -0
  31. package/build/src/v1/chat_service_client_config.json +148 -0
  32. package/build/src/v1/index.d.ts +1 -0
  33. package/build/src/v1/index.js +23 -0
  34. package/build/src/v1/index.js.map +1 -0
  35. package/package.json +70 -0
@@ -0,0 +1,183 @@
1
+ // Copyright 2023 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/user.proto";
22
+
23
+ option csharp_namespace = "Google.Chat.V1";
24
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
25
+ option java_multiple_files = true;
26
+ option java_outer_classname = "ReactionProto";
27
+ option java_package = "com.google.chat.v1";
28
+ option php_namespace = "Google\\Chat\\V1";
29
+ option ruby_package = "Google::Chat::V1";
30
+
31
+ // A reaction to a message.
32
+ message Reaction {
33
+ option (google.api.resource) = {
34
+ type: "chat.googleapis.com/Reaction"
35
+ pattern: "spaces/{space}/messages/{message}/reactions/{reaction}"
36
+ };
37
+
38
+ // The resource name of the reaction.
39
+ //
40
+ // Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
41
+ string name = 1;
42
+
43
+ // Output only. The user who created the reaction.
44
+ User user = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
45
+
46
+ // The emoji used in the reaction.
47
+ Emoji emoji = 3;
48
+ }
49
+
50
+ // An emoji that is used as a reaction to a message.
51
+ message Emoji {
52
+ oneof content {
53
+ // A basic emoji represented by a unicode string.
54
+ string unicode = 1;
55
+
56
+ // Output only. A custom emoji.
57
+ CustomEmoji custom_emoji = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
58
+ }
59
+ }
60
+
61
+ // Represents a custom emoji.
62
+ message CustomEmoji {
63
+ // Unique key for the custom emoji resource.
64
+ string uid = 1;
65
+ }
66
+
67
+ // The number of people who reacted to a message with a specific emoji.
68
+ message EmojiReactionSummary {
69
+ // Emoji associated with the reactions.
70
+ Emoji emoji = 1;
71
+
72
+ // The total number of reactions using the associated emoji.
73
+ optional int32 reaction_count = 2;
74
+ }
75
+
76
+ // Creates a reaction to a message.
77
+ message CreateReactionRequest {
78
+ // Required. The message where the reaction is created.
79
+ //
80
+ // Format: `spaces/{space}/messages/{message}`
81
+ string parent = 1 [
82
+ (google.api.field_behavior) = REQUIRED,
83
+ (google.api.resource_reference) = {
84
+ child_type: "chat.googleapis.com/Reaction"
85
+ }
86
+ ];
87
+
88
+ // Required. The reaction to create.
89
+ Reaction reaction = 2 [(google.api.field_behavior) = REQUIRED];
90
+ }
91
+
92
+ // Lists reactions to a message.
93
+ message ListReactionsRequest {
94
+ // Required. The message users reacted to.
95
+ //
96
+ // Format: `spaces/{space}/messages/{message}`
97
+ string parent = 1 [
98
+ (google.api.field_behavior) = REQUIRED,
99
+ (google.api.resource_reference) = {
100
+ child_type: "chat.googleapis.com/Reaction"
101
+ }
102
+ ];
103
+
104
+ // Optional. The maximum number of reactions returned. The service can return
105
+ // fewer reactions than this value. If unspecified, the default value is 25.
106
+ // The maximum value is 200; values above 200 are changed to 200.
107
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
108
+
109
+ // Optional. (If resuming from a previous query.)
110
+ //
111
+ // A page token received from a previous list reactions call. Provide this
112
+ // to retrieve the subsequent page.
113
+ //
114
+ // When paginating, the filter value should match the call that provided the
115
+ // page token. Passing a different value might lead to unexpected results.
116
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
117
+
118
+ // Optional. A query filter.
119
+ //
120
+ // You can filter reactions by
121
+ // [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji)
122
+ // (either `emoji.unicode` or `emoji.custom_emoji.uid`) and
123
+ // [user](https://developers.google.com/chat/api/reference/rest/v1/User)
124
+ // (`user.name`).
125
+ //
126
+ // To filter reactions for multiple emojis or users, join similar fields
127
+ // with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode =
128
+ // "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`.
129
+ //
130
+ // To filter reactions by emoji and user, use the `AND` operator, such as
131
+ // `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`.
132
+ //
133
+ // If your query uses both `AND` and `OR`, group them with parentheses.
134
+ //
135
+ // For example, the following queries are valid:
136
+ //
137
+ // ```
138
+ // user.name = "users/{user}"
139
+ // emoji.unicode = "🙂"
140
+ // emoji.custom_emoji.uid = "{uid}"
141
+ // emoji.unicode = "🙂" OR emoji.unicode = "👍"
142
+ // emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
143
+ // emoji.unicode = "🙂" AND user.name = "users/{user}"
144
+ // (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}")
145
+ // AND user.name = "users/{user}"
146
+ // ```
147
+ //
148
+ // The following queries are invalid:
149
+ //
150
+ // ```
151
+ // emoji.unicode = "🙂" AND emoji.unicode = "👍"
152
+ // emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}"
153
+ // emoji.unicode = "🙂" OR user.name = "users/{user}"
154
+ // emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR
155
+ // user.name = "users/{user}"
156
+ // emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
157
+ // AND user.name = "users/{user}"
158
+ // ```
159
+ //
160
+ // Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
161
+ // error.
162
+ string filter = 4 [(google.api.field_behavior) = OPTIONAL];
163
+ }
164
+
165
+ message ListReactionsResponse {
166
+ // List of reactions in the requested (or first) page.
167
+ repeated Reaction reactions = 1;
168
+
169
+ // Continuation token to retrieve the next page of results. It's empty
170
+ // for the last page of results.
171
+ string next_page_token = 2;
172
+ }
173
+
174
+ // Deletes a reaction to a message.
175
+ message DeleteReactionRequest {
176
+ // Required. Name of the reaction to delete.
177
+ //
178
+ // Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
179
+ string name = 1 [
180
+ (google.api.field_behavior) = REQUIRED,
181
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Reaction" }
182
+ ];
183
+ }
@@ -0,0 +1,32 @@
1
+ // Copyright 2023 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
+ option csharp_namespace = "Google.Chat.V1";
20
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "SlashCommandProto";
23
+ option java_package = "com.google.chat.v1";
24
+ option php_namespace = "Google\\Chat\\V1";
25
+ option ruby_package = "Google::Chat::V1";
26
+
27
+ // A [slash command](https://developers.google.com/chat/how-tos/slash-commands)
28
+ // in Google Chat.
29
+ message SlashCommand {
30
+ // The ID of the slash command invoked.
31
+ int64 command_id = 1;
32
+ }
@@ -0,0 +1,360 @@
1
+ // Copyright 2023 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/history_state.proto";
22
+ import "google/protobuf/field_mask.proto";
23
+ import "google/protobuf/timestamp.proto";
24
+
25
+ option csharp_namespace = "Google.Chat.V1";
26
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
27
+ option java_multiple_files = true;
28
+ option java_outer_classname = "SpaceProto";
29
+ option java_package = "com.google.chat.v1";
30
+ option php_namespace = "Google\\Chat\\V1";
31
+ option ruby_package = "Google::Chat::V1";
32
+
33
+ // A space in Google Chat. Spaces are conversations between two or more users
34
+ // or 1:1 messages between a user and a Chat app.
35
+ message Space {
36
+ option (google.api.resource) = {
37
+ type: "chat.googleapis.com/Space"
38
+ pattern: "spaces/{space}"
39
+ };
40
+
41
+ // Deprecated: Use `SpaceType` instead.
42
+ enum Type {
43
+ TYPE_UNSPECIFIED = 0;
44
+
45
+ // Conversations between two or more humans.
46
+ ROOM = 1;
47
+
48
+ // 1:1 Direct Message between a human and a Chat app, where all messages are
49
+ // flat. Note that this doesn't include direct messages between two humans.
50
+ DM = 2;
51
+ }
52
+
53
+ // The type of space. Required when creating or updating a space. Output only
54
+ // for other usage.
55
+ enum SpaceType {
56
+ // Reserved.
57
+ SPACE_TYPE_UNSPECIFIED = 0;
58
+
59
+ // A place where people send messages, share files, and collaborate.
60
+ // A `SPACE` can include Chat apps.
61
+ SPACE = 1;
62
+
63
+ // Group conversations between 3 or more people.
64
+ // A `GROUP_CHAT` can include Chat apps.
65
+ GROUP_CHAT = 2;
66
+
67
+ // 1:1 messages between two humans or a human and a Chat app.
68
+ DIRECT_MESSAGE = 3;
69
+ }
70
+
71
+ // Specifies the type of threading state in the Chat space.
72
+ enum SpaceThreadingState {
73
+ // Reserved.
74
+ SPACE_THREADING_STATE_UNSPECIFIED = 0;
75
+
76
+ // Named spaces that support message threads. When users respond to a
77
+ // message, they can reply in-thread, which keeps their response in the
78
+ // context of the original message.
79
+ THREADED_MESSAGES = 2;
80
+
81
+ // Named spaces where the conversation is organized by topic. Topics and
82
+ // their replies are grouped together.
83
+ GROUPED_MESSAGES = 3;
84
+
85
+ // Direct messages (DMs) between two people and group conversations between
86
+ // 3 or more people.
87
+ UNTHREADED_MESSAGES = 4;
88
+ }
89
+
90
+ // Details about the space including description and rules.
91
+ message SpaceDetails {
92
+ // Optional. A description of the space. For example, describe the space's
93
+ // discussion topic, functional purpose, or participants.
94
+ //
95
+ // Supports up to 150 characters.
96
+ string description = 1;
97
+
98
+ // Optional. The space's rules, expectations, and etiquette.
99
+ //
100
+ // Supports up to 5,000 characters.
101
+ string guidelines = 2;
102
+ }
103
+
104
+ // Resource name of the space.
105
+ //
106
+ // Format: `spaces/{space}`
107
+ string name = 1;
108
+
109
+ // Output only. Deprecated: Use `space_type` instead.
110
+ // The type of a space.
111
+ Type type = 2 [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
112
+
113
+ // The type of space. Required when creating a space or updating the space
114
+ // type of a space. Output only for other usage.
115
+ SpaceType space_type = 10;
116
+
117
+ // Optional. Whether the space is a DM between a Chat app and a single
118
+ // human.
119
+ bool single_user_bot_dm = 4 [(google.api.field_behavior) = OPTIONAL];
120
+
121
+ // Output only. Deprecated: Use `spaceThreadingState` instead.
122
+ // Whether messages are threaded in this space.
123
+ bool threaded = 5
124
+ [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
125
+
126
+ // The space's display name. Required when [creating a
127
+ // space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create).
128
+ // If you receive the error message `ALREADY_EXISTS` when creating a space or
129
+ // updating the `displayName`, try a different `displayName`. An
130
+ // existing space within the Google Workspace organization might already use
131
+ // this display name.
132
+ //
133
+ // For direct messages, this field might be empty.
134
+ //
135
+ // Supports up to 128 characters.
136
+ string display_name = 3;
137
+
138
+ // Immutable. Whether this space permits any Google Chat user as a member.
139
+ // Input when creating a space in a Google Workspace organization. Omit this
140
+ // field when creating spaces in the following conditions:
141
+ //
142
+ // * The authenticated user uses a Google Account. By default,
143
+ // the space permits any Google Chat user.
144
+ //
145
+ // * The space is used to [import data to Google Chat]
146
+ // (https://developers.google.com/chat/api/guides/import-data-overview).
147
+ // Import mode spaces must only permit members from the same Google
148
+ // Workspace organization.
149
+ //
150
+ // For existing spaces, this field is output only.
151
+ bool external_user_allowed = 8 [(google.api.field_behavior) = IMMUTABLE];
152
+
153
+ // Output only. The threading state in the Chat space.
154
+ SpaceThreadingState space_threading_state = 9
155
+ [(google.api.field_behavior) = OUTPUT_ONLY];
156
+
157
+ // Details about the space including description and rules.
158
+ SpaceDetails space_details = 11;
159
+
160
+ // The message history state for messages and threads in this space.
161
+ HistoryState space_history_state = 13;
162
+
163
+ // Optional. Whether this space is created in `Import Mode` as part of a data
164
+ // migration into Google Workspace. While spaces are being imported, they
165
+ // aren't visible to users until the import is complete.
166
+ bool import_mode = 16 [(google.api.field_behavior) = OPTIONAL];
167
+
168
+ // Optional. Immutable. For spaces created in Chat, the time the space was
169
+ // created. This field is output only, except when used in import mode spaces.
170
+ //
171
+ // For import mode spaces, set this field to the historical timestamp at which
172
+ // the space was created in the source in order to preserve the original
173
+ // creation time.
174
+ //
175
+ // Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
176
+ google.protobuf.Timestamp create_time = 17 [
177
+ (google.api.field_behavior) = IMMUTABLE,
178
+ (google.api.field_behavior) = OPTIONAL
179
+ ];
180
+
181
+ // Output only. Whether the Chat app was installed by a Google Workspace
182
+ // administrator. Administrators can install a Chat app for their domain,
183
+ // organizational unit, or a group of users.
184
+ //
185
+ // Administrators can only install Chat apps for direct messaging between
186
+ // users and the app. To support admin install, your app must feature direct
187
+ // messaging.
188
+ bool admin_installed = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
189
+ }
190
+
191
+ message CreateSpaceRequest {
192
+ // Required. The `displayName` and `spaceType` fields must be populated. Only
193
+ // `SpaceType.SPACE` is supported.
194
+ //
195
+ // If you receive the error message `ALREADY_EXISTS` when creating a space,
196
+ // try a different `displayName`. An existing space within the Google
197
+ // Workspace organization might already use this display name.
198
+ //
199
+ // The space `name` is assigned on the server so anything specified in this
200
+ // field will be ignored.
201
+ Space space = 1 [(google.api.field_behavior) = REQUIRED];
202
+
203
+ // Optional. A unique identifier for this request.
204
+ // A random UUID is recommended.
205
+ // Specifying an existing request ID returns the space created with that ID
206
+ // instead of creating a new space.
207
+ // Specifying an existing request ID from the same Chat app with a different
208
+ // authenticated user returns an error.
209
+ string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
210
+ }
211
+
212
+ // A request to list the spaces the caller is a member of.
213
+ message ListSpacesRequest {
214
+ // Optional. The maximum number of spaces to return. The service might return
215
+ // fewer than this value.
216
+ //
217
+ // If unspecified, at most 100 spaces are returned.
218
+ //
219
+ // The maximum value is 1,000. If you use a value more than 1,000, it's
220
+ // automatically changed to 1,000.
221
+ //
222
+ // Negative values return an `INVALID_ARGUMENT` error.
223
+ int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
224
+
225
+ // Optional. A page token, received from a previous list spaces call.
226
+ // Provide this parameter to retrieve the subsequent page.
227
+ //
228
+ // When paginating, the filter value should match the call that provided the
229
+ // page token. Passing a different value may lead to unexpected results.
230
+ string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
231
+
232
+ // Optional. A query filter.
233
+ //
234
+ // You can filter spaces by the space type
235
+ // ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)).
236
+ //
237
+ // To filter by space type, you must specify valid enum value, such as
238
+ // `SPACE` or `GROUP_CHAT` (the `space_type` can't be
239
+ // `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
240
+ // operator.
241
+ //
242
+ // For example, the following queries are valid:
243
+ //
244
+ // ```
245
+ // space_type = "SPACE"
246
+ // spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"
247
+ // ```
248
+ //
249
+ // Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
250
+ // error.
251
+ string filter = 3 [(google.api.field_behavior) = OPTIONAL];
252
+ }
253
+
254
+ message ListSpacesResponse {
255
+ // List of spaces in the requested (or first) page.
256
+ repeated Space spaces = 1;
257
+
258
+ // You can send a token as `pageToken` to retrieve the next page of
259
+ // results. If empty, there are no subsequent pages.
260
+ string next_page_token = 2;
261
+ }
262
+
263
+ // A request to return a single space.
264
+ message GetSpaceRequest {
265
+ // Required. Resource name of the space, in the form "spaces/*".
266
+ //
267
+ // Format: `spaces/{space}`
268
+ string name = 1 [
269
+ (google.api.field_behavior) = REQUIRED,
270
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Space" }
271
+ ];
272
+ }
273
+
274
+ // A request to get direct message space based on the user resource.
275
+ message FindDirectMessageRequest {
276
+ // Required. Resource name of the user to find direct message with.
277
+ //
278
+ // Format: `users/{user}`, where `{user}` is either the `id` for the
279
+ // [person](https://developers.google.com/people/api/rest/v1/people) from the
280
+ // People API, or the `id` for the
281
+ // [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
282
+ // in the Directory API. For example, if the People API profile ID is
283
+ // `123456789`, you can find a direct message with that person by using
284
+ // `users/123456789` as the `name`. When [authenticated as a
285
+ // user](https://developers.google.com/chat/api/guides/auth/users), you can
286
+ // use the email as an alias for `{user}`. For example,
287
+ // `users/example@gmail.com` where `example@gmail.com` is the email of the
288
+ // Google Chat user.
289
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
290
+ }
291
+
292
+ // A request to update a single space.
293
+ message UpdateSpaceRequest {
294
+ // Required. Space with fields to be updated. `Space.name` must be
295
+ // populated in the form of `spaces/{space}`. Only fields
296
+ // specified by `update_mask` are updated.
297
+ Space space = 1 [(google.api.field_behavior) = REQUIRED];
298
+
299
+ // Required. The updated field paths, comma separated if there are
300
+ // multiple.
301
+ //
302
+ // Currently supported field paths:
303
+ //
304
+ // - `display_name` (Only supports changing the display name of a space with
305
+ // the `SPACE` type, or when also including the `space_type` mask to change a
306
+ // `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a
307
+ // `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument
308
+ // error. If you receive the error message `ALREADY_EXISTS` when updating the
309
+ // `displayName`, try a different `displayName`. An existing space within the
310
+ // Google Workspace organization might already use this display name.)
311
+ //
312
+ // - `space_type` (Only supports changing a `GROUP_CHAT` space type to
313
+ // `SPACE`. Include `display_name` together with `space_type` in the update
314
+ // mask and ensure that the specified space has a non-empty display name and
315
+ // the `SPACE` space type. Including the `space_type` mask and the `SPACE`
316
+ // type in the specified space when updating the display name is optional if
317
+ // the existing space already has the `SPACE` type. Trying to update the
318
+ // space type in other ways results in an invalid argument error).
319
+ //
320
+ // - `space_details`
321
+ //
322
+ // - `space_history_state` (Supports [turning history on or off for the
323
+ // space](https://support.google.com/chat/answer/7664687) if [the organization
324
+ // allows users to change their history
325
+ // setting](https://support.google.com/a/answer/7664184).
326
+ // Warning: mutually exclusive with all other field paths.)
327
+ // - Developer Preview: `access_settings.audience` (Supports changing the
328
+ // [access setting](https://support.google.com/chat/answer/11971020) of a
329
+ // space. If no audience is specified in the access setting, the space's
330
+ // access setting is updated to restricted. Warning: mutually exclusive with
331
+ // all other field paths.)
332
+ google.protobuf.FieldMask update_mask = 2;
333
+ }
334
+
335
+ // Request for deleting a space.
336
+ message DeleteSpaceRequest {
337
+ // Required. Resource name of the space to delete.
338
+ //
339
+ // Format: `spaces/{space}`
340
+ string name = 1 [
341
+ (google.api.field_behavior) = REQUIRED,
342
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Space" }
343
+ ];
344
+ }
345
+
346
+ // Request message for completing the import process for a space.
347
+ message CompleteImportSpaceRequest {
348
+ // Required. Resource name of the import mode space.
349
+ //
350
+ // Format: `spaces/{space}`
351
+ string name = 1 [
352
+ (google.api.field_behavior) = REQUIRED,
353
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Space" }
354
+ ];
355
+ }
356
+
357
+ message CompleteImportSpaceResponse {
358
+ // The import mode space.
359
+ Space space = 1;
360
+ }
@@ -0,0 +1,91 @@
1
+ // Copyright 2023 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/chat/v1/membership.proto";
21
+ import "google/chat/v1/space.proto";
22
+
23
+ option csharp_namespace = "Google.Chat.V1";
24
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
25
+ option java_multiple_files = true;
26
+ option java_outer_classname = "SpaceSetupProto";
27
+ option java_package = "com.google.chat.v1";
28
+ option php_namespace = "Google\\Chat\\V1";
29
+ option ruby_package = "Google::Chat::V1";
30
+
31
+ message SetUpSpaceRequest {
32
+ // Required. The `Space.spaceType` field is required.
33
+ //
34
+ // To create a space, set `Space.spaceType` to `SPACE` and set
35
+ // `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when
36
+ // setting up a space, try a different `displayName`. An existing space
37
+ // within the Google Workspace organization might already use this display
38
+ // name.
39
+ //
40
+ // To create a group chat, set `Space.spaceType` to
41
+ // `GROUP_CHAT`. Don't set `Space.displayName`.
42
+ //
43
+ // To create a 1:1 conversation between humans,
44
+ // set `Space.spaceType` to `DIRECT_MESSAGE` and set
45
+ // `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or
46
+ // `Space.spaceDetails`.
47
+ //
48
+ // To create an 1:1 conversation between a human and the calling Chat app, set
49
+ // `Space.spaceType` to `DIRECT_MESSAGE` and
50
+ // `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or
51
+ // `Space.spaceDetails`.
52
+ //
53
+ // If a `DIRECT_MESSAGE` space already exists, that space is returned instead
54
+ // of creating a new space.
55
+ Space space = 1 [(google.api.field_behavior) = REQUIRED];
56
+
57
+ // Optional. A unique identifier for this request.
58
+ // A random UUID is recommended.
59
+ // Specifying an existing request ID returns the space created with that ID
60
+ // instead of creating a new space.
61
+ // Specifying an existing request ID from the same Chat app with a different
62
+ // authenticated user returns an error.
63
+ string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
64
+
65
+ // Optional. The Google Chat users to invite to join the space. Omit the
66
+ // calling user, as they are added automatically.
67
+ //
68
+ // The set currently allows up to 20 memberships (in addition to the caller).
69
+ //
70
+ // The `Membership.member` field must contain a `user` with `name` populated
71
+ // (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only
72
+ // add human users when setting up a space (adding Chat apps is only supported
73
+ // for direct message setup with the calling app). You can also add members
74
+ // using the user's email as an alias for {user}. For example, the `user.name`
75
+ // can be `users/example@gmail.com`." To invite Gmail users or users from
76
+ // external Google Workspace domains, user's email must be used for
77
+ // `{user}`.
78
+ //
79
+ // Optional when setting `Space.spaceType` to `SPACE`.
80
+ //
81
+ // Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at
82
+ // least two memberships.
83
+ //
84
+ // Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human
85
+ // user, along with exactly one membership.
86
+ //
87
+ // Must be empty when creating a 1:1 conversation between a human and the
88
+ // calling Chat app (when setting `Space.spaceType` to
89
+ // `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`).
90
+ repeated Membership memberships = 4 [(google.api.field_behavior) = OPTIONAL];
91
+ }