#[non_exhaustive]pub struct Message {Show 28 fields
pub name: String,
pub sender: Option<User>,
pub create_time: Option<Timestamp>,
pub last_update_time: Option<Timestamp>,
pub delete_time: Option<Timestamp>,
pub text: String,
pub formatted_text: String,
pub cards: Vec<Card>,
pub cards_v2: Vec<CardWithId>,
pub annotations: Vec<Annotation>,
pub thread: Option<Thread>,
pub space: Option<Space>,
pub fallback_text: String,
pub action_response: Option<ActionResponse>,
pub argument_text: String,
pub slash_command: Option<SlashCommand>,
pub attachment: Vec<Attachment>,
pub matched_url: Option<MatchedUrl>,
pub thread_reply: bool,
pub silent: bool,
pub client_assigned_message_id: String,
pub emoji_reaction_summaries: Vec<EmojiReactionSummary>,
pub private_message_viewer: Option<User>,
pub deletion_metadata: Option<DeletionMetadata>,
pub quoted_message_metadata: Option<QuotedMessageMetadata>,
pub attached_gifs: Vec<AttachedGif>,
pub accessory_widgets: Vec<AccessoryWidget>,
pub markup_syntax: MarkupSyntax,
/* private fields */
}Expand description
A message in a Google Chat space.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. Resource name of the message.
Format: spaces/{space}/messages/{message}
Where {space} is the ID of the space where the message is posted and
{message} is a system-assigned ID for the message. For example,
spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB.
If you set a custom ID when you create a message, you can use this ID to
specify the message in a request by replacing {message} with the value
from the clientAssignedMessageId field. For example,
spaces/AAAAAAAAAAA/messages/client-custom-name. For details, see Name
a
message.
sender: Option<User>Output only. The user who created the message.
If your Chat app authenticates as a
user,
the output populates the
user
name and type.
create_time: Option<Timestamp>Optional. Immutable. For spaces created in Chat, the time at which the message was created. This field is output only, except when used in import mode spaces.
For import mode spaces, set this field to the historical timestamp at which the message was created in the source in order to preserve the original creation time.
last_update_time: Option<Timestamp>Output only. The time at which the message was last edited by a user. If the message has never been edited, this field is empty.
delete_time: Option<Timestamp>Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty.
text: StringOptional. Plain-text body of the message. The first link to an image, video, or web page generates a preview chip. You can also @mention a Google Chat user, or everyone in the space.
To learn about creating text messages, see Send a message.
formatted_text: StringOutput only. Contains the message text with markups added to communicate
formatting. This field might not capture all formatting visible in the UI,
but includes the following:
-
Markup syntax for bold, italic, strikethrough, monospace, monospace block, bulleted list, and block quote.
-
User mentions using the format
<users/{user}>. -
Custom hyperlinks using the format
<{url}|{rendered_text}>where the first string is the URL and the second is the rendered text—for example,<<http://example.com>|custom text>. -
Custom emoji using the format
:{emoji_name}:—for example,:smile:. This doesn’t apply to Unicode emoji, such asU+1F600for a grinning face emoji. -
Bullet list items using asterisks (
*)—for example,* item.
For more information, see View text formatting sent in a message
cards: Vec<Card>Deprecated: Use cards_v2 instead.
Rich, formatted, and interactive cards that you can use to display UI
elements such as: formatted texts, buttons, and clickable images. Cards are
normally displayed below the plain-text body of the message. cards and
cards_v2 can have a maximum size of 32 KB.
cards_v2: Vec<CardWithId>Optional. An array of cards.
Chat apps can create cards with app authentication. As part of the Developer Preview Program, if your Chat app authenticates as a user, it can create card messages. If your Chat app is not part of Developer Preview Program, it can’t create cards with user authentication.
To learn how to create a message that contains cards, see Send a message.
annotations: Vec<Annotation>Output only. Annotations can be associated with the plain-text body of the
message or with chips that link to Google Workspace resources like Google
Docs or Sheets with start_index and length of 0.
thread: Option<Thread>The thread the message belongs to. For example usage, see Start or reply to a message thread.
space: Option<Space>Output only. If your Chat app authenticates as a
user,
the output only populates the
space
name.
fallback_text: StringOptional. A plain-text description of the message’s cards, used when the actual cards can’t be displayed—for example, mobile notifications.
action_response: Option<ActionResponse>Input only. Parameters that a Chat app can use to configure how its response is posted.
argument_text: StringOutput only. Plain-text body of the message with all Chat app mentions stripped out.
slash_command: Option<SlashCommand>Output only. Slash command information, if applicable.
attachment: Vec<Attachment>Optional. User-uploaded attachment.
matched_url: Option<MatchedUrl>Output only. A URL in the Chat message text field that matches a link
preview pattern. For more information, see Preview
links.
thread_reply: boolOutput only. When true, the message is a response in a reply thread. When
false, the message is visible in the space’s top-level conversation as
either the first message of a thread or a message with no threaded replies.
If the space doesn’t support reply in threads, this field is always
false.
silent: boolOutput only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.
client_assigned_message_id: StringOptional. A custom ID for the message. You can use field to identify a
message, or to get, delete, or update a message. To set a custom ID,
specify the
messageId
field when you create the message. For details, see Name a
message.
emoji_reaction_summaries: Vec<EmojiReactionSummary>Output only. The list of emoji reaction summaries on the message.
private_message_viewer: Option<User>Optional. Immutable. Input for creating a message, otherwise output only. The user that can view the message. When set, the message is private and only visible to the specified user and the Chat app. To include this field in your request, you must call the Chat API using app authentication and omit the following:
For details, see Send a message privately.
deletion_metadata: Option<DeletionMetadata>Output only. Information about a deleted message. A message is deleted when
delete_time is set.
quoted_message_metadata: Option<QuotedMessageMetadata>Optional. Information about a message that another message quotes.
When you create a message, you can quote messages within the same thread, or quote a root message to create a new root message. However, you can’t quote a message reply from a different thread.
When you update a message, you can’t add or replace the
quotedMessageMetadata field, but you can remove it.
For example usage, see Quote another message.
attached_gifs: Vec<AttachedGif>Output only. GIF images that are attached to the message.
accessory_widgets: Vec<AccessoryWidget>Optional. One or more interactive widgets that appear at the bottom of a message. You can add accessory widgets to messages that contain text, cards, or both text and cards. Not supported for messages that contain dialogs. For details, see Add interactive widgets at the bottom of a message.
Creating a message with accessory widgets requires [app authentication] (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
markup_syntax: MarkupSyntaxOptional. Specifies how the server interprets the message text field
content.
Implementations§
Source§impl Message
impl Message
Sourcepub fn set_sender<T>(self, v: T) -> Self
pub fn set_sender<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_sender<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_sender<T>(self, v: Option<T>) -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = Message::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = Message::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Message::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_last_update_time<T>(self, v: T) -> Self
pub fn set_last_update_time<T>(self, v: T) -> Self
Sets the value of last_update_time.
§Example
use wkt::Timestamp;
let x = Message::new().set_last_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_last_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_last_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of last_update_time.
§Example
use wkt::Timestamp;
let x = Message::new().set_or_clear_last_update_time(Some(Timestamp::default()/* use setters */));
let x = Message::new().set_or_clear_last_update_time(None::<Timestamp>);Sourcepub fn set_delete_time<T>(self, v: T) -> Self
pub fn set_delete_time<T>(self, v: T) -> Self
Sets the value of delete_time.
§Example
use wkt::Timestamp;
let x = Message::new().set_delete_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_delete_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_delete_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of delete_time.
§Example
use wkt::Timestamp;
let x = Message::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
let x = Message::new().set_or_clear_delete_time(None::<Timestamp>);Sourcepub fn set_formatted_text<T: Into<String>>(self, v: T) -> Self
pub fn set_formatted_text<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_cards_v2<T, V>(self, v: T) -> Self
pub fn set_cards_v2<T, V>(self, v: T) -> Self
Sourcepub fn set_annotations<T, V>(self, v: T) -> Self
pub fn set_annotations<T, V>(self, v: T) -> Self
Sets the value of annotations.
§Example
use google_chat_v1::model::Annotation;
let x = Message::new()
.set_annotations([
Annotation::default()/* use setters */,
Annotation::default()/* use (different) setters */,
]);Sourcepub fn set_thread<T>(self, v: T) -> Self
pub fn set_thread<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_thread<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_thread<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_space<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_space<T>(self, v: Option<T>) -> Self
Sourcepub fn set_fallback_text<T: Into<String>>(self, v: T) -> Self
pub fn set_fallback_text<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_action_response<T>(self, v: T) -> Selfwhere
T: Into<ActionResponse>,
pub fn set_action_response<T>(self, v: T) -> Selfwhere
T: Into<ActionResponse>,
Sets the value of action_response.
§Example
use google_chat_v1::model::ActionResponse;
let x = Message::new().set_action_response(ActionResponse::default()/* use setters */);Sourcepub fn set_or_clear_action_response<T>(self, v: Option<T>) -> Selfwhere
T: Into<ActionResponse>,
pub fn set_or_clear_action_response<T>(self, v: Option<T>) -> Selfwhere
T: Into<ActionResponse>,
Sets or clears the value of action_response.
§Example
use google_chat_v1::model::ActionResponse;
let x = Message::new().set_or_clear_action_response(Some(ActionResponse::default()/* use setters */));
let x = Message::new().set_or_clear_action_response(None::<ActionResponse>);Sourcepub fn set_argument_text<T: Into<String>>(self, v: T) -> Self
pub fn set_argument_text<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_slash_command<T>(self, v: T) -> Selfwhere
T: Into<SlashCommand>,
pub fn set_slash_command<T>(self, v: T) -> Selfwhere
T: Into<SlashCommand>,
Sets the value of slash_command.
§Example
use google_chat_v1::model::SlashCommand;
let x = Message::new().set_slash_command(SlashCommand::default()/* use setters */);Sourcepub fn set_or_clear_slash_command<T>(self, v: Option<T>) -> Selfwhere
T: Into<SlashCommand>,
pub fn set_or_clear_slash_command<T>(self, v: Option<T>) -> Selfwhere
T: Into<SlashCommand>,
Sets or clears the value of slash_command.
§Example
use google_chat_v1::model::SlashCommand;
let x = Message::new().set_or_clear_slash_command(Some(SlashCommand::default()/* use setters */));
let x = Message::new().set_or_clear_slash_command(None::<SlashCommand>);Sourcepub fn set_attachment<T, V>(self, v: T) -> Self
pub fn set_attachment<T, V>(self, v: T) -> Self
Sets the value of attachment.
§Example
use google_chat_v1::model::Attachment;
let x = Message::new()
.set_attachment([
Attachment::default()/* use setters */,
Attachment::default()/* use (different) setters */,
]);Sourcepub fn set_matched_url<T>(self, v: T) -> Selfwhere
T: Into<MatchedUrl>,
pub fn set_matched_url<T>(self, v: T) -> Selfwhere
T: Into<MatchedUrl>,
Sets the value of matched_url.
§Example
use google_chat_v1::model::MatchedUrl;
let x = Message::new().set_matched_url(MatchedUrl::default()/* use setters */);Sourcepub fn set_or_clear_matched_url<T>(self, v: Option<T>) -> Selfwhere
T: Into<MatchedUrl>,
pub fn set_or_clear_matched_url<T>(self, v: Option<T>) -> Selfwhere
T: Into<MatchedUrl>,
Sets or clears the value of matched_url.
§Example
use google_chat_v1::model::MatchedUrl;
let x = Message::new().set_or_clear_matched_url(Some(MatchedUrl::default()/* use setters */));
let x = Message::new().set_or_clear_matched_url(None::<MatchedUrl>);Sourcepub fn set_thread_reply<T: Into<bool>>(self, v: T) -> Self
pub fn set_thread_reply<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_silent<T: Into<bool>>(self, v: T) -> Self
pub fn set_silent<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_client_assigned_message_id<T: Into<String>>(self, v: T) -> Self
pub fn set_client_assigned_message_id<T: Into<String>>(self, v: T) -> Self
Sets the value of client_assigned_message_id.
§Example
let x = Message::new().set_client_assigned_message_id("example");Sourcepub fn set_emoji_reaction_summaries<T, V>(self, v: T) -> Self
pub fn set_emoji_reaction_summaries<T, V>(self, v: T) -> Self
Sets the value of emoji_reaction_summaries.
§Example
use google_chat_v1::model::EmojiReactionSummary;
let x = Message::new()
.set_emoji_reaction_summaries([
EmojiReactionSummary::default()/* use setters */,
EmojiReactionSummary::default()/* use (different) setters */,
]);Sourcepub fn set_private_message_viewer<T>(self, v: T) -> Self
pub fn set_private_message_viewer<T>(self, v: T) -> Self
Sets the value of private_message_viewer.
§Example
use google_chat_v1::model::User;
let x = Message::new().set_private_message_viewer(User::default()/* use setters */);Sourcepub fn set_or_clear_private_message_viewer<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_private_message_viewer<T>(self, v: Option<T>) -> Self
Sets or clears the value of private_message_viewer.
§Example
use google_chat_v1::model::User;
let x = Message::new().set_or_clear_private_message_viewer(Some(User::default()/* use setters */));
let x = Message::new().set_or_clear_private_message_viewer(None::<User>);Sourcepub fn set_deletion_metadata<T>(self, v: T) -> Selfwhere
T: Into<DeletionMetadata>,
pub fn set_deletion_metadata<T>(self, v: T) -> Selfwhere
T: Into<DeletionMetadata>,
Sets the value of deletion_metadata.
§Example
use google_chat_v1::model::DeletionMetadata;
let x = Message::new().set_deletion_metadata(DeletionMetadata::default()/* use setters */);Sourcepub fn set_or_clear_deletion_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<DeletionMetadata>,
pub fn set_or_clear_deletion_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<DeletionMetadata>,
Sets or clears the value of deletion_metadata.
§Example
use google_chat_v1::model::DeletionMetadata;
let x = Message::new().set_or_clear_deletion_metadata(Some(DeletionMetadata::default()/* use setters */));
let x = Message::new().set_or_clear_deletion_metadata(None::<DeletionMetadata>);Sourcepub fn set_quoted_message_metadata<T>(self, v: T) -> Selfwhere
T: Into<QuotedMessageMetadata>,
pub fn set_quoted_message_metadata<T>(self, v: T) -> Selfwhere
T: Into<QuotedMessageMetadata>,
Sets the value of quoted_message_metadata.
§Example
use google_chat_v1::model::QuotedMessageMetadata;
let x = Message::new().set_quoted_message_metadata(QuotedMessageMetadata::default()/* use setters */);Sourcepub fn set_or_clear_quoted_message_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<QuotedMessageMetadata>,
pub fn set_or_clear_quoted_message_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<QuotedMessageMetadata>,
Sets or clears the value of quoted_message_metadata.
§Example
use google_chat_v1::model::QuotedMessageMetadata;
let x = Message::new().set_or_clear_quoted_message_metadata(Some(QuotedMessageMetadata::default()/* use setters */));
let x = Message::new().set_or_clear_quoted_message_metadata(None::<QuotedMessageMetadata>);Sourcepub fn set_attached_gifs<T, V>(self, v: T) -> Self
pub fn set_attached_gifs<T, V>(self, v: T) -> Self
Sets the value of attached_gifs.
§Example
use google_chat_v1::model::AttachedGif;
let x = Message::new()
.set_attached_gifs([
AttachedGif::default()/* use setters */,
AttachedGif::default()/* use (different) setters */,
]);Sourcepub fn set_accessory_widgets<T, V>(self, v: T) -> Self
pub fn set_accessory_widgets<T, V>(self, v: T) -> Self
Sets the value of accessory_widgets.
§Example
use google_chat_v1::model::AccessoryWidget;
let x = Message::new()
.set_accessory_widgets([
AccessoryWidget::default()/* use setters */,
AccessoryWidget::default()/* use (different) setters */,
]);Sourcepub fn set_markup_syntax<T: Into<MarkupSyntax>>(self, v: T) -> Self
pub fn set_markup_syntax<T: Into<MarkupSyntax>>(self, v: T) -> Self
Sets the value of markup_syntax.
§Example
use google_chat_v1::model::MarkupSyntax;
let x0 = Message::new().set_markup_syntax(MarkupSyntax::Chat);
let x1 = Message::new().set_markup_syntax(MarkupSyntax::Markdown);