0.31.0 (latest) 0.30.0 0.29.0 0.28.0 0.27.0 0.23.0 0.20.0 0.19.0 0.18.0 0.17.1 0.16.1 0.15.0 0.14.0 0.13.1 0.12.1 0.11.2 0.10.0 0.9.0 0.8.1 0.7.2 0.6.1 0.5.0 0.4.0 0.3.0 0.2.0 0.1.4 Reference documentation and code samples for the Google Apps Chat V1 Client class Message.

A message in a Google Chat space.

Generated from protobuf message `google.chat.v1.Message`

## Namespace

Google \\ Apps \\ Chat \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` 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](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). |
| `↳ sender` | `User` Output only. The user who created the message. If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output only populates the [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) `name` and `type` fields for both internal and external users, unless they are members of the space or have a prior affinity, like a direct message (DM) conversation, with the calling user. |
| `↳ create_time` | `Google\Protobuf\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` | `Google\Protobuf\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` | `Google\Protobuf\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` | `string` Optional. Plain-text body of the message. The first link to an image, video, or web page generates a [preview chip](https://developers.google.com/workspace/chat/preview-links). You can also [@mention a Google Chat user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), or everyone in the space. To learn about creating text messages, see [Send a message](https://developers.google.com/workspace/chat/create-messages). |
| `↳ formatted_text` | `string` 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](https://developers.google.com/workspace/chat/format-messages) for bold, italic, strikethrough, monospace, monospace block, bulleted list, and block quote. \* \* [User mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention) 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. \* \* Bullet list items using asterisks (`*`)---for example, `* item`. For more information, see [View text formatting sent in a message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message) |
| `↳ cards` | `array<ContextualAddOnMarkup\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` | `array<CardWithId>` Optional. An array of [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). Chat apps can create cards with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). As part of the [Developer Preview Program](https://developers.google.com/workspace/preview), if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-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](https://developers.google.com/workspace/chat/create-messages). [Card builder](https://addons.gsuite.google.com/uikit/builder) |
| `↳ annotations` | `array<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` | `Thread` The thread the message belongs to. For example usage, see [Start or reply to a message thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). |
| `↳ space` | `Space` Output only. If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output only populates the [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) `name`. |
| `↳ fallback_text` | `string` Optional. A plain-text description of the message's cards, used when the actual cards can't be displayed---for example, mobile notifications. |
| `↳ action_response` | `ActionResponse` Input only. Parameters that a Chat app can use to configure how its response is posted. |
| `↳ argument_text` | `string` Output only. Plain-text body of the message with all Chat app mentions stripped out. |
| `↳ slash_command` | `SlashCommand` Output only. Slash command information, if applicable. |
| `↳ attachment` | `array<Attachment>` Optional. User-uploaded attachment. |
| `↳ matched_url` | `MatchedUrl` Output only. A URL in the Chat message `text` field that matches a link preview pattern. For more information, see [Preview links](https://developers.google.com/workspace/chat/preview-links). |
| `↳ thread_reply` | `bool` 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`. |
| `↳ silent` | `bool` Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients. |
| `↳ client_assigned_message_id` | `string` 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`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) field when you create the message. For details, see [Name a message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). |
| `↳ emoji_reaction_summaries` | `array<EmojiReactionSummary>` Output only. The list of emoji reaction summaries on the message. |
| `↳ private_message_viewer` | `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](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and omit the following: \* \* [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) For details, see [Send a message privately](https://developers.google.com/workspace/chat/create-messages#private). |
| `↳ deletion_metadata` | `DeletionMetadata` Output only. Information about a deleted message. A message is deleted when `delete_time` is set. |
| `↳ quoted_message_metadata` | `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](https://developers.google.com/workspace/chat/create-messages#quote-a-message). |
| `↳ attached_gifs` | `array<AttachedGif>` Output only. GIF images that are attached to the message. |
| `↳ accessory_widgets` | `array<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](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). Creating a message with accessory widgets requires [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). |
| `↳ elements` | `Elements` Optional. Additional message components, including inline `citations` (where each citation is associated with a specific portion of the message text) and `cited_sources` (which are general references used to generate the response and are not directly linked to specific segments of the text). On input, provide `elements` when creating or updating a message. On output, both `citations` and `cited_sources` are populated when reading a message that contains them. Callers can read structured citation metadata from `elements`, while `formatted_text` also includes inline citation tags or source links depending on `markup_syntax`. These differ from `annotations`, which are output-only and offer supplementary information tied to message fragments or the entire message text. |
| `↳ markup_syntax` | `int` Optional. Specifies how the server interprets the message `text` field content. |

### getName

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](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

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](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSender

Output only. The user who created the message.

If your Chat app [authenticates as a
user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
the output only populates the
[user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User)
`name` and `type` fields for both internal and external users, unless they
are members of the space or have a prior affinity, like a direct message
(DM) conversation, with the calling user.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `User|null` |   |

### hasSender

### clearSender

### setSender

Output only. The user who created the message.

If your Chat app [authenticates as a
user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
the output only populates the
[user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User)
`name` and `type` fields for both internal and external users, unless they
are members of the space or have a prior affinity, like a direct message
(DM) conversation, with the calling user.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `User` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLastUpdateTime

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasLastUpdateTime

### clearLastUpdateTime

### setLastUpdateTime

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDeleteTime

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasDeleteTime

### clearDeleteTime

### setDeleteTime

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getText

Optional. Plain-text body of the message. The first link to an image,
video, or web page generates a [preview
chip](https://developers.google.com/workspace/chat/preview-links). You can
also [@mention a Google Chat
user](https://developers.google.com/workspace/chat/format-messages#messages-@mention),
or everyone in the space.

To learn about creating text messages, see [Send a
message](https://developers.google.com/workspace/chat/create-messages).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setText

Optional. Plain-text body of the message. The first link to an image,
video, or web page generates a [preview
chip](https://developers.google.com/workspace/chat/preview-links). You can
also [@mention a Google Chat
user](https://developers.google.com/workspace/chat/format-messages#messages-@mention),
or everyone in the space.

To learn about creating text messages, see [Send a
message](https://developers.google.com/workspace/chat/create-messages).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFormattedText

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](https://developers.google.com/workspace/chat/format-messages)
  for bold, italic, strikethrough, monospace, monospace block, bulleted
  list, and block quote.

- [User
  mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention)
  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.
- Bullet list items using asterisks (`*`)---for example, `* item`. For more information, see [View text formatting sent in a
  message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFormattedText

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](https://developers.google.com/workspace/chat/format-messages)
  for bold, italic, strikethrough, monospace, monospace block, bulleted
  list, and block quote.

- [User
  mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention)
  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.
- Bullet list items using asterisks (`*`)---for example, `* item`. For more information, see [View text formatting sent in a
  message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCards

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<ContextualAddOnMarkup\Card>` |   |

### setCards

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<ContextualAddOnMarkup\Card>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCardsV2

Optional. An array of
[cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards).

Chat apps can create cards with [app
authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
As part of the [Developer Preview
Program](https://developers.google.com/workspace/preview), if your Chat app
[authenticates as a
user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-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](https://developers.google.com/workspace/chat/create-messages).
[Card builder](https://addons.gsuite.google.com/uikit/builder)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<CardWithId>` |   |

### setCardsV2

Optional. An array of
[cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards).

Chat apps can create cards with [app
authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
As part of the [Developer Preview
Program](https://developers.google.com/workspace/preview), if your Chat app
[authenticates as a
user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-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](https://developers.google.com/workspace/chat/create-messages).
[Card builder](https://addons.gsuite.google.com/uikit/builder)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<CardWithId>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAnnotations

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<Annotation>` |   |

### setAnnotations

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<Annotation>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getThread

The thread the message belongs to. For example usage, see
[Start or reply to a message
thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Thread|null` |   |

### hasThread

### clearThread

### setThread

The thread the message belongs to. For example usage, see
[Start or reply to a message
thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Thread` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSpace

Output only. If your Chat app [authenticates as a
user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
the output only populates the
[space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces)
`name`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Space|null` |   |

### hasSpace

### clearSpace

### setSpace

Output only. If your Chat app [authenticates as a
user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
the output only populates the
[space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces)
`name`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Space` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFallbackText

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFallbackText

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getActionResponse

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ActionResponse|null` |   |

### hasActionResponse

### clearActionResponse

### setActionResponse

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `ActionResponse` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getArgumentText

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setArgumentText

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSlashCommand

Output only. Slash command information, if applicable.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `SlashCommand|null` |   |

### hasSlashCommand

### clearSlashCommand

### setSlashCommand

Output only. Slash command information, if applicable.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `SlashCommand` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAttachment

Optional. User-uploaded attachment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<Attachment>` |   |

### setAttachment

Optional. User-uploaded attachment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<Attachment>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMatchedUrl

Output only. A URL in the Chat message `text` field that matches a link
preview pattern. For more information, see [Preview
links](https://developers.google.com/workspace/chat/preview-links).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `MatchedUrl|null` |   |

### hasMatchedUrl

### clearMatchedUrl

### setMatchedUrl

Output only. A URL in the Chat message `text` field that matches a link
preview pattern. For more information, see [Preview
links](https://developers.google.com/workspace/chat/preview-links).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `MatchedUrl` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getThreadReply

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setThreadReply

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSilent

Output only. Whether this is a silent message. Silent messages are messages
where Chat suppresses push notifications for recipients.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setSilent

Output only. Whether this is a silent message. Silent messages are messages
where Chat suppresses push notifications for recipients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClientAssignedMessageId

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`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id)
field when you create the message. For details, see [Name a
message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setClientAssignedMessageId

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`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id)
field when you create the message. For details, see [Name a
message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEmojiReactionSummaries

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<EmojiReactionSummary>` |   |

### setEmojiReactionSummaries

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<EmojiReactionSummary>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPrivateMessageViewer

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](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
and omit the following:

- [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) For details, see [Send a message
  privately](https://developers.google.com/workspace/chat/create-messages#private).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `User|null` |   |

### hasPrivateMessageViewer

### clearPrivateMessageViewer

### setPrivateMessageViewer

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](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
and omit the following:

- [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) For details, see [Send a message
  privately](https://developers.google.com/workspace/chat/create-messages#private).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `User` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDeletionMetadata

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `DeletionMetadata|null` |   |

### hasDeletionMetadata

### clearDeletionMetadata

### setDeletionMetadata

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `DeletionMetadata` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQuotedMessageMetadata

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](https://developers.google.com/workspace/chat/create-messages#quote-a-message).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `QuotedMessageMetadata|null` |   |

### hasQuotedMessageMetadata

### clearQuotedMessageMetadata

### setQuotedMessageMetadata

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](https://developers.google.com/workspace/chat/create-messages#quote-a-message).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `QuotedMessageMetadata` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAttachedGifs

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<AttachedGif>` |   |

### setAttachedGifs

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<AttachedGif>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAccessoryWidgets

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](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets).

Creating a message with accessory widgets requires [app
authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<AccessoryWidget>` |   |

### setAccessoryWidgets

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](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets).

Creating a message with accessory widgets requires [app
authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<AccessoryWidget>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getElements

Optional. Additional message components, including inline `citations`
(where each citation is associated with a specific portion of the message
text) and `cited_sources` (which are general references used to generate
the response and are not directly linked to specific segments of the text).

On input, provide `elements` when creating or updating a message. On
output, both `citations` and `cited_sources` are populated when reading a
message that contains them. Callers can read structured citation metadata
from `elements`, while `formatted_text` also includes inline citation tags
or source links depending on `markup_syntax`.
These differ from `annotations`, which are output-only and offer
supplementary information tied to message fragments or the entire message
text.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Elements|null` |   |

### hasElements

### clearElements

### setElements

Optional. Additional message components, including inline `citations`
(where each citation is associated with a specific portion of the message
text) and `cited_sources` (which are general references used to generate
the response and are not directly linked to specific segments of the text).

On input, provide `elements` when creating or updating a message. On
output, both `citations` and `cited_sources` are populated when reading a
message that contains them. Callers can read structured citation metadata
from `elements`, while `formatted_text` also includes inline citation tags
or source links depending on `markup_syntax`.
These differ from `annotations`, which are output-only and offer
supplementary information tied to message fragments or the entire message
text.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Elements` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMarkupSyntax

Optional. Specifies how the server interprets the message `text` field
content.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [MarkupSyntax](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Chat.V1.MarkupSyntax.md.txt). |

### setMarkupSyntax

Optional. Specifies how the server interprets the message `text` field
content.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [MarkupSyntax](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Chat.V1.MarkupSyntax.md.txt). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |