@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,645 @@
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/apps/card/v1/card.proto";
22
+ import "google/chat/v1/action_status.proto";
23
+ import "google/chat/v1/annotation.proto";
24
+ import "google/chat/v1/attachment.proto";
25
+ import "google/chat/v1/contextual_addon.proto";
26
+ import "google/chat/v1/deletion_metadata.proto";
27
+ import "google/chat/v1/matched_url.proto";
28
+ import "google/chat/v1/reaction.proto";
29
+ import "google/chat/v1/slash_command.proto";
30
+ import "google/chat/v1/space.proto";
31
+ import "google/chat/v1/user.proto";
32
+ import "google/protobuf/field_mask.proto";
33
+ import "google/protobuf/timestamp.proto";
34
+
35
+ option csharp_namespace = "Google.Chat.V1";
36
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
37
+ option java_multiple_files = true;
38
+ option java_outer_classname = "MessageProto";
39
+ option java_package = "com.google.chat.v1";
40
+ option php_namespace = "Google\\Chat\\V1";
41
+ option ruby_package = "Google::Chat::V1";
42
+
43
+ // A message in a Google Chat space.
44
+ message Message {
45
+ option (google.api.resource) = {
46
+ type: "chat.googleapis.com/Message"
47
+ pattern: "spaces/{space}/messages/{message}"
48
+ };
49
+
50
+ // Resource name of the message.
51
+ //
52
+ // Format: `spaces/{space}/messages/{message}`
53
+ //
54
+ //
55
+ // Where `{space}` is the ID of the space where the message is posted and
56
+ // `{message}` is a system-assigned ID for the message. For example,
57
+ // `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`.
58
+ //
59
+ // If you set a custom ID when you create a message, you can use this ID to
60
+ // specify the message in a request by replacing `{message}` with the value
61
+ // from the `clientAssignedMessageId` field. For example,
62
+ // `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name
63
+ // a
64
+ // message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message).
65
+ string name = 1;
66
+
67
+ // Output only. The user who created the message.
68
+ // If your Chat app [authenticates as a
69
+ // user](https://developers.google.com/chat/api/guides/auth/users), the output
70
+ // populates the
71
+ // [user](https://developers.google.com/chat/api/reference/rest/v1/User)
72
+ // `name` and `type`.
73
+ User sender = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
74
+
75
+ // Optional. Immutable. For spaces created in Chat, the time at which the
76
+ // message was created. This field is output only, except when used in import
77
+ // mode spaces.
78
+ //
79
+ // For import mode spaces, set this field to the historical timestamp at which
80
+ // the message was created in the source in order to preserve the original
81
+ // creation time.
82
+ google.protobuf.Timestamp create_time = 3 [
83
+ (google.api.field_behavior) = IMMUTABLE,
84
+ (google.api.field_behavior) = OPTIONAL
85
+ ];
86
+
87
+ // Output only. The time at which the message was last edited by a user. If
88
+ // the message has never been edited, this field is empty.
89
+ google.protobuf.Timestamp last_update_time = 23
90
+ [(google.api.field_behavior) = OUTPUT_ONLY];
91
+
92
+ // Output only. The time at which the message was deleted in
93
+ // Google Chat. If the message is never deleted, this field is empty.
94
+ google.protobuf.Timestamp delete_time = 26
95
+ [(google.api.field_behavior) = OUTPUT_ONLY];
96
+
97
+ // Plain-text body of the message. The first link to an image, video, or web
98
+ // page generates a
99
+ // [preview chip](https://developers.google.com/chat/how-tos/preview-links).
100
+ // You can also [@mention a Google Chat
101
+ // user](https://developers.google.com/chat/format-messages#messages-@mention),
102
+ // or everyone in the space.
103
+ //
104
+ // To learn about creating text messages, see [Send a text
105
+ // message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages).
106
+ string text = 4;
107
+
108
+ // Output only. Contains the message `text` with markups added to communicate
109
+ // formatting. This field might not capture all formatting visible in the UI,
110
+ // but includes the following:
111
+ //
112
+ // * [Markup
113
+ // syntax](https://developers.google.com/chat/format-messages)
114
+ // for bold, italic, strikethrough, monospace, and monospace block.
115
+ //
116
+ // * [User
117
+ // mentions](https://developers.google.com/chat/format-messages#messages-@mention)
118
+ // using the format `<users/{user}>`.
119
+ //
120
+ // * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the
121
+ // first string is the URL and the second is the rendered text—for example,
122
+ // `<http://example.com|custom text>`.
123
+ //
124
+ // * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`.
125
+ // This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning
126
+ // face emoji.
127
+ //
128
+ // For more information, see [View text formatting sent in a
129
+ // message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message)
130
+ string formatted_text = 43 [(google.api.field_behavior) = OUTPUT_ONLY];
131
+
132
+ // Deprecated: Use `cards_v2` instead.
133
+ //
134
+ // Rich, formatted, and interactive cards that you can use to display UI
135
+ // elements such as: formatted texts, buttons, and clickable images. Cards are
136
+ // normally displayed below the plain-text body of the message. `cards` and
137
+ // `cards_v2` can have a maximum size of 32 KB.
138
+ repeated ContextualAddOnMarkup.Card cards = 5 [deprecated = true];
139
+
140
+ // An array of
141
+ // [cards](https://developers.google.com/chat/api/reference/rest/v1/cards).
142
+ //
143
+ // Only Chat apps can create cards. If your Chat app [authenticates as a
144
+ // user](https://developers.google.com/chat/api/guides/auth/users), the
145
+ // messages can't contain cards.
146
+ //
147
+ // To learn about cards and how to create them, see [Design dynamic,
148
+ // interactive, and consistent UIs with
149
+ // cards](https://developers.google.com/chat/ui).
150
+ //
151
+ // [Card builder](https://addons.gsuite.google.com/uikit/builder)
152
+ repeated CardWithId cards_v2 = 22;
153
+
154
+ // Output only. Annotations associated with the `text` in this message.
155
+ repeated Annotation annotations = 10
156
+ [(google.api.field_behavior) = OUTPUT_ONLY];
157
+
158
+ // The thread the message belongs to. For example usage, see
159
+ // [Start or reply to a message
160
+ // thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread).
161
+ Thread thread = 11;
162
+
163
+ // If your Chat app [authenticates as a
164
+ // user](https://developers.google.com/chat/api/guides/auth/users), the output
165
+ // populates the
166
+ // [space](https://developers.google.com/chat/api/reference/rest/v1/spaces)
167
+ // `name`.
168
+ Space space = 12;
169
+
170
+ // A plain-text description of the message's cards, used when the actual cards
171
+ // can't be displayed—for example, mobile notifications.
172
+ string fallback_text = 13;
173
+
174
+ // Input only. Parameters that a Chat app can use to configure how its
175
+ // response is posted.
176
+ ActionResponse action_response = 14
177
+ [(google.api.field_behavior) = INPUT_ONLY];
178
+
179
+ // Output only. Plain-text body of the message with all Chat app mentions
180
+ // stripped out.
181
+ string argument_text = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
182
+
183
+ // Output only. Slash command information, if applicable.
184
+ SlashCommand slash_command = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
185
+
186
+ // User-uploaded attachment.
187
+ repeated Attachment attachment = 18;
188
+
189
+ // Output only. A URL in `spaces.messages.text` that matches a link preview
190
+ // pattern. For more information, see [Preview
191
+ // links](https://developers.google.com/chat/how-tos/preview-links).
192
+ MatchedUrl matched_url = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
193
+
194
+ // Output only. When `true`, the message is a response in a reply thread. When
195
+ // `false`, the message is visible in the space's top-level conversation as
196
+ // either the first message of a thread or a message with no threaded replies.
197
+ //
198
+ // If the space doesn't support reply in threads, this field is always
199
+ // `false`.
200
+ bool thread_reply = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
201
+
202
+ // Optional. A custom ID for the message. You can use field to identify a
203
+ // message, or to get, delete, or update a message. To set a custom ID,
204
+ // specify the
205
+ // [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id)
206
+ // field when you create the message. For details, see [Name a
207
+ // message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message).
208
+ string client_assigned_message_id = 32;
209
+
210
+ // Output only. The list of emoji reaction summaries on the message.
211
+ repeated EmojiReactionSummary emoji_reaction_summaries = 33
212
+ [(google.api.field_behavior) = OUTPUT_ONLY];
213
+
214
+ // Immutable. Input for creating a message, otherwise output only. The user
215
+ // that can view the message. When set, the message is private and only
216
+ // visible to the specified user and the Chat app. Link previews and
217
+ // attachments aren't supported for private messages.
218
+ //
219
+ // Only Chat apps can send private messages. If your Chat app [authenticates
220
+ // as a user](https://developers.google.com/chat/api/guides/auth/users) to
221
+ // send a message, the message can't be private and must omit this field.
222
+ //
223
+ // For details, see [Send private messages to Google Chat
224
+ // users](https://developers.google.com/chat/api/guides/v1/messages/private).
225
+ User private_message_viewer = 36 [(google.api.field_behavior) = IMMUTABLE];
226
+
227
+ // Output only. Information about a deleted message. A message is deleted when
228
+ // `delete_time` is set.
229
+ DeletionMetadata deletion_metadata = 38
230
+ [(google.api.field_behavior) = OUTPUT_ONLY];
231
+
232
+ // Output only. Information about a message that's quoted by a Google Chat
233
+ // user in a space. Google Chat users can quote a message to reply to it.
234
+ QuotedMessageMetadata quoted_message_metadata = 39
235
+ [(google.api.field_behavior) = OUTPUT_ONLY];
236
+
237
+ // Output only. GIF images that are attached to the message.
238
+ repeated AttachedGif attached_gifs = 42
239
+ [(google.api.field_behavior) = OUTPUT_ONLY];
240
+ }
241
+
242
+ // A GIF image that's specified by a URL.
243
+ message AttachedGif {
244
+ // Output only. The URL that hosts the GIF image.
245
+ string uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
246
+ }
247
+
248
+ // Information about a quoted message.
249
+ message QuotedMessageMetadata {
250
+ option (google.api.resource) = {
251
+ type: "chat.googleapis.com/QuotedMessageMetadata"
252
+ pattern: "spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}"
253
+ };
254
+
255
+ // Output only. Resource name of the quoted message.
256
+ //
257
+ // Format: `spaces/{space}/messages/{message}`
258
+ string name = 1 [
259
+ (google.api.field_behavior) = OUTPUT_ONLY,
260
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Message" }
261
+ ];
262
+
263
+ // Output only. The timestamp when the quoted message was created or when the
264
+ // quoted message was last updated.
265
+ google.protobuf.Timestamp last_update_time = 2
266
+ [(google.api.field_behavior) = OUTPUT_ONLY];
267
+ }
268
+
269
+ // A thread in a Google Chat space. For example usage, see
270
+ // [Start or reply to a message
271
+ // thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread).
272
+ //
273
+ // If you specify a thread when creating a message, you can set the
274
+ // [`messageReplyOption`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption)
275
+ // field to determine what happens if no matching thread is found.
276
+ message Thread {
277
+ option (google.api.resource) = {
278
+ type: "chat.googleapis.com/Thread"
279
+ pattern: "spaces/{space}/threads/{thread}"
280
+ };
281
+
282
+ // Output only. Resource name of the thread.
283
+ //
284
+ // Example: `spaces/{space}/threads/{thread}`
285
+ string name = 1;
286
+
287
+ // Optional. Input for creating or updating a thread. Otherwise, output only.
288
+ // ID for the thread. Supports up to 4000 characters.
289
+ //
290
+ // This ID is unique to the Chat app that sets it. For example, if
291
+ // multiple Chat apps create a message using the same thread key,
292
+ // the messages are posted in different threads. To reply in a
293
+ // thread created by a person or another Chat app, specify the thread `name`
294
+ // field instead.
295
+ string thread_key = 3 [(google.api.field_behavior) = OPTIONAL];
296
+ }
297
+
298
+ // Parameters that a Chat app can use to configure how its response is posted.
299
+ message ActionResponse {
300
+ // The type of Chat app response.
301
+ enum ResponseType {
302
+ // Default type that's handled as `NEW_MESSAGE`.
303
+ TYPE_UNSPECIFIED = 0;
304
+
305
+ // Post as a new message in the topic.
306
+ NEW_MESSAGE = 1;
307
+
308
+ // Update the Chat app's message. This is only permitted on a `CARD_CLICKED`
309
+ // event where the message sender type is `BOT`.
310
+ UPDATE_MESSAGE = 2;
311
+
312
+ // Update the cards on a user's message. This is only permitted as a
313
+ // response to a `MESSAGE` event with a matched url, or a `CARD_CLICKED`
314
+ // event where the message sender type is `HUMAN`. Text is ignored.
315
+ UPDATE_USER_MESSAGE_CARDS = 6;
316
+
317
+ // Privately ask the user for additional authentication or configuration.
318
+ REQUEST_CONFIG = 3;
319
+
320
+ // Presents a
321
+ // [dialog](https://developers.google.com/chat/how-tos/dialogs).
322
+ DIALOG = 4;
323
+
324
+ // Widget text autocomplete options query.
325
+ UPDATE_WIDGET = 7;
326
+ }
327
+
328
+ // List of widget autocomplete results.
329
+ message SelectionItems {
330
+ // An array of the SelectionItem objects.
331
+ repeated google.apps.card.v1.SelectionInput.SelectionItem items = 1;
332
+ }
333
+
334
+ // The response of the updated widget.
335
+ // Used to provide autocomplete options for a widget.
336
+ message UpdatedWidget {
337
+ oneof updated_widget {
338
+ // List of widget autocomplete results
339
+ SelectionItems suggestions = 1;
340
+ }
341
+
342
+ // The ID of the updated widget. The ID must match the one for the
343
+ // widget that triggered the update request.
344
+ string widget = 2;
345
+ }
346
+
347
+ // Input only. The type of Chat app response.
348
+ ResponseType type = 1 [(google.api.field_behavior) = INPUT_ONLY];
349
+
350
+ // Input only. URL for users to authenticate or configure. (Only for
351
+ // `REQUEST_CONFIG` response types.)
352
+ string url = 2 [(google.api.field_behavior) = INPUT_ONLY];
353
+
354
+ // Input only. A response to an interaction event related to a
355
+ // [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be
356
+ // accompanied by `ResponseType.Dialog`.
357
+ DialogAction dialog_action = 3 [(google.api.field_behavior) = INPUT_ONLY];
358
+
359
+ // Input only. The response of the updated widget.
360
+ UpdatedWidget updated_widget = 4 [(google.api.field_behavior) = INPUT_ONLY];
361
+ }
362
+
363
+ message GetMessageRequest {
364
+ // Required. Resource name of the message.
365
+ //
366
+ // Format: `spaces/{space}/messages/{message}`
367
+ //
368
+ // If you've set a custom ID for your message, you can use the value from the
369
+ // `clientAssignedMessageId` field for `{message}`. For details, see [Name a
370
+ // message]
371
+ // (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message).
372
+ string name = 1 [
373
+ (google.api.field_behavior) = REQUIRED,
374
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Message" }
375
+ ];
376
+ }
377
+
378
+ message DeleteMessageRequest {
379
+ // Required. Resource name of the message.
380
+ //
381
+ // Format: `spaces/{space}/messages/{message}`
382
+ //
383
+ // If you've set a custom ID for your message, you can use the value from the
384
+ // `clientAssignedMessageId` field for `{message}`. For details, see [Name a
385
+ // message]
386
+ // (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message).
387
+ string name = 1 [
388
+ (google.api.field_behavior) = REQUIRED,
389
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Message" }
390
+ ];
391
+
392
+ // When `true`, deleting a message also deletes its threaded replies. When
393
+ // `false`, if a message has threaded replies, deletion fails.
394
+ //
395
+ // Only applies when [authenticating as a
396
+ // user](https://developers.google.com/chat/api/guides/auth/users). Has no
397
+ // effect when [authenticating as a Chat app]
398
+ // (https://developers.google.com/chat/api/guides/auth/service-accounts).
399
+ bool force = 2;
400
+ }
401
+
402
+ message UpdateMessageRequest {
403
+ // Required. Message with fields updated.
404
+ Message message = 1 [(google.api.field_behavior) = REQUIRED];
405
+
406
+ // Required. The field paths to update. Separate multiple values with commas
407
+ // or use `*` to update all field paths.
408
+ //
409
+ // Currently supported field paths:
410
+ //
411
+ // - `text`
412
+ //
413
+ // - `attachment`
414
+ //
415
+ // - `cards` (Requires [app
416
+ // authentication](/chat/api/guides/auth/service-accounts).)
417
+ //
418
+ // - `cards_v2` (Requires [app
419
+ // authentication](/chat/api/guides/auth/service-accounts).)
420
+ //
421
+ // - Developer Preview: `accessory_widgets` (Requires [app
422
+ // authentication](/chat/api/guides/auth/service-accounts).)
423
+ google.protobuf.FieldMask update_mask = 2;
424
+
425
+ // Optional. If `true` and the message isn't found, a new message is created
426
+ // and `updateMask` is ignored. The specified message ID must be
427
+ // [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message)
428
+ // or the request fails.
429
+ bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL];
430
+ }
431
+
432
+ // Creates a message.
433
+ message CreateMessageRequest {
434
+ // Specifies how to reply to a message.
435
+ // More states might be added in the future.
436
+ enum MessageReplyOption {
437
+ // Default. Starts a new thread. Using this option ignores any [thread
438
+ // ID][google.chat.v1.Thread.name] or
439
+ // [`thread_key`][google.chat.v1.Thread.thread_key] that's included.
440
+ MESSAGE_REPLY_OPTION_UNSPECIFIED = 0;
441
+
442
+ // Creates the message as a reply to the thread specified by [thread
443
+ // ID][google.chat.v1.Thread.name] or
444
+ // [`thread_key`][google.chat.v1.Thread.thread_key]. If it fails, the
445
+ // message starts a new thread instead.
446
+ REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1;
447
+
448
+ // Creates the message as a reply to the thread specified by [thread
449
+ // ID][google.chat.v1.Thread.name] or
450
+ // [`thread_key`][google.chat.v1.Thread.thread_key]. If a new `thread_key`
451
+ // is used, a new thread is created. If the message creation fails, a
452
+ // `NOT_FOUND` error is returned instead.
453
+ REPLY_MESSAGE_OR_FAIL = 2;
454
+ }
455
+
456
+ // Required. The resource name of the space in which to create a message.
457
+ //
458
+ // Format: `spaces/{space}`
459
+ string parent = 1 [
460
+ (google.api.field_behavior) = REQUIRED,
461
+ (google.api.resource_reference) = {
462
+ child_type: "chat.googleapis.com/Message"
463
+ }
464
+ ];
465
+
466
+ // Required. Message body.
467
+ Message message = 4 [(google.api.field_behavior) = REQUIRED];
468
+
469
+ // Optional. Deprecated: Use
470
+ // [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the
471
+ // thread. Supports up to 4000 characters. To start or add to a thread, create
472
+ // a message and specify a `threadKey` or the
473
+ // [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or
474
+ // reply to a message
475
+ // thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread).
476
+ string thread_key = 6
477
+ [deprecated = true, (google.api.field_behavior) = OPTIONAL];
478
+
479
+ // Optional. A unique request ID for this message. Specifying an existing
480
+ // request ID returns the message created with that ID instead of creating a
481
+ // new message.
482
+ string request_id = 7 [(google.api.field_behavior) = OPTIONAL];
483
+
484
+ // Optional. Specifies whether a message starts a thread or replies to one.
485
+ // Only supported in named spaces.
486
+ MessageReplyOption message_reply_option = 8
487
+ [(google.api.field_behavior) = OPTIONAL];
488
+
489
+ // Optional. A custom ID for a message. Lets Chat apps get, update, or delete
490
+ // a message without needing to store the system-assigned ID in the message's
491
+ // resource name (represented in the message `name` field).
492
+ //
493
+ // The value for this field must meet the following requirements:
494
+ //
495
+ // * Begins with `client-`. For example, `client-custom-name` is a valid
496
+ // custom ID, but `custom-name` is not.
497
+ // * Contains up to 63 characters and only lowercase letters, numbers, and
498
+ // hyphens.
499
+ // * Is unique within a space. A Chat app can't use the same custom ID for
500
+ // different messages.
501
+ //
502
+ // For details, see [Name a
503
+ // message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message).
504
+ string message_id = 9 [(google.api.field_behavior) = OPTIONAL];
505
+ }
506
+
507
+ // Lists messages in the specified space, that the user is a member of.
508
+ message ListMessagesRequest {
509
+ // Required. The resource name of the space to list messages from.
510
+ //
511
+ // Format: `spaces/{space}`
512
+ string parent = 1 [
513
+ (google.api.field_behavior) = REQUIRED,
514
+ (google.api.resource_reference) = {
515
+ child_type: "chat.googleapis.com/Message"
516
+ }
517
+ ];
518
+
519
+ // The maximum number of messages returned. The service might return fewer
520
+ // messages than this value.
521
+ //
522
+ // If unspecified, at most 25 are returned.
523
+ //
524
+ // The maximum value is 1,000. If you use a value more than 1,000, it's
525
+ // automatically changed to 1,000.
526
+ //
527
+ // Negative values return an `INVALID_ARGUMENT` error.
528
+ int32 page_size = 2;
529
+
530
+ // Optional, if resuming from a previous query.
531
+ //
532
+ // A page token received from a previous list messages call. Provide this
533
+ // parameter to retrieve the subsequent page.
534
+ //
535
+ // When paginating, all other parameters provided should match the call that
536
+ // provided the page token. Passing different values to the other parameters
537
+ // might lead to unexpected results.
538
+ string page_token = 3;
539
+
540
+ // A query filter.
541
+ //
542
+ // You can filter messages by date (`create_time`) and thread (`thread.name`).
543
+ //
544
+ // To filter messages by the date they were created, specify the `create_time`
545
+ // with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339)
546
+ // format and double quotation marks. For example,
547
+ // `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to
548
+ // list messages that were created after a timestamp, or the less than
549
+ // operator `<` to list messages that were created before a timestamp. To
550
+ // filter messages within a time interval, use the `AND` operator between two
551
+ // timestamps.
552
+ //
553
+ // To filter by thread, specify the `thread.name`, formatted as
554
+ // `spaces/{space}/threads/{thread}`. You can only specify one
555
+ // `thread.name` per query.
556
+ //
557
+ // To filter by both thread and date, use the `AND` operator in your query.
558
+ //
559
+ // For example, the following queries are valid:
560
+ //
561
+ // ```
562
+ // create_time > "2012-04-21T11:30:00-04:00"
563
+ //
564
+ // create_time > "2012-04-21T11:30:00-04:00" AND
565
+ // thread.name = spaces/AAAAAAAAAAA/threads/123
566
+ //
567
+ // create_time > "2012-04-21T11:30:00+00:00" AND
568
+ //
569
+ // create_time < "2013-01-01T00:00:00+00:00" AND
570
+ // thread.name = spaces/AAAAAAAAAAA/threads/123
571
+ //
572
+ // thread.name = spaces/AAAAAAAAAAA/threads/123
573
+ // ```
574
+ //
575
+ // Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
576
+ // error.
577
+ string filter = 4;
578
+
579
+ // Optional, if resuming from a previous query.
580
+ //
581
+ // How the list of messages is ordered. Specify a value to order by an
582
+ // ordering operation. Valid ordering operation values are as follows:
583
+ //
584
+ // - `ASC` for ascending.
585
+ //
586
+ // - `DESC` for descending.
587
+ //
588
+ // The default ordering is `create_time ASC`.
589
+ string order_by = 5;
590
+
591
+ // Whether to include deleted messages. Deleted messages include deleted time
592
+ // and metadata about their deletion, but message content is unavailable.
593
+ bool show_deleted = 6;
594
+ }
595
+
596
+ message ListMessagesResponse {
597
+ // List of messages.
598
+ repeated Message messages = 1;
599
+
600
+ // You can send a token as `pageToken` to retrieve the next page of
601
+ // results. If empty, there are no subsequent pages.
602
+ string next_page_token = 2;
603
+ }
604
+
605
+ // Contains a
606
+ // [dialog](https://developers.google.com/chat/how-tos/dialogs) and request
607
+ // status code.
608
+ message DialogAction {
609
+ oneof action {
610
+ // Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs)
611
+ // for the request.
612
+ Dialog dialog = 1 [(google.api.field_behavior) = INPUT_ONLY];
613
+ }
614
+
615
+ // Input only. Status for a request to either invoke or submit a
616
+ // [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays
617
+ // a status and message to users, if necessary.
618
+ // For example, in case of an error or success.
619
+ ActionStatus action_status = 2 [(google.api.field_behavior) = INPUT_ONLY];
620
+ }
621
+
622
+ // Wrapper around the card body of the dialog.
623
+ message Dialog {
624
+ // Input only. Body of the dialog, which is rendered in a modal.
625
+ // Google Chat apps don't support the following card entities:
626
+ // `DateTimePicker`, `OnChangeAction`.
627
+ google.apps.card.v1.Card body = 1 [(google.api.field_behavior) = INPUT_ONLY];
628
+ }
629
+
630
+ // A [card](https://developers.google.com/chat/api/reference/rest/v1/cards) in a
631
+ // Google Chat message.
632
+ //
633
+ // Only Chat apps can create cards. If your Chat app [authenticates as a
634
+ // user](https://developers.google.com/chat/api/guides/auth/users), the message
635
+ // can't contain cards.
636
+ //
637
+ // [Card builder](https://addons.gsuite.google.com/uikit/builder)
638
+ message CardWithId {
639
+ // Required if the message contains multiple cards. A unique identifier for
640
+ // a card in a message.
641
+ string card_id = 1;
642
+
643
+ // A card. Maximum size is 32 KB.
644
+ google.apps.card.v1.Card card = 2;
645
+ }