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

- old
+ new

@@ -92,15 +92,13 @@ 'FriendlyName' => friendly_name, 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) - response = @version.page( - 'GET', - @uri, - params - ) + + response = @version.page('GET', @uri, params) + WorkflowPage.new(@version, response, @solution) end ## # Retrieve a single page of WorkflowInstance records from the API. @@ -114,12 +112,11 @@ ) WorkflowPage.new(@version, response, @solution) end ## - # Retrieve a single page of WorkflowInstance records from the API. - # Request is executed immediately. + # Create the WorkflowInstance # @param [String] friendly_name A descriptive string that you create to describe # the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound # Campaign`. # @param [String] configuration A JSON string that contains the rules to apply to # the Workflow. See [Configuring @@ -132,25 +129,21 @@ # @param [String] fallback_assignment_callback_url The URL that we should call # when a call to the `assignment_callback_url` fails. # @param [String] task_reservation_timeout How long TaskRouter will wait for a # confirmation response from your application after it assigns a Task to a Worker. # Can be up to `86,400` (24 hours) and the default is `120`. - # @return [WorkflowInstance] Newly created WorkflowInstance + # @return [WorkflowInstance] Created WorkflowInstance def create(friendly_name: nil, configuration: nil, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, task_reservation_timeout: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Configuration' => configuration, 'AssignmentCallbackUrl' => assignment_callback_url, 'FallbackAssignmentCallbackUrl' => fallback_assignment_callback_url, 'TaskReservationTimeout' => task_reservation_timeout, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) WorkflowInstance.new(@version, payload, workspace_sid: @solution[:workspace_sid], ) end ## @@ -209,21 +202,15 @@ @real_time_statistics = nil @cumulative_statistics = nil end ## - # Fetch a WorkflowInstance + # Fetch the WorkflowInstance # @return [WorkflowInstance] Fetched WorkflowInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - WorkflowInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], @@ -260,29 +247,25 @@ 'Configuration' => configuration, 'TaskReservationTimeout' => task_reservation_timeout, 'ReEvaluateTasks' => re_evaluate_tasks, }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) WorkflowInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end ## - # Deletes the WorkflowInstance + # Delete the WorkflowInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Access the statistics # @return [WorkflowStatisticsList] @@ -444,11 +427,11 @@ def links @properties['links'] end ## - # Fetch a WorkflowInstance + # Fetch the WorkflowInstance # @return [WorkflowInstance] Fetched WorkflowInstance def fetch context.fetch end @@ -484,10 +467,10 @@ re_evaluate_tasks: re_evaluate_tasks, ) end ## - # Deletes the WorkflowInstance + # Delete the WorkflowInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file