export type DeleteApiApiAdminStelorderMappingsMappingIdArgs = {mapping_id: number, hard_delete?: boolean | undefined}; export type DeleteApiApiAdminStelorderMappingsMappingIdOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Mapping * * DELETE /api/admin/stelorder/mappings/{mapping_id} */ export const deleteApiApiAdminStelorderMappingsMappingId = async (args: DeleteApiApiAdminStelorderMappingsMappingIdArgs, options: DeleteApiApiAdminStelorderMappingsMappingIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.hard_delete != null) query.append("hard_delete", String(args.hard_delete)) if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/admin/stelorder/mappings/${encodeURIComponent(String(args.mapping_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };