export type DeleteApiImportsArgs = {'Addepar-Firm': string, import_type?: string | undefined, is_dry_run?: string | undefined, ignore_warnings?: string | undefined, body: BodyInit}; export type DeleteApiImportsOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Imports * * DELETE /imports */ export const deleteApiImports = async (args: DeleteApiImportsArgs, options?: DeleteApiImportsOptions) => { const {baseUrl = "https://examplefirm.addepar.com/api/v1", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "text/plain") headers.set('accept', "application/vnd.api+json") if (args['Addepar-Firm'] != null) headers.set("Addepar-Firm", String(args['Addepar-Firm'])) if (args.import_type != null) query.append("import_type", String(args.import_type)) if (args.is_dry_run != null) query.append("is_dry_run", String(args.is_dry_run)) if (args.ignore_warnings != null) query.append("ignore_warnings", String(args.ignore_warnings)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/imports${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };