Class: Google::Apis::ChatV1::Annotation
- Inherits:
- 
      Object
      
        - Object
- Google::Apis::ChatV1::Annotation
 
- Defined in:
- generated/google/apis/chat_v1/classes.rb,
 generated/google/apis/chat_v1/representations.rb,
 generated/google/apis/chat_v1/representations.rb
Overview
Annotations associated with the plain-text body of the message. 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/107946847022116401880",
"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. 
- 
  
    
      #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. 
Methods included from Google::Apis::Core::JsonObjectSupport
Methods included from Google::Apis::Core::Hashable
Constructor Details
#initialize(**args) ⇒ Annotation
Returns a new instance of Annotation
| 125 126 127 | # File 'generated/google/apis/chat_v1/classes.rb', line 125 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
| 107 108 109 | # File 'generated/google/apis/chat_v1/classes.rb', line 107 def length @length 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
| 113 114 115 | # File 'generated/google/apis/chat_v1/classes.rb', line 113 def start_index @start_index end | 
#type ⇒ String
The type of this annotation.
Corresponds to the JSON property type
| 118 119 120 | # File 'generated/google/apis/chat_v1/classes.rb', line 118 def type @type end | 
#user_mention ⇒ Google::Apis::ChatV1::UserMentionMetadata
Annotation metadata for user mentions (@).
Corresponds to the JSON property userMention
| 123 124 125 | # File 'generated/google/apis/chat_v1/classes.rb', line 123 def user_mention @user_mention end | 
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
| 130 131 132 133 134 135 | # File 'generated/google/apis/chat_v1/classes.rb', line 130 def update!(**args) @length = args[:length] if args.key?(:length) @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 |