export type HeadApiCatalogussenUuidArgs = {uuid: string, 'If-None-Match'?: string | undefined}; export type HeadApiCatalogussenUuidOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * De headers voor een specifiek(e) CATALOGUS opvragen * * HEAD /catalogussen/{uuid} */ export const headApiCatalogussenUuid = async (args: HeadApiCatalogussenUuidArgs, options?: HeadApiCatalogussenUuidOptions) => { const {baseUrl = "https://virtserver.swaggerhub.com/michielverhoef/Catalogussen_API/1.3.0", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['If-None-Match'] != null) headers.set("If-None-Match", String(args['If-None-Match'])) const url = `${baseUrl.replace(/\/+$/, '')}/catalogussen/${encodeURIComponent(String(args.uuid))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "HEAD", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };