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 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 Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Annotation

Returns a new instance of Annotation.



237
238
239
# File 'lib/google/apis/chat_v1/classes.rb', line 237

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

Instance Attribute Details

#custom_emoji_metadataGoogle::Apis::ChatV1::CustomEmojiMetadata

Annotation metadata for custom emoji. Corresponds to the JSON property customEmojiMetadata



201
202
203
# File 'lib/google/apis/chat_v1/classes.rb', line 201

def 
  @custom_emoji_metadata
end

#lengthFixnum

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

Returns:

  • (Fixnum)


207
208
209
# File 'lib/google/apis/chat_v1/classes.rb', line 207

def length
  @length
end

A rich link to a resource. Rich links can be associated with the plain-text body of the message or represent chips that link to Google Workspace resources like Google Docs or Sheets with start_index and length of 0. Corresponds to the JSON property richLinkMetadata



214
215
216
# File 'lib/google/apis/chat_v1/classes.rb', line 214

def 
  @rich_link_metadata
end

#slash_commandGoogle::Apis::ChatV1::SlashCommandMetadata

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



219
220
221
# File 'lib/google/apis/chat_v1/classes.rb', line 219

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)


225
226
227
# File 'lib/google/apis/chat_v1/classes.rb', line 225

def start_index
  @start_index
end

#typeString

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

Returns:

  • (String)


230
231
232
# File 'lib/google/apis/chat_v1/classes.rb', line 230

def type
  @type
end

#user_mentionGoogle::Apis::ChatV1::UserMentionMetadata

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



235
236
237
# File 'lib/google/apis/chat_v1/classes.rb', line 235

def user_mention
  @user_mention
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



242
243
244
245
246
247
248
249
250
# File 'lib/google/apis/chat_v1/classes.rb', line 242

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