class Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueContext

Public Class Methods

new(version, workspace_sid, sid) click to toggle source

Initialize the TaskQueueContext @param [Version] version Version that contains the resource @param [String] workspace_sid The SID of the Workspace with the TaskQueue to

fetch.

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

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
237 def initialize(version, workspace_sid, sid)
238   super(version)
239 
240   # Path Solution
241   @solution = {workspace_sid: workspace_sid, sid: sid, }
242   @uri = "/Workspaces/#{@solution[:workspace_sid]}/TaskQueues/#{@solution[:sid]}"
243 
244   # Dependents
245   @statistics = nil
246   @real_time_statistics = nil
247   @cumulative_statistics = nil
248 end

Public Instance Methods

cumulative_statistics() click to toggle source

Access the cumulative_statistics @return [TaskQueueCumulativeStatisticsList] @return [TaskQueueCumulativeStatisticsContext]

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
332 def cumulative_statistics
333   TaskQueueCumulativeStatisticsContext.new(@version, @solution[:workspace_sid], @solution[:sid], )
334 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
308 def delete
309    @version.delete('DELETE', @uri)
310 end
fetch() click to toggle source

Fetch the TaskQueueInstance @return [TaskQueueInstance] Fetched TaskQueueInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
253 def fetch
254   payload = @version.fetch('GET', @uri)
255 
256   TaskQueueInstance.new(
257       @version,
258       payload,
259       workspace_sid: @solution[:workspace_sid],
260       sid: @solution[:sid],
261   )
262 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
345 def inspect
346   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
347   "#<Twilio.Taskrouter.V1.TaskQueueContext #{context}>"
348 end
real_time_statistics() click to toggle source

Access the real_time_statistics @return [TaskQueueRealTimeStatisticsList] @return [TaskQueueRealTimeStatisticsContext]

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
324 def real_time_statistics
325   TaskQueueRealTimeStatisticsContext.new(@version, @solution[:workspace_sid], @solution[:sid], )
326 end
statistics() click to toggle source

Access the statistics @return [TaskQueueStatisticsList] @return [TaskQueueStatisticsContext]

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
316 def statistics
317   TaskQueueStatisticsContext.new(@version, @solution[:workspace_sid], @solution[:sid], )
318 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
338 def to_s
339   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
340   "#<Twilio.Taskrouter.V1.TaskQueueContext #{context}>"
341 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
285 def update(friendly_name: :unset, target_workers: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset, max_reserved_workers: :unset, task_order: :unset)
286   data = Twilio::Values.of({
287       'FriendlyName' => friendly_name,
288       'TargetWorkers' => target_workers,
289       'ReservationActivitySid' => reservation_activity_sid,
290       'AssignmentActivitySid' => assignment_activity_sid,
291       'MaxReservedWorkers' => max_reserved_workers,
292       'TaskOrder' => task_order,
293   })
294 
295   payload = @version.update('POST', @uri, data: data)
296 
297   TaskQueueInstance.new(
298       @version,
299       payload,
300       workspace_sid: @solution[:workspace_sid],
301       sid: @solution[:sid],
302   )
303 end