Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the TaskQueue resource.
-
#assignment_activity_name ⇒ String
The name of the Activity to assign Workers when a task is assigned for them.
-
#assignment_activity_sid ⇒ String
The SID of the Activity to assign Workers when a task is assigned for them.
-
#context ⇒ TaskQueueContext
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 [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the TaskQueueInstance.
-
#fetch ⇒ TaskQueueInstance
Fetch the TaskQueueInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ TaskQueueInstance
constructor
Initialize the TaskQueueInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#max_reserved_workers ⇒ String
The maximum number of Workers to reserve for the assignment of a task in the queue.
-
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics.
-
#reservation_activity_name ⇒ String
The name of the Activity to assign Workers once a task is reserved for them.
-
#reservation_activity_sid ⇒ String
The SID of the Activity to assign Workers once a task is reserved for them.
-
#sid ⇒ String
The unique string that we created to identify the TaskQueue resource.
-
#statistics ⇒ statistics
Access the statistics.
-
#target_workers ⇒ String
A string describing the Worker selection criteria for any Tasks that enter the TaskQueue.
- #task_order ⇒ TaskOrder
-
#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.
-
#url ⇒ String
The absolute URL of the TaskQueue resource.
-
#workspace_sid ⇒ String
The SID of the Workspace that contains the TaskQueue.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ TaskQueueInstance
Initialize the TaskQueueInstance
674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 674 def initialize(version, payload , workspace_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'assignment_activity_sid' => payload['assignment_activity_sid'], 'assignment_activity_name' => payload['assignment_activity_name'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'max_reserved_workers' => payload['max_reserved_workers'] == nil ? payload['max_reserved_workers'] : payload['max_reserved_workers'].to_i, 'reservation_activity_sid' => payload['reservation_activity_sid'], 'reservation_activity_name' => payload['reservation_activity_name'], 'sid' => payload['sid'], 'target_workers' => payload['target_workers'], 'task_order' => payload['task_order'], 'url' => payload['url'], 'workspace_sid' => payload['workspace_sid'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'workspace_sid' => workspace_sid || @properties['workspace_sid'] ,'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 TaskQueue resource.
715 716 717 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 715 def account_sid @properties['account_sid'] end |
#assignment_activity_name ⇒ String
Returns The name of the Activity to assign Workers when a task is assigned for them.
727 728 729 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 727 def assignment_activity_name @properties['assignment_activity_name'] end |
#assignment_activity_sid ⇒ String
Returns The SID of the Activity to assign Workers when a task is assigned for them.
721 722 723 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 721 def assignment_activity_sid @properties['assignment_activity_sid'] end |
#context ⇒ TaskQueueContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
706 707 708 709 710 711 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 706 def context unless @instance_context @instance_context = TaskQueueContext.new(@version , @params['workspace_sid'], @params['sid']) end @instance_context end |
#cumulative_statistics ⇒ cumulative_statistics
Access the cumulative_statistics
850 851 852 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 850 def cumulative_statistics context.cumulative_statistics end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
733 734 735 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 733 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 [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
739 740 741 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 739 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the TaskQueueInstance
806 807 808 809 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 806 def delete context.delete end |
#fetch ⇒ TaskQueueInstance
Fetch the TaskQueueInstance
814 815 816 817 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 814 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
745 746 747 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 745 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
877 878 879 880 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 877 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.TaskQueueInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
799 800 801 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 799 def links @properties['links'] end |
#max_reserved_workers ⇒ String
Returns The maximum number of Workers to reserve for the assignment of a task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1.
751 752 753 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 751 def max_reserved_workers @properties['max_reserved_workers'] end |
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics
864 865 866 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 864 def real_time_statistics context.real_time_statistics end |
#reservation_activity_name ⇒ String
Returns The name of the Activity to assign Workers once a task is reserved for them.
763 764 765 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 763 def reservation_activity_name @properties['reservation_activity_name'] end |
#reservation_activity_sid ⇒ String
Returns The SID of the Activity to assign Workers once a task is reserved for them.
757 758 759 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 757 def reservation_activity_sid @properties['reservation_activity_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the TaskQueue resource.
769 770 771 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 769 def sid @properties['sid'] end |
#statistics ⇒ statistics
Access the statistics
857 858 859 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 857 def statistics context.statistics end |
#target_workers ⇒ String
Returns A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example ‘’"language" == "spanish"‘` If no TargetWorkers parameter is provided, Tasks will wait in the TaskQueue until they are either deleted or moved to another TaskQueue. Additional examples on how to describing Worker selection criteria below. Defaults to 1==1.
775 776 777 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 775 def target_workers @properties['target_workers'] end |
#task_order ⇒ TaskOrder
781 782 783 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 781 def task_order @properties['task_order'] end |
#to_s ⇒ Object
Provide a user friendly representation
870 871 872 873 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 870 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.TaskQueueInstance #{values}>" 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
828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 828 def update( friendly_name: :unset, target_workers: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset, max_reserved_workers: :unset, task_order: :unset ) context.update( friendly_name: friendly_name, target_workers: target_workers, reservation_activity_sid: reservation_activity_sid, assignment_activity_sid: assignment_activity_sid, max_reserved_workers: max_reserved_workers, task_order: task_order, ) end |
#url ⇒ String
Returns The absolute URL of the TaskQueue resource.
787 788 789 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 787 def url @properties['url'] end |
#workspace_sid ⇒ String
Returns The SID of the Workspace that contains the TaskQueue.
793 794 795 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 793 def workspace_sid @properties['workspace_sid'] end |