Class: Twilio::REST::Taskrouter::V1::WorkspaceContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_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,
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb
Defined Under Namespace
Classes: ActivityContext, ActivityInstance, ActivityList, ActivityPage, EventContext, EventInstance, EventList, EventPage, TaskChannelContext, TaskChannelInstance, TaskChannelList, TaskChannelPage, TaskContext, TaskInstance, TaskList, TaskPage, TaskQueueContext, TaskQueueInstance, TaskQueueList, TaskQueuePage, WorkerContext, WorkerInstance, WorkerList, WorkerPage, WorkflowContext, WorkflowInstance, WorkflowList, WorkflowPage, WorkspaceCumulativeStatisticsContext, WorkspaceCumulativeStatisticsInstance, WorkspaceCumulativeStatisticsList, WorkspaceCumulativeStatisticsPage, WorkspaceRealTimeStatisticsContext, WorkspaceRealTimeStatisticsInstance, WorkspaceRealTimeStatisticsList, WorkspaceRealTimeStatisticsPage, WorkspaceStatisticsContext, WorkspaceStatisticsInstance, WorkspaceStatisticsList, WorkspaceStatisticsPage
Instance Method Summary collapse
-
#activities(sid = :unset) ⇒ ActivityList, ActivityContext
Access the activities.
-
#cumulative_statistics ⇒ WorkspaceCumulativeStatisticsList, WorkspaceCumulativeStatisticsContext
Access the cumulative_statistics.
-
#delete ⇒ Boolean
Delete the WorkspaceInstance.
-
#events(sid = :unset) ⇒ EventList, EventContext
Access the events.
-
#fetch ⇒ WorkspaceInstance
Fetch the WorkspaceInstance.
-
#initialize(version, sid) ⇒ WorkspaceContext
constructor
Initialize the WorkspaceContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#real_time_statistics ⇒ WorkspaceRealTimeStatisticsList, WorkspaceRealTimeStatisticsContext
Access the real_time_statistics.
-
#statistics ⇒ WorkspaceStatisticsList, WorkspaceStatisticsContext
Access the statistics.
-
#task_channels(sid = :unset) ⇒ TaskChannelList, TaskChannelContext
Access the task_channels.
-
#task_queues(sid = :unset) ⇒ TaskQueueList, TaskQueueContext
Access the task_queues.
-
#tasks(sid = :unset) ⇒ TaskList, TaskContext
Access the tasks.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(default_activity_sid: :unset, event_callback_url: :unset, events_filter: :unset, friendly_name: :unset, multi_task_enabled: :unset, timeout_activity_sid: :unset, prioritize_queue_order: :unset) ⇒ WorkspaceInstance
Update the WorkspaceInstance.
-
#workers(sid = :unset) ⇒ WorkerList, WorkerContext
Access the workers.
-
#workflows(sid = :unset) ⇒ WorkflowList, WorkflowContext
Access the workflows.
Constructor Details
#initialize(version, sid) ⇒ WorkspaceContext
Initialize the WorkspaceContext
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 182 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Workspaces/#{@solution[:sid]}" # Dependents @cumulative_statistics = nil @task_queues = nil @activities = nil @real_time_statistics = nil @tasks = nil @workflows = nil @events = nil @workers = nil @statistics = nil @task_channels = nil end |
Instance Method Details
#activities(sid = :unset) ⇒ ActivityList, ActivityContext
Access the activities
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 309 def activities(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ActivityContext.new(@version, @solution[:sid],sid ) end unless @activities @activities = ActivityList.new( @version, workspace_sid: @solution[:sid], ) end @activities end |
#cumulative_statistics ⇒ WorkspaceCumulativeStatisticsList, WorkspaceCumulativeStatisticsContext
Access the cumulative_statistics
280 281 282 283 284 285 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 280 def cumulative_statistics WorkspaceCumulativeStatisticsContext.new( @version, @solution[:sid] ) end |
#delete ⇒ Boolean
Delete the WorkspaceInstance
204 205 206 207 208 209 210 211 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 204 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#events(sid = :unset) ⇒ EventList, EventContext
Access the events
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 376 def events(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return EventContext.new(@version, @solution[:sid],sid ) end unless @events @events = EventList.new( @version, workspace_sid: @solution[:sid], ) end @events end |
#fetch ⇒ WorkspaceInstance
Fetch the WorkspaceInstance
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 216 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) WorkspaceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
449 450 451 452 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 449 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkspaceContext #{context}>" end |
#real_time_statistics ⇒ WorkspaceRealTimeStatisticsList, WorkspaceRealTimeStatisticsContext
Access the real_time_statistics
328 329 330 331 332 333 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 328 def real_time_statistics WorkspaceRealTimeStatisticsContext.new( @version, @solution[:sid] ) end |
#statistics ⇒ WorkspaceStatisticsList, WorkspaceStatisticsContext
Access the statistics
414 415 416 417 418 419 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 414 def statistics WorkspaceStatisticsContext.new( @version, @solution[:sid] ) end |
#task_channels(sid = :unset) ⇒ TaskChannelList, TaskChannelContext
Access the task_channels
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 424 def task_channels(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TaskChannelContext.new(@version, @solution[:sid],sid ) end unless @task_channels @task_channels = TaskChannelList.new( @version, workspace_sid: @solution[:sid], ) end @task_channels end |
#task_queues(sid = :unset) ⇒ TaskQueueList, TaskQueueContext
Access the task_queues
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 290 def task_queues(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TaskQueueContext.new(@version, @solution[:sid],sid ) end unless @task_queues @task_queues = TaskQueueList.new( @version, workspace_sid: @solution[:sid], ) end @task_queues end |
#tasks(sid = :unset) ⇒ TaskList, TaskContext
Access the tasks
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 338 def tasks(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TaskContext.new(@version, @solution[:sid],sid ) end unless @tasks @tasks = TaskList.new( @version, workspace_sid: @solution[:sid], ) end @tasks end |
#to_s ⇒ Object
Provide a user friendly representation
442 443 444 445 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 442 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkspaceContext #{context}>" end |
#update(default_activity_sid: :unset, event_callback_url: :unset, events_filter: :unset, friendly_name: :unset, multi_task_enabled: :unset, timeout_activity_sid: :unset, prioritize_queue_order: :unset) ⇒ WorkspaceInstance
Update the WorkspaceInstance
242 243 244 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 271 272 273 274 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 242 def update( default_activity_sid: :unset, event_callback_url: :unset, events_filter: :unset, friendly_name: :unset, multi_task_enabled: :unset, timeout_activity_sid: :unset, prioritize_queue_order: :unset ) data = Twilio::Values.of({ 'DefaultActivitySid' => default_activity_sid, 'EventCallbackUrl' => event_callback_url, 'EventsFilter' => events_filter, 'FriendlyName' => friendly_name, 'MultiTaskEnabled' => multi_task_enabled, 'TimeoutActivitySid' => timeout_activity_sid, 'PrioritizeQueueOrder' => prioritize_queue_order, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) WorkspaceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#workers(sid = :unset) ⇒ WorkerList, WorkerContext
Access the workers
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 395 def workers(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return WorkerContext.new(@version, @solution[:sid],sid ) end unless @workers @workers = WorkerList.new( @version, workspace_sid: @solution[:sid], ) end @workers end |
#workflows(sid = :unset) ⇒ WorkflowList, WorkflowContext
Access the workflows
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 357 def workflows(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return WorkflowContext.new(@version, @solution[:sid],sid ) end unless @workflows @workflows = WorkflowList.new( @version, workspace_sid: @solution[:sid], ) end @workflows end |