class Twilio::REST::Preview::Understand::AssistantContext::TaskInstance
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 TaskInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] assistant_sid
The unique ID of the Assistant. @param [String] sid A 34 character string that uniquely identifies this
resource.
@return [TaskInstance] TaskInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 322 def initialize(version, payload, assistant_sid: nil, sid: nil) 323 super(version) 324 325 # Marshaled Properties 326 @properties = { 327 'account_sid' => payload['account_sid'], 328 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 329 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 330 'friendly_name' => payload['friendly_name'], 331 'links' => payload['links'], 332 'assistant_sid' => payload['assistant_sid'], 333 'sid' => payload['sid'], 334 'unique_name' => payload['unique_name'], 335 'actions_url' => payload['actions_url'], 336 'url' => payload['url'], 337 } 338 339 # Context 340 @instance_context = nil 341 @params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], } 342 end
Public Instance Methods
@return [String] The unique ID of the Account that created this Task.
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 357 def account_sid 358 @properties['account_sid'] 359 end
@return [String] User-provided HTTP
endpoint where from the assistant fetches actions
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 405 def actions_url 406 @properties['actions_url'] 407 end
@return [String] The unique ID of the Assistant.
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 387 def assistant_sid 388 @properties['assistant_sid'] 389 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 [TaskContext] TaskContext
for this TaskInstance
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 348 def context 349 unless @instance_context 350 @instance_context = TaskContext.new(@version, @params['assistant_sid'], @params['sid'], ) 351 end 352 @instance_context 353 end
@return [Time] The date that this resource was created
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 363 def date_created 364 @properties['date_created'] 365 end
@return [Time] The date that this resource was last updated
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 369 def date_updated 370 @properties['date_updated'] 371 end
Delete the TaskInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 445 def delete 446 context.delete 447 end
Fetch the TaskInstance
@return [TaskInstance] Fetched TaskInstance
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 418 def fetch 419 context.fetch 420 end
Access the fields @return [fields] fields
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 452 def fields 453 context.fields 454 end
@return [String] A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long.
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 375 def friendly_name 376 @properties['friendly_name'] 377 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 486 def inspect 487 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 488 "<Twilio.Preview.Understand.TaskInstance #{values}>" 489 end
@return [String] The links
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 381 def links 382 @properties['links'] 383 end
Access the samples @return [samples] samples
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 459 def samples 460 context.samples 461 end
@return [String] A 34 character string that uniquely identifies this resource.
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 393 def sid 394 @properties['sid'] 395 end
Access the statistics @return [statistics] statistics
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 473 def statistics 474 context.statistics 475 end
Access the task_actions
@return [task_actions] task_actions
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 466 def task_actions 467 context.task_actions 468 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 479 def to_s 480 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 481 "<Twilio.Preview.Understand.TaskInstance #{values}>" 482 end
@return [String] A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 399 def unique_name 400 @properties['unique_name'] 401 end
Update the TaskInstance
@param [String] friendly_name
A user-provided string that identifies this
resource. It is non-unique and can up to 255 characters long.
@param [String] unique_name
A user-provided string that uniquely identifies this
resource as an alternative to the sid. Unique up to 64 characters long.
@param [Hash] actions A user-provided JSON object encoded as a string to specify
the actions for this task. It is optional and non-unique.
@param [String] actions_url
User-provided HTTP
endpoint where from the assistant
fetches actions
@return [TaskInstance] Updated TaskInstance
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 433 def update(friendly_name: :unset, unique_name: :unset, actions: :unset, actions_url: :unset) 434 context.update( 435 friendly_name: friendly_name, 436 unique_name: unique_name, 437 actions: actions, 438 actions_url: actions_url, 439 ) 440 end
@return [String] The url
# File lib/twilio-ruby/rest/preview/understand/assistant/task.rb 411 def url 412 @properties['url'] 413 end