class Twilio::REST::Preview::Understand::AssistantContext::TaskContext::TaskActionsContext

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, assistant_sid, task_sid) click to toggle source

Initialize the TaskActionsContext @param [Version] version Version that contains the resource @param [String] assistant_sid The unique ID of the parent Assistant. @param [String] task_sid The unique ID of the Task. @return [TaskActionsContext] TaskActionsContext

Calls superclass method Twilio::REST::InstanceContext::new
   # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb
83 def initialize(version, assistant_sid, task_sid)
84   super(version)
85 
86   # Path Solution
87   @solution = {assistant_sid: assistant_sid, task_sid: task_sid, }
88   @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Actions"
89 end

Public Instance Methods

fetch() click to toggle source

Fetch the TaskActionsInstance @return [TaskActionsInstance] Fetched TaskActionsInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb
 94 def fetch
 95   payload = @version.fetch('GET', @uri)
 96 
 97   TaskActionsInstance.new(
 98       @version,
 99       payload,
100       assistant_sid: @solution[:assistant_sid],
101       task_sid: @solution[:task_sid],
102   )
103 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb
132 def inspect
133   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
134   "#<Twilio.Preview.Understand.TaskActionsContext #{context}>"
135 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb
125 def to_s
126   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
127   "#<Twilio.Preview.Understand.TaskActionsContext #{context}>"
128 end
update(actions: :unset) click to toggle source

Update the TaskActionsInstance @param [Hash] actions The JSON actions that instruct the Assistant how to

perform this task.

@return [TaskActionsInstance] Updated TaskActionsInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb
110 def update(actions: :unset)
111   data = Twilio::Values.of({'Actions' => Twilio.serialize_object(actions), })
112 
113   payload = @version.update('POST', @uri, data: data)
114 
115   TaskActionsInstance.new(
116       @version,
117       payload,
118       assistant_sid: @solution[:assistant_sid],
119       task_sid: @solution[:task_sid],
120   )
121 end