export type GetApiNhtsaNhtsadbApiV1TestPerformersDatabaseArgs = {database: string}; export type GetApiNhtsaNhtsadbApiV1TestPerformersDatabaseOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /nhtsa/nhtsadb/api/v1/testPerformers/{database} */ export const getApiNhtsaNhtsadbApiV1TestPerformersDatabase = async (args: GetApiNhtsaNhtsadbApiV1TestPerformersDatabaseArgs, options: GetApiNhtsaNhtsadbApiV1TestPerformersDatabaseOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/nhtsa/nhtsadb/api/v1/testPerformers/${encodeURIComponent(String(args.database))}${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() };