Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkspaceRealTimeStatisticsInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkspaceRealTimeStatisticsInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_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 Workspace resource.
-
#activity_statistics ⇒ Array<Hash>
The number of current Workers by Activity.
-
#context ⇒ WorkspaceRealTimeStatisticsContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch(task_channel: :unset) ⇒ WorkspaceRealTimeStatisticsInstance
Fetch the WorkspaceRealTimeStatisticsInstance.
-
#initialize(version, payload, workspace_sid: nil) ⇒ WorkspaceRealTimeStatisticsInstance
constructor
Initialize the WorkspaceRealTimeStatisticsInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#longest_task_waiting_age ⇒ String
The age of the longest waiting Task.
-
#longest_task_waiting_sid ⇒ String
The SID of the longest waiting Task.
-
#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_tasks ⇒ String
The total number of Tasks.
-
#total_workers ⇒ String
The total number of Workers in the Workspace.
-
#url ⇒ String
The absolute URL of the Workspace statistics resource.
-
#workspace_sid ⇒ String
The SID of the Workspace.
Constructor Details
#initialize(version, payload, workspace_sid: nil) ⇒ WorkspaceRealTimeStatisticsInstance
Initialize the WorkspaceRealTimeStatisticsInstance
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 139 def initialize(version, payload , workspace_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'], 'tasks_by_priority' => payload['tasks_by_priority'], 'tasks_by_status' => payload['tasks_by_status'], 'total_tasks' => payload['total_tasks'] == nil ? payload['total_tasks'] : payload['total_tasks'].to_i, 'total_workers' => payload['total_workers'] == nil ? payload['total_workers'] : payload['total_workers'].to_i, 'workspace_sid' => payload['workspace_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'workspace_sid' => workspace_sid || @properties['workspace_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Workspace resource.
174 175 176 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 174 def account_sid @properties['account_sid'] end |
#activity_statistics ⇒ Array<Hash>
Returns The number of current Workers by Activity.
180 181 182 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 180 def activity_statistics @properties['activity_statistics'] end |
#context ⇒ WorkspaceRealTimeStatisticsContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
165 166 167 168 169 170 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 165 def context unless @instance_context @instance_context = WorkspaceRealTimeStatisticsContext.new(@version , @params['workspace_sid']) end @instance_context end |
#fetch(task_channel: :unset) ⇒ WorkspaceRealTimeStatisticsInstance
Fetch the WorkspaceRealTimeStatisticsInstance
236 237 238 239 240 241 242 243 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 236 def fetch( task_channel: :unset ) context.fetch( task_channel: task_channel, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
254 255 256 257 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 254 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsInstance #{values}>" end |
#longest_task_waiting_age ⇒ String
Returns The age of the longest waiting Task.
186 187 188 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 186 def longest_task_waiting_age @properties['longest_task_waiting_age'] end |
#longest_task_waiting_sid ⇒ String
Returns The SID of the longest waiting Task.
192 193 194 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 192 def longest_task_waiting_sid @properties['longest_task_waiting_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.
198 199 200 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 198 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"`.
204 205 206 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 204 def tasks_by_status @properties['tasks_by_status'] end |
#to_s ⇒ Object
Provide a user friendly representation
247 248 249 250 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 247 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsInstance #{values}>" end |
#total_tasks ⇒ String
Returns The total number of Tasks.
210 211 212 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 210 def total_tasks @properties['total_tasks'] end |
#total_workers ⇒ String
Returns The total number of Workers in the Workspace.
216 217 218 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 216 def total_workers @properties['total_workers'] end |
#url ⇒ String
Returns The absolute URL of the Workspace statistics resource.
228 229 230 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 228 def url @properties['url'] end |
#workspace_sid ⇒ String
Returns The SID of the Workspace.
222 223 224 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb', line 222 def workspace_sid @properties['workspace_sid'] end |