class Twilio::REST::Autopilot::V1::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 SID of the
{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the parent of the Task for which the task actions to fetch were defined.
@param [String] task_sid The SID of the
{Task}[https://www.twilio.com/docs/autopilot/api/task] for which the task actions to fetch were defined.
@return [TaskActionsContext] TaskActionsContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 91 def initialize(version, assistant_sid, task_sid) 92 super(version) 93 94 # Path Solution 95 @solution = {assistant_sid: assistant_sid, task_sid: task_sid, } 96 @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Actions" 97 end
Public Instance Methods
fetch()
click to toggle source
Fetch the TaskActionsInstance
@return [TaskActionsInstance] Fetched TaskActionsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 102 def fetch 103 payload = @version.fetch('GET', @uri) 104 105 TaskActionsInstance.new( 106 @version, 107 payload, 108 assistant_sid: @solution[:assistant_sid], 109 task_sid: @solution[:task_sid], 110 ) 111 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 141 def inspect 142 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 143 "#<Twilio.Autopilot.V1.TaskActionsContext #{context}>" 144 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 134 def to_s 135 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 136 "#<Twilio.Autopilot.V1.TaskActionsContext #{context}>" 137 end
update(actions: :unset)
click to toggle source
Update the TaskActionsInstance
@param [Hash] actions The JSON string that specifies the
{actions}[https://www.twilio.com/docs/autopilot/actions] that instruct the Assistant on how to perform the task.
@return [TaskActionsInstance] Updated TaskActionsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 119 def update(actions: :unset) 120 data = Twilio::Values.of({'Actions' => Twilio.serialize_object(actions), }) 121 122 payload = @version.update('POST', @uri, data: data) 123 124 TaskActionsInstance.new( 125 @version, 126 payload, 127 assistant_sid: @solution[:assistant_sid], 128 task_sid: @solution[:task_sid], 129 ) 130 end