Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueContext::TaskQueueRealTimeStatisticsInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueContext::TaskQueueRealTimeStatisticsInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the TaskQueue resource.
-
#activity_statistics ⇒ Array<Hash>
The number of current Workers by Activity.
-
#context ⇒ TaskQueueRealTimeStatisticsContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch(task_channel: :unset) ⇒ TaskQueueRealTimeStatisticsInstance
Fetch the TaskQueueRealTimeStatisticsInstance.
-
#initialize(version, payload, workspace_sid: nil, task_queue_sid: nil) ⇒ TaskQueueRealTimeStatisticsInstance
constructor
Initialize the TaskQueueRealTimeStatisticsInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#longest_relative_task_age_in_queue ⇒ String
The relative age in the TaskQueue for the longest waiting Task.
-
#longest_relative_task_sid_in_queue ⇒ String
The Task SID of the Task waiting in the TaskQueue the longest.
-
#longest_task_waiting_age ⇒ String
The age of the longest waiting Task.
-
#longest_task_waiting_sid ⇒ String
The SID of the longest waiting Task.
-
#task_queue_sid ⇒ String
The SID of the TaskQueue from which these statistics were calculated.
-
#tasks_by_priority ⇒ Hash
The number of Tasks by priority.
-
#tasks_by_status ⇒ Hash
The number of Tasks by their current status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#total_available_workers ⇒ String
The total number of Workers in the TaskQueue with an ‘available` status.
-
#total_eligible_workers ⇒ String
The total number of Workers eligible for Tasks in the TaskQueue, independent of their Activity state.
-
#total_tasks ⇒ String
The total number of Tasks.
-
#url ⇒ String
The absolute URL of the TaskQueue statistics resource.
-
#workspace_sid ⇒ String
The SID of the Workspace that contains the TaskQueue.
Constructor Details
#initialize(version, payload, workspace_sid: nil, task_queue_sid: nil) ⇒ TaskQueueRealTimeStatisticsInstance
Initialize the TaskQueueRealTimeStatisticsInstance
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 142 def initialize(version, payload , workspace_sid: nil, task_queue_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'activity_statistics' => payload['activity_statistics'], 'longest_task_waiting_age' => payload['longest_task_waiting_age'] == nil ? payload['longest_task_waiting_age'] : payload['longest_task_waiting_age'].to_i, 'longest_task_waiting_sid' => payload['longest_task_waiting_sid'], 'longest_relative_task_age_in_queue' => payload['longest_relative_task_age_in_queue'] == nil ? payload['longest_relative_task_age_in_queue'] : payload['longest_relative_task_age_in_queue'].to_i, 'longest_relative_task_sid_in_queue' => payload['longest_relative_task_sid_in_queue'], 'task_queue_sid' => payload['task_queue_sid'], 'tasks_by_priority' => payload['tasks_by_priority'], 'tasks_by_status' => payload['tasks_by_status'], 'total_available_workers' => payload['total_available_workers'] == nil ? payload['total_available_workers'] : payload['total_available_workers'].to_i, 'total_eligible_workers' => payload['total_eligible_workers'] == nil ? payload['total_eligible_workers'] : payload['total_eligible_workers'].to_i, 'total_tasks' => payload['total_tasks'] == nil ? payload['total_tasks'] : payload['total_tasks'].to_i, 'workspace_sid' => payload['workspace_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'workspace_sid' => workspace_sid || @properties['workspace_sid'] ,'task_queue_sid' => task_queue_sid || @properties['task_queue_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the TaskQueue resource.
181 182 183 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 181 def account_sid @properties['account_sid'] end |
#activity_statistics ⇒ Array<Hash>
Returns The number of current Workers by Activity.
187 188 189 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 187 def activity_statistics @properties['activity_statistics'] end |
#context ⇒ TaskQueueRealTimeStatisticsContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
172 173 174 175 176 177 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 172 def context unless @instance_context @instance_context = TaskQueueRealTimeStatisticsContext.new(@version , @params['workspace_sid'], @params['task_queue_sid']) end @instance_context end |
#fetch(task_channel: :unset) ⇒ TaskQueueRealTimeStatisticsInstance
Fetch the TaskQueueRealTimeStatisticsInstance
267 268 269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 267 def fetch( task_channel: :unset ) context.fetch( task_channel: task_channel, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
285 286 287 288 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 285 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsInstance #{values}>" end |
#longest_relative_task_age_in_queue ⇒ String
Returns The relative age in the TaskQueue for the longest waiting Task. Calculation is based on the time when the Task entered the TaskQueue.
205 206 207 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 205 def longest_relative_task_age_in_queue @properties['longest_relative_task_age_in_queue'] end |
#longest_relative_task_sid_in_queue ⇒ String
Returns The Task SID of the Task waiting in the TaskQueue the longest. Calculation is based on the time when the Task entered the TaskQueue.
211 212 213 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 211 def longest_relative_task_sid_in_queue @properties['longest_relative_task_sid_in_queue'] end |
#longest_task_waiting_age ⇒ String
Returns The age of the longest waiting Task.
193 194 195 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 193 def longest_task_waiting_age @properties['longest_task_waiting_age'] end |
#longest_task_waiting_sid ⇒ String
Returns The SID of the longest waiting Task.
199 200 201 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 199 def longest_task_waiting_sid @properties['longest_task_waiting_sid'] end |
#task_queue_sid ⇒ String
Returns The SID of the TaskQueue from which these statistics were calculated.
217 218 219 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 217 def task_queue_sid @properties['task_queue_sid'] end |
#tasks_by_priority ⇒ Hash
Returns The number of Tasks by priority. For example: ‘"10", "99": "5"` shows 10 Tasks at priority 0 and 5 at priority 99.
223 224 225 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 223 def tasks_by_priority @properties['tasks_by_priority'] end |
#tasks_by_status ⇒ Hash
Returns The number of Tasks by their current status. For example: ‘"1", "reserved": "3", "assigned": "2", "completed": "5"`.
229 230 231 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 229 def tasks_by_status @properties['tasks_by_status'] end |
#to_s ⇒ Object
Provide a user friendly representation
278 279 280 281 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 278 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsInstance #{values}>" end |
#total_available_workers ⇒ String
Returns The total number of Workers in the TaskQueue with an ‘available` status. Workers with an `available` status may already have active interactions or may have none.
235 236 237 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 235 def total_available_workers @properties['total_available_workers'] end |
#total_eligible_workers ⇒ String
Returns The total number of Workers eligible for Tasks in the TaskQueue, independent of their Activity state.
241 242 243 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 241 def total_eligible_workers @properties['total_eligible_workers'] end |
#total_tasks ⇒ String
Returns The total number of Tasks.
247 248 249 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 247 def total_tasks @properties['total_tasks'] end |
#url ⇒ String
Returns The absolute URL of the TaskQueue statistics resource.
259 260 261 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 259 def url @properties['url'] end |
#workspace_sid ⇒ String
Returns The SID of the Workspace that contains the TaskQueue.
253 254 255 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb', line 253 def workspace_sid @properties['workspace_sid'] end |