Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerList::WorkersStatisticsContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerList::WorkersStatisticsContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb
Instance Method Summary collapse
-
#fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset, task_channel: :unset) ⇒ WorkersStatisticsInstance
Fetch the WorkersStatisticsInstance.
-
#initialize(version, workspace_sid) ⇒ WorkersStatisticsContext
constructor
Initialize the WorkersStatisticsContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, workspace_sid) ⇒ WorkersStatisticsContext
Initialize the WorkersStatisticsContext
52 53 54 55 56 57 58 59 60 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb', line 52 def initialize(version, workspace_sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/Workers/Statistics" end |
Instance Method Details
#fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset, task_channel: :unset) ⇒ WorkersStatisticsInstance
Fetch the WorkersStatisticsInstance
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb', line 71 def fetch( minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset, task_channel: :unset ) params = Twilio::Values.of({ 'Minutes' => minutes, 'StartDate' => Twilio.serialize_iso8601_datetime(start_date), 'EndDate' => Twilio.serialize_iso8601_datetime(end_date), 'TaskQueueSid' => task_queue_sid, 'TaskQueueName' => task_queue_name, 'FriendlyName' => friendly_name, 'TaskChannel' => task_channel, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) WorkersStatisticsInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
114 115 116 117 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb', line 114 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkersStatisticsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
107 108 109 110 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb', line 107 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkersStatisticsContext #{context}>" end |