Sha256: 4f0fcb05a60f19086c1508a157432dafb0ad9a3ff376fb59929cf153a595d55b

Contents?: true

Size: 937 Bytes

Versions: 157

Compression:

Stored size: 937 Bytes

Contents

# frozen_string_literal: true

require 'json'

module Dor
  module Services
    class Client
      # API calls around background job results from dor-services-app
      class BackgroundJobResults < VersionedService
        # Get status/result of a background job
        # @param job_id [String] required string representing a job identifier
        # @raise [NotFoundResponse] when the response is a 404 (object not found)
        # @raise [UnexpectedResponse] on an unsuccessful response from the server
        # @return [String] result of background job
        def show(job_id:)
          resp = connection.get do |req|
            req.url "#{api_version}/background_job_results/#{job_id}"
            req.headers['Accept'] = 'application/json'
          end

          return JSON.parse(resp.body).with_indifferent_access if resp.success?

          raise_exception_based_on_response!(resp)
        end
      end
    end
  end
end

Version data entries

157 entries across 157 versions & 1 rubygems

Version Path
dor-services-client-7.6.0 lib/dor/services/client/background_job_results.rb
dor-services-client-7.5.0 lib/dor/services/client/background_job_results.rb
dor-services-client-7.4.0 lib/dor/services/client/background_job_results.rb
dor-services-client-7.3.1 lib/dor/services/client/background_job_results.rb
dor-services-client-7.3.0 lib/dor/services/client/background_job_results.rb
dor-services-client-7.2.0 lib/dor/services/client/background_job_results.rb
dor-services-client-7.1.0 lib/dor/services/client/background_job_results.rb
dor-services-client-7.0.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.36.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.35.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.34.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.33.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.32.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.31.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.30.1 lib/dor/services/client/background_job_results.rb
dor-services-client-6.30.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.29.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.28.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.27.0 lib/dor/services/client/background_job_results.rb
dor-services-client-6.26.0 lib/dor/services/client/background_job_results.rb