Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ TaskQueueInstance

Initialize the TaskQueueInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this TaskQueue resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 682

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_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the TaskQueue resource.

Returns:



723
724
725
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 723

def 
    @properties['account_sid']
end

#assignment_activity_nameString

Returns The name of the Activity to assign Workers when a task is assigned for them.

Returns:

  • (String)

    The name of the Activity to assign Workers when a task is assigned for them.



735
736
737
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 735

def assignment_activity_name
    @properties['assignment_activity_name']
end

#assignment_activity_sidString

Returns The SID of the Activity to assign Workers when a task is assigned for them.

Returns:

  • (String)

    The SID of the Activity to assign Workers when a task is assigned for them.



729
730
731
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 729

def assignment_activity_sid
    @properties['assignment_activity_sid']
end

#contextTaskQueueContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



714
715
716
717
718
719
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 714

def context
    unless @instance_context
        @instance_context = TaskQueueContext.new(@version , @params['workspace_sid'], @params['sid'])
    end
    @instance_context
end

#cumulative_statisticscumulative_statistics

Access the cumulative_statistics

Returns:



858
859
860
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 858

def cumulative_statistics
    context.cumulative_statistics
end

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



741
742
743
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 741

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



747
748
749
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 747

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the TaskQueueInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



814
815
816
817
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 814

def delete

    context.delete
end

#fetchTaskQueueInstance

Fetch the TaskQueueInstance

Returns:



822
823
824
825
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 822

def fetch

    context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource.



753
754
755
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 753

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



885
886
887
888
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 885

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Taskrouter.V1.TaskQueueInstance #{values}>"
end

Returns The URLs of related resources.

Returns:

  • (Hash)

    The URLs of related resources.



807
808
809
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 807

def links
    @properties['links']
end

#max_reserved_workersString

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.

Returns:

  • (String)

    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.



759
760
761
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 759

def max_reserved_workers
    @properties['max_reserved_workers']
end

#real_time_statisticsreal_time_statistics

Access the real_time_statistics

Returns:



872
873
874
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 872

def real_time_statistics
    context.real_time_statistics
end

#reservation_activity_nameString

Returns The name of the Activity to assign Workers once a task is reserved for them.

Returns:

  • (String)

    The name of the Activity to assign Workers once a task is reserved for them.



771
772
773
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 771

def reservation_activity_name
    @properties['reservation_activity_name']
end

#reservation_activity_sidString

Returns The SID of the Activity to assign Workers once a task is reserved for them.

Returns:

  • (String)

    The SID of the Activity to assign Workers once a task is reserved for them.



765
766
767
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 765

def reservation_activity_sid
    @properties['reservation_activity_sid']
end

#sidString

Returns The unique string that we created to identify the TaskQueue resource.

Returns:

  • (String)

    The unique string that we created to identify the TaskQueue resource.



777
778
779
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 777

def sid
    @properties['sid']
end

#statisticsstatistics

Access the statistics

Returns:



865
866
867
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 865

def statistics
    context.statistics
end

#target_workersString

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.

Returns:

  • (String)

    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.



783
784
785
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 783

def target_workers
    @properties['target_workers']
end

#task_orderTaskOrder

Returns:

  • (TaskOrder)


789
790
791
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 789

def task_order
    @properties['task_order']
end

#to_sObject

Provide a user friendly representation



878
879
880
881
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 878

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

Parameters:

  • friendly_name (String) (defaults to: :unset)

    A descriptive string that you create to describe the TaskQueue. For example ‘Support-Tier 1`, `Sales`, or `Escalation`.

  • target_workers (String) (defaults to: :unset)

    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 queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below.

  • reservation_activity_sid (String) (defaults to: :unset)

    The SID of the Activity to assign Workers when a task is reserved for them.

  • assignment_activity_sid (String) (defaults to: :unset)

    The SID of the Activity to assign Workers when a task is assigned for them.

  • max_reserved_workers (String) (defaults to: :unset)

    The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50.

  • task_order (TaskOrder) (defaults to: :unset)

Returns:



836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 836

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

#urlString

Returns The absolute URL of the TaskQueue resource.

Returns:

  • (String)

    The absolute URL of the TaskQueue resource.



795
796
797
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 795

def url
    @properties['url']
end

#workspace_sidString

Returns The SID of the Workspace that contains the TaskQueue.

Returns:

  • (String)

    The SID of the Workspace that contains the TaskQueue.



801
802
803
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 801

def workspace_sid
    @properties['workspace_sid']
end