Class: Google::Apis::ChatV1::Annotation
- Inherits:
-
Object
- Object
- Google::Apis::ChatV1::Annotation
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/chat_v1/classes.rb,
lib/google/apis/chat_v1/representations.rb,
lib/google/apis/chat_v1/representations.rb
Overview
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"
` `]
Instance Attribute Summary collapse
-
#length ⇒ Fixnum
Length of the substring in the plain-text message body this annotation corresponds to.
-
#rich_link_metadata ⇒ Google::Apis::ChatV1::RichLinkMetadata
A rich link to a resource.
-
#slash_command ⇒ Google::Apis::ChatV1::SlashCommandMetadata
Annotation metadata for slash commands (/).
-
#start_index ⇒ Fixnum
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
-
#type ⇒ String
The type of this annotation.
-
#user_mention ⇒ Google::Apis::ChatV1::UserMentionMetadata
Annotation metadata for user mentions (@).
Instance Method Summary collapse
-
#initialize(**args) ⇒ Annotation
constructor
A new instance of Annotation.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Annotation
Returns a new instance of Annotation.
222 223 224 |
# File 'lib/google/apis/chat_v1/classes.rb', line 222 def initialize(**args) update!(**args) end |
Instance Attribute Details
#length ⇒ Fixnum
Length of the substring in the plain-text message body this annotation
corresponds to.
Corresponds to the JSON property length
194 195 196 |
# File 'lib/google/apis/chat_v1/classes.rb', line 194 def length @length end |
#rich_link_metadata ⇒ Google::Apis::ChatV1::RichLinkMetadata
A rich link to a resource.
Corresponds to the JSON property richLinkMetadata
199 200 201 |
# File 'lib/google/apis/chat_v1/classes.rb', line 199 def @rich_link_metadata end |
#slash_command ⇒ Google::Apis::ChatV1::SlashCommandMetadata
Annotation metadata for slash commands (/).
Corresponds to the JSON property slashCommand
204 205 206 |
# File 'lib/google/apis/chat_v1/classes.rb', line 204 def slash_command @slash_command end |
#start_index ⇒ Fixnum
Start index (0-based, inclusive) in the plain-text message body this
annotation corresponds to.
Corresponds to the JSON property startIndex
210 211 212 |
# File 'lib/google/apis/chat_v1/classes.rb', line 210 def start_index @start_index end |
#type ⇒ String
The type of this annotation.
Corresponds to the JSON property type
215 216 217 |
# File 'lib/google/apis/chat_v1/classes.rb', line 215 def type @type end |
#user_mention ⇒ Google::Apis::ChatV1::UserMentionMetadata
Annotation metadata for user mentions (@).
Corresponds to the JSON property userMention
220 221 222 |
# File 'lib/google/apis/chat_v1/classes.rb', line 220 def user_mention @user_mention end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
227 228 229 230 231 232 233 234 |
# File 'lib/google/apis/chat_v1/classes.rb', line 227 def update!(**args) @length = args[:length] if args.key?(:length) @rich_link_metadata = args[:rich_link_metadata] if args.key?(:rich_link_metadata) @slash_command = args[:slash_command] if args.key?(:slash_command) @start_index = args[:start_index] if args.key?(:start_index) @type = args[:type] if args.key?(:type) @user_mention = args[:user_mention] if args.key?(:user_mention) end |