@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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +202 -0
- package/README.md +220 -0
- package/build/protos/google/apps/card/v1/card.proto +1918 -0
- package/build/protos/google/chat/v1/action_status.proto +38 -0
- package/build/protos/google/chat/v1/annotation.proto +137 -0
- package/build/protos/google/chat/v1/attachment.proto +122 -0
- package/build/protos/google/chat/v1/chat_service.proto +493 -0
- package/build/protos/google/chat/v1/contextual_addon.proto +106 -0
- package/build/protos/google/chat/v1/deletion_metadata.proto +56 -0
- package/build/protos/google/chat/v1/group.proto +37 -0
- package/build/protos/google/chat/v1/history_state.proto +41 -0
- package/build/protos/google/chat/v1/matched_url.proto +35 -0
- package/build/protos/google/chat/v1/membership.proto +292 -0
- package/build/protos/google/chat/v1/message.proto +645 -0
- package/build/protos/google/chat/v1/reaction.proto +183 -0
- package/build/protos/google/chat/v1/slash_command.proto +32 -0
- package/build/protos/google/chat/v1/space.proto +360 -0
- package/build/protos/google/chat/v1/space_setup.proto +91 -0
- package/build/protos/google/chat/v1/user.proto +82 -0
- package/build/protos/google/chat/v1/widgets.proto +277 -0
- package/build/protos/protos.d.ts +20339 -0
- package/build/protos/protos.js +52506 -0
- package/build/protos/protos.json +5114 -0
- package/build/src/index.d.ts +11 -0
- package/build/src/index.js +28 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v1/chat_service_client.d.ts +2194 -0
- package/build/src/v1/chat_service_client.js +1763 -0
- package/build/src/v1/chat_service_client.js.map +1 -0
- package/build/src/v1/chat_service_client_config.json +148 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +23 -0
- package/build/src/v1/index.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,493 @@
|
|
|
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/annotations.proto";
|
|
20
|
+
import "google/api/client.proto";
|
|
21
|
+
import "google/chat/v1/attachment.proto";
|
|
22
|
+
import "google/chat/v1/membership.proto";
|
|
23
|
+
import "google/chat/v1/message.proto";
|
|
24
|
+
import "google/chat/v1/reaction.proto";
|
|
25
|
+
import "google/chat/v1/space.proto";
|
|
26
|
+
import "google/chat/v1/space_setup.proto";
|
|
27
|
+
import "google/protobuf/empty.proto";
|
|
28
|
+
|
|
29
|
+
option csharp_namespace = "Google.Chat.V1";
|
|
30
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
31
|
+
option java_multiple_files = true;
|
|
32
|
+
option java_outer_classname = "ChatServiceProto";
|
|
33
|
+
option java_package = "com.google.chat.v1";
|
|
34
|
+
option php_namespace = "Google\\Chat\\V1";
|
|
35
|
+
option ruby_package = "Google::Chat::V1";
|
|
36
|
+
|
|
37
|
+
// Enables developers to build Chat apps and
|
|
38
|
+
// integrations on Google Chat Platform.
|
|
39
|
+
service ChatService {
|
|
40
|
+
option (google.api.default_host) = "chat.googleapis.com";
|
|
41
|
+
option (google.api.oauth_scopes) =
|
|
42
|
+
"https://www.googleapis.com/auth/chat.bot,"
|
|
43
|
+
"https://www.googleapis.com/auth/chat.delete,"
|
|
44
|
+
"https://www.googleapis.com/auth/chat.import,"
|
|
45
|
+
"https://www.googleapis.com/auth/chat.memberships,"
|
|
46
|
+
"https://www.googleapis.com/auth/chat.memberships.app,"
|
|
47
|
+
"https://www.googleapis.com/auth/chat.memberships.readonly,"
|
|
48
|
+
"https://www.googleapis.com/auth/chat.messages,"
|
|
49
|
+
"https://www.googleapis.com/auth/chat.messages.create,"
|
|
50
|
+
"https://www.googleapis.com/auth/chat.messages.reactions,"
|
|
51
|
+
"https://www.googleapis.com/auth/chat.messages.reactions.create,"
|
|
52
|
+
"https://www.googleapis.com/auth/chat.messages.reactions.readonly,"
|
|
53
|
+
"https://www.googleapis.com/auth/chat.messages.readonly,"
|
|
54
|
+
"https://www.googleapis.com/auth/chat.spaces,"
|
|
55
|
+
"https://www.googleapis.com/auth/chat.spaces.create,"
|
|
56
|
+
"https://www.googleapis.com/auth/chat.spaces.readonly";
|
|
57
|
+
|
|
58
|
+
// Creates a message in a Google Chat space. For an example, see [Create a
|
|
59
|
+
// message](https://developers.google.com/chat/api/guides/v1/messages/create).
|
|
60
|
+
//
|
|
61
|
+
// Calling this method requires
|
|
62
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth) and
|
|
63
|
+
// supports the following authentication types:
|
|
64
|
+
//
|
|
65
|
+
// - For text messages, user authentication or app authentication are
|
|
66
|
+
// supported.
|
|
67
|
+
// - For card messages, only app authentication is supported. (Only Chat apps
|
|
68
|
+
// can create card messages.)
|
|
69
|
+
rpc CreateMessage(CreateMessageRequest) returns (Message) {
|
|
70
|
+
option (google.api.http) = {
|
|
71
|
+
post: "/v1/{parent=spaces/*}/messages"
|
|
72
|
+
body: "message"
|
|
73
|
+
};
|
|
74
|
+
option (google.api.method_signature) = "parent,message,message_id";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Lists messages in a space that the caller is a member of, including
|
|
78
|
+
// messages from blocked members and spaces. For an example, see
|
|
79
|
+
// [List messages](/chat/api/guides/v1/messages/list).
|
|
80
|
+
// Requires [user
|
|
81
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
82
|
+
rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) {
|
|
83
|
+
option (google.api.http) = {
|
|
84
|
+
get: "/v1/{parent=spaces/*}/messages"
|
|
85
|
+
};
|
|
86
|
+
option (google.api.method_signature) = "parent";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Lists memberships in a space. For an example, see [List
|
|
90
|
+
// memberships](https://developers.google.com/chat/api/guides/v1/members/list).
|
|
91
|
+
// Listing memberships with
|
|
92
|
+
// [app
|
|
93
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
94
|
+
// lists memberships in spaces that the Chat app has
|
|
95
|
+
// access to, but excludes Chat app memberships,
|
|
96
|
+
// including its own. Listing memberships with
|
|
97
|
+
// [User
|
|
98
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users)
|
|
99
|
+
// lists memberships in spaces that the authenticated user has access to.
|
|
100
|
+
//
|
|
101
|
+
// Requires
|
|
102
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth).
|
|
103
|
+
// Supports
|
|
104
|
+
// [app
|
|
105
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
106
|
+
// and [user
|
|
107
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
108
|
+
rpc ListMemberships(ListMembershipsRequest)
|
|
109
|
+
returns (ListMembershipsResponse) {
|
|
110
|
+
option (google.api.http) = {
|
|
111
|
+
get: "/v1/{parent=spaces/*}/members"
|
|
112
|
+
};
|
|
113
|
+
option (google.api.method_signature) = "parent";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Returns details about a membership. For an example, see
|
|
117
|
+
// [Get a
|
|
118
|
+
// membership](https://developers.google.com/chat/api/guides/v1/members/get).
|
|
119
|
+
//
|
|
120
|
+
// Requires
|
|
121
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth).
|
|
122
|
+
// Supports
|
|
123
|
+
// [app
|
|
124
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
125
|
+
// and [user
|
|
126
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
127
|
+
rpc GetMembership(GetMembershipRequest) returns (Membership) {
|
|
128
|
+
option (google.api.http) = {
|
|
129
|
+
get: "/v1/{name=spaces/*/members/*}"
|
|
130
|
+
};
|
|
131
|
+
option (google.api.method_signature) = "name";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Returns details about a message.
|
|
135
|
+
// For an example, see [Read a
|
|
136
|
+
// message](https://developers.google.com/chat/api/guides/v1/messages/get).
|
|
137
|
+
//
|
|
138
|
+
// Requires
|
|
139
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth).
|
|
140
|
+
// Supports
|
|
141
|
+
// [app
|
|
142
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
143
|
+
// and [user
|
|
144
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
145
|
+
//
|
|
146
|
+
// Note: Might return a message from a blocked member or space.
|
|
147
|
+
rpc GetMessage(GetMessageRequest) returns (Message) {
|
|
148
|
+
option (google.api.http) = {
|
|
149
|
+
get: "/v1/{name=spaces/*/messages/*}"
|
|
150
|
+
};
|
|
151
|
+
option (google.api.method_signature) = "name";
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Updates a message. There's a difference between the `patch` and `update`
|
|
155
|
+
// methods. The `patch`
|
|
156
|
+
// method uses a `patch` request while the `update` method uses a `put`
|
|
157
|
+
// request. We recommend using the `patch` method. For an example, see
|
|
158
|
+
// [Update a
|
|
159
|
+
// message](https://developers.google.com/chat/api/guides/v1/messages/update).
|
|
160
|
+
//
|
|
161
|
+
// Requires
|
|
162
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth).
|
|
163
|
+
// Supports
|
|
164
|
+
// [app
|
|
165
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
166
|
+
// and [user
|
|
167
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
168
|
+
// When using app authentication, requests can only update messages
|
|
169
|
+
// created by the calling Chat app.
|
|
170
|
+
rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
|
|
171
|
+
option (google.api.http) = {
|
|
172
|
+
put: "/v1/{message.name=spaces/*/messages/*}"
|
|
173
|
+
body: "message"
|
|
174
|
+
additional_bindings {
|
|
175
|
+
patch: "/v1/{message.name=spaces/*/messages/*}"
|
|
176
|
+
body: "message"
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
option (google.api.method_signature) = "message,update_mask";
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Deletes a message.
|
|
183
|
+
// For an example, see [Delete a
|
|
184
|
+
// message](https://developers.google.com/chat/api/guides/v1/messages/delete).
|
|
185
|
+
//
|
|
186
|
+
// Requires
|
|
187
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth).
|
|
188
|
+
// Supports
|
|
189
|
+
// [app
|
|
190
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
191
|
+
// and [user
|
|
192
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
193
|
+
// When using app authentication, requests can only delete messages
|
|
194
|
+
// created by the calling Chat app.
|
|
195
|
+
rpc DeleteMessage(DeleteMessageRequest) returns (google.protobuf.Empty) {
|
|
196
|
+
option (google.api.http) = {
|
|
197
|
+
delete: "/v1/{name=spaces/*/messages/*}"
|
|
198
|
+
};
|
|
199
|
+
option (google.api.method_signature) = "name";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Gets the metadata of a message attachment. The attachment data is fetched
|
|
203
|
+
// using the [media
|
|
204
|
+
// API](https://developers.google.com/chat/api/reference/rest/v1/media/download).
|
|
205
|
+
// For an example, see
|
|
206
|
+
// [Get a message
|
|
207
|
+
// attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get).
|
|
208
|
+
// Requires [app
|
|
209
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
|
|
210
|
+
rpc GetAttachment(GetAttachmentRequest) returns (Attachment) {
|
|
211
|
+
option (google.api.http) = {
|
|
212
|
+
get: "/v1/{name=spaces/*/messages/*/attachments/*}"
|
|
213
|
+
};
|
|
214
|
+
option (google.api.method_signature) = "name";
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Uploads an attachment. For an example, see
|
|
218
|
+
// [Upload media as a file
|
|
219
|
+
// attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload).
|
|
220
|
+
// Requires user
|
|
221
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
222
|
+
//
|
|
223
|
+
// You can upload attachments up to 200 MB. Certain file types aren't
|
|
224
|
+
// supported. For details, see [File types blocked by Google
|
|
225
|
+
// Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
|
|
226
|
+
rpc UploadAttachment(UploadAttachmentRequest)
|
|
227
|
+
returns (UploadAttachmentResponse) {
|
|
228
|
+
option (google.api.http) = {
|
|
229
|
+
post: "/v1/{parent=spaces/*}/attachments:upload"
|
|
230
|
+
body: "*"
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Lists spaces the caller is a member of. Group chats and DMs aren't listed
|
|
235
|
+
// until the first message is sent. For an example, see
|
|
236
|
+
// [List
|
|
237
|
+
// spaces](https://developers.google.com/chat/api/guides/v1/spaces/list).
|
|
238
|
+
//
|
|
239
|
+
// Requires
|
|
240
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth).
|
|
241
|
+
// Supports
|
|
242
|
+
// [app
|
|
243
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
244
|
+
// and [user
|
|
245
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
246
|
+
//
|
|
247
|
+
// Lists spaces visible to the caller or authenticated user. Group chats
|
|
248
|
+
// and DMs aren't listed until the first message is sent.
|
|
249
|
+
rpc ListSpaces(ListSpacesRequest) returns (ListSpacesResponse) {
|
|
250
|
+
option (google.api.http) = {
|
|
251
|
+
get: "/v1/spaces"
|
|
252
|
+
};
|
|
253
|
+
option (google.api.method_signature) = "";
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Returns details about a space. For an example, see
|
|
257
|
+
// [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get).
|
|
258
|
+
//
|
|
259
|
+
// Requires
|
|
260
|
+
// [authentication](https://developers.google.com/chat/api/guides/auth).
|
|
261
|
+
// Supports
|
|
262
|
+
// [app
|
|
263
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
|
|
264
|
+
// and [user
|
|
265
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
266
|
+
rpc GetSpace(GetSpaceRequest) returns (Space) {
|
|
267
|
+
option (google.api.http) = {
|
|
268
|
+
get: "/v1/{name=spaces/*}"
|
|
269
|
+
};
|
|
270
|
+
option (google.api.method_signature) = "name";
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Creates a named space. Spaces grouped by topics aren't supported. For an
|
|
274
|
+
// example, see [Create a
|
|
275
|
+
// space](https://developers.google.com/chat/api/guides/v1/spaces/create).
|
|
276
|
+
//
|
|
277
|
+
// If you receive the error message `ALREADY_EXISTS` when creating
|
|
278
|
+
// a space, try a different `displayName`. An existing space within
|
|
279
|
+
// the Google Workspace organization might already use this display name.
|
|
280
|
+
//
|
|
281
|
+
// Requires [user
|
|
282
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
283
|
+
rpc CreateSpace(CreateSpaceRequest) returns (Space) {
|
|
284
|
+
option (google.api.http) = {
|
|
285
|
+
post: "/v1/spaces"
|
|
286
|
+
body: "space"
|
|
287
|
+
};
|
|
288
|
+
option (google.api.method_signature) = "space";
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Creates a space and adds specified users to it. The calling user is
|
|
292
|
+
// automatically added to the space, and shouldn't be specified as a
|
|
293
|
+
// membership in the request. For an example, see
|
|
294
|
+
// [Set up a
|
|
295
|
+
// space](https://developers.google.com/chat/api/guides/v1/spaces/set-up).
|
|
296
|
+
//
|
|
297
|
+
// To specify the human members to add, add memberships with the appropriate
|
|
298
|
+
// `member.name` in the `SetUpSpaceRequest`. To add a human user, use
|
|
299
|
+
// `users/{user}`, where `{user}` can be the email address for the user. For
|
|
300
|
+
// users in the same Workspace organization `{user}` can also be the `id` for
|
|
301
|
+
// the person from the People API, or the `id` for the user in the Directory
|
|
302
|
+
// API. For example, if the People API Person profile ID for
|
|
303
|
+
// `user@example.com` is `123456789`, you can add the user to the space by
|
|
304
|
+
// setting the `membership.member.name` to `users/user@example.com` or
|
|
305
|
+
// `users/123456789`.
|
|
306
|
+
//
|
|
307
|
+
// For a space or group chat, if the caller blocks or is blocked by some
|
|
308
|
+
// members, then those members aren't added to the created space.
|
|
309
|
+
//
|
|
310
|
+
// To create a direct message (DM) between the calling user and another human
|
|
311
|
+
// user, specify exactly one membership to represent the human user. If
|
|
312
|
+
// one user blocks the other, the request fails and the DM isn't created.
|
|
313
|
+
//
|
|
314
|
+
// To create a DM between the calling user and the calling app, set
|
|
315
|
+
// `Space.singleUserBotDm` to `true` and don't specify any memberships. You
|
|
316
|
+
// can only use this method to set up a DM with the calling app. To add the
|
|
317
|
+
// calling app as a member of a space or an existing DM between two human
|
|
318
|
+
// users, see
|
|
319
|
+
// [create a
|
|
320
|
+
// membership](https://developers.google.com/chat/api/guides/v1/members/create).
|
|
321
|
+
//
|
|
322
|
+
// If a DM already exists between two users, even when one user blocks the
|
|
323
|
+
// other at the time a request is made, then the existing DM is returned.
|
|
324
|
+
//
|
|
325
|
+
// Spaces with threaded replies aren't supported. If you receive the error
|
|
326
|
+
// message `ALREADY_EXISTS` when setting up a space, try a different
|
|
327
|
+
// `displayName`. An existing space within the Google Workspace organization
|
|
328
|
+
// might already use this display name.
|
|
329
|
+
//
|
|
330
|
+
// Requires [user
|
|
331
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
332
|
+
rpc SetUpSpace(SetUpSpaceRequest) returns (Space) {
|
|
333
|
+
option (google.api.http) = {
|
|
334
|
+
post: "/v1/spaces:setup"
|
|
335
|
+
body: "*"
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Updates a space. For an example, see
|
|
340
|
+
// [Update a
|
|
341
|
+
// space](https://developers.google.com/chat/api/guides/v1/spaces/update).
|
|
342
|
+
//
|
|
343
|
+
// If you're updating the `displayName` field and receive the error message
|
|
344
|
+
// `ALREADY_EXISTS`, try a different display name.. An existing space within
|
|
345
|
+
// the Google Workspace organization might already use this display name.
|
|
346
|
+
//
|
|
347
|
+
// Requires [user
|
|
348
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
349
|
+
rpc UpdateSpace(UpdateSpaceRequest) returns (Space) {
|
|
350
|
+
option (google.api.http) = {
|
|
351
|
+
patch: "/v1/{space.name=spaces/*}"
|
|
352
|
+
body: "space"
|
|
353
|
+
};
|
|
354
|
+
option (google.api.method_signature) = "space,update_mask";
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Deletes a named space. Always performs a cascading delete, which means
|
|
358
|
+
// that the space's child resources—like messages posted in the space and
|
|
359
|
+
// memberships in the space—are also deleted. For an example, see
|
|
360
|
+
// [Delete a
|
|
361
|
+
// space](https://developers.google.com/chat/api/guides/v1/spaces/delete).
|
|
362
|
+
// Requires [user
|
|
363
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users)
|
|
364
|
+
// from a user who has permission to delete the space.
|
|
365
|
+
rpc DeleteSpace(DeleteSpaceRequest) returns (google.protobuf.Empty) {
|
|
366
|
+
option (google.api.http) = {
|
|
367
|
+
delete: "/v1/{name=spaces/*}"
|
|
368
|
+
};
|
|
369
|
+
option (google.api.method_signature) = "name";
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// Completes the
|
|
373
|
+
// [import process](https://developers.google.com/chat/api/guides/import-data)
|
|
374
|
+
// for the specified space and makes it visible to users.
|
|
375
|
+
// Requires app authentication and domain-wide delegation. For more
|
|
376
|
+
// information, see [Authorize Google Chat apps to import
|
|
377
|
+
// data](https://developers.google.com/chat/api/guides/authorize-import).
|
|
378
|
+
rpc CompleteImportSpace(CompleteImportSpaceRequest)
|
|
379
|
+
returns (CompleteImportSpaceResponse) {
|
|
380
|
+
option (google.api.http) = {
|
|
381
|
+
post: "/v1/{name=spaces/*}:completeImport"
|
|
382
|
+
body: "*"
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Returns the existing direct message with the specified user. If no direct
|
|
387
|
+
// message space is found, returns a `404 NOT_FOUND` error. For an example,
|
|
388
|
+
// see
|
|
389
|
+
// [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
|
|
390
|
+
//
|
|
391
|
+
// With [user
|
|
392
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users),
|
|
393
|
+
// returns the direct message space between the specified user and the
|
|
394
|
+
// authenticated user.
|
|
395
|
+
//
|
|
396
|
+
// With [app
|
|
397
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts),
|
|
398
|
+
// returns the direct message space between the specified user and the calling
|
|
399
|
+
// Chat app.
|
|
400
|
+
//
|
|
401
|
+
// Requires [user
|
|
402
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users)
|
|
403
|
+
// or [app
|
|
404
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
|
|
405
|
+
rpc FindDirectMessage(FindDirectMessageRequest) returns (Space) {
|
|
406
|
+
option (google.api.http) = {
|
|
407
|
+
get: "/v1/spaces:findDirectMessage"
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// Creates a human membership or app membership for the calling app. Creating
|
|
412
|
+
// memberships for other apps isn't supported. For an example, see
|
|
413
|
+
// [ Create a
|
|
414
|
+
// membership](https://developers.google.com/chat/api/guides/v1/members/create).
|
|
415
|
+
// When creating a membership, if the specified member has their auto-accept
|
|
416
|
+
// policy turned off, then they're invited, and must accept the space
|
|
417
|
+
// invitation before joining. Otherwise, creating a membership adds the member
|
|
418
|
+
// directly to the specified space. Requires [user
|
|
419
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
420
|
+
//
|
|
421
|
+
// To specify the member to add, set the `membership.member.name` in the
|
|
422
|
+
// `CreateMembershipRequest`:
|
|
423
|
+
//
|
|
424
|
+
// - To add the calling app to a space or a direct message between two human
|
|
425
|
+
// users, use `users/app`. Unable to add other
|
|
426
|
+
// apps to the space.
|
|
427
|
+
//
|
|
428
|
+
// - To add a human user, use `users/{user}`, where `{user}` can be the email
|
|
429
|
+
// address for the user. For users in the same Workspace organization `{user}`
|
|
430
|
+
// can also be the `id` for the person from the People API, or the `id` for
|
|
431
|
+
// the user in the Directory API. For example, if the People API Person
|
|
432
|
+
// profile ID for `user@example.com` is `123456789`, you can add the user to
|
|
433
|
+
// the space by setting the `membership.member.name` to
|
|
434
|
+
// `users/user@example.com` or `users/123456789`.
|
|
435
|
+
rpc CreateMembership(CreateMembershipRequest) returns (Membership) {
|
|
436
|
+
option (google.api.http) = {
|
|
437
|
+
post: "/v1/{parent=spaces/*}/members"
|
|
438
|
+
body: "membership"
|
|
439
|
+
};
|
|
440
|
+
option (google.api.method_signature) = "parent,membership";
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// Deletes a membership. For an example, see
|
|
444
|
+
// [Delete a
|
|
445
|
+
// membership](https://developers.google.com/chat/api/guides/v1/members/delete).
|
|
446
|
+
//
|
|
447
|
+
// Requires [user
|
|
448
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
449
|
+
rpc DeleteMembership(DeleteMembershipRequest) returns (Membership) {
|
|
450
|
+
option (google.api.http) = {
|
|
451
|
+
delete: "/v1/{name=spaces/*/members/*}"
|
|
452
|
+
};
|
|
453
|
+
option (google.api.method_signature) = "name";
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Creates a reaction and adds it to a message. For an example, see
|
|
457
|
+
// [Create a
|
|
458
|
+
// reaction](https://developers.google.com/chat/api/guides/v1/reactions/create).
|
|
459
|
+
// Requires [user
|
|
460
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
461
|
+
// Only unicode emoji are supported.
|
|
462
|
+
rpc CreateReaction(CreateReactionRequest) returns (Reaction) {
|
|
463
|
+
option (google.api.http) = {
|
|
464
|
+
post: "/v1/{parent=spaces/*/messages/*}/reactions"
|
|
465
|
+
body: "reaction"
|
|
466
|
+
};
|
|
467
|
+
option (google.api.method_signature) = "parent,reaction";
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// Lists reactions to a message. For an example, see
|
|
471
|
+
// [List
|
|
472
|
+
// reactions](https://developers.google.com/chat/api/guides/v1/reactions/list).
|
|
473
|
+
// Requires [user
|
|
474
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
475
|
+
rpc ListReactions(ListReactionsRequest) returns (ListReactionsResponse) {
|
|
476
|
+
option (google.api.http) = {
|
|
477
|
+
get: "/v1/{parent=spaces/*/messages/*}/reactions"
|
|
478
|
+
};
|
|
479
|
+
option (google.api.method_signature) = "parent";
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// Deletes a reaction to a message. For an example, see
|
|
483
|
+
// [Delete a
|
|
484
|
+
// reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete).
|
|
485
|
+
// Requires [user
|
|
486
|
+
// authentication](https://developers.google.com/chat/api/guides/auth/users).
|
|
487
|
+
rpc DeleteReaction(DeleteReactionRequest) returns (google.protobuf.Empty) {
|
|
488
|
+
option (google.api.http) = {
|
|
489
|
+
delete: "/v1/{name=spaces/*/messages/*/reactions/*}"
|
|
490
|
+
};
|
|
491
|
+
option (google.api.method_signature) = "name";
|
|
492
|
+
}
|
|
493
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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/chat/v1/widgets.proto";
|
|
20
|
+
|
|
21
|
+
option csharp_namespace = "Google.Chat.V1";
|
|
22
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_outer_classname = "ContextualAddOnProto";
|
|
25
|
+
option java_package = "com.google.chat.v1";
|
|
26
|
+
option php_namespace = "Google\\Chat\\V1";
|
|
27
|
+
option ruby_package = "Google::Chat::V1";
|
|
28
|
+
|
|
29
|
+
// The markup for developers to specify the contents of a contextual AddOn.
|
|
30
|
+
message ContextualAddOnMarkup {
|
|
31
|
+
// A card is a UI element that can contain UI widgets such as text and
|
|
32
|
+
// images.
|
|
33
|
+
message Card {
|
|
34
|
+
message CardHeader {
|
|
35
|
+
enum ImageStyle {
|
|
36
|
+
IMAGE_STYLE_UNSPECIFIED = 0;
|
|
37
|
+
|
|
38
|
+
// Square border.
|
|
39
|
+
IMAGE = 1;
|
|
40
|
+
|
|
41
|
+
// Circular border.
|
|
42
|
+
AVATAR = 2;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// The title must be specified. The header has a fixed height: if both a
|
|
46
|
+
// title and subtitle is specified, each takes up one line. If only the
|
|
47
|
+
// title is specified, it takes up both lines.
|
|
48
|
+
string title = 1;
|
|
49
|
+
|
|
50
|
+
// The subtitle of the card header.
|
|
51
|
+
string subtitle = 2;
|
|
52
|
+
|
|
53
|
+
// The image's type (for example, square border or circular border).
|
|
54
|
+
ImageStyle image_style = 3;
|
|
55
|
+
|
|
56
|
+
// The URL of the image in the card header.
|
|
57
|
+
string image_url = 4;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// A section contains a collection of widgets that are rendered
|
|
61
|
+
// (vertically) in the order that they are specified. Across all platforms,
|
|
62
|
+
// cards have a narrow fixed width, so
|
|
63
|
+
// there's currently no need for layout properties (for example, float).
|
|
64
|
+
message Section {
|
|
65
|
+
// The header of the section. Formatted text is
|
|
66
|
+
// supported. For more information
|
|
67
|
+
// about formatting text, see
|
|
68
|
+
// [Formatting text in Google Chat
|
|
69
|
+
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
70
|
+
// and
|
|
71
|
+
// [Formatting
|
|
72
|
+
// text in Google Workspace
|
|
73
|
+
// Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
|
|
74
|
+
string header = 1;
|
|
75
|
+
|
|
76
|
+
// A section must contain at least one widget.
|
|
77
|
+
repeated WidgetMarkup widgets = 2;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// A card action is
|
|
81
|
+
// the action associated with the card. For an invoice card, a
|
|
82
|
+
// typical action would be: delete invoice, email invoice or open the
|
|
83
|
+
// invoice in browser.
|
|
84
|
+
//
|
|
85
|
+
// Not supported by Google Chat apps.
|
|
86
|
+
message CardAction {
|
|
87
|
+
// The label used to be displayed in the action menu item.
|
|
88
|
+
string action_label = 1;
|
|
89
|
+
|
|
90
|
+
// The onclick action for this action item.
|
|
91
|
+
WidgetMarkup.OnClick on_click = 2;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// The header of the card. A header usually contains a title and an image.
|
|
95
|
+
CardHeader header = 1;
|
|
96
|
+
|
|
97
|
+
// Sections are separated by a line divider.
|
|
98
|
+
repeated Section sections = 2;
|
|
99
|
+
|
|
100
|
+
// The actions of this card.
|
|
101
|
+
repeated CardAction card_actions = 3;
|
|
102
|
+
|
|
103
|
+
// Name of the card.
|
|
104
|
+
string name = 4;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 = "DeletionMetadataProto";
|
|
23
|
+
option java_package = "com.google.chat.v1";
|
|
24
|
+
option php_namespace = "Google\\Chat\\V1";
|
|
25
|
+
option ruby_package = "Google::Chat::V1";
|
|
26
|
+
|
|
27
|
+
// Information about a deleted message. A message is deleted when `delete_time`
|
|
28
|
+
// is set.
|
|
29
|
+
message DeletionMetadata {
|
|
30
|
+
// Who deleted the message and how it was deleted.
|
|
31
|
+
enum DeletionType {
|
|
32
|
+
// This value is unused.
|
|
33
|
+
DELETION_TYPE_UNSPECIFIED = 0;
|
|
34
|
+
|
|
35
|
+
// User deleted their own message.
|
|
36
|
+
CREATOR = 1;
|
|
37
|
+
|
|
38
|
+
// The space owner deleted the message.
|
|
39
|
+
SPACE_OWNER = 2;
|
|
40
|
+
|
|
41
|
+
// A Google Workspace admin deleted the message.
|
|
42
|
+
ADMIN = 3;
|
|
43
|
+
|
|
44
|
+
// A Chat app deleted its own message when it expired.
|
|
45
|
+
APP_MESSAGE_EXPIRY = 4;
|
|
46
|
+
|
|
47
|
+
// A Chat app deleted the message on behalf of the user.
|
|
48
|
+
CREATOR_VIA_APP = 5;
|
|
49
|
+
|
|
50
|
+
// A Chat app deleted the message on behalf of the space owner.
|
|
51
|
+
SPACE_OWNER_VIA_APP = 6;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Indicates who deleted the message.
|
|
55
|
+
DeletionType deletion_type = 1;
|
|
56
|
+
}
|