class Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerList::WorkersStatisticsInstance

Public Class Methods

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

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

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

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

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb
172 def cumulative
173   @properties['cumulative']
174 end
fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset, task_channel: :unset) click to toggle source

Fetch the WorkersStatisticsInstance @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_queue_sid The SID of the TaskQueue for which to fetch

Worker statistics.

@param [String] task_queue_name The `friendly_name` of the TaskQueue for which

to fetch Worker statistics.

@param [String] friendly_name Only include Workers with `friendly_name` values

that match this parameter.

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

@return [WorkersStatisticsInstance] Fetched WorkersStatisticsInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb
214 def fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset, task_channel: :unset)
215   context.fetch(
216       minutes: minutes,
217       start_date: start_date,
218       end_date: end_date,
219       task_queue_sid: task_queue_sid,
220       task_queue_name: task_queue_name,
221       friendly_name: friendly_name,
222       task_channel: task_channel,
223   )
224 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb
235 def inspect
236   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
237   "<Twilio.Taskrouter.V1.WorkersStatisticsInstance #{values}>"
238 end
realtime() click to toggle source

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

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

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb
228 def to_s
229   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
230   "<Twilio.Taskrouter.V1.WorkersStatisticsInstance #{values}>"
231 end
url() click to toggle source

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

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

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

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb
184 def workspace_sid
185   @properties['workspace_sid']
186 end