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.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 124

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.



154
155
156
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 154

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:



166
167
168
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 166

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



172
173
174
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 172

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



178
179
180
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 178

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.



148
149
150
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 148

def flagged
    @properties['flagged']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#session_idString

Returns The unique name for the session.

Returns:

  • (String)

    The unique name for the session.



160
161
162
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 160

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.



142
143
144
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 142

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



184
185
186
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 184

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