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

Public Class Methods

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

Initialize the WorkflowCumulativeStatisticsInstance @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 [WorkflowCumulativeStatisticsInstance] WorkflowCumulativeStatisticsInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
154 def initialize(version, payload, workspace_sid: nil, workflow_sid: nil)
155   super(version)
156 
157   # Marshaled Properties
158   @properties = {
159       'account_sid' => payload['account_sid'],
160       'avg_task_acceptance_time' => payload['avg_task_acceptance_time'].to_i,
161       'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
162       'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
163       'reservations_created' => payload['reservations_created'].to_i,
164       'reservations_accepted' => payload['reservations_accepted'].to_i,
165       'reservations_rejected' => payload['reservations_rejected'].to_i,
166       'reservations_timed_out' => payload['reservations_timed_out'].to_i,
167       'reservations_canceled' => payload['reservations_canceled'].to_i,
168       'reservations_rescinded' => payload['reservations_rescinded'].to_i,
169       'split_by_wait_time' => payload['split_by_wait_time'],
170       'wait_duration_until_accepted' => payload['wait_duration_until_accepted'],
171       'wait_duration_until_canceled' => payload['wait_duration_until_canceled'],
172       'tasks_canceled' => payload['tasks_canceled'].to_i,
173       'tasks_completed' => payload['tasks_completed'].to_i,
174       'tasks_entered' => payload['tasks_entered'].to_i,
175       'tasks_deleted' => payload['tasks_deleted'].to_i,
176       'tasks_moved' => payload['tasks_moved'].to_i,
177       'tasks_timed_out_in_workflow' => payload['tasks_timed_out_in_workflow'].to_i,
178       'workflow_sid' => payload['workflow_sid'],
179       'workspace_sid' => payload['workspace_sid'],
180       'url' => payload['url'],
181   }
182 
183   # Context
184   @instance_context = nil
185   @params = {'workspace_sid' => workspace_sid, 'workflow_sid' => workflow_sid, }
186 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_cumulative_statistics.rb
205 def account_sid
206   @properties['account_sid']
207 end
avg_task_acceptance_time() click to toggle source

@return [String] The average time in seconds between Task creation and acceptance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
211 def avg_task_acceptance_time
212   @properties['avg_task_acceptance_time']
213 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 [WorkflowCumulativeStatisticsContext] WorkflowCumulativeStatisticsContext for this WorkflowCumulativeStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
192 def context
193   unless @instance_context
194     @instance_context = WorkflowCumulativeStatisticsContext.new(
195         @version,
196         @params['workspace_sid'],
197         @params['workflow_sid'],
198     )
199   end
200   @instance_context
201 end
end_time() click to toggle source

@return [Time] The end of the interval during which these statistics were calculated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
223 def end_time
224   @properties['end_time']
225 end
fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset) click to toggle source

Fetch the WorkflowCumulativeStatisticsInstance @param [Time] end_date Only include usage that occurred on or before this date,

specified in GMT as an {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601]
date-time.

@param [String] minutes Only calculate statistics since this many minutes in the

past. The default 15 minutes. This is helpful for displaying statistics for the
last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends.

@param [Time] start_date Only calculate statistics from this date and time and

later, specified in {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.

@param [String] task_channel Only calculate cumulative statistics on this

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

@param [String] split_by_wait_time A comma separated list of values that

describes the thresholds, in seconds, to calculate statistics on. For each
threshold specified, the number of Tasks canceled and reservations accepted
above and below the specified thresholds in seconds are computed. For example,
`5,30` would show splits of Tasks that were canceled or accepted before and
after 5 seconds and before and after 30 seconds. This can be used to show short
abandoned Tasks or Tasks that failed to meet an SLA.

@return [WorkflowCumulativeStatisticsInstance] Fetched WorkflowCumulativeStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
356 def fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset)
357   context.fetch(
358       end_date: end_date,
359       minutes: minutes,
360       start_date: start_date,
361       task_channel: task_channel,
362       split_by_wait_time: split_by_wait_time,
363   )
364 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
375 def inspect
376   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
377   "<Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsInstance #{values}>"
378 end
reservations_accepted() click to toggle source

@return [String] The total number of Reservations accepted by Workers

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
235 def reservations_accepted
236   @properties['reservations_accepted']
237 end
reservations_canceled() click to toggle source

@return [String] The total number of Reservations that were canceled

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
253 def reservations_canceled
254   @properties['reservations_canceled']
255 end
reservations_created() click to toggle source

@return [String] The total number of Reservations that were created for Workers

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
229 def reservations_created
230   @properties['reservations_created']
231 end
reservations_rejected() click to toggle source

@return [String] The total number of Reservations that were rejected

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
241 def reservations_rejected
242   @properties['reservations_rejected']
243 end
reservations_rescinded() click to toggle source

@return [String] The total number of Reservations that were rescinded

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
259 def reservations_rescinded
260   @properties['reservations_rescinded']
261 end
reservations_timed_out() click to toggle source

@return [String] The total number of Reservations that were timed out

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
247 def reservations_timed_out
248   @properties['reservations_timed_out']
249 end
split_by_wait_time() click to toggle source

@return [Hash] A list of objects that describe the Tasks canceled and reservations accepted above and below the specified thresholds

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
265 def split_by_wait_time
266   @properties['split_by_wait_time']
267 end
start_time() click to toggle source

@return [Time] The beginning of the interval during which these statistics were calculated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
217 def start_time
218   @properties['start_time']
219 end
tasks_canceled() click to toggle source

@return [String] The total number of Tasks that were canceled

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
283 def tasks_canceled
284   @properties['tasks_canceled']
285 end
tasks_completed() click to toggle source

@return [String] The total number of Tasks that were completed

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
289 def tasks_completed
290   @properties['tasks_completed']
291 end
tasks_deleted() click to toggle source

@return [String] The total number of Tasks that were deleted

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
301 def tasks_deleted
302   @properties['tasks_deleted']
303 end
tasks_entered() click to toggle source

@return [String] The total number of Tasks that entered the Workflow

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
295 def tasks_entered
296   @properties['tasks_entered']
297 end
tasks_moved() click to toggle source

@return [String] The total number of Tasks that were moved from one queue to another

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
307 def tasks_moved
308   @properties['tasks_moved']
309 end
tasks_timed_out_in_workflow() click to toggle source

@return [String] The total number of Tasks that were timed out of their Workflows

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
313 def tasks_timed_out_in_workflow
314   @properties['tasks_timed_out_in_workflow']
315 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
368 def to_s
369   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
370   "<Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsInstance #{values}>"
371 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_cumulative_statistics.rb
331 def url
332   @properties['url']
333 end
wait_duration_until_accepted() click to toggle source

@return [Hash] The wait duration statistics for Tasks that were accepted

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
271 def wait_duration_until_accepted
272   @properties['wait_duration_until_accepted']
273 end
wait_duration_until_canceled() click to toggle source

@return [Hash] The wait duration statistics for Tasks that were canceled

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
277 def wait_duration_until_canceled
278   @properties['wait_duration_until_canceled']
279 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_cumulative_statistics.rb
319 def workflow_sid
320   @properties['workflow_sid']
321 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_cumulative_statistics.rb
325 def workspace_sid
326   @properties['workspace_sid']
327 end