Google Chat V1 API - Class Google::Apps::Chat::V1::Annotation (v0.8.0)

Reference documentation and code samples for the Google Chat V1 API class Google::Apps::Chat::V1::Annotation.

Output only. Annotations associated with the plain-text body of the message. To add basic formatting to a text message, see Format text messages.

Example plain-text message body: Hello @FooBot how are you!"

The corresponding annotations metadata: "annotations":[{ "type":"USER_MENTION", "startIndex":6, "length":7, "userMention": { "user": { "name":"users/\{user}", "displayName":"FooBot", "avatarUrl":"https://goo.gl/aeDtrS";, "type":"BOT" }, "type":"MENTION" } }]

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#length

def length() -> ::Integer
Returns
  • (::Integer) — Length of the substring in the plain-text message body this annotation corresponds to.

#length=

def length=(value) -> ::Integer
Parameter
  • value (::Integer) — Length of the substring in the plain-text message body this annotation corresponds to.
Returns
  • (::Integer) — Length of the substring in the plain-text message body this annotation corresponds to.
def rich_link_metadata() -> ::Google::Apps::Chat::V1::RichLinkMetadata
Returns
  • (::Google::Apps::Chat::V1::RichLinkMetadata) — The metadata for a rich link.

    Note: The following fields are mutually exclusive: rich_link_metadata, user_mention, slash_command. If a field in that set is populated, all other fields in the set will automatically be cleared.

def rich_link_metadata=(value) -> ::Google::Apps::Chat::V1::RichLinkMetadata
Parameter
  • value (::Google::Apps::Chat::V1::RichLinkMetadata) — The metadata for a rich link.

    Note: The following fields are mutually exclusive: rich_link_metadata, user_mention, slash_command. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Apps::Chat::V1::RichLinkMetadata) — The metadata for a rich link.

    Note: The following fields are mutually exclusive: rich_link_metadata, user_mention, slash_command. If a field in that set is populated, all other fields in the set will automatically be cleared.

#slash_command

def slash_command() -> ::Google::Apps::Chat::V1::SlashCommandMetadata
Returns
  • (::Google::Apps::Chat::V1::SlashCommandMetadata) — The metadata for a slash command.

    Note: The following fields are mutually exclusive: slash_command, user_mention, rich_link_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.

#slash_command=

def slash_command=(value) -> ::Google::Apps::Chat::V1::SlashCommandMetadata
Parameter
  • value (::Google::Apps::Chat::V1::SlashCommandMetadata) — The metadata for a slash command.

    Note: The following fields are mutually exclusive: slash_command, user_mention, rich_link_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Apps::Chat::V1::SlashCommandMetadata) — The metadata for a slash command.

    Note: The following fields are mutually exclusive: slash_command, user_mention, rich_link_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.

#start_index

def start_index() -> ::Integer
Returns
  • (::Integer) — Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.

#start_index=

def start_index=(value) -> ::Integer
Parameter
  • value (::Integer) — Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
Returns
  • (::Integer) — Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.

#type

def type() -> ::Google::Apps::Chat::V1::AnnotationType
Returns

#type=

def type=(value) -> ::Google::Apps::Chat::V1::AnnotationType
Parameter
Returns

#user_mention

def user_mention() -> ::Google::Apps::Chat::V1::UserMentionMetadata
Returns
  • (::Google::Apps::Chat::V1::UserMentionMetadata) — The metadata of user mention.

    Note: The following fields are mutually exclusive: user_mention, slash_command, rich_link_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.

#user_mention=

def user_mention=(value) -> ::Google::Apps::Chat::V1::UserMentionMetadata
Parameter
  • value (::Google::Apps::Chat::V1::UserMentionMetadata) — The metadata of user mention.

    Note: The following fields are mutually exclusive: user_mention, slash_command, rich_link_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Apps::Chat::V1::UserMentionMetadata) — The metadata of user mention.

    Note: The following fields are mutually exclusive: user_mention, slash_command, rich_link_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.