export type GetApiV2ProvidersEmployersEmployerIdDocumenttemplatesDocumentIdArgs = {employerId: string, documentId: string, Authorization: string}; export type GetApiV2ProvidersEmployersEmployerIdDocumenttemplatesDocumentIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download template document * * GET /v2/providers/employers/{employerId}/documenttemplates/{documentId} */ export const getApiV2ProvidersEmployersEmployerIdDocumenttemplatesDocumentId = async (args: GetApiV2ProvidersEmployersEmployerIdDocumenttemplatesDocumentIdArgs, options?: GetApiV2ProvidersEmployersEmployerIdDocumenttemplatesDocumentIdOptions) => { const {baseUrl = "https://api.loket.nl", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.openxmlformats-officedocument.wordprocessingml.document") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/providers/employers/${encodeURIComponent(String(args.employerId))}/documenttemplates/${encodeURIComponent(String(args.documentId))}${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() };