class Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowContext::WorkflowRealTimeStatisticsInstance

Public Class Methods

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

Initialize the WorkflowRealTimeStatisticsInstance @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

Workflow.

@param [String] workflow_sid Returns the list of Tasks that are being controlled

by the Workflow with the specified SID value.

@return [WorkflowRealTimeStatisticsInstance] WorkflowRealTimeStatisticsInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
133 def initialize(version, payload, workspace_sid: nil, workflow_sid: nil)
134   super(version)
135 
136   # Marshaled Properties
137   @properties = {
138       'account_sid' => payload['account_sid'],
139       'longest_task_waiting_age' => payload['longest_task_waiting_age'].to_i,
140       'longest_task_waiting_sid' => payload['longest_task_waiting_sid'],
141       'tasks_by_priority' => payload['tasks_by_priority'],
142       'tasks_by_status' => payload['tasks_by_status'],
143       'total_tasks' => payload['total_tasks'].to_i,
144       'workflow_sid' => payload['workflow_sid'],
145       'workspace_sid' => payload['workspace_sid'],
146       'url' => payload['url'],
147   }
148 
149   # Context
150   @instance_context = nil
151   @params = {'workspace_sid' => workspace_sid, 'workflow_sid' => workflow_sid, }
152 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/workflow/workflow_real_time_statistics.rb
171 def account_sid
172   @properties['account_sid']
173 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 [WorkflowRealTimeStatisticsContext] WorkflowRealTimeStatisticsContext for this WorkflowRealTimeStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
158 def context
159   unless @instance_context
160     @instance_context = WorkflowRealTimeStatisticsContext.new(
161         @version,
162         @params['workspace_sid'],
163         @params['workflow_sid'],
164     )
165   end
166   @instance_context
167 end
fetch(task_channel: :unset) click to toggle source

Fetch the WorkflowRealTimeStatisticsInstance @param [String] task_channel Only calculate real-time statistics on this

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

@return [WorkflowRealTimeStatisticsInstance] Fetched WorkflowRealTimeStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
229 def fetch(task_channel: :unset)
230   context.fetch(task_channel: task_channel, )
231 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
242 def inspect
243   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
244   "<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsInstance #{values}>"
245 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/workflow/workflow_real_time_statistics.rb
177 def longest_task_waiting_age
178   @properties['longest_task_waiting_age']
179 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/workflow/workflow_real_time_statistics.rb
183 def longest_task_waiting_sid
184   @properties['longest_task_waiting_sid']
185 end
tasks_by_priority() click to toggle source

@return [Hash] The number of Tasks by priority

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
189 def tasks_by_priority
190   @properties['tasks_by_priority']
191 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/workflow/workflow_real_time_statistics.rb
195 def tasks_by_status
196   @properties['tasks_by_status']
197 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
235 def to_s
236   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
237   "<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsInstance #{values}>"
238 end
total_tasks() click to toggle source

@return [String] The total number of Tasks

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
201 def total_tasks
202   @properties['total_tasks']
203 end
url() click to toggle source

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
219 def url
220   @properties['url']
221 end
workflow_sid() click to toggle source

@return [String] Returns the list of Tasks that are being controlled by the Workflow with the specified SID value

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
207 def workflow_sid
208   @properties['workflow_sid']
209 end
workspace_sid() click to toggle source

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb
213 def workspace_sid
214   @properties['workspace_sid']
215 end