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