class Twilio::REST::Taskrouter::V1::WorkspaceInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the WorkspaceInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The SID of the Workspace resource to fetch. @return [WorkspaceInstance] WorkspaceInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
460 def initialize(version, payload, sid: nil)
461   super(version)
462 
463   # Marshaled Properties
464   @properties = {
465       'account_sid' => payload['account_sid'],
466       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
467       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
468       'default_activity_name' => payload['default_activity_name'],
469       'default_activity_sid' => payload['default_activity_sid'],
470       'event_callback_url' => payload['event_callback_url'],
471       'events_filter' => payload['events_filter'],
472       'friendly_name' => payload['friendly_name'],
473       'multi_task_enabled' => payload['multi_task_enabled'],
474       'sid' => payload['sid'],
475       'timeout_activity_name' => payload['timeout_activity_name'],
476       'timeout_activity_sid' => payload['timeout_activity_sid'],
477       'prioritize_queue_order' => payload['prioritize_queue_order'],
478       'url' => payload['url'],
479       'links' => payload['links'],
480   }
481 
482   # Context
483   @instance_context = nil
484   @params = {'sid' => sid || @properties['sid'], }
485 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
500 def account_sid
501   @properties['account_sid']
502 end
activities() click to toggle source

Access the activities @return [activities] activities

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
650 def activities
651   context.activities
652 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [WorkspaceContext] WorkspaceContext for this WorkspaceInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
491 def context
492   unless @instance_context
493     @instance_context = WorkspaceContext.new(@version, @params['sid'], )
494   end
495   @instance_context
496 end
cumulative_statistics() click to toggle source

Access the cumulative_statistics @return [cumulative_statistics] cumulative_statistics

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
706 def cumulative_statistics
707   context.cumulative_statistics
708 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
506 def date_created
507   @properties['date_created']
508 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
512 def date_updated
513   @properties['date_updated']
514 end
default_activity_name() click to toggle source

@return [String] The name of the default activity

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
518 def default_activity_name
519   @properties['default_activity_name']
520 end
default_activity_sid() click to toggle source

@return [String] The SID of the Activity that will be used when new Workers are created in the Workspace

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
524 def default_activity_sid
525   @properties['default_activity_sid']
526 end
delete() click to toggle source

Delete the WorkspaceInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
643 def delete
644   context.delete
645 end
event_callback_url() click to toggle source

@return [String] The URL we call when an event occurs

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
530 def event_callback_url
531   @properties['event_callback_url']
532 end
events() click to toggle source

Access the events @return [events] events

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
657 def events
658   context.events
659 end
events_filter() click to toggle source

@return [String] The list of Workspace events for which to call event_callback_url

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
536 def events_filter
537   @properties['events_filter']
538 end
fetch() click to toggle source

Fetch the WorkspaceInstance @return [WorkspaceInstance] Fetched WorkspaceInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
591 def fetch
592   context.fetch
593 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the Workspace resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
542 def friendly_name
543   @properties['friendly_name']
544 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
726 def inspect
727   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
728   "<Twilio.Taskrouter.V1.WorkspaceInstance #{values}>"
729 end
multi_task_enabled() click to toggle source

@return [Boolean] Whether multi-tasking is enabled

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
548 def multi_task_enabled
549   @properties['multi_task_enabled']
550 end
prioritize_queue_order() click to toggle source

@return [workspace.QueueOrder] The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
572 def prioritize_queue_order
573   @properties['prioritize_queue_order']
574 end
real_time_statistics() click to toggle source

Access the real_time_statistics @return [real_time_statistics] real_time_statistics

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
699 def real_time_statistics
700   context.real_time_statistics
701 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
554 def sid
555   @properties['sid']
556 end
statistics() click to toggle source

Access the statistics @return [statistics] statistics

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
692 def statistics
693   context.statistics
694 end
task_channels() click to toggle source

Access the task_channels @return [task_channels] task_channels

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
713 def task_channels
714   context.task_channels
715 end
task_queues() click to toggle source

Access the task_queues @return [task_queues] task_queues

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
671 def task_queues
672   context.task_queues
673 end
tasks() click to toggle source

Access the tasks @return [tasks] tasks

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
664 def tasks
665   context.tasks
666 end
timeout_activity_name() click to toggle source

@return [String] The name of the timeout activity

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
560 def timeout_activity_name
561   @properties['timeout_activity_name']
562 end
timeout_activity_sid() click to toggle source

@return [String] The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
566 def timeout_activity_sid
567   @properties['timeout_activity_sid']
568 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
719 def to_s
720   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
721   "<Twilio.Taskrouter.V1.WorkspaceInstance #{values}>"
722 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) click to toggle source

Update the WorkspaceInstance @param [String] default_activity_sid The SID of the Activity that will be used

when new Workers are created in the Workspace.

@param [String] event_callback_url The URL we should call when an event occurs.

See {Workspace Events}[https://www.twilio.com/docs/taskrouter/api/event] for
more information.

@param [String] events_filter 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.

@param [String] friendly_name A descriptive string that you create to describe

the Workspace resource. For example: `Sales Call Center` or `Customer Support
Team`.

@param [Boolean] multi_task_enabled Whether to enable multi-tasking. Can be:

`true` to enable multi-tasking, or `false` to disable it. However, all
workspaces should be maintained as multi-tasking. There is no default when
omitting this parameter. A multi-tasking Workspace can't be updated to
single-tasking unless it is not a Flex Project and another (legacy)
single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple
Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel
reservations up to the per-channel maximums defined in the Workers section. In
single-tasking mode (legacy mode), each Worker will only receive a new
reservation when the previous task is completed. Learn more at
{Multitasking}[https://www.twilio.com/docs/taskrouter/multitasking].

@param [String] timeout_activity_sid The SID of the Activity that will be

assigned to a Worker when a Task reservation times out without a response.

@param [workspace.QueueOrder] prioritize_queue_order The type of TaskQueue to

prioritize when Workers are receiving Tasks from both types of TaskQueues. Can
be: `LIFO` or `FIFO`. For more information, see {Queue
Ordering}[https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo].

@return [WorkspaceInstance] Updated WorkspaceInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
628 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)
629   context.update(
630       default_activity_sid: default_activity_sid,
631       event_callback_url: event_callback_url,
632       events_filter: events_filter,
633       friendly_name: friendly_name,
634       multi_task_enabled: multi_task_enabled,
635       timeout_activity_sid: timeout_activity_sid,
636       prioritize_queue_order: prioritize_queue_order,
637   )
638 end
url() click to toggle source

@return [String] The absolute URL of the Workspace resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
578 def url
579   @properties['url']
580 end
workers() click to toggle source

Access the workers @return [workers] workers

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
678 def workers
679   context.workers
680 end
workflows() click to toggle source

Access the workflows @return [workflows] workflows

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace.rb
685 def workflows
686   context.workflows
687 end