export type GetApiV10MetsRequestsWithholdReopenAvailableAccountIdArgs = {accountId: number}; export type GetApiV10MetsRequestsWithholdReopenAvailableAccountIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Check if the account can reopen a completed withhold flag workflow * * GET /v1.0/mets/requests/withhold/reopen-available/{accountId} */ export const getApiV10MetsRequestsWithholdReopenAvailableAccountId = async (args: GetApiV10MetsRequestsWithholdReopenAvailableAccountIdArgs, options?: GetApiV10MetsRequestsWithholdReopenAvailableAccountIdOptions) => { const {baseUrl = "http://localhost:8080/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1.0/mets/requests/withhold/reopen-available/${encodeURIComponent(String(args.accountId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };