Sha256: de523620e488c482ff2ab04bda78e879c96f22361e64a453afc75e700ee1b7fc

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Dor
  module Workflow
    class Client
      # Makes requests relating to versions
      class VersionRoutes
        def initialize(requestor:)
          @requestor = requestor
        end

        # Calls the versionClose endpoint of the workflow service:
        #
        # - completes the versioningWF:submit-version and versioningWF:start-accession steps
        # - initiates accesssionWF
        #
        # @param [String] repo The repository the object resides in.  The service recoginzes "dor" and "sdr" at the moment
        # @param [String] druid The id of the object to delete the workflow from
        # @param [Boolean] create_accession_wf Option to create accessionWF when closing a version.  Defaults to true
        def close_version(repo, druid, create_accession_wf = true)
          uri = "#{repo}/objects/#{druid}/versionClose"
          uri += '?create-accession=false' unless create_accession_wf
          requestor.request(uri, 'post', '')
          true
        end

        private

        attr_reader :requestor
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dor-workflow-client-3.13.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.12.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.11.1 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.11.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.10.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.9.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.8.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.7.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.6.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.5.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.4.2 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.4.1 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.4.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.3.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.2.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.1.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.0.0 lib/dor/workflow/client/version_routes.rb
dor-workflow-client-3.0.0.rc1 lib/dor/workflow/client/version_routes.rb