Sha256: 495970ffed0f5a366f327a0f03276497b00916d5319346f5f0227848f6da7b00

Contents?: true

Size: 724 Bytes

Versions: 6

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

module Dor
  module Services
    class Client
      # API calls that are about workflow
      class Workflow < VersionedService
        # Begin a new workflow
        # @param object [String] the pid for the object
        # @param wf_name [String] the name of the workflow
        # @raises [UnexpectedResponse] if the request is unsuccessful.
        # @return nil
        def create(object:, wf_name:)
          resp = connection.post do |req|
            req.url "#{api_version}/objects/#{object}/apo_workflows/#{wf_name}"
          end
          raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dor-services-client-0.10.0 lib/dor/services/client/workflow.rb
dor-services-client-0.9.0 lib/dor/services/client/workflow.rb
dor-services-client-0.8.0 lib/dor/services/client/workflow.rb
dor-services-client-0.7.0 lib/dor/services/client/workflow.rb
dor-services-client-0.6.0 lib/dor/services/client/workflow.rb
dor-services-client-0.5.0 lib/dor/services/client/workflow.rb