class Twilio::REST::Autopilot::V1::AssistantContext::TaskContext::TaskActionsInstance
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
Initialize the TaskActionsInstance
@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 Task associated with the resource.
@param [String] task_sid
The SID of the
{Task}[https://www.twilio.com/docs/autopilot/api/task] associated with the resource.
@return [TaskActionsInstance] TaskActionsInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 161 def initialize(version, payload, assistant_sid: nil, task_sid: nil) 162 super(version) 163 164 # Marshaled Properties 165 @properties = { 166 'account_sid' => payload['account_sid'], 167 'assistant_sid' => payload['assistant_sid'], 168 'task_sid' => payload['task_sid'], 169 'url' => payload['url'], 170 'data' => payload['data'], 171 } 172 173 # Context 174 @instance_context = nil 175 @params = {'assistant_sid' => assistant_sid, 'task_sid' => task_sid, } 176 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 191 def account_sid 192 @properties['account_sid'] 193 end
@return [String] The SID of the Assistant that is the parent of the Task associated with the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 197 def assistant_sid 198 @properties['assistant_sid'] 199 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [TaskActionsContext] TaskActionsContext
for this TaskActionsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 182 def context 183 unless @instance_context 184 @instance_context = TaskActionsContext.new(@version, @params['assistant_sid'], @params['task_sid'], ) 185 end 186 @instance_context 187 end
@return [Hash] The JSON string that specifies the actions that instruct the Assistant on how to perform the task
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 215 def data 216 @properties['data'] 217 end
Fetch the TaskActionsInstance
@return [TaskActionsInstance] Fetched TaskActionsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 222 def fetch 223 context.fetch 224 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 245 def inspect 246 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 247 "<Twilio.Autopilot.V1.TaskActionsInstance #{values}>" 248 end
@return [String] The SID of the Task associated with the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 203 def task_sid 204 @properties['task_sid'] 205 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 238 def to_s 239 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 240 "<Twilio.Autopilot.V1.TaskActionsInstance #{values}>" 241 end
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 232 def update(actions: :unset) 233 context.update(actions: actions, ) 234 end
@return [String] The absolute URL of the TaskActions resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb 209 def url 210 @properties['url'] 211 end