Class Message
A message in a Google Chat space.
Implements
Inherited Members
Namespace: Google.Apis.HangoutsChat.v1.Data
Assembly: Google.Apis.HangoutsChat.v1.dll
Syntax
public class Message : IDirectResponseSchema
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
[JsonProperty("accessoryWidgets")]
public virtual IList<AccessoryWidget> AccessoryWidgets { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<AccessoryWidget> |
ActionResponse
Input only. Parameters that a Chat app can use to configure how its response is posted.
Declaration
[JsonProperty("actionResponse")]
public virtual ActionResponse ActionResponse { get; set; }
Property Value
| Type | Description |
|---|---|
| ActionResponse |
Annotations
Output only. Annotations associated with the text in this message.
Declaration
[JsonProperty("annotations")]
public virtual IList<Annotation> Annotations { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<Annotation> |
ArgumentText
Output only. Plain-text body of the message with all Chat app mentions stripped out.
Declaration
[JsonProperty("argumentText")]
public virtual string ArgumentText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
AttachedGifs
Output only. GIF images that are attached to the message.
Declaration
[JsonProperty("attachedGifs")]
public virtual IList<AttachedGif> AttachedGifs { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<AttachedGif> |
Attachment
Optional. User-uploaded attachment.
Declaration
[JsonProperty("attachment")]
public virtual IList<Attachment> Attachment { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<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
[JsonProperty("cards")]
public virtual IList<Card> Cards { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<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
[JsonProperty("cardsV2")]
public virtual IList<CardWithId> CardsV2 { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<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
[JsonProperty("clientAssignedMessageId")]
public virtual string ClientAssignedMessageId { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
CreateTime
object representation of CreateTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use CreateTimeDateTimeOffset instead.")]
public virtual object CreateTime { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
CreateTimeDateTimeOffset
DateTimeOffset representation of CreateTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? CreateTimeDateTimeOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset? |
CreateTimeRaw
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
[JsonProperty("createTime")]
public virtual string CreateTimeRaw { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DeleteTime
object representation of DeleteTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use DeleteTimeDateTimeOffset instead.")]
public virtual object DeleteTime { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
DeleteTimeDateTimeOffset
DateTimeOffset representation of DeleteTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? DeleteTimeDateTimeOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset? |
DeleteTimeRaw
Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty.
Declaration
[JsonProperty("deleteTime")]
public virtual string DeleteTimeRaw { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DeletionMetadata
Output only. Information about a deleted message. A message is deleted when delete_time is set.
Declaration
[JsonProperty("deletionMetadata")]
public virtual DeletionMetadata DeletionMetadata { get; set; }
Property Value
| Type | Description |
|---|---|
| DeletionMetadata |
ETag
The ETag of the item.
Declaration
public virtual string ETag { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
EmojiReactionSummaries
Output only. The list of emoji reaction summaries on the message.
Declaration
[JsonProperty("emojiReactionSummaries")]
public virtual IList<EmojiReactionSummary> EmojiReactionSummaries { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<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
[JsonProperty("fallbackText")]
public virtual 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
. * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the first string is the URL and the second is the rendered text—for example, . * 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
[JsonProperty("formattedText")]
public virtual string FormattedText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
LastUpdateTime
object representation of LastUpdateTimeRaw.
Declaration
[JsonIgnore]
[Obsolete("This property is obsolete and may behave unexpectedly; please use LastUpdateTimeDateTimeOffset instead.")]
public virtual object LastUpdateTime { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
LastUpdateTimeDateTimeOffset
DateTimeOffset representation of LastUpdateTimeRaw.
Declaration
[JsonIgnore]
public virtual DateTimeOffset? LastUpdateTimeDateTimeOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset? |
LastUpdateTimeRaw
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
[JsonProperty("lastUpdateTime")]
public virtual string LastUpdateTimeRaw { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
MatchedUrl
Output only. A URL in spaces.messages.text that matches a link preview pattern. For more information, see
Preview links.
Declaration
[JsonProperty("matchedUrl")]
public virtual MatchedUrl MatchedUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| MatchedUrl |
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
[JsonProperty("name")]
public virtual 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
[JsonProperty("privateMessageViewer")]
public virtual 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
[JsonProperty("quotedMessageMetadata")]
public virtual 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
[JsonProperty("sender")]
public virtual User Sender { get; set; }
Property Value
| Type | Description |
|---|---|
| User |
SlashCommand
Output only. Slash command information, if applicable.
Declaration
[JsonProperty("slashCommand")]
public virtual 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
[JsonProperty("space")]
public virtual 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
[JsonProperty("text")]
public virtual 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
[JsonProperty("thread")]
public virtual 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
[JsonProperty("threadReply")]
public virtual bool? ThreadReply { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |