Class: Twilio::REST::Taskrouter::V1::WorkspaceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Workspace resource.
-
#activities ⇒ activities
Access the activities.
-
#context ⇒ WorkspaceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#cumulative_statistics ⇒ cumulative_statistics
Access the cumulative_statistics.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#default_activity_name ⇒ String
The name of the default activity.
-
#default_activity_sid ⇒ String
The SID of the Activity that will be used when new Workers are created in the Workspace.
-
#delete ⇒ Boolean
Delete the WorkspaceInstance.
-
#event_callback_url ⇒ String
The URL we call when an event occurs.
-
#events ⇒ events
Access the events.
-
#events_filter ⇒ String
The list of Workspace events for which to call ‘event_callback_url`.
-
#fetch ⇒ WorkspaceInstance
Fetch the WorkspaceInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the Workspace resource.
-
#initialize(version, payload, sid: nil) ⇒ WorkspaceInstance
constructor
Initialize the WorkspaceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#multi_task_enabled ⇒ Boolean
Whether multi-tasking is enabled.
- #prioritize_queue_order ⇒ QueueOrder
-
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics.
-
#sid ⇒ String
The unique string that we created to identify the Workspace resource.
-
#statistics ⇒ statistics
Access the statistics.
-
#task_channels ⇒ task_channels
Access the task_channels.
-
#task_queues ⇒ task_queues
Access the task_queues.
-
#tasks ⇒ tasks
Access the tasks.
-
#timeout_activity_name ⇒ String
The name of the timeout activity.
-
#timeout_activity_sid ⇒ String
The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response.
-
#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.
-
#url ⇒ String
The absolute URL of the Workspace resource.
-
#workers ⇒ workers
Access the workers.
-
#workflows ⇒ workflows
Access the workflows.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ WorkspaceInstance
Initialize the WorkspaceInstance
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 467 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'default_activity_name' => payload['default_activity_name'], 'default_activity_sid' => payload['default_activity_sid'], 'event_callback_url' => payload['event_callback_url'], 'events_filter' => payload['events_filter'], 'friendly_name' => payload['friendly_name'], 'multi_task_enabled' => payload['multi_task_enabled'], 'sid' => payload['sid'], 'timeout_activity_name' => payload['timeout_activity_name'], 'timeout_activity_sid' => payload['timeout_activity_sid'], 'prioritize_queue_order' => payload['prioritize_queue_order'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Workspace resource.
507 508 509 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 507 def account_sid @properties['account_sid'] end |
#activities ⇒ activities
Access the activities
659 660 661 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 659 def activities context.activities end |
#context ⇒ WorkspaceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
498 499 500 501 502 503 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 498 def context unless @instance_context @instance_context = WorkspaceContext.new(@version , @params['sid']) end @instance_context end |
#cumulative_statistics ⇒ cumulative_statistics
Access the cumulative_statistics
645 646 647 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 645 def cumulative_statistics context.cumulative_statistics end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
513 514 515 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 513 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
519 520 521 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 519 def date_updated @properties['date_updated'] end |
#default_activity_name ⇒ String
Returns The name of the default activity.
525 526 527 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 525 def default_activity_name @properties['default_activity_name'] end |
#default_activity_sid ⇒ String
Returns The SID of the Activity that will be used when new Workers are created in the Workspace.
531 532 533 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 531 def default_activity_sid @properties['default_activity_sid'] end |
#delete ⇒ Boolean
Delete the WorkspaceInstance
598 599 600 601 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 598 def delete context.delete end |
#event_callback_url ⇒ String
Returns The URL we call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio’s [Webhooks (HTTP callbacks) Connection Overrides](www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides).
537 538 539 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 537 def event_callback_url @properties['event_callback_url'] end |
#events ⇒ events
Access the events
687 688 689 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 687 def events context.events end |
#events_filter ⇒ String
Returns The list of Workspace events for which to call ‘event_callback_url`. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated.
543 544 545 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 543 def events_filter @properties['events_filter'] end |
#fetch ⇒ WorkspaceInstance
Fetch the WorkspaceInstance
606 607 608 609 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 606 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Workspace resource. For example ‘Customer Support` or `2014 Election Campaign`.
549 550 551 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 549 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
721 722 723 724 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 721 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkspaceInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
591 592 593 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 591 def links @properties['links'] end |
#multi_task_enabled ⇒ Boolean
Returns Whether multi-tasking is enabled. The default is ‘true`, which enables multi-tasking. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking each Worker would only receive a new reservation when the previous task is completed. Learn more at [Multitasking](www.twilio.com/docs/taskrouter/multitasking).
555 556 557 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 555 def multi_task_enabled @properties['multi_task_enabled'] end |
#prioritize_queue_order ⇒ QueueOrder
579 580 581 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 579 def prioritize_queue_order @properties['prioritize_queue_order'] end |
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics
666 667 668 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 666 def real_time_statistics context.real_time_statistics end |
#sid ⇒ String
Returns The unique string that we created to identify the Workspace resource.
561 562 563 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 561 def sid @properties['sid'] end |
#statistics ⇒ statistics
Access the statistics
701 702 703 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 701 def statistics context.statistics end |
#task_channels ⇒ task_channels
Access the task_channels
708 709 710 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 708 def task_channels context.task_channels end |
#task_queues ⇒ task_queues
Access the task_queues
652 653 654 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 652 def task_queues context.task_queues end |
#tasks ⇒ tasks
Access the tasks
673 674 675 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 673 def tasks context.tasks end |
#timeout_activity_name ⇒ String
Returns The name of the timeout activity.
567 568 569 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 567 def timeout_activity_name @properties['timeout_activity_name'] end |
#timeout_activity_sid ⇒ String
Returns The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response.
573 574 575 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 573 def timeout_activity_sid @properties['timeout_activity_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
714 715 716 717 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 714 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkspaceInstance #{values}>" 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
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 621 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 ) context.update( default_activity_sid: default_activity_sid, event_callback_url: event_callback_url, events_filter: events_filter, friendly_name: friendly_name, multi_task_enabled: multi_task_enabled, timeout_activity_sid: timeout_activity_sid, prioritize_queue_order: prioritize_queue_order, ) end |
#url ⇒ String
Returns The absolute URL of the Workspace resource.
585 586 587 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 585 def url @properties['url'] end |
#workers ⇒ workers
Access the workers
694 695 696 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 694 def workers context.workers end |
#workflows ⇒ workflows
Access the workflows
680 681 682 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace.rb', line 680 def workflows context.workflows end |