lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb in twilio-ruby-5.39.0

- old
+ new

@@ -123,15 +123,13 @@ 'WorkerSid' => worker_sid, 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) - response = @version.page( - 'GET', - @uri, - params - ) + + response = @version.page('GET', @uri, params) + TaskQueuePage.new(@version, response, @solution) end ## # Retrieve a single page of TaskQueueInstance records from the API. @@ -145,12 +143,11 @@ ) TaskQueuePage.new(@version, response, @solution) end ## - # Retrieve a single page of TaskQueueInstance records from the API. - # Request is executed immediately. + # Create the TaskQueueInstance # @param [String] friendly_name A descriptive string that you create to describe # the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. # @param [String] target_workers A string that describes the Worker selection # criteria for any Tasks that enter the TaskQueue. For example, `'"language" == # "spanish"'`. The default value is `1==1`. If this value is empty, Tasks will @@ -167,26 +164,22 @@ # to learn more. # @param [String] reservation_activity_sid The SID of the Activity to assign # Workers when a task is reserved for them. # @param [String] assignment_activity_sid The SID of the Activity to assign # Workers when a task is assigned to them. - # @return [TaskQueueInstance] Newly created TaskQueueInstance + # @return [TaskQueueInstance] Created TaskQueueInstance def create(friendly_name: nil, target_workers: :unset, max_reserved_workers: :unset, task_order: :unset, reservation_activity_sid: :unset, assignment_activity_sid: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'TargetWorkers' => target_workers, 'MaxReservedWorkers' => max_reserved_workers, 'TaskOrder' => task_order, 'ReservationActivitySid' => reservation_activity_sid, 'AssignmentActivitySid' => assignment_activity_sid, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) TaskQueueInstance.new(@version, payload, workspace_sid: @solution[:workspace_sid], ) end ## @@ -253,21 +246,15 @@ @real_time_statistics = nil @cumulative_statistics = nil end ## - # Fetch a TaskQueueInstance + # Fetch the TaskQueueInstance # @return [TaskQueueInstance] Fetched TaskQueueInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - TaskQueueInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], @@ -303,29 +290,25 @@ 'AssignmentActivitySid' => assignment_activity_sid, 'MaxReservedWorkers' => max_reserved_workers, 'TaskOrder' => task_order, }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) TaskQueueInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end ## - # Deletes the TaskQueueInstance + # Delete the TaskQueueInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Access the statistics # @return [TaskQueueStatisticsList] @@ -501,11 +484,11 @@ def links @properties['links'] end ## - # Fetch a TaskQueueInstance + # Fetch the TaskQueueInstance # @return [TaskQueueInstance] Fetched TaskQueueInstance def fetch context.fetch end @@ -540,10 +523,10 @@ task_order: task_order, ) end ## - # Deletes the TaskQueueInstance + # Delete the TaskQueueInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file