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
220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 220 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
310 311 312 313 314 315 316 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 310 def cumulative_statistics TaskQueueCumulativeStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#delete ⇒ Boolean
Delete the TaskQueueInstance
235 236 237 238 239 240 241 242 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 235 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ TaskQueueInstance
Fetch the TaskQueueInstance
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 247 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) TaskQueueInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
349 350 351 352 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 349 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
332 333 334 335 336 337 338 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 332 def real_time_statistics TaskQueueRealTimeStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#statistics ⇒ TaskQueueStatisticsList, TaskQueueStatisticsContext
Access the statistics
321 322 323 324 325 326 327 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 321 def statistics TaskQueueStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#to_s ⇒ Object
Provide a user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 342 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
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 273 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, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) TaskQueueInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |