export type DeleteApiInstrumentsInstrumentIdArgs = {instrument_id: string, 'X-API-Key'?: (string | null) | undefined}; export type DeleteApiInstrumentsInstrumentIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Instrument * * DELETE /instruments/{instrument_id} */ export const deleteApiInstrumentsInstrumentId = async (args: DeleteApiInstrumentsInstrumentIdArgs, options: DeleteApiInstrumentsInstrumentIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-API-Key'] != null) headers.set("X-API-Key", String(args['X-API-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/instruments/${encodeURIComponent(String(args.instrument_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 };