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.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 129

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.



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

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:



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

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



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

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



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

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.



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

def flagged
    @properties['flagged']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#session_idString

Returns The unique name for the session.

Returns:

  • (String)

    The unique name for the session.



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

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.



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

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



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

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