Class: Twilio::REST::Assistants::V1::Session::MessageInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/session/message.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, session_id: nil) ⇒ MessageInstance

Initialize the MessageInstance

Parameters:

  • Version that contains the resource

  • payload that contains response from Twilio

  • The SID of the Account that created this Message resource.

  • The SID of the Call resource to fetch.



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 253

def initialize(version, payload , session_id: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'id' => payload['id'],
        'account_sid' => payload['account_sid'],
        'assistant_id' => payload['assistant_id'],
        'session_id' => payload['session_id'],
        'identity' => payload['identity'],
        'role' => payload['role'],
        'content' => payload['content'],
        'meta' => payload['meta'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
    }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Message resource.

Returns:



281
282
283
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 281

def 
    @properties['account_sid']
end

#assistant_idString

Returns The Assistant ID.

Returns:

  • The Assistant ID.



287
288
289
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 287

def assistant_id
    @properties['assistant_id']
end

#contentHash

Returns The content of the message.

Returns:

  • The content of the message.



311
312
313
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 311

def content
    @properties['content']
end

#date_createdTime

Returns The date and time in GMT when the Message was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



323
324
325
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 323

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the Message was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



329
330
331
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 329

def date_updated
    @properties['date_updated']
end

#idString

Returns The message ID.

Returns:

  • The message ID.



275
276
277
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 275

def id
    @properties['id']
end

#identityString

Returns The identity of the user.

Returns:

  • The identity of the user.



299
300
301
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 299

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



341
342
343
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 341

def inspect
    "<Twilio.Assistants.V1.MessageInstance>"
end

#metaHash

Returns The metadata of the message.

Returns:

  • The metadata of the message.



317
318
319
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 317

def meta
    @properties['meta']
end

#roleString

Returns The role of the user associated with the message.

Returns:

  • The role of the user associated with the message.



305
306
307
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 305

def role
    @properties['role']
end

#session_idString

Returns The Session ID.

Returns:

  • The Session ID.



293
294
295
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 293

def session_id
    @properties['session_id']
end

#to_sObject

Provide a user friendly representation



335
336
337
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 335

def to_s
    "<Twilio.Assistants.V1.MessageInstance>"
end