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

Public Class Methods

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

Initialize the TaskQueueRealTimeStatisticsInstance @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] task_queue_sid The SID of the TaskQueue from which these

statistics were calculated.

@return [TaskQueueRealTimeStatisticsInstance] TaskQueueRealTimeStatisticsInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
133 def initialize(version, payload, workspace_sid: nil, task_queue_sid: nil)
134   super(version)
135 
136   # Marshaled Properties
137   @properties = {
138       'account_sid' => payload['account_sid'],
139       'activity_statistics' => payload['activity_statistics'],
140       'longest_task_waiting_age' => payload['longest_task_waiting_age'].to_i,
141       'longest_task_waiting_sid' => payload['longest_task_waiting_sid'],
142       'longest_relative_task_age_in_queue' => payload['longest_relative_task_age_in_queue'].to_i,
143       'longest_relative_task_sid_in_queue' => payload['longest_relative_task_sid_in_queue'],
144       'task_queue_sid' => payload['task_queue_sid'],
145       'tasks_by_priority' => payload['tasks_by_priority'],
146       'tasks_by_status' => payload['tasks_by_status'],
147       'total_available_workers' => payload['total_available_workers'].to_i,
148       'total_eligible_workers' => payload['total_eligible_workers'].to_i,
149       'total_tasks' => payload['total_tasks'].to_i,
150       'workspace_sid' => payload['workspace_sid'],
151       'url' => payload['url'],
152   }
153 
154   # Context
155   @instance_context = nil
156   @params = {'workspace_sid' => workspace_sid, 'task_queue_sid' => task_queue_sid, }
157 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/task_queue_real_time_statistics.rb
176 def account_sid
177   @properties['account_sid']
178 end
activity_statistics() click to toggle source

@return [Array] The number of current Workers by Activity

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
182 def activity_statistics
183   @properties['activity_statistics']
184 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 [TaskQueueRealTimeStatisticsContext] TaskQueueRealTimeStatisticsContext for this TaskQueueRealTimeStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
163 def context
164   unless @instance_context
165     @instance_context = TaskQueueRealTimeStatisticsContext.new(
166         @version,
167         @params['workspace_sid'],
168         @params['task_queue_sid'],
169     )
170   end
171   @instance_context
172 end
fetch(task_channel: :unset) click to toggle source

Fetch the TaskQueueRealTimeStatisticsInstance @param [String] task_channel The TaskChannel for which to fetch statistics. Can

be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or
`default`.

@return [TaskQueueRealTimeStatisticsInstance] Fetched TaskQueueRealTimeStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
264 def fetch(task_channel: :unset)
265   context.fetch(task_channel: task_channel, )
266 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
277 def inspect
278   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
279   "<Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsInstance #{values}>"
280 end
longest_relative_task_age_in_queue() click to toggle source

@return [String] The relative age in the TaskQueue for the longest waiting Task.

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
200 def longest_relative_task_age_in_queue
201   @properties['longest_relative_task_age_in_queue']
202 end
longest_relative_task_sid_in_queue() click to toggle source

@return [String] The SID of the Task waiting in the TaskQueue the longest.

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
206 def longest_relative_task_sid_in_queue
207   @properties['longest_relative_task_sid_in_queue']
208 end
longest_task_waiting_age() click to toggle source

@return [String] The age of the longest waiting Task

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
188 def longest_task_waiting_age
189   @properties['longest_task_waiting_age']
190 end
longest_task_waiting_sid() click to toggle source

@return [String] The SID of the longest waiting Task

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
194 def longest_task_waiting_sid
195   @properties['longest_task_waiting_sid']
196 end
task_queue_sid() click to toggle source

@return [String] The SID of the TaskQueue from which these statistics were calculated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
212 def task_queue_sid
213   @properties['task_queue_sid']
214 end
tasks_by_priority() click to toggle source

@return [Hash] The number of Tasks by priority

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
218 def tasks_by_priority
219   @properties['tasks_by_priority']
220 end
tasks_by_status() click to toggle source

@return [Hash] The number of Tasks by their current status

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
224 def tasks_by_status
225   @properties['tasks_by_status']
226 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
270 def to_s
271   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
272   "<Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsInstance #{values}>"
273 end
total_available_workers() click to toggle source

@return [String] The total number of Workers available for Tasks in the TaskQueue

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
230 def total_available_workers
231   @properties['total_available_workers']
232 end
total_eligible_workers() click to toggle source

@return [String] The total number of Workers eligible for Tasks in the TaskQueue, independent of their Activity state

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
236 def total_eligible_workers
237   @properties['total_eligible_workers']
238 end
total_tasks() click to toggle source

@return [String] The total number of Tasks

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
242 def total_tasks
243   @properties['total_tasks']
244 end
url() click to toggle source

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
254 def url
255   @properties['url']
256 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/task_queue_real_time_statistics.rb
248 def workspace_sid
249   @properties['workspace_sid']
250 end