Class: Twilio::REST::Assistants::V1::AssistantContext::MessageInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, 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.



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 218

def initialize(version, payload , id: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'status' => payload['status'],
        'flagged' => payload['flagged'],
        'aborted' => payload['aborted'],
        'session_id' => payload['session_id'],
        'account_sid' => payload['account_sid'],
        'body' => payload['body'],
        'error' => payload['error'],
    }
end

Instance Method Details

#abortedBoolean

Returns This property will denote whether the request was aborted or not.

Returns:

  • (Boolean)

    This property will denote whether the request was aborted or not.



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

def aborted
    @properties['aborted']
end

#account_sidString

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

Returns:



261
262
263
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 261

def 
    @properties['account_sid']
end

#bodyString

Returns If successful, the body of the generated response.

Returns:

  • (String)

    If successful, the body of the generated response



267
268
269
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 267

def body
    @properties['body']
end

#errorString

Returns The error message if generation was not successful.

Returns:

  • (String)

    The error message if generation was not successful



273
274
275
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 273

def error
    @properties['error']
end

#flaggedBoolean

Returns If successful, this property will denote whether the response was flagged or not.

Returns:

  • (Boolean)

    If successful, this property will denote whether the response was flagged or not.



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

def flagged
    @properties['flagged']
end

#inspectObject

Provide a detailed, user friendly representation



285
286
287
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 285

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

#session_idString

Returns The unique name for the session.

Returns:

  • (String)

    The unique name for the session.



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

def session_id
    @properties['session_id']
end

#statusString

Returns success or failure based on whether the request successfully generated a response.

Returns:

  • (String)

    success or failure based on whether the request successfully generated a response.



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

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



279
280
281
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 279

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