class Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkspaceCumulativeStatisticsContext

Public Class Methods

new(version, workspace_sid) click to toggle source

Initialize the WorkspaceCumulativeStatisticsContext @param [Version] version Version that contains the resource @param [String] workspace_sid The SID of the Workspace to fetch. @return [WorkspaceCumulativeStatisticsContext] WorkspaceCumulativeStatisticsContext

Calls superclass method Twilio::REST::InstanceContext::new
   # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb
73 def initialize(version, workspace_sid)
74   super(version)
75 
76   # Path Solution
77   @solution = {workspace_sid: workspace_sid, }
78   @uri = "/Workspaces/#{@solution[:workspace_sid]}/CumulativeStatistics"
79 end

Public Instance Methods

fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset) click to toggle source

Fetch the WorkspaceCumulativeStatisticsInstance @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 [WorkspaceCumulativeStatisticsInstance] Fetched WorkspaceCumulativeStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb
102 def fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset)
103   params = Twilio::Values.of({
104       'EndDate' => Twilio.serialize_iso8601_datetime(end_date),
105       'Minutes' => minutes,
106       'StartDate' => Twilio.serialize_iso8601_datetime(start_date),
107       'TaskChannel' => task_channel,
108       'SplitByWaitTime' => split_by_wait_time,
109   })
110 
111   payload = @version.fetch('GET', @uri, params: params)
112 
113   WorkspaceCumulativeStatisticsInstance.new(
114       @version,
115       payload,
116       workspace_sid: @solution[:workspace_sid],
117   )
118 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb
129 def inspect
130   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
131   "#<Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsContext #{context}>"
132 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb
122 def to_s
123   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
124   "#<Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsContext #{context}>"
125 end