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

Public Class Methods

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

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

TaskQueue.

@param [String] task_queue_sid The SID of the TaskQueue from which these

statistics were calculated.

@return [TaskQueueStatisticsInstance] TaskQueueStatisticsInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
150 def initialize(version, payload, workspace_sid: nil, task_queue_sid: nil)
151   super(version)
152 
153   # Marshaled Properties
154   @properties = {
155       'account_sid' => payload['account_sid'],
156       'cumulative' => payload['cumulative'],
157       'realtime' => payload['realtime'],
158       'task_queue_sid' => payload['task_queue_sid'],
159       'workspace_sid' => payload['workspace_sid'],
160       'url' => payload['url'],
161   }
162 
163   # Context
164   @instance_context = nil
165   @params = {'workspace_sid' => workspace_sid, 'task_queue_sid' => task_queue_sid, }
166 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/task_queue/task_queue_statistics.rb
185 def account_sid
186   @properties['account_sid']
187 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 [TaskQueueStatisticsContext] TaskQueueStatisticsContext for this TaskQueueStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
172 def context
173   unless @instance_context
174     @instance_context = TaskQueueStatisticsContext.new(
175         @version,
176         @params['workspace_sid'],
177         @params['task_queue_sid'],
178     )
179   end
180   @instance_context
181 end
cumulative() click to toggle source

@return [Hash] An object that contains the cumulative statistics for the TaskQueue

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
191 def cumulative
192   @properties['cumulative']
193 end
fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset) click to toggle source

Fetch the TaskQueueStatisticsInstance @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 real-time and cumulative statistics

for the specified 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 [TaskQueueStatisticsInstance] Fetched TaskQueueStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
236 def fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset)
237   context.fetch(
238       end_date: end_date,
239       minutes: minutes,
240       start_date: start_date,
241       task_channel: task_channel,
242       split_by_wait_time: split_by_wait_time,
243   )
244 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
255 def inspect
256   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
257   "<Twilio.Taskrouter.V1.TaskQueueStatisticsInstance #{values}>"
258 end
realtime() click to toggle source

@return [Hash] An object that contains the real-time statistics for the TaskQueue

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
197 def realtime
198   @properties['realtime']
199 end
task_queue_sid() click to toggle source

@return [String] The SID of the TaskQueue from which these statistics were calculated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
203 def task_queue_sid
204   @properties['task_queue_sid']
205 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
248 def to_s
249   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
250   "<Twilio.Taskrouter.V1.TaskQueueStatisticsInstance #{values}>"
251 end
url() click to toggle source

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
215 def url
216   @properties['url']
217 end
workspace_sid() click to toggle source

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb
209 def workspace_sid
210   @properties['workspace_sid']
211 end