class Twilio::REST::Autopilot::V1::AssistantContext::DialogueInstance

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

new(version, payload, assistant_sid: nil, sid: nil) click to toggle source

Initialize the DialogueInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] assistant_sid The SID of the

{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
parent of the resource.

@param [String] sid The Twilio-provided string that uniquely identifies the

Dialogue resource to fetch.

@return [DialogueInstance] DialogueInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
131 def initialize(version, payload, assistant_sid: nil, sid: nil)
132   super(version)
133 
134   # Marshaled Properties
135   @properties = {
136       'account_sid' => payload['account_sid'],
137       'assistant_sid' => payload['assistant_sid'],
138       'sid' => payload['sid'],
139       'data' => payload['data'],
140       'url' => payload['url'],
141   }
142 
143   # Context
144   @instance_context = nil
145   @params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], }
146 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
161 def account_sid
162   @properties['account_sid']
163 end
assistant_sid() click to toggle source

@return [String] The SID of the Assistant that is the parent of the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
167 def assistant_sid
168   @properties['assistant_sid']
169 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [DialogueContext] DialogueContext for this DialogueInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
152 def context
153   unless @instance_context
154     @instance_context = DialogueContext.new(@version, @params['assistant_sid'], @params['sid'], )
155   end
156   @instance_context
157 end
data() click to toggle source

@return [Hash] The JSON string that describes the dialogue session object

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
179 def data
180   @properties['data']
181 end
fetch() click to toggle source

Fetch the DialogueInstance @return [DialogueInstance] Fetched DialogueInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
192 def fetch
193   context.fetch
194 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
205 def inspect
206   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
207   "<Twilio.Autopilot.V1.DialogueInstance #{values}>"
208 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
173 def sid
174   @properties['sid']
175 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
198 def to_s
199   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
200   "<Twilio.Autopilot.V1.DialogueInstance #{values}>"
201 end
url() click to toggle source

@return [String] The absolute URL of the Dialogue resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb
185 def url
186   @properties['url']
187 end