Class: Google::Apps::Chat::V1::Annotation

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/chat/v1/annotation.rb

Overview

Output only. Annotations can be associated with the plain-text body of the message or with chips that link to Google Workspace resources like Google Docs or Sheets with start_index and length of 0. 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"
   }
}]

Instance Attribute Summary collapse

Instance Attribute Details

#custom_emoji_metadata::Google::Apps::Chat::V1::CustomEmojiMetadata

Returns The metadata for a custom emoji.

Note: The following fields are mutually exclusive: custom_emoji_metadata, 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::CustomEmojiMetadata)

    The metadata for a custom emoji.

    Note: The following fields are mutually exclusive: custom_emoji_metadata, 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.



83
84
85
86
# File 'proto_docs/google/chat/v1/annotation.rb', line 83

class Annotation
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#length::Integer

Returns Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.

Returns:

  • (::Integer)

    Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.



83
84
85
86
# File 'proto_docs/google/chat/v1/annotation.rb', line 83

class Annotation
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

Returns The metadata for a rich link.

Note: The following fields are mutually exclusive: rich_link_metadata, user_mention, slash_command, custom_emoji_metadata. 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, custom_emoji_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.



83
84
85
86
# File 'proto_docs/google/chat/v1/annotation.rb', line 83

class Annotation
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#slash_command::Google::Apps::Chat::V1::SlashCommandMetadata

Returns The metadata for a slash command.

Note: The following fields are mutually exclusive: slash_command, user_mention, rich_link_metadata, custom_emoji_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, custom_emoji_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.



83
84
85
86
# File 'proto_docs/google/chat/v1/annotation.rb', line 83

class Annotation
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#start_index::Integer

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



83
84
85
86
# File 'proto_docs/google/chat/v1/annotation.rb', line 83

class Annotation
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#type::Google::Apps::Chat::V1::AnnotationType

Returns The type of this annotation.

Returns:



83
84
85
86
# File 'proto_docs/google/chat/v1/annotation.rb', line 83

class Annotation
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#user_mention::Google::Apps::Chat::V1::UserMentionMetadata

Returns The metadata of user mention.

Note: The following fields are mutually exclusive: user_mention, slash_command, rich_link_metadata, custom_emoji_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, custom_emoji_metadata. If a field in that set is populated, all other fields in the set will automatically be cleared.



83
84
85
86
# File 'proto_docs/google/chat/v1/annotation.rb', line 83

class Annotation
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end