Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb
Defined Under Namespace
Classes: TaskQueueCumulativeStatisticsContext, TaskQueueCumulativeStatisticsInstance, TaskQueueCumulativeStatisticsList, TaskQueueCumulativeStatisticsPage, TaskQueueRealTimeStatisticsContext, TaskQueueRealTimeStatisticsInstance, TaskQueueRealTimeStatisticsList, TaskQueueRealTimeStatisticsPage, TaskQueueStatisticsContext, TaskQueueStatisticsInstance, TaskQueueStatisticsList, TaskQueueStatisticsPage
Instance Method Summary collapse
-
#cumulative_statistics ⇒ TaskQueueCumulativeStatisticsList, TaskQueueCumulativeStatisticsContext
Access the cumulative_statistics.
-
#delete ⇒ Boolean
Delete the TaskQueueInstance.
-
#fetch ⇒ TaskQueueInstance
Fetch the TaskQueueInstance.
-
#initialize(version, workspace_sid, sid) ⇒ TaskQueueContext
constructor
Initialize the TaskQueueContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#real_time_statistics ⇒ TaskQueueRealTimeStatisticsList, TaskQueueRealTimeStatisticsContext
Access the real_time_statistics.
-
#statistics ⇒ TaskQueueStatisticsList, TaskQueueStatisticsContext
Access the statistics.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, target_workers: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset, max_reserved_workers: :unset, task_order: :unset) ⇒ TaskQueueInstance
Update the TaskQueueInstance.
Constructor Details
#initialize(version, workspace_sid, sid) ⇒ TaskQueueContext
Initialize the TaskQueueContext
202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 202 def initialize(version, workspace_sid, sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, sid: sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/TaskQueues/#{@solution[:sid]}" # Dependents @cumulative_statistics = nil @statistics = nil @real_time_statistics = nil end |
Instance Method Details
#cumulative_statistics ⇒ TaskQueueCumulativeStatisticsList, TaskQueueCumulativeStatisticsContext
Access the cumulative_statistics
276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 276 def cumulative_statistics TaskQueueCumulativeStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#delete ⇒ Boolean
Delete the TaskQueueInstance
217 218 219 220 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 217 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ TaskQueueInstance
Fetch the TaskQueueInstance
225 226 227 228 229 230 231 232 233 234 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 225 def fetch payload = @version.fetch('GET', @uri) TaskQueueInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
315 316 317 318 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 315 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.TaskQueueContext #{context}>" end |
#real_time_statistics ⇒ TaskQueueRealTimeStatisticsList, TaskQueueRealTimeStatisticsContext
Access the real_time_statistics
298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 298 def real_time_statistics TaskQueueRealTimeStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#statistics ⇒ TaskQueueStatisticsList, TaskQueueStatisticsContext
Access the statistics
287 288 289 290 291 292 293 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 287 def statistics TaskQueueStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#to_s ⇒ Object
Provide a user friendly representation
308 309 310 311 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 308 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.TaskQueueContext #{context}>" end |
#update(friendly_name: :unset, target_workers: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset, max_reserved_workers: :unset, task_order: :unset) ⇒ TaskQueueInstance
Update the TaskQueueInstance
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 245 def update( friendly_name: :unset, target_workers: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset, max_reserved_workers: :unset, task_order: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'TargetWorkers' => target_workers, 'ReservationActivitySid' => reservation_activity_sid, 'AssignmentActivitySid' => assignment_activity_sid, 'MaxReservedWorkers' => max_reserved_workers, 'TaskOrder' => task_order, }) payload = @version.update('POST', @uri, data: data) TaskQueueInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |