class Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::WorkersRealTimeStatisticsInstance
Public Class Methods
Initialize the WorkersRealTimeStatisticsInstance
@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
Workers.
@return [WorkersRealTimeStatisticsInstance] WorkersRealTimeStatisticsInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 117 def initialize(version, payload, workspace_sid: nil) 118 super(version) 119 120 # Marshaled Properties 121 @properties = { 122 'account_sid' => payload['account_sid'], 123 'activity_statistics' => payload['activity_statistics'], 124 'total_workers' => payload['total_workers'].to_i, 125 'workspace_sid' => payload['workspace_sid'], 126 'url' => payload['url'], 127 } 128 129 # Context 130 @instance_context = nil 131 @params = {'workspace_sid' => workspace_sid, } 132 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 147 def account_sid 148 @properties['account_sid'] 149 end
@return [Array] The number of current Workers by Activity
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 153 def activity_statistics 154 @properties['activity_statistics'] 155 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [WorkersRealTimeStatisticsContext] WorkersRealTimeStatisticsContext
for this WorkersRealTimeStatisticsInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 138 def context 139 unless @instance_context 140 @instance_context = WorkersRealTimeStatisticsContext.new(@version, @params['workspace_sid'], ) 141 end 142 @instance_context 143 end
Fetch the WorkersRealTimeStatisticsInstance
@param [String] task_channel Only calculate real-time statistics on this
TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.
@return [WorkersRealTimeStatisticsInstance] Fetched WorkersRealTimeStatisticsInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 181 def fetch(task_channel: :unset) 182 context.fetch(task_channel: task_channel, ) 183 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 194 def inspect 195 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 196 "<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsInstance #{values}>" 197 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 187 def to_s 188 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 189 "<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsInstance #{values}>" 190 end
@return [String] The total number of Workers
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 159 def total_workers 160 @properties['total_workers'] 161 end
@return [String] The absolute URL of the Workers statistics resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 171 def url 172 @properties['url'] 173 end
@return [String] The SID of the Workspace that contains the Workers
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb 165 def workspace_sid 166 @properties['workspace_sid'] 167 end