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

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

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

Calls superclass method 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

account_sid() click to toggle source

@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
actions_url() click to toggle source

@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
assistant_sid() click to toggle source

@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
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 [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
date_created() click to toggle source

@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
date_updated() click to toggle source

@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() click to toggle source

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() click to toggle source

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
fields() click to toggle source

Access the fields @return [fields] fields

    # File lib/twilio-ruby/rest/preview/understand/assistant/task.rb
452 def fields
453   context.fields
454 end
friendly_name() click to toggle source

@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
inspect() click to toggle source

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
samples() click to toggle source

Access the samples @return [samples] samples

    # File lib/twilio-ruby/rest/preview/understand/assistant/task.rb
459 def samples
460   context.samples
461 end
sid() click to toggle source

@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
statistics() click to toggle source

Access the statistics @return [statistics] statistics

    # File lib/twilio-ruby/rest/preview/understand/assistant/task.rb
473 def statistics
474   context.statistics
475 end
task_actions() click to toggle source

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
to_s() click to toggle source

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
unique_name() click to toggle source

@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(friendly_name: :unset, unique_name: :unset, actions: :unset, actions_url: :unset) click to toggle source

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
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/preview/understand/assistant/task.rb
411 def url
412   @properties['url']
413 end