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 (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Message resource.

  • sid (String)

    The SID of the Call resource to fetch.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 169

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:



196
197
198
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 196

def 
    @properties['account_sid']
end

#assistant_idString

Returns The Assistant ID.

Returns:

  • (String)

    The Assistant ID.



202
203
204
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 202

def assistant_id
    @properties['assistant_id']
end

#contentHash

Returns The content of the message.

Returns:

  • (Hash)

    The content of the message.



226
227
228
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 226

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:



238
239
240
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 238

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:



244
245
246
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 244

def date_updated
    @properties['date_updated']
end

#idString

Returns The message ID.

Returns:

  • (String)

    The message ID.



190
191
192
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 190

def id
    @properties['id']
end

#identityString

Returns The identity of the user.

Returns:

  • (String)

    The identity of the user.



214
215
216
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 214

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



256
257
258
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 256

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

#metaHash

Returns The metadata of the message.

Returns:

  • (Hash)

    The metadata of the message.



232
233
234
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 232

def meta
    @properties['meta']
end

#roleString

Returns The role of the user associated with the message.

Returns:

  • (String)

    The role of the user associated with the message.



220
221
222
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 220

def role
    @properties['role']
end

#session_idString

Returns The Session ID.

Returns:

  • (String)

    The Session ID.



208
209
210
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 208

def session_id
    @properties['session_id']
end

#to_sObject

Provide a user friendly representation



250
251
252
# File 'lib/twilio-ruby/rest/assistants/v1/session/message.rb', line 250

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