@google-apps/chat 0.2.0 → 0.4.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.
- package/CHANGELOG.md +14 -0
- package/README.md +4 -0
- package/build/protos/google/apps/card/v1/card.proto +242 -160
- package/build/protos/google/chat/v1/action_status.proto +1 -1
- package/build/protos/google/chat/v1/annotation.proto +2 -2
- package/build/protos/google/chat/v1/attachment.proto +9 -0
- package/build/protos/google/chat/v1/chat_service.proto +135 -81
- package/build/protos/google/chat/v1/contextual_addon.proto +1 -1
- package/build/protos/google/chat/v1/membership.proto +33 -11
- package/build/protos/google/chat/v1/message.proto +71 -113
- package/build/protos/google/chat/v1/reaction.proto +4 -2
- package/build/protos/google/chat/v1/slash_command.proto +3 -2
- package/build/protos/google/chat/v1/space.proto +28 -17
- package/build/protos/google/chat/v1/space_read_state.proto +112 -0
- package/build/protos/google/chat/v1/space_setup.proto +1 -0
- package/build/protos/google/chat/v1/thread_read_state.proto +74 -0
- package/build/protos/google/chat/v1/user.proto +3 -2
- package/build/protos/google/chat/v1/widgets.proto +4 -4
- package/build/protos/protos.d.ts +887 -76
- package/build/protos/protos.js +1976 -192
- package/build/protos/protos.json +210 -12
- package/build/src/v1/chat_service_client.d.ts +368 -134
- package/build/src/v1/chat_service_client.js +196 -24
- package/build/src/v1/chat_service_client.js.map +1 -1
- package/build/src/v1/chat_service_client_config.json +20 -0
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ message Space {
|
|
|
40
40
|
|
|
41
41
|
// Deprecated: Use `SpaceType` instead.
|
|
42
42
|
enum Type {
|
|
43
|
+
// Reserved.
|
|
43
44
|
TYPE_UNSPECIFIED = 0;
|
|
44
45
|
|
|
45
46
|
// Conversations between two or more humans.
|
|
@@ -124,7 +125,7 @@ message Space {
|
|
|
124
125
|
[deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
|
|
125
126
|
|
|
126
127
|
// The space's display name. Required when [creating a
|
|
127
|
-
// space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create).
|
|
128
|
+
// space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create).
|
|
128
129
|
// If you receive the error message `ALREADY_EXISTS` when creating a space or
|
|
129
130
|
// updating the `displayName`, try a different `displayName`. An
|
|
130
131
|
// existing space within the Google Workspace organization might already use
|
|
@@ -139,13 +140,18 @@ message Space {
|
|
|
139
140
|
// Input when creating a space in a Google Workspace organization. Omit this
|
|
140
141
|
// field when creating spaces in the following conditions:
|
|
141
142
|
//
|
|
142
|
-
// * The authenticated user uses a
|
|
143
|
-
//
|
|
143
|
+
// * The authenticated user uses a consumer account (unmanaged user
|
|
144
|
+
// account). By default, a space created by a consumer account permits any
|
|
145
|
+
// Google Chat user.
|
|
144
146
|
//
|
|
145
147
|
// * The space is used to [import data to Google Chat]
|
|
146
|
-
// (https://developers.google.com/chat/api/guides/import-data-overview)
|
|
147
|
-
//
|
|
148
|
-
// Workspace organization.
|
|
148
|
+
// (https://developers.google.com/chat/api/guides/import-data-overview)
|
|
149
|
+
// because import mode spaces must only permit members from the same
|
|
150
|
+
// Google Workspace organization. However, as part of the [Google
|
|
151
|
+
// Workspace Developer Preview
|
|
152
|
+
// Program](https://developers.google.com/workspace/preview), import mode
|
|
153
|
+
// spaces can permit any Google Chat user so this field can then be set
|
|
154
|
+
// for import mode spaces.
|
|
149
155
|
//
|
|
150
156
|
// For existing spaces, this field is output only.
|
|
151
157
|
bool external_user_allowed = 8 [(google.api.field_behavior) = IMMUTABLE];
|
|
@@ -188,6 +194,7 @@ message Space {
|
|
|
188
194
|
bool admin_installed = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
189
195
|
}
|
|
190
196
|
|
|
197
|
+
// A request to create a named space.
|
|
191
198
|
message CreateSpaceRequest {
|
|
192
199
|
// Required. The `displayName` and `spaceType` fields must be populated. Only
|
|
193
200
|
// `SpaceType.SPACE` is supported.
|
|
@@ -216,8 +223,8 @@ message ListSpacesRequest {
|
|
|
216
223
|
//
|
|
217
224
|
// If unspecified, at most 100 spaces are returned.
|
|
218
225
|
//
|
|
219
|
-
// The maximum value is
|
|
220
|
-
// automatically changed to
|
|
226
|
+
// The maximum value is 1000. If you use a value more than 1000, it's
|
|
227
|
+
// automatically changed to 1000.
|
|
221
228
|
//
|
|
222
229
|
// Negative values return an `INVALID_ARGUMENT` error.
|
|
223
230
|
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
@@ -232,7 +239,7 @@ message ListSpacesRequest {
|
|
|
232
239
|
// Optional. A query filter.
|
|
233
240
|
//
|
|
234
241
|
// You can filter spaces by the space type
|
|
235
|
-
// ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)).
|
|
242
|
+
// ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)).
|
|
236
243
|
//
|
|
237
244
|
// To filter by space type, you must specify valid enum value, such as
|
|
238
245
|
// `SPACE` or `GROUP_CHAT` (the `space_type` can't be
|
|
@@ -251,6 +258,7 @@ message ListSpacesRequest {
|
|
|
251
258
|
string filter = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
252
259
|
}
|
|
253
260
|
|
|
261
|
+
// The response for a list spaces request.
|
|
254
262
|
message ListSpacesResponse {
|
|
255
263
|
// List of spaces in the requested (or first) page.
|
|
256
264
|
repeated Space spaces = 1;
|
|
@@ -282,8 +290,8 @@ message FindDirectMessageRequest {
|
|
|
282
290
|
// in the Directory API. For example, if the People API profile ID is
|
|
283
291
|
// `123456789`, you can find a direct message with that person by using
|
|
284
292
|
// `users/123456789` as the `name`. When [authenticated as a
|
|
285
|
-
// user](https://developers.google.com/chat/
|
|
286
|
-
// use the email as an alias for `{user}`. For example,
|
|
293
|
+
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
|
|
294
|
+
// you can use the email as an alias for `{user}`. For example,
|
|
287
295
|
// `users/example@gmail.com` where `example@gmail.com` is the email of the
|
|
288
296
|
// Google Chat user.
|
|
289
297
|
string name = 1 [(google.api.field_behavior) = REQUIRED];
|
|
@@ -310,12 +318,13 @@ message UpdateSpaceRequest {
|
|
|
310
318
|
// Google Workspace organization might already use this display name.)
|
|
311
319
|
//
|
|
312
320
|
// - `space_type` (Only supports changing a `GROUP_CHAT` space type to
|
|
313
|
-
// `SPACE`. Include `display_name` together
|
|
314
|
-
// mask and ensure that the specified space
|
|
315
|
-
// the `SPACE` space type. Including the
|
|
316
|
-
// type in the specified space when updating
|
|
317
|
-
// the existing space already has the `SPACE`
|
|
318
|
-
// space type in other ways results in an invalid
|
|
321
|
+
// `SPACE`. Include `display_name` together
|
|
322
|
+
// with `space_type` in the update mask and ensure that the specified space
|
|
323
|
+
// has a non-empty display name and the `SPACE` space type. Including the
|
|
324
|
+
// `space_type` mask and the `SPACE` type in the specified space when updating
|
|
325
|
+
// the display name is optional if the existing space already has the `SPACE`
|
|
326
|
+
// type. Trying to update the space type in other ways results in an invalid
|
|
327
|
+
// argument error).
|
|
319
328
|
//
|
|
320
329
|
// - `space_details`
|
|
321
330
|
//
|
|
@@ -324,6 +333,7 @@ message UpdateSpaceRequest {
|
|
|
324
333
|
// allows users to change their history
|
|
325
334
|
// setting](https://support.google.com/a/answer/7664184).
|
|
326
335
|
// Warning: mutually exclusive with all other field paths.)
|
|
336
|
+
//
|
|
327
337
|
// - Developer Preview: `access_settings.audience` (Supports changing the
|
|
328
338
|
// [access setting](https://support.google.com/chat/answer/11971020) of a
|
|
329
339
|
// space. If no audience is specified in the access setting, the space's
|
|
@@ -354,6 +364,7 @@ message CompleteImportSpaceRequest {
|
|
|
354
364
|
];
|
|
355
365
|
}
|
|
356
366
|
|
|
367
|
+
// Response message for completing the import process for a space.
|
|
357
368
|
message CompleteImportSpaceResponse {
|
|
358
369
|
// The import mode space.
|
|
359
370
|
Space space = 1;
|
|
@@ -0,0 +1,112 @@
|
|
|
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/protobuf/field_mask.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 = "SpaceReadStateProto";
|
|
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
|
+
// A user's read state within a space, used to identify read and unread
|
|
33
|
+
// messages.
|
|
34
|
+
message SpaceReadState {
|
|
35
|
+
option (google.api.resource) = {
|
|
36
|
+
type: "chat.googleapis.com/SpaceReadState"
|
|
37
|
+
pattern: "users/{user}/spaces/{space}/spaceReadState"
|
|
38
|
+
singular: "spaceReadState"
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Resource name of the space read state.
|
|
42
|
+
//
|
|
43
|
+
// Format: `users/{user}/spaces/{space}/spaceReadState`
|
|
44
|
+
string name = 1;
|
|
45
|
+
|
|
46
|
+
// Optional. The time when the user's space read state was updated. Usually
|
|
47
|
+
// this corresponds with either the timestamp of the last read message, or a
|
|
48
|
+
// timestamp specified by the user to mark the last read position in a space.
|
|
49
|
+
google.protobuf.Timestamp last_read_time = 2
|
|
50
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Request message for GetSpaceReadState API.
|
|
54
|
+
message GetSpaceReadStateRequest {
|
|
55
|
+
// Required. Resource name of the space read state to retrieve.
|
|
56
|
+
//
|
|
57
|
+
// Only supports getting read state for the calling user.
|
|
58
|
+
//
|
|
59
|
+
// To refer to the calling user, set one of the following:
|
|
60
|
+
//
|
|
61
|
+
// - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
|
|
62
|
+
//
|
|
63
|
+
// - Their Workspace email address. For example,
|
|
64
|
+
// `users/user@example.com/spaces/{space}/spaceReadState`.
|
|
65
|
+
//
|
|
66
|
+
// - Their user id. For example,
|
|
67
|
+
// `users/123456789/spaces/{space}/spaceReadState`.
|
|
68
|
+
//
|
|
69
|
+
// Format: users/{user}/spaces/{space}/spaceReadState
|
|
70
|
+
string name = 1 [
|
|
71
|
+
(google.api.field_behavior) = REQUIRED,
|
|
72
|
+
(google.api.resource_reference) = {
|
|
73
|
+
type: "chat.googleapis.com/SpaceReadState"
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Request message for UpdateSpaceReadState API.
|
|
79
|
+
message UpdateSpaceReadStateRequest {
|
|
80
|
+
// Required. The space read state and fields to update.
|
|
81
|
+
//
|
|
82
|
+
// Only supports updating read state for the calling user.
|
|
83
|
+
//
|
|
84
|
+
// To refer to the calling user, set one of the following:
|
|
85
|
+
//
|
|
86
|
+
// - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
|
|
87
|
+
//
|
|
88
|
+
// - Their Workspace email address. For example,
|
|
89
|
+
// `users/user@example.com/spaces/{space}/spaceReadState`.
|
|
90
|
+
//
|
|
91
|
+
// - Their user id. For example,
|
|
92
|
+
// `users/123456789/spaces/{space}/spaceReadState`.
|
|
93
|
+
//
|
|
94
|
+
// Format: users/{user}/spaces/{space}/spaceReadState
|
|
95
|
+
SpaceReadState space_read_state = 1 [(google.api.field_behavior) = REQUIRED];
|
|
96
|
+
|
|
97
|
+
// Required. The field paths to update. Currently supported field paths:
|
|
98
|
+
//
|
|
99
|
+
// - `last_read_time`
|
|
100
|
+
//
|
|
101
|
+
// When the `last_read_time` is before the latest message create time, the
|
|
102
|
+
// space appears as unread in the UI.
|
|
103
|
+
//
|
|
104
|
+
// To mark the space as read, set `last_read_time` to any value later (larger)
|
|
105
|
+
// than the latest message create time. The `last_read_time` is coerced to
|
|
106
|
+
// match the latest message create time. Note that the space read state only
|
|
107
|
+
// affects the read state of messages that are visible in the space's
|
|
108
|
+
// top-level conversation. Replies in threads are unaffected by this
|
|
109
|
+
// timestamp, and instead rely on the thread read state.
|
|
110
|
+
google.protobuf.FieldMask update_mask = 2
|
|
111
|
+
[(google.api.field_behavior) = REQUIRED];
|
|
112
|
+
}
|
|
@@ -28,6 +28,7 @@ option java_package = "com.google.chat.v1";
|
|
|
28
28
|
option php_namespace = "Google\\Apps\\Chat\\V1";
|
|
29
29
|
option ruby_package = "Google::Apps::Chat::V1";
|
|
30
30
|
|
|
31
|
+
// Request to create a space and add specified users to it.
|
|
31
32
|
message SetUpSpaceRequest {
|
|
32
33
|
// Required. The `Space.spaceType` field is required.
|
|
33
34
|
//
|
|
@@ -0,0 +1,74 @@
|
|
|
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/protobuf/timestamp.proto";
|
|
22
|
+
|
|
23
|
+
option csharp_namespace = "Google.Apps.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 = "ThreadReadStateProto";
|
|
27
|
+
option java_package = "com.google.chat.v1";
|
|
28
|
+
option php_namespace = "Google\\Apps\\Chat\\V1";
|
|
29
|
+
option ruby_package = "Google::Apps::Chat::V1";
|
|
30
|
+
|
|
31
|
+
// A user's read state within a thread, used to identify read and unread
|
|
32
|
+
// messages.
|
|
33
|
+
message ThreadReadState {
|
|
34
|
+
option (google.api.resource) = {
|
|
35
|
+
type: "chat.googleapis.com/ThreadReadState"
|
|
36
|
+
pattern: "users/{user}/spaces/{space}/threads/{thread}/threadReadState"
|
|
37
|
+
singular: "threadReadState"
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Resource name of the thread read state.
|
|
41
|
+
//
|
|
42
|
+
// Format: `users/{user}/spaces/{space}/threads/{thread}/threadReadState`
|
|
43
|
+
string name = 1;
|
|
44
|
+
|
|
45
|
+
// The time when the user's thread read state was updated. Usually this
|
|
46
|
+
// corresponds with the timestamp of the last read message in a thread.
|
|
47
|
+
google.protobuf.Timestamp last_read_time = 2;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Request message for GetThreadReadStateRequest API.
|
|
51
|
+
message GetThreadReadStateRequest {
|
|
52
|
+
// Required. Resource name of the thread read state to retrieve.
|
|
53
|
+
//
|
|
54
|
+
// Only supports getting read state for the calling user.
|
|
55
|
+
//
|
|
56
|
+
// To refer to the calling user, set one of the following:
|
|
57
|
+
//
|
|
58
|
+
// - The `me` alias. For example,
|
|
59
|
+
// `users/me/spaces/{space}/threads/{thread}/threadReadState`.
|
|
60
|
+
//
|
|
61
|
+
// - Their Workspace email address. For example,
|
|
62
|
+
// `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`.
|
|
63
|
+
//
|
|
64
|
+
// - Their user id. For example,
|
|
65
|
+
// `users/123456789/spaces/{space}/threads/{thread}/threadReadState`.
|
|
66
|
+
//
|
|
67
|
+
// Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState
|
|
68
|
+
string name = 1 [
|
|
69
|
+
(google.api.field_behavior) = REQUIRED,
|
|
70
|
+
(google.api.resource_reference) = {
|
|
71
|
+
type: "chat.googleapis.com/ThreadReadState"
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
}
|
|
@@ -29,8 +29,9 @@ option ruby_package = "Google::Apps::Chat::V1";
|
|
|
29
29
|
|
|
30
30
|
// A user in Google Chat.
|
|
31
31
|
// When returned as an output from a request, if your Chat app [authenticates as
|
|
32
|
-
// a
|
|
33
|
-
//
|
|
32
|
+
// a
|
|
33
|
+
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
|
|
34
|
+
// the output for a `User` resource only populates the user's `name` and `type`.
|
|
34
35
|
message User {
|
|
35
36
|
enum Type {
|
|
36
37
|
// Default value for the enum. DO NOT USE.
|
|
@@ -29,7 +29,7 @@ message WidgetMarkup {
|
|
|
29
29
|
// A paragraph of text. Formatted text supported. For more information
|
|
30
30
|
// about formatting text, see
|
|
31
31
|
// [Formatting text in Google Chat
|
|
32
|
-
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
32
|
+
// apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
|
|
33
33
|
// and
|
|
34
34
|
// [Formatting
|
|
35
35
|
// text in Google Workspace
|
|
@@ -139,7 +139,7 @@ message WidgetMarkup {
|
|
|
139
139
|
// The text of the top label. Formatted text supported. For more information
|
|
140
140
|
// about formatting text, see
|
|
141
141
|
// [Formatting text in Google Chat
|
|
142
|
-
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
142
|
+
// apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
|
|
143
143
|
// and
|
|
144
144
|
// [Formatting
|
|
145
145
|
// text in Google Workspace
|
|
@@ -150,7 +150,7 @@ message WidgetMarkup {
|
|
|
150
150
|
// For more information
|
|
151
151
|
// about formatting text, see
|
|
152
152
|
// [Formatting text in Google Chat
|
|
153
|
-
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
153
|
+
// apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
|
|
154
154
|
// and
|
|
155
155
|
// [Formatting
|
|
156
156
|
// text in Google Workspace
|
|
@@ -162,7 +162,7 @@ message WidgetMarkup {
|
|
|
162
162
|
|
|
163
163
|
// The text of the bottom label. Formatted text supported. For more
|
|
164
164
|
// information about formatting text, see [Formatting text in Google Chat
|
|
165
|
-
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
165
|
+
// apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
|
|
166
166
|
// and
|
|
167
167
|
// [Formatting
|
|
168
168
|
// text in Google Workspace
|