class Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueContext::TaskQueueCumulativeStatisticsContext

Public Class Methods

new(version, workspace_sid, task_queue_sid) click to toggle source

Initialize the TaskQueueCumulativeStatisticsContext @param [Version] version Version that contains the resource @param [String] workspace_sid The SID of the Workspace with the TaskQueue to

fetch.

@param [String] task_queue_sid The SID of the TaskQueue for which to fetch

statistics.

@return [TaskQueueCumulativeStatisticsContext] TaskQueueCumulativeStatisticsContext

Calls superclass method Twilio::REST::InstanceContext::new
   # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb
81 def initialize(version, workspace_sid, task_queue_sid)
82   super(version)
83 
84   # Path Solution
85   @solution = {workspace_sid: workspace_sid, task_queue_sid: task_queue_sid, }
86   @uri = "/Workspaces/#{@solution[:workspace_sid]}/TaskQueues/#{@solution[:task_queue_sid]}/CumulativeStatistics"
87 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 TaskQueueCumulativeStatisticsInstance @param [Time] end_date Only calculate statistics from this date and time and

earlier, 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 is 15 minutes.

@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.

@return [TaskQueueCumulativeStatisticsInstance] Fetched TaskQueueCumulativeStatisticsInstance

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

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb
134 def inspect
135   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
136   "#<Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsContext #{context}>"
137 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb
127 def to_s
128   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
129   "#<Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsContext #{context}>"
130 end