export type GetApiExportGobdRegistrierkassenRegistrierkasseUuidArgs = {registrierkasseUuid: string, before?: string | undefined, after?: string | undefined}; export type GetApiExportGobdRegistrierkassenRegistrierkasseUuidOptions = {baseUrl: string, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /export/gobd/registrierkassen/{registrierkasseUuid} */ export const getApiExportGobdRegistrierkassenRegistrierkasseUuid = async (args: GetApiExportGobdRegistrierkassenRegistrierkasseUuidArgs, options: GetApiExportGobdRegistrierkassenRegistrierkasseUuidOptions) => { const {baseUrl, fetch: fetchFn = fetch, jwt} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.before != null) query.append("before", String(args.before)) if (args.after != null) query.append("after", String(args.after)) if (jwt !== undefined) headers.set("Authorization", jwt) const url = `${baseUrl.replace(/\/+$/, '')}/export/gobd/registrierkassen/${encodeURIComponent(String(args.registrierkasseUuid))}${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 undefined };