class Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueInstance

Public Class Methods

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

Initialize the TaskQueueInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] workspace_sid The SID of the Workspace that contains the

TaskQueue.

@param [String] sid The SID of the TaskQueue resource to fetch. @return [TaskQueueInstance] TaskQueueInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
360 def initialize(version, payload, workspace_sid: nil, sid: nil)
361   super(version)
362 
363   # Marshaled Properties
364   @properties = {
365       'account_sid' => payload['account_sid'],
366       'assignment_activity_sid' => payload['assignment_activity_sid'],
367       'assignment_activity_name' => payload['assignment_activity_name'],
368       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
369       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
370       'friendly_name' => payload['friendly_name'],
371       'max_reserved_workers' => payload['max_reserved_workers'].to_i,
372       'reservation_activity_sid' => payload['reservation_activity_sid'],
373       'reservation_activity_name' => payload['reservation_activity_name'],
374       'sid' => payload['sid'],
375       'target_workers' => payload['target_workers'],
376       'task_order' => payload['task_order'],
377       'url' => payload['url'],
378       'workspace_sid' => payload['workspace_sid'],
379       'links' => payload['links'],
380   }
381 
382   # Context
383   @instance_context = nil
384   @params = {'workspace_sid' => workspace_sid, 'sid' => sid || @properties['sid'], }
385 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
400 def account_sid
401   @properties['account_sid']
402 end
assignment_activity_name() click to toggle source

@return [String] The name of the Activity to assign Workers when a task is assigned for them

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
412 def assignment_activity_name
413   @properties['assignment_activity_name']
414 end
assignment_activity_sid() click to toggle source

@return [String] The SID of the Activity to assign Workers when a task is assigned for them

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
406 def assignment_activity_sid
407   @properties['assignment_activity_sid']
408 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 [TaskQueueContext] TaskQueueContext for this TaskQueueInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
391 def context
392   unless @instance_context
393     @instance_context = TaskQueueContext.new(@version, @params['workspace_sid'], @params['sid'], )
394   end
395   @instance_context
396 end
cumulative_statistics() click to toggle source

Access the cumulative_statistics @return [cumulative_statistics] cumulative_statistics

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
551 def cumulative_statistics
552   context.cumulative_statistics
553 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
418 def date_created
419   @properties['date_created']
420 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
424 def date_updated
425   @properties['date_updated']
426 end
delete() click to toggle source

Delete the TaskQueueInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
530 def delete
531   context.delete
532 end
fetch() click to toggle source

Fetch the TaskQueueInstance @return [TaskQueueInstance] Fetched TaskQueueInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
491 def fetch
492   context.fetch
493 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
430 def friendly_name
431   @properties['friendly_name']
432 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
564 def inspect
565   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
566   "<Twilio.Taskrouter.V1.TaskQueueInstance #{values}>"
567 end
max_reserved_workers() click to toggle source

@return [String] The maximum number of Workers to reserve

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
436 def max_reserved_workers
437   @properties['max_reserved_workers']
438 end
real_time_statistics() click to toggle source

Access the real_time_statistics @return [real_time_statistics] real_time_statistics

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
544 def real_time_statistics
545   context.real_time_statistics
546 end
reservation_activity_name() click to toggle source

@return [String] The name of the Activity to assign Workers once a task is reserved for them

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
448 def reservation_activity_name
449   @properties['reservation_activity_name']
450 end
reservation_activity_sid() click to toggle source

@return [String] The SID of the Activity to assign Workers once a task is reserved for them

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
442 def reservation_activity_sid
443   @properties['reservation_activity_sid']
444 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
454 def sid
455   @properties['sid']
456 end
statistics() click to toggle source

Access the statistics @return [statistics] statistics

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
537 def statistics
538   context.statistics
539 end
target_workers() click to toggle source

@return [String] A string describing the Worker selection criteria for any Tasks that enter the TaskQueue

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
460 def target_workers
461   @properties['target_workers']
462 end
task_order() click to toggle source

@return [task_queue.TaskOrder] How Tasks will be assigned to Workers

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
466 def task_order
467   @properties['task_order']
468 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
557 def to_s
558   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
559   "<Twilio.Taskrouter.V1.TaskQueueInstance #{values}>"
560 end
update(friendly_name: :unset, target_workers: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset, max_reserved_workers: :unset, task_order: :unset) click to toggle source

Update the TaskQueueInstance @param [String] friendly_name A descriptive string that you create to describe

the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`.

@param [String] target_workers A string describing the Worker selection criteria

for any Tasks that enter the TaskQueue. For example '"language" == "spanish"' If
no TargetWorkers parameter is provided, Tasks will wait in the queue until they
are either deleted or moved to another queue. Additional examples on how to
describing Worker selection criteria below.

@param [String] reservation_activity_sid The SID of the Activity to assign

Workers when a task is reserved for them.

@param [String] assignment_activity_sid The SID of the Activity to assign

Workers when a task is assigned for them.

@param [String] max_reserved_workers The maximum number of Workers to create

reservations for the assignment of a task while in the queue. Maximum of 50.

@param [task_queue.TaskOrder] task_order How Tasks will be assigned to Workers.

Can be: `FIFO` or `LIFO` and the default is `FIFO`. Use `FIFO` to assign the
oldest task first and `LIFO` to assign the most recent task first. For more
information, see {Queue
Ordering}[https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo].

@return [TaskQueueInstance] Updated TaskQueueInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
516 def update(friendly_name: :unset, target_workers: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset, max_reserved_workers: :unset, task_order: :unset)
517   context.update(
518       friendly_name: friendly_name,
519       target_workers: target_workers,
520       reservation_activity_sid: reservation_activity_sid,
521       assignment_activity_sid: assignment_activity_sid,
522       max_reserved_workers: max_reserved_workers,
523       task_order: task_order,
524   )
525 end
url() click to toggle source

@return [String] The absolute URL of the TaskQueue resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
472 def url
473   @properties['url']
474 end
workspace_sid() click to toggle source

@return [String] The SID of the Workspace that contains the TaskQueue

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
478 def workspace_sid
479   @properties['workspace_sid']
480 end