Class Message.Builder (0.13.0)

public static final class Message.Builder extends GeneratedMessageV3.Builder<Message.Builder> implements MessageOrBuilder

A message in a Google Chat space.

Protobuf type google.chat.v1.Message

Implements

MessageOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAccessoryWidgets(AccessoryWidget value)

public Message.Builder addAccessoryWidgets(AccessoryWidget value)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
value AccessoryWidget
Returns
Type Description
Message.Builder

addAccessoryWidgets(AccessoryWidget.Builder builderForValue)

public Message.Builder addAccessoryWidgets(AccessoryWidget.Builder builderForValue)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
builderForValue AccessoryWidget.Builder
Returns
Type Description
Message.Builder

addAccessoryWidgets(int index, AccessoryWidget value)

public Message.Builder addAccessoryWidgets(int index, AccessoryWidget value)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameters
Name Description
index int
value AccessoryWidget
Returns
Type Description
Message.Builder

addAccessoryWidgets(int index, AccessoryWidget.Builder builderForValue)

public Message.Builder addAccessoryWidgets(int index, AccessoryWidget.Builder builderForValue)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameters
Name Description
index int
builderForValue AccessoryWidget.Builder
Returns
Type Description
Message.Builder

addAccessoryWidgetsBuilder()

public AccessoryWidget.Builder addAccessoryWidgetsBuilder()

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Returns
Type Description
AccessoryWidget.Builder

addAccessoryWidgetsBuilder(int index)

public AccessoryWidget.Builder addAccessoryWidgetsBuilder(int index)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
index int
Returns
Type Description
AccessoryWidget.Builder

addAllAccessoryWidgets(Iterable<? extends AccessoryWidget> values)

public Message.Builder addAllAccessoryWidgets(Iterable<? extends AccessoryWidget> values)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
values Iterable<? extends com.google.chat.v1.AccessoryWidget>
Returns
Type Description
Message.Builder

addAllAnnotations(Iterable<? extends Annotation> values)

public Message.Builder addAllAnnotations(Iterable<? extends Annotation> values)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.chat.v1.Annotation>
Returns
Type Description
Message.Builder

addAllAttachedGifs(Iterable<? extends AttachedGif> values)

public Message.Builder addAllAttachedGifs(Iterable<? extends AttachedGif> values)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.chat.v1.AttachedGif>
Returns
Type Description
Message.Builder

addAllAttachment(Iterable<? extends Attachment> values)

public Message.Builder addAllAttachment(Iterable<? extends Attachment> values)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
values Iterable<? extends com.google.chat.v1.Attachment>
Returns
Type Description
Message.Builder

addAllCards(Iterable<? extends ContextualAddOnMarkup.Card> values) (deprecated)

public Message.Builder addAllCards(Iterable<? extends ContextualAddOnMarkup.Card> values)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
values Iterable<? extends com.google.chat.v1.ContextualAddOnMarkup.Card>
Returns
Type Description
Message.Builder

addAllCardsV2(Iterable<? extends CardWithId> values)

public Message.Builder addAllCardsV2(Iterable<? extends CardWithId> values)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
values Iterable<? extends com.google.chat.v1.CardWithId>
Returns
Type Description
Message.Builder

addAllEmojiReactionSummaries(Iterable<? extends EmojiReactionSummary> values)

public Message.Builder addAllEmojiReactionSummaries(Iterable<? extends EmojiReactionSummary> values)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.chat.v1.EmojiReactionSummary>
Returns
Type Description
Message.Builder

addAnnotations(Annotation value)

public Message.Builder addAnnotations(Annotation value)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Annotation
Returns
Type Description
Message.Builder

addAnnotations(Annotation.Builder builderForValue)

public Message.Builder addAnnotations(Annotation.Builder builderForValue)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Annotation.Builder
Returns
Type Description
Message.Builder

addAnnotations(int index, Annotation value)

public Message.Builder addAnnotations(int index, Annotation value)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value Annotation
Returns
Type Description
Message.Builder

addAnnotations(int index, Annotation.Builder builderForValue)

public Message.Builder addAnnotations(int index, Annotation.Builder builderForValue)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue Annotation.Builder
Returns
Type Description
Message.Builder

addAnnotationsBuilder()

public Annotation.Builder addAnnotationsBuilder()

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Annotation.Builder

addAnnotationsBuilder(int index)

public Annotation.Builder addAnnotationsBuilder(int index)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Annotation.Builder

addAttachedGifs(AttachedGif value)

public Message.Builder addAttachedGifs(AttachedGif value)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value AttachedGif
Returns
Type Description
Message.Builder

addAttachedGifs(AttachedGif.Builder builderForValue)

public Message.Builder addAttachedGifs(AttachedGif.Builder builderForValue)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue AttachedGif.Builder
Returns
Type Description
Message.Builder

addAttachedGifs(int index, AttachedGif value)

public Message.Builder addAttachedGifs(int index, AttachedGif value)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value AttachedGif
Returns
Type Description
Message.Builder

addAttachedGifs(int index, AttachedGif.Builder builderForValue)

public Message.Builder addAttachedGifs(int index, AttachedGif.Builder builderForValue)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue AttachedGif.Builder
Returns
Type Description
Message.Builder

addAttachedGifsBuilder()

public AttachedGif.Builder addAttachedGifsBuilder()

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
AttachedGif.Builder

addAttachedGifsBuilder(int index)

public AttachedGif.Builder addAttachedGifsBuilder(int index)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
AttachedGif.Builder

addAttachment(Attachment value)

public Message.Builder addAttachment(Attachment value)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
value Attachment
Returns
Type Description
Message.Builder

addAttachment(Attachment.Builder builderForValue)

public Message.Builder addAttachment(Attachment.Builder builderForValue)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
builderForValue Attachment.Builder
Returns
Type Description
Message.Builder

addAttachment(int index, Attachment value)

public Message.Builder addAttachment(int index, Attachment value)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameters
Name Description
index int
value Attachment
Returns
Type Description
Message.Builder

addAttachment(int index, Attachment.Builder builderForValue)

public Message.Builder addAttachment(int index, Attachment.Builder builderForValue)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameters
Name Description
index int
builderForValue Attachment.Builder
Returns
Type Description
Message.Builder

addAttachmentBuilder()

public Attachment.Builder addAttachmentBuilder()

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Returns
Type Description
Attachment.Builder

addAttachmentBuilder(int index)

public Attachment.Builder addAttachmentBuilder(int index)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
index int
Returns
Type Description
Attachment.Builder

addCards(ContextualAddOnMarkup.Card value) (deprecated)

public Message.Builder addCards(ContextualAddOnMarkup.Card value)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
value ContextualAddOnMarkup.Card
Returns
Type Description
Message.Builder

addCards(ContextualAddOnMarkup.Card.Builder builderForValue) (deprecated)

public Message.Builder addCards(ContextualAddOnMarkup.Card.Builder builderForValue)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
builderForValue ContextualAddOnMarkup.Card.Builder
Returns
Type Description
Message.Builder

addCards(int index, ContextualAddOnMarkup.Card value) (deprecated)

public Message.Builder addCards(int index, ContextualAddOnMarkup.Card value)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameters
Name Description
index int
value ContextualAddOnMarkup.Card
Returns
Type Description
Message.Builder

addCards(int index, ContextualAddOnMarkup.Card.Builder builderForValue) (deprecated)

public Message.Builder addCards(int index, ContextualAddOnMarkup.Card.Builder builderForValue)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameters
Name Description
index int
builderForValue ContextualAddOnMarkup.Card.Builder
Returns
Type Description
Message.Builder

addCardsBuilder() (deprecated)

public ContextualAddOnMarkup.Card.Builder addCardsBuilder()

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Returns
Type Description
ContextualAddOnMarkup.Card.Builder

addCardsBuilder(int index) (deprecated)

public ContextualAddOnMarkup.Card.Builder addCardsBuilder(int index)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
index int
Returns
Type Description
ContextualAddOnMarkup.Card.Builder

addCardsV2(CardWithId value)

public Message.Builder addCardsV2(CardWithId value)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
value CardWithId
Returns
Type Description
Message.Builder

addCardsV2(CardWithId.Builder builderForValue)

public Message.Builder addCardsV2(CardWithId.Builder builderForValue)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
builderForValue CardWithId.Builder
Returns
Type Description
Message.Builder

addCardsV2(int index, CardWithId value)

public Message.Builder addCardsV2(int index, CardWithId value)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameters
Name Description
index int
value CardWithId
Returns
Type Description
Message.Builder

addCardsV2(int index, CardWithId.Builder builderForValue)

public Message.Builder addCardsV2(int index, CardWithId.Builder builderForValue)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameters
Name Description
index int
builderForValue CardWithId.Builder
Returns
Type Description
Message.Builder

addCardsV2Builder()

public CardWithId.Builder addCardsV2Builder()

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Returns
Type Description
CardWithId.Builder

addCardsV2Builder(int index)

public CardWithId.Builder addCardsV2Builder(int index)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
index int
Returns
Type Description
CardWithId.Builder

addEmojiReactionSummaries(EmojiReactionSummary value)

public Message.Builder addEmojiReactionSummaries(EmojiReactionSummary value)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value EmojiReactionSummary
Returns
Type Description
Message.Builder

addEmojiReactionSummaries(EmojiReactionSummary.Builder builderForValue)

public Message.Builder addEmojiReactionSummaries(EmojiReactionSummary.Builder builderForValue)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue EmojiReactionSummary.Builder
Returns
Type Description
Message.Builder

addEmojiReactionSummaries(int index, EmojiReactionSummary value)

public Message.Builder addEmojiReactionSummaries(int index, EmojiReactionSummary value)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value EmojiReactionSummary
Returns
Type Description
Message.Builder

addEmojiReactionSummaries(int index, EmojiReactionSummary.Builder builderForValue)

public Message.Builder addEmojiReactionSummaries(int index, EmojiReactionSummary.Builder builderForValue)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue EmojiReactionSummary.Builder
Returns
Type Description
Message.Builder

addEmojiReactionSummariesBuilder()

public EmojiReactionSummary.Builder addEmojiReactionSummariesBuilder()

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
EmojiReactionSummary.Builder

addEmojiReactionSummariesBuilder(int index)

public EmojiReactionSummary.Builder addEmojiReactionSummariesBuilder(int index)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
EmojiReactionSummary.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Message.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Message.Builder
Overrides

build()

public Message build()
Returns
Type Description
Message

buildPartial()

public Message buildPartial()
Returns
Type Description
Message

clear()

public Message.Builder clear()
Returns
Type Description
Message.Builder
Overrides

clearAccessoryWidgets()

public Message.Builder clearAccessoryWidgets()

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Returns
Type Description
Message.Builder

clearActionResponse()

public Message.Builder clearActionResponse()

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
Message.Builder

clearAnnotations()

public Message.Builder clearAnnotations()

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearArgumentText()

public Message.Builder clearArgumentText()

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

string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

This builder for chaining.

clearAttachedGifs()

public Message.Builder clearAttachedGifs()

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearAttachment()

public Message.Builder clearAttachment()

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Returns
Type Description
Message.Builder

clearCards() (deprecated)

public Message.Builder clearCards()

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Returns
Type Description
Message.Builder

clearCardsV2()

public Message.Builder clearCardsV2()

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Returns
Type Description
Message.Builder

clearClientAssignedMessageId()

public Message.Builder clearClientAssignedMessageId()

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.

string client_assigned_message_id = 32;

Returns
Type Description
Message.Builder

This builder for chaining.

clearCreateTime()

public Message.Builder clearCreateTime()

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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Message.Builder

clearDeleteTime()

public Message.Builder clearDeleteTime()

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearDeletionMetadata()

public Message.Builder clearDeletionMetadata()

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearEmojiReactionSummaries()

public Message.Builder clearEmojiReactionSummaries()

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearFallbackText()

public Message.Builder clearFallbackText()

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

string fallback_text = 13;

Returns
Type Description
Message.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Message.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Message.Builder
Overrides

clearFormattedText()

public Message.Builder clearFormattedText()

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, 😄. 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

string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

This builder for chaining.

clearLastUpdateTime()

public Message.Builder clearLastUpdateTime()

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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearMatchedUrl()

public Message.Builder clearMatchedUrl()

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearName()

public Message.Builder clearName()

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.

string name = 1;

Returns
Type Description
Message.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Message.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Message.Builder
Overrides

clearPrivateMessageViewer()

public Message.Builder clearPrivateMessageViewer()

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
Message.Builder

clearQuotedMessageMetadata()

public Message.Builder clearQuotedMessageMetadata()

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearSender()

public Message.Builder clearSender()

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearSlashCommand()

public Message.Builder clearSlashCommand()

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

clearSpace()

public Message.Builder clearSpace()

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

.google.chat.v1.Space space = 12;

Returns
Type Description
Message.Builder

clearText()

public Message.Builder clearText()

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 text message.

string text = 4;

Returns
Type Description
Message.Builder

This builder for chaining.

clearThread()

public Message.Builder clearThread()

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

.google.chat.v1.Thread thread = 11;

Returns
Type Description
Message.Builder

clearThreadReply()

public Message.Builder clearThreadReply()

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.

bool thread_reply = 25 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Message.Builder

This builder for chaining.

clone()

public Message.Builder clone()
Returns
Type Description
Message.Builder
Overrides

getAccessoryWidgets(int index)

public AccessoryWidget getAccessoryWidgets(int index)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
index int
Returns
Type Description
AccessoryWidget

getAccessoryWidgetsBuilder(int index)

public AccessoryWidget.Builder getAccessoryWidgetsBuilder(int index)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
index int
Returns
Type Description
AccessoryWidget.Builder

getAccessoryWidgetsBuilderList()

public List<AccessoryWidget.Builder> getAccessoryWidgetsBuilderList()

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Returns
Type Description
List<Builder>

getAccessoryWidgetsCount()

public int getAccessoryWidgetsCount()

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Returns
Type Description
int

getAccessoryWidgetsList()

public List<AccessoryWidget> getAccessoryWidgetsList()

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Returns
Type Description
List<AccessoryWidget>

getAccessoryWidgetsOrBuilder(int index)

public AccessoryWidgetOrBuilder getAccessoryWidgetsOrBuilder(int index)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
index int
Returns
Type Description
AccessoryWidgetOrBuilder

getAccessoryWidgetsOrBuilderList()

public List<? extends AccessoryWidgetOrBuilder> getAccessoryWidgetsOrBuilderList()

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Returns
Type Description
List<? extends com.google.chat.v1.AccessoryWidgetOrBuilder>

getActionResponse()

public ActionResponse getActionResponse()

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
ActionResponse

The actionResponse.

getActionResponseBuilder()

public ActionResponse.Builder getActionResponseBuilder()

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
ActionResponse.Builder

getActionResponseOrBuilder()

public ActionResponseOrBuilder getActionResponseOrBuilder()

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
ActionResponseOrBuilder

getAnnotations(int index)

public Annotation getAnnotations(int index)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Annotation

getAnnotationsBuilder(int index)

public Annotation.Builder getAnnotationsBuilder(int index)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Annotation.Builder

getAnnotationsBuilderList()

public List<Annotation.Builder> getAnnotationsBuilderList()

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getAnnotationsCount()

public int getAnnotationsCount()

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getAnnotationsList()

public List<Annotation> getAnnotationsList()

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Annotation>

getAnnotationsOrBuilder(int index)

public AnnotationOrBuilder getAnnotationsOrBuilder(int index)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
AnnotationOrBuilder

getAnnotationsOrBuilderList()

public List<? extends AnnotationOrBuilder> getAnnotationsOrBuilderList()

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.chat.v1.AnnotationOrBuilder>

getArgumentText()

public String getArgumentText()

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

string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The argumentText.

getArgumentTextBytes()

public ByteString getArgumentTextBytes()

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

string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for argumentText.

getAttachedGifs(int index)

public AttachedGif getAttachedGifs(int index)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
AttachedGif

getAttachedGifsBuilder(int index)

public AttachedGif.Builder getAttachedGifsBuilder(int index)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
AttachedGif.Builder

getAttachedGifsBuilderList()

public List<AttachedGif.Builder> getAttachedGifsBuilderList()

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getAttachedGifsCount()

public int getAttachedGifsCount()

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getAttachedGifsList()

public List<AttachedGif> getAttachedGifsList()

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<AttachedGif>

getAttachedGifsOrBuilder(int index)

public AttachedGifOrBuilder getAttachedGifsOrBuilder(int index)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
AttachedGifOrBuilder

getAttachedGifsOrBuilderList()

public List<? extends AttachedGifOrBuilder> getAttachedGifsOrBuilderList()

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.chat.v1.AttachedGifOrBuilder>

getAttachment(int index)

public Attachment getAttachment(int index)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
index int
Returns
Type Description
Attachment

getAttachmentBuilder(int index)

public Attachment.Builder getAttachmentBuilder(int index)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
index int
Returns
Type Description
Attachment.Builder

getAttachmentBuilderList()

public List<Attachment.Builder> getAttachmentBuilderList()

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Returns
Type Description
List<Builder>

getAttachmentCount()

public int getAttachmentCount()

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Returns
Type Description
int

getAttachmentList()

public List<Attachment> getAttachmentList()

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Returns
Type Description
List<Attachment>

getAttachmentOrBuilder(int index)

public AttachmentOrBuilder getAttachmentOrBuilder(int index)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
index int
Returns
Type Description
AttachmentOrBuilder

getAttachmentOrBuilderList()

public List<? extends AttachmentOrBuilder> getAttachmentOrBuilderList()

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Returns
Type Description
List<? extends com.google.chat.v1.AttachmentOrBuilder>

getCards(int index) (deprecated)

public ContextualAddOnMarkup.Card getCards(int index)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
index int
Returns
Type Description
ContextualAddOnMarkup.Card

getCardsBuilder(int index) (deprecated)

public ContextualAddOnMarkup.Card.Builder getCardsBuilder(int index)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
index int
Returns
Type Description
ContextualAddOnMarkup.Card.Builder

getCardsBuilderList() (deprecated)

public List<ContextualAddOnMarkup.Card.Builder> getCardsBuilderList()

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Returns
Type Description
List<Builder>

getCardsCount() (deprecated)

public int getCardsCount()

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Returns
Type Description
int

getCardsList() (deprecated)

public List<ContextualAddOnMarkup.Card> getCardsList()

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Returns
Type Description
List<Card>

getCardsOrBuilder(int index) (deprecated)

public ContextualAddOnMarkup.CardOrBuilder getCardsOrBuilder(int index)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
index int
Returns
Type Description
ContextualAddOnMarkup.CardOrBuilder

getCardsOrBuilderList() (deprecated)

public List<? extends ContextualAddOnMarkup.CardOrBuilder> getCardsOrBuilderList()

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Returns
Type Description
List<? extends com.google.chat.v1.ContextualAddOnMarkup.CardOrBuilder>

getCardsV2(int index)

public CardWithId getCardsV2(int index)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
index int
Returns
Type Description
CardWithId

getCardsV2Builder(int index)

public CardWithId.Builder getCardsV2Builder(int index)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
index int
Returns
Type Description
CardWithId.Builder

getCardsV2BuilderList()

public List<CardWithId.Builder> getCardsV2BuilderList()

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Returns
Type Description
List<Builder>

getCardsV2Count()

public int getCardsV2Count()

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Returns
Type Description
int

getCardsV2List()

public List<CardWithId> getCardsV2List()

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Returns
Type Description
List<CardWithId>

getCardsV2OrBuilder(int index)

public CardWithIdOrBuilder getCardsV2OrBuilder(int index)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
index int
Returns
Type Description
CardWithIdOrBuilder

getCardsV2OrBuilderList()

public List<? extends CardWithIdOrBuilder> getCardsV2OrBuilderList()

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Returns
Type Description
List<? extends com.google.chat.v1.CardWithIdOrBuilder>

getClientAssignedMessageId()

public String 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 field when you create the message. For details, see Name a message.

string client_assigned_message_id = 32;

Returns
Type Description
String

The clientAssignedMessageId.

getClientAssignedMessageIdBytes()

public ByteString getClientAssignedMessageIdBytes()

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.

string client_assigned_message_id = 32;

Returns
Type Description
ByteString

The bytes for clientAssignedMessageId.

getCreateTime()

public Timestamp 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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public Message getDefaultInstanceForType()
Returns
Type Description
Message

getDeleteTime()

public Timestamp getDeleteTime()

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The deleteTime.

getDeleteTimeBuilder()

public Timestamp.Builder getDeleteTimeBuilder()

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getDeleteTimeOrBuilder()

public TimestampOrBuilder getDeleteTimeOrBuilder()

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDeletionMetadata()

public DeletionMetadata getDeletionMetadata()

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DeletionMetadata

The deletionMetadata.

getDeletionMetadataBuilder()

public DeletionMetadata.Builder getDeletionMetadataBuilder()

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DeletionMetadata.Builder

getDeletionMetadataOrBuilder()

public DeletionMetadataOrBuilder getDeletionMetadataOrBuilder()

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DeletionMetadataOrBuilder

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEmojiReactionSummaries(int index)

public EmojiReactionSummary getEmojiReactionSummaries(int index)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
EmojiReactionSummary

getEmojiReactionSummariesBuilder(int index)

public EmojiReactionSummary.Builder getEmojiReactionSummariesBuilder(int index)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
EmojiReactionSummary.Builder

getEmojiReactionSummariesBuilderList()

public List<EmojiReactionSummary.Builder> getEmojiReactionSummariesBuilderList()

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getEmojiReactionSummariesCount()

public int getEmojiReactionSummariesCount()

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getEmojiReactionSummariesList()

public List<EmojiReactionSummary> getEmojiReactionSummariesList()

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<EmojiReactionSummary>

getEmojiReactionSummariesOrBuilder(int index)

public EmojiReactionSummaryOrBuilder getEmojiReactionSummariesOrBuilder(int index)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
EmojiReactionSummaryOrBuilder

getEmojiReactionSummariesOrBuilderList()

public List<? extends EmojiReactionSummaryOrBuilder> getEmojiReactionSummariesOrBuilderList()

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.chat.v1.EmojiReactionSummaryOrBuilder>

getFallbackText()

public String getFallbackText()

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

string fallback_text = 13;

Returns
Type Description
String

The fallbackText.

getFallbackTextBytes()

public ByteString getFallbackTextBytes()

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

string fallback_text = 13;

Returns
Type Description
ByteString

The bytes for fallbackText.

getFormattedText()

public String 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 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, 😄. 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

string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The formattedText.

getFormattedTextBytes()

public ByteString getFormattedTextBytes()

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, 😄. 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

string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for formattedText.

getLastUpdateTime()

public Timestamp 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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The lastUpdateTime.

getLastUpdateTimeBuilder()

public Timestamp.Builder getLastUpdateTimeBuilder()

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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getLastUpdateTimeOrBuilder()

public TimestampOrBuilder getLastUpdateTimeOrBuilder()

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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getMatchedUrl()

public MatchedUrl getMatchedUrl()

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
MatchedUrl

The matchedUrl.

getMatchedUrlBuilder()

public MatchedUrl.Builder getMatchedUrlBuilder()

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
MatchedUrl.Builder

getMatchedUrlOrBuilder()

public MatchedUrlOrBuilder getMatchedUrlOrBuilder()

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
MatchedUrlOrBuilder

getName()

public String getName()

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.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

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.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getPrivateMessageViewer()

public User getPrivateMessageViewer()

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
User

The privateMessageViewer.

getPrivateMessageViewerBuilder()

public User.Builder getPrivateMessageViewerBuilder()

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
User.Builder

getPrivateMessageViewerOrBuilder()

public UserOrBuilder getPrivateMessageViewerOrBuilder()

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
UserOrBuilder

getQuotedMessageMetadata()

public QuotedMessageMetadata getQuotedMessageMetadata()

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
QuotedMessageMetadata

The quotedMessageMetadata.

getQuotedMessageMetadataBuilder()

public QuotedMessageMetadata.Builder getQuotedMessageMetadataBuilder()

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
QuotedMessageMetadata.Builder

getQuotedMessageMetadataOrBuilder()

public QuotedMessageMetadataOrBuilder getQuotedMessageMetadataOrBuilder()

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
QuotedMessageMetadataOrBuilder

getSender()

public User getSender()

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
User

The sender.

getSenderBuilder()

public User.Builder getSenderBuilder()

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
User.Builder

getSenderOrBuilder()

public UserOrBuilder getSenderOrBuilder()

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UserOrBuilder

getSlashCommand()

public SlashCommand getSlashCommand()

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
SlashCommand

The slashCommand.

getSlashCommandBuilder()

public SlashCommand.Builder getSlashCommandBuilder()

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
SlashCommand.Builder

getSlashCommandOrBuilder()

public SlashCommandOrBuilder getSlashCommandOrBuilder()

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
SlashCommandOrBuilder

getSpace()

public Space getSpace()

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

.google.chat.v1.Space space = 12;

Returns
Type Description
Space

The space.

getSpaceBuilder()

public Space.Builder getSpaceBuilder()

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

.google.chat.v1.Space space = 12;

Returns
Type Description
Space.Builder

getSpaceOrBuilder()

public SpaceOrBuilder getSpaceOrBuilder()

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

.google.chat.v1.Space space = 12;

Returns
Type Description
SpaceOrBuilder

getText()

public String getText()

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 text message.

string text = 4;

Returns
Type Description
String

The text.

getTextBytes()

public ByteString getTextBytes()

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 text message.

string text = 4;

Returns
Type Description
ByteString

The bytes for text.

getThread()

public Thread getThread()

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

.google.chat.v1.Thread thread = 11;

Returns
Type Description
Thread

The thread.

getThreadBuilder()

public Thread.Builder getThreadBuilder()

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

.google.chat.v1.Thread thread = 11;

Returns
Type Description
Thread.Builder

getThreadOrBuilder()

public ThreadOrBuilder getThreadOrBuilder()

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

.google.chat.v1.Thread thread = 11;

Returns
Type Description
ThreadOrBuilder

getThreadReply()

public boolean 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.

bool thread_reply = 25 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The threadReply.

hasActionResponse()

public boolean hasActionResponse()

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
boolean

Whether the actionResponse field is set.

hasCreateTime()

public boolean hasCreateTime()

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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the createTime field is set.

hasDeleteTime()

public boolean hasDeleteTime()

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the deleteTime field is set.

hasDeletionMetadata()

public boolean hasDeletionMetadata()

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the deletionMetadata field is set.

hasLastUpdateTime()

public boolean hasLastUpdateTime()

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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the lastUpdateTime field is set.

hasMatchedUrl()

public boolean hasMatchedUrl()

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the matchedUrl field is set.

hasPrivateMessageViewer()

public boolean hasPrivateMessageViewer()

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
boolean

Whether the privateMessageViewer field is set.

hasQuotedMessageMetadata()

public boolean hasQuotedMessageMetadata()

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the quotedMessageMetadata field is set.

hasSender()

public boolean hasSender()

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the sender field is set.

hasSlashCommand()

public boolean hasSlashCommand()

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the slashCommand field is set.

hasSpace()

public boolean hasSpace()

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

.google.chat.v1.Space space = 12;

Returns
Type Description
boolean

Whether the space field is set.

hasThread()

public boolean hasThread()

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

.google.chat.v1.Thread thread = 11;

Returns
Type Description
boolean

Whether the thread field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeActionResponse(ActionResponse value)

public Message.Builder mergeActionResponse(ActionResponse value)

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
Name Description
value ActionResponse
Returns
Type Description
Message.Builder

mergeCreateTime(Timestamp value)

public Message.Builder mergeCreateTime(Timestamp value)

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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Timestamp
Returns
Type Description
Message.Builder

mergeDeleteTime(Timestamp value)

public Message.Builder mergeDeleteTime(Timestamp value)

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Message.Builder

mergeDeletionMetadata(DeletionMetadata value)

public Message.Builder mergeDeletionMetadata(DeletionMetadata value)

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value DeletionMetadata
Returns
Type Description
Message.Builder

mergeFrom(Message other)

public Message.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Message.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Message.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Message.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Message.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Message.Builder
Overrides

mergeLastUpdateTime(Timestamp value)

public Message.Builder mergeLastUpdateTime(Timestamp value)

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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Message.Builder

mergeMatchedUrl(MatchedUrl value)

public Message.Builder mergeMatchedUrl(MatchedUrl value)

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value MatchedUrl
Returns
Type Description
Message.Builder

mergePrivateMessageViewer(User value)

public Message.Builder mergePrivateMessageViewer(User value)

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value User
Returns
Type Description
Message.Builder

mergeQuotedMessageMetadata(QuotedMessageMetadata value)

public Message.Builder mergeQuotedMessageMetadata(QuotedMessageMetadata value)

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value QuotedMessageMetadata
Returns
Type Description
Message.Builder

mergeSender(User value)

public Message.Builder mergeSender(User value)

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value User
Returns
Type Description
Message.Builder

mergeSlashCommand(SlashCommand value)

public Message.Builder mergeSlashCommand(SlashCommand value)

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value SlashCommand
Returns
Type Description
Message.Builder

mergeSpace(Space value)

public Message.Builder mergeSpace(Space value)

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

.google.chat.v1.Space space = 12;

Parameter
Name Description
value Space
Returns
Type Description
Message.Builder

mergeThread(Thread value)

public Message.Builder mergeThread(Thread value)

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

.google.chat.v1.Thread thread = 11;

Parameter
Name Description
value Thread
Returns
Type Description
Message.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Message.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Message.Builder
Overrides

removeAccessoryWidgets(int index)

public Message.Builder removeAccessoryWidgets(int index)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameter
Name Description
index int
Returns
Type Description
Message.Builder

removeAnnotations(int index)

public Message.Builder removeAnnotations(int index)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Message.Builder

removeAttachedGifs(int index)

public Message.Builder removeAttachedGifs(int index)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Message.Builder

removeAttachment(int index)

public Message.Builder removeAttachment(int index)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameter
Name Description
index int
Returns
Type Description
Message.Builder

removeCards(int index) (deprecated)

public Message.Builder removeCards(int index)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameter
Name Description
index int
Returns
Type Description
Message.Builder

removeCardsV2(int index)

public Message.Builder removeCardsV2(int index)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameter
Name Description
index int
Returns
Type Description
Message.Builder

removeEmojiReactionSummaries(int index)

public Message.Builder removeEmojiReactionSummaries(int index)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Message.Builder

setAccessoryWidgets(int index, AccessoryWidget value)

public Message.Builder setAccessoryWidgets(int index, AccessoryWidget value)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameters
Name Description
index int
value AccessoryWidget
Returns
Type Description
Message.Builder

setAccessoryWidgets(int index, AccessoryWidget.Builder builderForValue)

public Message.Builder setAccessoryWidgets(int index, AccessoryWidget.Builder builderForValue)

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.

repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44;

Parameters
Name Description
index int
builderForValue AccessoryWidget.Builder
Returns
Type Description
Message.Builder

setActionResponse(ActionResponse value)

public Message.Builder setActionResponse(ActionResponse value)

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
Name Description
value ActionResponse
Returns
Type Description
Message.Builder

setActionResponse(ActionResponse.Builder builderForValue)

public Message.Builder setActionResponse(ActionResponse.Builder builderForValue)

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

.google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
Name Description
builderForValue ActionResponse.Builder
Returns
Type Description
Message.Builder

setAnnotations(int index, Annotation value)

public Message.Builder setAnnotations(int index, Annotation value)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value Annotation
Returns
Type Description
Message.Builder

setAnnotations(int index, Annotation.Builder builderForValue)

public Message.Builder setAnnotations(int index, Annotation.Builder builderForValue)

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

repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue Annotation.Builder
Returns
Type Description
Message.Builder

setArgumentText(String value)

public Message.Builder setArgumentText(String value)

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

string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The argumentText to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setArgumentTextBytes(ByteString value)

public Message.Builder setArgumentTextBytes(ByteString value)

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

string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for argumentText to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setAttachedGifs(int index, AttachedGif value)

public Message.Builder setAttachedGifs(int index, AttachedGif value)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value AttachedGif
Returns
Type Description
Message.Builder

setAttachedGifs(int index, AttachedGif.Builder builderForValue)

public Message.Builder setAttachedGifs(int index, AttachedGif.Builder builderForValue)

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

repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue AttachedGif.Builder
Returns
Type Description
Message.Builder

setAttachment(int index, Attachment value)

public Message.Builder setAttachment(int index, Attachment value)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameters
Name Description
index int
value Attachment
Returns
Type Description
Message.Builder

setAttachment(int index, Attachment.Builder builderForValue)

public Message.Builder setAttachment(int index, Attachment.Builder builderForValue)

User-uploaded attachment.

repeated .google.chat.v1.Attachment attachment = 18;

Parameters
Name Description
index int
builderForValue Attachment.Builder
Returns
Type Description
Message.Builder

setCards(int index, ContextualAddOnMarkup.Card value) (deprecated)

public Message.Builder setCards(int index, ContextualAddOnMarkup.Card value)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameters
Name Description
index int
value ContextualAddOnMarkup.Card
Returns
Type Description
Message.Builder

setCards(int index, ContextualAddOnMarkup.Card.Builder builderForValue) (deprecated)

public Message.Builder setCards(int index, ContextualAddOnMarkup.Card.Builder builderForValue)

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.

repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true];

Parameters
Name Description
index int
builderForValue ContextualAddOnMarkup.Card.Builder
Returns
Type Description
Message.Builder

setCardsV2(int index, CardWithId value)

public Message.Builder setCardsV2(int index, CardWithId value)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameters
Name Description
index int
value CardWithId
Returns
Type Description
Message.Builder

setCardsV2(int index, CardWithId.Builder builderForValue)

public Message.Builder setCardsV2(int index, CardWithId.Builder builderForValue)

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 about cards and how to create them, see Send card messages.

Card builder

repeated .google.chat.v1.CardWithId cards_v2 = 22;

Parameters
Name Description
index int
builderForValue CardWithId.Builder
Returns
Type Description
Message.Builder

setClientAssignedMessageId(String value)

public Message.Builder setClientAssignedMessageId(String value)

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.

string client_assigned_message_id = 32;

Parameter
Name Description
value String

The clientAssignedMessageId to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setClientAssignedMessageIdBytes(ByteString value)

public Message.Builder setClientAssignedMessageIdBytes(ByteString value)

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.

string client_assigned_message_id = 32;

Parameter
Name Description
value ByteString

The bytes for clientAssignedMessageId to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setCreateTime(Timestamp value)

public Message.Builder setCreateTime(Timestamp value)

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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Timestamp
Returns
Type Description
Message.Builder

setCreateTime(Timestamp.Builder builderForValue)

public Message.Builder setCreateTime(Timestamp.Builder builderForValue)

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.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Message.Builder

setDeleteTime(Timestamp value)

public Message.Builder setDeleteTime(Timestamp value)

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Message.Builder

setDeleteTime(Timestamp.Builder builderForValue)

public Message.Builder setDeleteTime(Timestamp.Builder builderForValue)

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

.google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Message.Builder

setDeletionMetadata(DeletionMetadata value)

public Message.Builder setDeletionMetadata(DeletionMetadata value)

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value DeletionMetadata
Returns
Type Description
Message.Builder

setDeletionMetadata(DeletionMetadata.Builder builderForValue)

public Message.Builder setDeletionMetadata(DeletionMetadata.Builder builderForValue)

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

.google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue DeletionMetadata.Builder
Returns
Type Description
Message.Builder

setEmojiReactionSummaries(int index, EmojiReactionSummary value)

public Message.Builder setEmojiReactionSummaries(int index, EmojiReactionSummary value)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value EmojiReactionSummary
Returns
Type Description
Message.Builder

setEmojiReactionSummaries(int index, EmojiReactionSummary.Builder builderForValue)

public Message.Builder setEmojiReactionSummaries(int index, EmojiReactionSummary.Builder builderForValue)

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

repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue EmojiReactionSummary.Builder
Returns
Type Description
Message.Builder

setFallbackText(String value)

public Message.Builder setFallbackText(String value)

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

string fallback_text = 13;

Parameter
Name Description
value String

The fallbackText to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setFallbackTextBytes(ByteString value)

public Message.Builder setFallbackTextBytes(ByteString value)

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

string fallback_text = 13;

Parameter
Name Description
value ByteString

The bytes for fallbackText to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Message.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Message.Builder
Overrides

setFormattedText(String value)

public Message.Builder setFormattedText(String value)

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, 😄. 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

string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The formattedText to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setFormattedTextBytes(ByteString value)

public Message.Builder setFormattedTextBytes(ByteString value)

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, 😄. 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

string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for formattedText to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setLastUpdateTime(Timestamp value)

public Message.Builder setLastUpdateTime(Timestamp value)

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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Message.Builder

setLastUpdateTime(Timestamp.Builder builderForValue)

public Message.Builder setLastUpdateTime(Timestamp.Builder builderForValue)

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.

.google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Message.Builder

setMatchedUrl(MatchedUrl value)

public Message.Builder setMatchedUrl(MatchedUrl value)

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value MatchedUrl
Returns
Type Description
Message.Builder

setMatchedUrl(MatchedUrl.Builder builderForValue)

public Message.Builder setMatchedUrl(MatchedUrl.Builder builderForValue)

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

.google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue MatchedUrl.Builder
Returns
Type Description
Message.Builder

setName(String value)

public Message.Builder setName(String value)

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.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Message.Builder setNameBytes(ByteString value)

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.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setPrivateMessageViewer(User value)

public Message.Builder setPrivateMessageViewer(User value)

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value User
Returns
Type Description
Message.Builder

setPrivateMessageViewer(User.Builder builderForValue)

public Message.Builder setPrivateMessageViewer(User.Builder builderForValue)

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. Link previews and attachments aren't supported for private messages.

Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field.

For details, see Send private messages to Google Chat users.

.google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
builderForValue User.Builder
Returns
Type Description
Message.Builder

setQuotedMessageMetadata(QuotedMessageMetadata value)

public Message.Builder setQuotedMessageMetadata(QuotedMessageMetadata value)

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value QuotedMessageMetadata
Returns
Type Description
Message.Builder

setQuotedMessageMetadata(QuotedMessageMetadata.Builder builderForValue)

public Message.Builder setQuotedMessageMetadata(QuotedMessageMetadata.Builder builderForValue)

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.

.google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue QuotedMessageMetadata.Builder
Returns
Type Description
Message.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Message.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Message.Builder
Overrides

setSender(User value)

public Message.Builder setSender(User value)

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value User
Returns
Type Description
Message.Builder

setSender(User.Builder builderForValue)

public Message.Builder setSender(User.Builder builderForValue)

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

.google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue User.Builder
Returns
Type Description
Message.Builder

setSlashCommand(SlashCommand value)

public Message.Builder setSlashCommand(SlashCommand value)

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value SlashCommand
Returns
Type Description
Message.Builder

setSlashCommand(SlashCommand.Builder builderForValue)

public Message.Builder setSlashCommand(SlashCommand.Builder builderForValue)

Output only. Slash command information, if applicable.

.google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue SlashCommand.Builder
Returns
Type Description
Message.Builder

setSpace(Space value)

public Message.Builder setSpace(Space value)

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

.google.chat.v1.Space space = 12;

Parameter
Name Description
value Space
Returns
Type Description
Message.Builder

setSpace(Space.Builder builderForValue)

public Message.Builder setSpace(Space.Builder builderForValue)

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

.google.chat.v1.Space space = 12;

Parameter
Name Description
builderForValue Space.Builder
Returns
Type Description
Message.Builder

setText(String value)

public Message.Builder setText(String value)

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 text message.

string text = 4;

Parameter
Name Description
value String

The text to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setTextBytes(ByteString value)

public Message.Builder setTextBytes(ByteString value)

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 text message.

string text = 4;

Parameter
Name Description
value ByteString

The bytes for text to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setThread(Thread value)

public Message.Builder setThread(Thread value)

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

.google.chat.v1.Thread thread = 11;

Parameter
Name Description
value Thread
Returns
Type Description
Message.Builder

setThread(Thread.Builder builderForValue)

public Message.Builder setThread(Thread.Builder builderForValue)

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

.google.chat.v1.Thread thread = 11;

Parameter
Name Description
builderForValue Thread.Builder
Returns
Type Description
Message.Builder

setThreadReply(boolean value)

public Message.Builder setThreadReply(boolean value)

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.

bool thread_reply = 25 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value boolean

The threadReply to set.

Returns
Type Description
Message.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Message.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Message.Builder
Overrides