Show / Hide Table of Contents

Class Message

A message in a Google Chat space.

Inheritance
object
Message
Implements
IMessage<Message>
IEquatable<Message>
IDeepCloneable<Message>
IBufferMessage
IMessage
Inherited Members
object.GetHashCode()
object.GetType()
object.ToString()
Namespace: Google.Apps.Chat.V1
Assembly: Google.Apps.Chat.V1.dll
Syntax
public sealed class Message : IMessage<Message>, IEquatable<Message>, IDeepCloneable<Message>, IBufferMessage, IMessage

Constructors

Message()

Declaration
public Message()

Message(Message)

Declaration
public Message(Message other)
Parameters
Type Name Description
Message other

Properties

AccessoryWidgets

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).

Declaration
public RepeatedField<AccessoryWidget> AccessoryWidgets { get; }
Property Value
Type Description
RepeatedField<AccessoryWidget>

ActionResponse

Input only. Parameters that a Chat app can use to configure how its response is posted.

Declaration
public ActionResponse ActionResponse { get; set; }
Property Value
Type Description
ActionResponse

Annotations

Output only. Annotations associated with the text in this message.

Declaration
public RepeatedField<Annotation> Annotations { get; }
Property Value
Type Description
RepeatedField<Annotation>

ArgumentText

Output only. Plain-text body of the message with all Chat app mentions stripped out.

Declaration
public string ArgumentText { get; set; }
Property Value
Type Description
string

AttachedGifs

Output only. GIF images that are attached to the message.

Declaration
public RepeatedField<AttachedGif> AttachedGifs { get; }
Property Value
Type Description
RepeatedField<AttachedGif>

Attachment

Optional. User-uploaded attachment.

Declaration
public RepeatedField<Attachment> Attachment { get; }
Property Value
Type Description
RepeatedField<Attachment>

Cards

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.

Declaration
[Obsolete]
public RepeatedField<ContextualAddOnMarkup.Types.Card> Cards { get; }
Property Value
Type Description
RepeatedField<ContextualAddOnMarkup.Types.Card>

CardsV2

Optional. An array of cards.

Only Chat apps can create cards. If your Chat app authenticates as a user, the messages can't contain cards.

To learn how to create a message that contains cards, see Send a message.

Card builder

Declaration
public RepeatedField<CardWithId> CardsV2 { get; }
Property Value
Type Description
RepeatedField<CardWithId>

ClientAssignedMessageId

Optional. 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.

Declaration
public string ClientAssignedMessageId { get; set; }
Property Value
Type Description
string

CreateTime

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.

Declaration
public Timestamp CreateTime { get; set; }
Property Value
Type Description
Timestamp

DeleteTime

Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty.

Declaration
public Timestamp DeleteTime { get; set; }
Property Value
Type Description
Timestamp

DeletionMetadata

Output only. Information about a deleted message. A message is deleted when delete_time is set.

Declaration
public DeletionMetadata DeletionMetadata { get; set; }
Property Value
Type Description
DeletionMetadata

EmojiReactionSummaries

Output only. The list of emoji reaction summaries on the message.

Declaration
public RepeatedField<EmojiReactionSummary> EmojiReactionSummaries { get; }
Property Value
Type Description
RepeatedField<EmojiReactionSummary>

FallbackText

Optional. A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications.

Declaration
public string FallbackText { get; set; }
Property Value
Type Description
string

FormattedText

Output 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, and bulleted list.

  • 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 as U+1F600 for a grinning face emoji.

For more information, see View text formatting sent in a message

Declaration
public string FormattedText { get; set; }
Property Value
Type Description
string

LastUpdateTime

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.

Declaration
public Timestamp LastUpdateTime { get; set; }
Property Value
Type Description
Timestamp

MatchedUrl

Output only. A URL in spaces.messages.text that matches a link preview pattern. For more information, see Preview links.

Declaration
public MatchedUrl MatchedUrl { get; set; }
Property Value
Type Description
MatchedUrl

MessageName

MessageName-typed view over the Name resource name property.

Declaration
public MessageName MessageName { get; set; }
Property Value
Type Description
MessageName

Name

Identifier. 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.

Declaration
public string Name { get; set; }
Property Value
Type Description
string

PrivateMessageViewer

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:

  • Attachments
  • Accessory widgets

For details, see Send a message privately.

Declaration
public User PrivateMessageViewer { get; set; }
Property Value
Type Description
User

QuotedMessageMetadata

Output only. Information about a message that's quoted by a Google Chat user in a space. Google Chat users can quote a message to reply to it.

Declaration
public QuotedMessageMetadata QuotedMessageMetadata { get; set; }
Property Value
Type Description
QuotedMessageMetadata

Sender

Output only. The user who created the message. If your Chat app authenticates as a user, the output populates the user name and type.

Declaration
public User Sender { get; set; }
Property Value
Type Description
User

SlashCommand

Output only. Slash command information, if applicable.

Declaration
public SlashCommand SlashCommand { get; set; }
Property Value
Type Description
SlashCommand

Space

Output only. If your Chat app authenticates as a user, the output only populates the space name.

Declaration
public Space Space { get; set; }
Property Value
Type Description
Space

Text

Optional. 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.

Declaration
public string Text { get; set; }
Property Value
Type Description
string

Thread

The thread the message belongs to. For example usage, see Start or reply to a message thread.

Declaration
public Thread Thread { get; set; }
Property Value
Type Description
Thread

ThreadReply

Output 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.

Declaration
public bool ThreadReply { get; set; }
Property Value
Type Description
bool
In this article
Back to top Generated by DocFX