Class: Google::Apis::ChatV1::Annotation

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Annotation

Returns a new instance of Annotation.



150
151
152
# File 'lib/google/apis/chat_v1/classes.rb', line 150

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#lengthFixnum

Length of the substring in the plain-text message body this annotation corresponds to. Corresponds to the JSON property length

Returns:

  • (Fixnum)


127
128
129
# File 'lib/google/apis/chat_v1/classes.rb', line 127

def length
  @length
end

#slash_commandGoogle::Apis::ChatV1::SlashCommandMetadata

Annotation metadata for slash commands (/). Corresponds to the JSON property slashCommand



132
133
134
# File 'lib/google/apis/chat_v1/classes.rb', line 132

def slash_command
  @slash_command
end

#start_indexFixnum

Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to. Corresponds to the JSON property startIndex

Returns:

  • (Fixnum)


138
139
140
# File 'lib/google/apis/chat_v1/classes.rb', line 138

def start_index
  @start_index
end

#typeString

The type of this annotation. Corresponds to the JSON property type

Returns:

  • (String)


143
144
145
# File 'lib/google/apis/chat_v1/classes.rb', line 143

def type
  @type
end

#user_mentionGoogle::Apis::ChatV1::UserMentionMetadata

Annotation metadata for user mentions (@). Corresponds to the JSON property userMention



148
149
150
# File 'lib/google/apis/chat_v1/classes.rb', line 148

def user_mention
  @user_mention
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



155
156
157
158
159
160
161
# File 'lib/google/apis/chat_v1/classes.rb', line 155

def update!(**args)
  @length = args[:length] if args.key?(:length)
  @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