class Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkspaceStatisticsInstance

Public Class Methods

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

Initialize the WorkspaceStatisticsInstance @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. @return [WorkspaceStatisticsInstance] WorkspaceStatisticsInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
134 def initialize(version, payload, workspace_sid: nil)
135   super(version)
136 
137   # Marshaled Properties
138   @properties = {
139       'realtime' => payload['realtime'],
140       'cumulative' => payload['cumulative'],
141       'account_sid' => payload['account_sid'],
142       'workspace_sid' => payload['workspace_sid'],
143       'url' => payload['url'],
144   }
145 
146   # Context
147   @instance_context = nil
148   @params = {'workspace_sid' => workspace_sid, }
149 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/workspace_statistics.rb
176 def account_sid
177   @properties['account_sid']
178 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 [WorkspaceStatisticsContext] WorkspaceStatisticsContext for this WorkspaceStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
155 def context
156   unless @instance_context
157     @instance_context = WorkspaceStatisticsContext.new(@version, @params['workspace_sid'], )
158   end
159   @instance_context
160 end
cumulative() click to toggle source

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

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

Fetch the WorkspaceStatisticsInstance @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 [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] task_channel Only calculate 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 [WorkspaceStatisticsInstance] Fetched WorkspaceStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
213 def fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset)
214   context.fetch(
215       minutes: minutes,
216       start_date: start_date,
217       end_date: end_date,
218       task_channel: task_channel,
219       split_by_wait_time: split_by_wait_time,
220   )
221 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
232 def inspect
233   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
234   "<Twilio.Taskrouter.V1.WorkspaceStatisticsInstance #{values}>"
235 end
realtime() click to toggle source

@return [Hash] n object that contains the real-time statistics for the Workspace

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
164 def realtime
165   @properties['realtime']
166 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
225 def to_s
226   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
227   "<Twilio.Taskrouter.V1.WorkspaceStatisticsInstance #{values}>"
228 end
url() click to toggle source

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
188 def url
189   @properties['url']
190 end
workspace_sid() click to toggle source

@return [String] The SID of the Workspace

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
182 def workspace_sid
183   @properties['workspace_sid']
184 end