Reference documentation and code samples for the Google Apps Chat V1 Client class 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"
}
}]
Generated from protobuf message google.chat.v1.Annotation
Namespace
Google \ Apps \ Chat \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ type
int
The type of this annotation.
↳ start_index
int
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
↳ length
int
Length of the substring in the plain-text message body this annotation corresponds to.
↳ user_mention
↳ slash_command
↳ rich_link_metadata
getType
The type of this annotation.
int
setType
The type of this annotation.
var
int
$this
getStartIndex
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
int
hasStartIndex
clearStartIndex
setStartIndex
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
var
int
$this
getLength
Length of the substring in the plain-text message body this annotation corresponds to.
int
setLength
Length of the substring in the plain-text message body this annotation corresponds to.
var
int
$this
getUserMention
The metadata of user mention.
hasUserMention
setUserMention
The metadata of user mention.
$this
getSlashCommand
The metadata for a slash command.
hasSlashCommand
setSlashCommand
The metadata for a slash command.
$this
getRichLinkMetadata
The metadata for a rich link.
hasRichLinkMetadata
setRichLinkMetadata
The metadata for a rich link.
$this
getMetadata
string