# frozen_string_literal: true module Dor module Services class Client # API calls that are about workflows class Workflows < VersionedService extend Deprecation self.deprecation_horizon = 'dor-services-client version 2.0.0' # Get the initial XML for a workflow # @param name [String] the name of the xml # @return [String] the response def initial(name:) resp = connection.get do |req| req.url "#{api_version}/workflows/#{name}/initial" # asking the service to return XML req.headers['Accept'] = 'application/xml' end return resp.body if resp.success? raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" end deprecation_deprecate initial: 'Initial will be removed. Use dor-workflow-client instead' end end end end